/* ============================================================
   STOIC ORIGO — design system (noir parchment + foil gold)
   ============================================================ */

:root {
  --bg: #0E0C0A;
  --bg-soft: #161310;
  --accent: #C9A24B;
  --accent-soft: #E6CF92;
  --marble: #E8E2D4;
  --text: #EDE6D6;
  --muted: #9A8F7C;
  --line: rgba(201, 162, 75, 0.18);

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Jost", "Helvetica Neue", system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1280px;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
html.js { scroll-behavior: auto; } /* Lenis takes over */

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: auto;
}
body.is-locked { overflow: hidden; height: 100vh; }

@media (pointer: fine) { body { cursor: none; } }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---------- type ---------- */
h1, h2, h3, .display { font-family: var(--serif); font-weight: 400; line-height: 1.02; }
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
}
.muted { color: var(--muted); }
.serif-it { font-family: var(--serif); font-style: italic; }

/* ---------- reveal pattern (visible by default) ---------- */
.reveal { }
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
html.js .reveal.is-in { opacity: 1; transform: none; }
html.js .reveal.d1 { transition-delay: 0.08s; }
html.js .reveal.d2 { transition-delay: 0.18s; }
html.js .reveal.d3 { transition-delay: 0.30s; }
html.js .reveal.d4 { transition-delay: 0.42s; }

/* ---------- custom cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transition: width 0.3s var(--ease), height 0.3s var(--ease), background 0.3s var(--ease);
  mix-blend-mode: screen;
}
.cursor.is-lg { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: rgba(201,162,75,0.08); }

/* ============================================================
   LOADER
   ============================================================ */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background:
    radial-gradient(120% 90% at 50% 32%, rgba(20,16,8,0.55) 0%, rgba(8,7,6,0.82) 58%, rgba(0,0,0,0.95) 100%),
    url("../assets/main 2.png") center / cover no-repeat #0a0807;
  display: grid; place-items: center;
  transition: opacity 1s var(--ease), visibility 1s;
}
.loader.is-leaving { opacity: 0; visibility: hidden; }
.loader[hidden] { display: none; }
.loader-inner { text-align: center; padding: 2rem; }
.loader-mark {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 7vw, 5rem);
  letter-spacing: 0.22em;
  color: var(--marble);
}
.loader-mark .o { color: var(--accent); }
.loader-line {
  margin-top: 1.4rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.5rem);
  color: var(--muted);
}
.enter-btn {
  margin-top: 2.8rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0.95rem 2.6rem;
  font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.34em; text-transform: uppercase;
  border-radius: 999px;
  opacity: 0.4; pointer-events: none;
  transition: opacity 0.6s var(--ease), border-color 0.4s, color 0.4s, background 0.4s;
}
.enter-btn.is-ready { opacity: 1; pointer-events: auto; cursor: pointer; }
.enter-btn.is-ready:hover { border-color: var(--accent); color: var(--bg); background: var(--accent); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.8rem clamp(1.4rem, 4vw, 3.4rem);
  transition: padding 0.5s var(--ease), background 0.5s;
  mix-blend-mode: difference;
}
.nav.is-scrolled { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.nav-logo { font-family: var(--serif); font-size: 1.4rem; letter-spacing: 0.3em; color: #fff; }
.nav-links { display: flex; gap: 2.2rem; }
.nav-links a {
  font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: #fff;
  opacity: 0.8; transition: opacity 0.3s;
}
.nav-links a:hover { opacity: 1; }
.nav-meta { display: flex; align-items: center; gap: 1.2rem; color: #fff; }
.nav-dots { display: flex; gap: 0.5rem; }
.nav-dots [data-dot] {
  width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  transition: background 0.4s, transform 0.4s;
}
.nav-dots [data-dot].is-active { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.nav-counter { font-size: 0.72rem; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .nav-links { display: none; } }

/* ============================================================
   COVER STAGE — one pinned image behind hero + statement
   ============================================================ */
.cover-stage { position: relative; }
.cover-bg {
  position: sticky; top: 0;
  height: 100vh; width: 100%;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  z-index: 0;
  margin-bottom: -100vh; /* let all following content overlap the pinned image */
}
/* Shade lives on the FIXED image layer, so it's always even — no scroll seam. */
.cover-bg::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(8,7,6,0.52);
  pointer-events: none;
}
/* every content block in a cover stage sits above the pinned image */
.cover-stage > *:not(.cover-bg) { position: relative; z-index: 1; }
/* shading is on the fixed .cover-bg layer; sections stay transparent */
.statement-section {
  min-height: 100vh; display: grid; place-items: center;
}
/* big editorial pull-quote used across the cover stage */
.cover-quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.8rem, 5vw, 3.8rem); line-height: 1.2; color: var(--marble);
  max-width: 18ch; margin: 0 auto;
}
.cover-quote .accent { color: var(--accent); }
.lede-lg { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--text); max-width: 40ch; }
.cover-scroll {
  margin-top: 2.4rem; font-size: 0.66rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--accent);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100vh;
  display: grid; place-items: center; text-align: center;
  padding: 8rem 1.5rem 4rem;
}
.hero::after { /* vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 50% 35%, transparent 40%, rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; max-width: 900px; }
.hero h1 {
  font-size: clamp(3rem, 11vw, 9rem);
  letter-spacing: 0.04em;
  color: var(--marble);
}
.hero h1 .o { color: var(--accent); }
.hero-tag {
  margin-top: 1.2rem;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.2rem, 3vw, 2rem); color: var(--accent-soft);
}
.hero-intro {
  margin: 2rem auto 0; max-width: 540px; color: var(--muted);
  font-size: 1rem;
}
.scroll-hint {
  position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%);
  z-index: 2; font-size: 0.62rem; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
}
.scroll-hint::after {
  content: ""; width: 1px; height: 48px;
  background: linear-gradient(var(--accent), transparent);
  animation: drip 2.2s var(--ease) infinite;
}
@keyframes drip { 0% { opacity: 0; transform: scaleY(0.3); transform-origin: top; } 50% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); transform-origin: bottom; } }

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section { position: relative; padding: clamp(5rem, 12vh, 11rem) clamp(1.4rem, 5vw, 4rem); }
.wrap { max-width: var(--maxw); margin: 0 auto; }
.center { text-align: center; }
.statement {
  font-size: clamp(2rem, 6vw, 4.4rem);
  letter-spacing: 0.01em; line-height: 1.06; color: var(--marble);
  max-width: 14ch; margin: 0 auto;
}
.statement .accent { color: var(--accent); font-style: italic; }
.lede { max-width: 56ch; margin: 1.6rem auto 0; color: var(--muted); font-size: 1.05rem; }

/* ============================================================
   JOURNAL CHAPTERS — horizontal pinned slider
   ============================================================ */
/* Default (no GSAP / no-JS): vertical stack — visible by default. */
.rooms { position: relative; }
.rooms-track { display: block; }

/* GSAP present: become a horizontal row that the pin translates sideways. */
html.has-gsap .rooms { overflow: hidden; }
html.has-gsap .rooms-track {
  display: flex; flex-wrap: nowrap; width: max-content; height: 100vh;
  will-change: transform;
}
html.has-gsap .room { flex: 0 0 100vw; width: 100vw; height: 100vh; min-height: 100vh; }

.journal {
  position: relative; min-height: 100vh;
  display: grid; align-items: center;
  background-size: cover; background-position: center;
  padding: clamp(6rem, 12vh, 9rem) clamp(1.4rem, 5vw, 4rem);
  overflow: hidden;
}
.journal::before { /* deepen for legibility */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,7,6,0.86) 0%, rgba(8,7,6,0.5) 48%, rgba(8,7,6,0.2) 100%);
}
.journal-grid {
  position: relative; z-index: 2;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr; gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}
