/* ============================================================================
   DARK ACADEMIA SIMULATION SITE - SIMIDIOT.NET
   Design Language: Late-night library, scholarly atmosphere, code-and-marble
   ============================================================================ */

/* Color Palette */
:root {
  --bg-deep: #0E0C0A;        /* Library midnight */
  --surface-card: #1A1614;   /* Aged mahogany */
  --primary-green: #4A7A52;  /* Forest scholarly */
  --secondary-green: #6B9A5A; /* Moss accent */
  --warm-accent: #C4A44A;    /* Brass lamp */
  --text-primary: #E8E0D0;   /* Aged ivory */
  --text-secondary: #8A9A80; /* Dusty sage */
  --marble-vein: #C8C0B8;    /* Cool gray-white */
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: "Source Serif 4", serif;
  font-size: 17px;
  line-height: 1.8;
  overflow-x: hidden;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3 {
  font-family: "Playfair Display", serif;
  letter-spacing: 0.02em;
}

.display-title {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.5rem);
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 2.8rem;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.6;
}

.body-text {
  color: var(--text-primary);
  margin-bottom: 1.8rem;
  line-height: 1.8;
}

.body-text.secondary {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.emphasis {
  color: var(--primary-green);
  font-weight: 600;
}

code {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--secondary-green);
}

/* ============================================================================
   LAMP GLOW (Fixed Overlay)
   ============================================================================ */

.lamp-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 15% 10%, #C4A44A18, transparent 50%);
  pointer-events: none;
  z-index: 1;
  animation: lamp-pulse 8s ease-in-out infinite;
}

@keyframes lamp-pulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 0.8;
  }
}

/* ============================================================================
   MAIN CONTENT WRAPPER
   ============================================================================ */

.content-wrapper {
  position: relative;
  z-index: 0;
}

/* ============================================================================
   SECTION LAYOUT
   ============================================================================ */

.section {
  position: relative;
  min-height: 120vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  overflow: hidden;
}

.section-hero {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg-deep) 0%, #14120F 100%);
}

.section-foundations,
.section-agents,
.section-neural,
.section-closing {
  min-height: 130vh;
}

/* ============================================================================
   BACKGROUND LAYERS (Depth Plane 0)
   ============================================================================ */

.background-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  filter: blur(2px);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

.wood-texture {
  background: repeating-linear-gradient(
    90deg,
    var(--bg-deep) 0px,
    var(--bg-deep) 2px,
    #0D0B09 2px,
    #0D0B09 4px
  );
  opacity: 0.3;
}

.marble-texture {
  background: linear-gradient(45deg, #1A1614 0%, #1A1614 40%, #2A2420 50%, #1A1614 60%, #1A1614 100%);
  opacity: 0.4;
}

/* ============================================================================
   CONTENT CARDS (Depth Plane 1)
   ============================================================================ */

.content-card {
  position: relative;
  z-index: 10;
  background-color: rgba(18, 16, 14, 0.85);
  padding: 60px;
  max-width: 700px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-radius: 2px;
}

.hero-card {
  text-align: center;
  padding: 80px 60px;
  background-color: rgba(26, 22, 20, 0.9);
}

.card-foundations {
  margin-left: auto;
  margin-right: 5%;
}

.card-agents {
  margin-left: 5%;
  margin-right: auto;
}

.card-neural {
  margin-left: auto;
  margin-right: 5%;
}

.card-closing {
  text-align: center;
  padding: 80px 60px;
  background-color: rgba(26, 22, 20, 0.95);
}

/* ============================================================================
   CODE BLOCKS
   ============================================================================ */

.code-block {
  background-color: #0A0908;
  border-left: 1px solid #5A7A5A;
  padding: 20px;
  margin: 2rem 0;
  border-radius: 2px;
  overflow-x: auto;
}

.code-block pre {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--secondary-green);
  line-height: 1.6;
}

.code-block code {
  color: var(--secondary-green);
}

/* ============================================================================
   OVERLAY ELEMENTS (Depth Plane 2)
   ============================================================================ */

.overlay-marble,
.overlay-brass {
  position: absolute;
  z-index: 20;
}

/* Marble fragments - classical broken pieces */
.marble-fragment-1 {
  top: 10%;
  right: 5%;
  width: 200px;
  height: 150px;
  background: linear-gradient(135deg, transparent 0%, var(--marble-vein) 25%, rgba(200, 192, 184, 0.3) 50%, transparent 100%);
  clip-path: polygon(0 0, 100% 0, 85% 70%, 50% 100%, 0 80%);
  opacity: 0.6;
}

.marble-fragment-2 {
  bottom: 15%;
  left: 3%;
  width: 250px;
  height: 180px;
  background: linear-gradient(225deg, transparent 0%, var(--marble-vein) 20%, rgba(200, 192, 184, 0.25) 40%, transparent 80%);
  clip-path: polygon(20% 0, 100% 5%, 90% 100%, 0 95%);
  opacity: 0.5;
}

