/* ==========================================================================
   PB CLASSES — OXFORD EDITORIAL MINIMALISM (60 / 30 / 10 RULE)
   Anti-AI-Slop Audited:
   - 60% Main Color: Warm Archival Alabaster (#FBF9F5) & Soft Stone (#F2EFE9)
   - 30% Second Color: Deep Carbon Black (#141416) & Oxford Navy (#1B365D)
   - 10% Accent Color: Burnt Terracotta (#C84B31)
   - Typography: Fraunces (Bold Editorial Serif) + Syne (Bold Display) + JetBrains Mono
   ========================================================================== */

:root {
  /* 60% Dominant Surface Palette */
  --bg-page: #FBF9F5;
  --bg-surface: #F2EFE9;
  --bg-arch: #EAE5DC;

  /* 30% Secondary Structural / Ink Palette */
  --ink-black: #141416;
  --ink-secondary: #4A4A52;
  --ink-muted: #76767F;
  --oxford-navy: #1B365D;

  /* 10% High-Contrast Editorial Accent */
  --terracotta: #C84B31;
  --terracotta-dark: #A6361F;

  /* Hairlines & Minimal Borders (Zero Heavy Drop Shadows) */
  --hairline: rgba(20, 20, 22, 0.12);
  --hairline-strong: rgba(20, 20, 22, 0.24);
}

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

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

body {
  background-color: var(--bg-page);
  color: var(--ink-black);
  font-family: 'Syne', sans-serif;
  font-weight: 500;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TYPOGRAPHY — BOLD & CLEAR EDITORIAL HEADINGS (NO DEFAULT INTER/GEIST)
   ========================================================================== */
h1, h2, h3, .editorial-serif {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.editorial-italic {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  color: var(--terracotta);
}

.mono-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ==========================================================================
   MINIMALIST EDITORIAL NAVIGATION BAR (INSPIRED BY REFERENCE SCREENSHOTS)
   ========================================================================== */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.5rem 3.5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
  background: rgba(251, 249, 245, 0.86);
  backdrop-filter: blur(10px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.brand-mark {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: var(--ink-black);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--terracotta);
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 2.25rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink-secondary);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-bottom: 0.25rem;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--ink-black);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 1.5px;
  background-color: var(--ink-black);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ratio-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--hairline-strong);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-surface);
}

.ratio-bar {
  display: inline-flex;
  width: 36px;
  height: 8px;
  border: 1px solid var(--ink-black);
  overflow: hidden;
}
.ratio-bar .r-60 { width: 60%; background: #FBF9F5; }
.ratio-bar .r-30 { width: 30%; background: #141416; }
.ratio-bar .r-10 { width: 10%; background: #C84B31; }

.nav-cta {
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-page);
  background-color: var(--ink-black);
  padding: 0.65rem 1.25rem;
  border: 1px solid var(--ink-black);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-cta:hover {
  background-color: var(--terracotta);
  border-color: var(--terracotta);
}

/* ==========================================================================
   SPLIT SCREEN CHOREOGRAPHY LAYOUT (LEFT EDITORIAL / RIGHT PINNED 3D BOOK)
   ========================================================================== */
.split-stage {
  position: relative;
  display: grid;
  grid-template-columns: 48% 52%;
  width: 100%;
  min-height: 500vh;
}

.editorial-column {
  position: relative;
  z-index: 10;
  padding: 0 4vw 0 5vw;
  border-right: 1px solid var(--hairline);
}

.scroll-chapter {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 0 4rem;
  border-bottom: 1px solid var(--hairline);
}

.scroll-chapter:last-child {
  border-bottom: none;
}

.chapter-eyebrow {
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chapter-eyebrow span.sep {
  color: var(--terracotta);
}

.hero-display-title {
  font-size: clamp(2.85rem, 4.8vw, 4.75rem);
  color: var(--ink-black);
  margin-bottom: 1.65rem;
  font-weight: 700;
}

.chapter-display-title {
  font-size: clamp(2.35rem, 3.8vw, 3.75rem);
  color: var(--ink-black);
  margin-bottom: 1.4rem;
  font-weight: 700;
}

.editorial-lead {
  font-family: 'Syne', sans-serif;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--ink-secondary);
  max-width: 42ch;
  margin-bottom: 2.5rem;
  line-height: 1.65;
}

.editorial-lead strong {
  color: var(--ink-black);
  font-weight: 700;
}

/* Minimalist Spec Ledger Grid */
.minimal-ledger {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--hairline-strong);
  border-bottom: 1px solid var(--hairline-strong);
  margin-bottom: 2.5rem;
}

.ledger-cell {
  padding: 1.1rem 0;
}

.ledger-cell:first-child {
  border-right: 1px solid var(--hairline);
  padding-right: 1.25rem;
}

.ledger-cell:last-child {
  padding-left: 1.25rem;
}

.ledger-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  margin-bottom: 0.3rem;
}

.ledger-value {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-black);
}

/* Circular Arrow CTA from Inspiration Screenshots */
.explore-trigger {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  text-decoration: none;
  color: var(--ink-black);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  group: true;
}

.circle-arrow {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.25px solid var(--ink-black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.explore-trigger:hover .circle-arrow {
  background-color: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--bg-page);
  transform: translateX(6px);
}

/* Chapter Index Footer (01 --- 02   03   04   05) */
.chapter-pagination {
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.chapter-pagination .active-num {
  color: var(--ink-black);
  font-weight: 700;
}

.chapter-pagination .line-rule {
  width: 44px;
  height: 1px;
  background-color: var(--ink-black);
}

/* ==========================================================================
   RIGHT COLUMN: PINNED 3D VIEWPORT + ARCHITECTURAL ARCH BACKDROP
   ========================================================================== */
.book-stage-column {
  position: relative;
}

.book-sticky-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-surface);
}

/* Subtle Architectural Arch Alcove (Inspired by Uploaded Screenshots) */
.architectural-arch {
  position: absolute;
  width: min(68%, 480px);
  height: 76vh;
  bottom: 0;
  background: linear-gradient(180deg, var(--bg-arch) 0%, var(--bg-surface) 100%);
  border-radius: 999px 999px 0 0;
  border: 1px solid var(--hairline-strong);
  border-bottom: none;
  pointer-events: none;
  z-index: 1;
}

#book-webgl-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

/* Minimalist HUD Indicator on the 3D Stage */
.stage-hud {
  position: absolute;
  bottom: 2.25rem;
  left: 3rem;
  right: 3rem;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  border-top: 1px solid var(--hairline);
  padding-top: 0.9rem;
}

.hud-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.hud-status strong {
  color: var(--terracotta);
}

/* Responsive Layout for Mobile / Tablet */
@media (max-width: 980px) {
  .split-stage {
    grid-template-columns: 1fr;
  }
  .book-stage-column {
    order: -1;
    height: 44vh;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--hairline-strong);
  }
  .book-sticky-viewport {
    height: 44vh;
  }
  .architectural-arch {
    height: 36vh;
    width: 240px;
  }
  .editorial-column {
    padding: 0 6vw;
    border-right: none;
  }
  .scroll-chapter {
    min-height: 75vh;
    padding: 4rem 0;
  }
  .nav-links, .ratio-pill {
    display: none;
  }
}