/* The statue in each image already holds the journal, so hide the CSS book. */
.journal .book-stage { display: none; }
.journal-copy { max-width: 34rem; }
.journal-index {
  font-family: var(--serif); font-size: 1rem; letter-spacing: 0.3em; color: var(--accent);
}
.journal-title {
  font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 0.6rem 0 0.2rem; color: var(--marble);
}
.journal-author {
  font-family: var(--serif); font-style: italic; font-size: 1.4rem; color: var(--accent-soft);
}
.journal-role { font-size: 0.7rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); margin-top: 0.4rem; }
.journal-excerpt {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.6vw, 1.9rem); font-style: italic;
  line-height: 1.4; color: var(--text); margin: 1.8rem 0;
  padding-left: 1.4rem; border-left: 2px solid var(--accent);
}
.journal-story { color: var(--muted); font-size: 0.98rem; max-width: 34ch; }
.journal-meta { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; margin-top: 1.8rem; align-items: baseline; }
.journal-idea { font-family: var(--serif); font-size: 1.25rem; color: var(--accent); }
.journal-idea small { display: block; font-family: var(--sans); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); margin-top: 0.2rem; }
.journal-notes { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.journal-notes span {
  font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text);
  border: 1px solid var(--line); padding: 0.4rem 0.8rem; border-radius: 999px;
}