.marble-fragment-3 {
  top: 8%;
  left: 8%;
  width: 220px;
  height: 160px;
  background: linear-gradient(45deg, transparent 0%, var(--marble-vein) 15%, rgba(200, 192, 184, 0.2) 35%, transparent 70%);
  clip-path: polygon(0 0, 100% 0, 100% 80%, 60% 100%, 0 95%);
  opacity: 0.55;
}

/* Brass ornaments - warm metallic accents */
.brass-ornament-1 {
  top: 50%;
  left: 2%;
  width: 80px;
  height: 80px;
  background: radial-gradient(ellipse at 35% 35%, rgba(196, 164, 74, 0.4), transparent 70%);
  border-radius: 50%;
  box-shadow: inset 0 0 20px rgba(196, 164, 74, 0.2);
}

.brass-ornament-2 {
  bottom: 25%;
  right: 8%;
  width: 60px;
  height: 120px;
  background: linear-gradient(90deg, transparent 0%, rgba(196, 164, 74, 0.3) 50%, transparent 100%);
  clip-path: polygon(20% 0, 80% 0, 90% 100%, 10% 100%);
}

.brass-ornament-3 {
  top: 12%;
  right: 5%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle at 30% 30%, rgba(196, 164, 74, 0.35), transparent 60%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  opacity: 0.6;
}

/* ============================================================================
   PAGE TURN TRANSITION
   ============================================================================ */

.page-turn {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    #D4C4B8 0px,
    #D4C4B8 1px,
    transparent 1px,
    transparent 2px
  ), linear-gradient(
    180deg,
    rgba(212, 196, 184, 0.95) 0%,
    rgba(212, 196, 184, 0.8) 50%,
    rgba(212, 196, 184, 0.95) 100%
  );
  background-size: 100% 28px, 100% 100%;
  background-position: 0 0, 0 0;
  background-attachment: fixed;
  pointer-events: none;
  z-index: 15;
  display: none;
}

@keyframes page-turn-slide {
  0% {
    transform: translateX(100%);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(-100%);
    opacity: 1;
  }
}

.page-turn.active {
  display: block;
  animation: page-turn-slide 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ============================================================================
   SKELETON PLACEHOLDERS
   ============================================================================ */

.skeleton-placeholder {
  position: absolute;
  z-index: 5;
  background: linear-gradient(
    90deg,
    var(--surface-card) 0%,
    #2A2420 50%,
    var(--surface-card) 100%
  );
  background-size: 200% 100%;
  border-radius: 2px;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  0%, 100% {
    background-position: 200% 0;
  }
  50% {
    background-position: -200% 0;
  }
}

.skeleton-1 {
  top: 10%;
  left: 5%;
  width: 600px;
  height: 400px;
  opacity: 0;
}

.skeleton-2 {
  top: 15%;
  right: 8%;
  width: 550px;
  height: 380px;
  opacity: 0;
}

.skeleton-3 {
  top: 12%;
  left: 6%;
  width: 620px;
  height: 420px;
  opacity: 0;
}

/* ============================================================================
   DEPTH-RESPONSIVE EFFECTS
   ============================================================================ */

.background-layer {
  transition: filter 0.3s ease;
}

.content-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* When content card is in viewport center, reduce blur on background */
.background-layer.in-focus {
  filter: blur(0);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
  .section {
    padding: 40px 20px;
    min-height: auto;
  }

  .section-hero {
    min-height: 80vh;
  }

  .section-foundations,
  .section-agents,
  .section-neural,
  .section-closing {
    min-height: 100vh;
  }

  .content-card {
    padding: 40px 25px;
    max-width: 100%;
  }

  .hero-card {
    padding: 60px 30px;
  }

  .card-foundations,
  .card-agents,
  .card-neural {
    margin-left: auto;
    margin-right: auto;
  }

  .card-closing {
    padding: 60px 30px;
  }

  .display-title {
    font-size: 2.4rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .body-text {
    font-size: 16px;
  }

  .marble-fragment-1,
  .marble-fragment-2,
  .marble-fragment-3 {
    opacity: 0.3;
  }

  .brass-ornament-1,
  .brass-ornament-2,
  .brass-ornament-3 {
    opacity: 0.4;
  }

  .skeleton-1,
  .skeleton-2,
  .skeleton-3 {
    display: none;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .lamp-glow {
    animation: none;
    opacity: 0.7;
  }

  .skeleton-placeholder {
    animation: none;
  }

  .page-turn.active {
    animation: none;
  }
}

/* ============================================================================
   SCROLLBAR STYLING (Optional Enhancement)
   ============================================================================ */

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-green);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-green);
}