/* ---------- the CSS book object ---------- */
.book-stage { display: grid; place-items: center; perspective: 1600px; }
.book {
  --leather: #2A1E32;
  --foil: var(--accent);
  position: relative;
  width: clamp(220px, 26vw, 340px);
  aspect-ratio: 3 / 4.1;
  border-radius: 6px 12px 12px 6px;
  background:
    linear-gradient(125deg, rgba(255,255,255,0.10), rgba(255,255,255,0) 40%),
    var(--leather);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    inset -2px 0 12px rgba(0,0,0,0.5),
    0 40px 80px rgba(0,0,0,0.6),
    0 8px 24px rgba(0,0,0,0.5);
  transform: rotateY(-22deg) rotateX(6deg) rotateZ(-1deg);
  transform-style: preserve-3d;
  transition: transform 0.9s var(--ease);
}
.journal:hover .book { transform: rotateY(-12deg) rotateX(3deg) rotateZ(0deg); }
.book::before { /* spine */
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 18px;
  background: linear-gradient(90deg, rgba(0,0,0,0.55), rgba(0,0,0,0));
  border-radius: 6px 0 0 6px;
}
.book::after { /* pages edge */
  content: ""; position: absolute; top: 3%; bottom: 3%; right: -7px; width: 8px;
  background: repeating-linear-gradient(180deg, #d9cdb0 0px, #d9cdb0 1px, #c3b48f 2px, #c3b48f 3px);
  border-radius: 0 3px 3px 0;
  transform: rotateY(12deg);
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
.book-inner {
  position: absolute; inset: 22px 22px 22px 34px;
  border: 1px solid rgba(201,162,75,0.35);
  border-radius: 3px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.6rem 1.2rem;
  text-align: center;
}
.book-emblem {
  font-family: var(--serif); font-size: 2rem; color: var(--foil);
  align-self: center; margin-top: 0.4rem;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
.book-foil-title {
  font-family: var(--serif); font-size: 1.35rem; line-height: 1.1; color: var(--foil);
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, var(--accent-soft), var(--foil) 60%, #8a6f2c);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.book-foil-author {
  font-size: 0.6rem; letter-spacing: 0.26em; text-transform: uppercase; color: rgba(230,207,146,0.8);
  margin-top: 0.5rem;
}

@media (max-width: 880px) {
  .journal-grid { grid-template-columns: 1fr; gap: 3rem; }
  .book-stage { order: -1; }
  .journal::before { background: linear-gradient(180deg, rgba(8,7,6,0.55) 0%, rgba(8,7,6,0.85) 100%); }
}

/* ============================================================
   THE PORCH (essay) + LIBRARY STRIP
   ============================================================ */
/* Porch + Acquire share one pinned image; shading is on the fixed .cover-bg layer. */
.porch, .acquire {
  position: relative; min-height: 100vh;
  display: grid; place-items: center;
}
.porch > .wrap, .acquire > .wrap { position: relative; z-index: 2; }
.porch-quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1.3; color: var(--marble);
  max-width: 22ch; margin: 0 auto 1.6rem;
}
.library { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3rem; max-width: 760px; margin-left: auto; margin-right: auto; }
.lib-card {
  border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem 1rem; text-align: center;
  transition: border-color 0.4s, transform 0.4s, background 0.4s;
}
.lib-card:hover { border-color: var(--accent); transform: translateY(-4px); background: rgba(201,162,75,0.04); }
.lib-card .idx { font-family: var(--serif); color: var(--accent); font-size: 0.9rem; }
.lib-card .ttl { font-family: var(--serif); font-size: 1.2rem; margin-top: 0.4rem; color: var(--text); }
.lib-card .who { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-top: 0.5rem; }
@media (max-width: 880px) { .library { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   ACQUIRE + FOOTER
   ============================================================ */
.acquire { text-align: center; }
.cta-btn {
  display: inline-block; margin-top: 2rem;
  border: 1px solid var(--accent); color: var(--accent);
  padding: 1.1rem 3rem; border-radius: 999px;
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  transition: background 0.4s, color 0.4s;
}
.cta-btn:hover { background: var(--accent); color: var(--bg); }

.footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem clamp(1.4rem, 5vw, 4rem);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer .f-mark { font-family: var(--serif); letter-spacing: 0.24em; color: var(--marble); }
.footer .f-fine { font-size: 0.66rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

/* ============================================================
   NO-JS FALLBACK  (everything readable, stacked)
   ============================================================ */
html.no-js .loader { display: none; }
html.no-js body.is-locked { overflow: auto; height: auto; }
html.no-js .scroll-hint { display: none; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint::after { animation: none; }
  .book { transition: none; }
}
