/* ============================================================
   AVALOR.ART — the trust-first front door
   Subject: Sisyphus, the absurd, meaning built under weight.
   Warm near-black drawn from the cover's parchment; one gold accent.
   Two signatures: the book at rest, and the boulder you push by scrolling.
   ============================================================ */

:root {
  /* warm void — relates to the cover's sepia, not a cold blue-black */
  --bg:        #100e0b;
  --bg-soft:   #16130e;
  --bg-deep:   #0a0907;

  --ink:       #efe9dc;   /* warm white, like aged paper */
  --ink-dim:   #a8a294;
  --ink-faint: #6e6759;

  --gold:      #c9a84c;
  --gold-lift: #ddc06a;
  --gold-soft: rgba(201, 168, 76, 0.13);
  --line:      rgba(239, 233, 220, 0.09);

  --font-display: "Fraunces", Georgia, serif;
  --font-literary: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, sans-serif;

  --maxw: 1080px;
  --pad: clamp(1.5rem, 5vw, 4.5rem);
  --section-gap: clamp(6.5rem, 15vh, 12rem);

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

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* faint warmth pooled toward the top, so the void isn't flat */
  background-image:
    radial-gradient(120% 70% at 50% -10%, rgba(201,168,76,0.06), transparent 55%),
    radial-gradient(90% 60% at 80% 110%, rgba(201,168,76,0.04), transparent 60%);
  /* background-attachment: fixed — removed, causes repaint every scroll on iOS */
}

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

/* ---------- Epigraph — cinematic title card ---------- */
.epigraph {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-deep);
  text-align: center; padding: var(--pad);
  pointer-events: all;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
/* faint radial pool so the void isn't flat */
.epigraph::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 50%, rgba(201,168,76,0.07), transparent 70%);
}
.epigraph.is-done {
  opacity: 0; transform: scale(1.04);
  pointer-events: none;
}
.epigraph__inner { position: relative; }
.epigraph__line {
  font-family: var(--font-literary); font-style: italic;
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.6rem);
  color: var(--ink); letter-spacing: 0.01em;
  line-height: 1.35;
}
/* each word is wrapped by JS and revealed in sequence */
.epigraph__line .ew {
  display: inline-block;
  opacity: 0; transform: translateY(14px);
  filter: blur(8px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease), filter 0.7s var(--ease);
}
.epigraph__line .ew.in {
  opacity: 1; transform: none; filter: blur(0);
}
/* hairline that draws outward */
.epigraph__rule {
  display: block; height: 1px; width: 0; margin: 1.6rem auto;
  background: var(--gold); opacity: 0.7;
  transition: width 1s var(--ease) 0.1s;
}
.epigraph.rule-in .epigraph__rule { width: clamp(60px, 12vw, 140px); }
.epigraph__cite {
  display: block;
  font-family: var(--font-body); font-size: 0.66rem;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-faint); opacity: 0;
  transition: opacity 0.9s var(--ease) 0.2s;
}
.epigraph.cite-in .epigraph__cite { opacity: 1; }

/* ---------- Marquee ---------- */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
  background: var(--bg-soft);
}
.marquee__inner {
  display: flex; white-space: nowrap;
  animation: marquee 55s linear infinite;
}
.marquee__inner:hover { animation-play-state: paused; }
.marquee__inner span {
  font-family: var(--font-literary); font-style: italic;
  font-size: clamp(0.9rem, 1.2vw, 1.05rem);
  color: var(--ink-faint); padding-right: 0;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Word illumination ---------- */
.wrd {
  display: inline; color: var(--ink-faint);
  transition: color 0.5s var(--ease);
}
.wrd--lit { color: var(--ink); }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Shared: eyebrow label (echoes the cover's wide-tracked title) ---------- */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 500; font-size: 1rem; letter-spacing: 0.01em;
  padding: 0.95rem 1.7rem; border-radius: 2px;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.btn--primary {
  background: var(--gold); color: #1a1606;
  box-shadow: 0 10px 30px -18px rgba(201,168,76,0.5);
}
.btn--primary:hover {
  transform: translateY(-2px); background: var(--gold-lift);
  box-shadow: 0 18px 40px -16px rgba(201,168,76,0.6);
}
.btn--ghost {
  background: transparent; color: var(--ink-dim);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--ghost:hover {
  transform: translateY(-2px); color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(201,168,76,0.5);
}

/* ============================================================
   1 · QUIET NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.5rem var(--pad);
  background: linear-gradient(to bottom, rgba(16,14,11,0.9), rgba(16,14,11,0));
  backdrop-filter: blur(3px);
}
.nav__mark {
  display: inline-flex; align-items: center;
}
.nav__logo {
  height: 30px; width: auto; display: block;
  opacity: 0.95; transition: opacity 0.4s var(--ease);
}
.nav__mark:hover .nav__logo { opacity: 1; }
.nav__link {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-dim);
  transition: color 0.4s var(--ease);
}
.nav__link:hover { color: var(--gold); }

/* ============================================================
   2 · HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding: 9rem var(--pad) 6rem;
  max-width: var(--maxw); margin: 0 auto;
}

/* library background — full-bleed behind the manuscript page,
   a slow drift so the room feels lit by candlelight, not static */
.hero__bg {
  position: absolute; top: 0; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100vw; overflow: hidden;
  z-index: 0; pointer-events: none;
}
.hero__bg-img {
  position: absolute; inset: -6%;
  width: 112%; height: 112%;
  object-fit: cover; object-position: center 38%;
  filter: brightness(0.74) saturate(0.95) contrast(1.0);
  opacity: 1;
  animation: heroBgIn 2.4s var(--ease) both, heroDrift 26s ease-in-out 0.3s infinite alternate;
}
/* legibility + warmth: darken left where the text sits, vignette the edges */
.hero__bg-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(16,14,11,0.82) 0%, rgba(16,14,11,0.55) 42%, rgba(16,14,11,0.2) 100%),
    radial-gradient(ellipse at 60% 40%, rgba(201,168,76,0.07) 0%, transparent 55%),
    linear-gradient(to bottom, var(--bg) 0%, transparent 18%, transparent 72%, var(--bg) 100%);
}
.hero__inner, .hero__margin, .hero__scrollcue { position: relative; z-index: 2; }
@keyframes heroBgIn { to { opacity: 1; } }
/* clearly perceptible slow push — the candlelit room comes toward you */
@keyframes heroDrift {
  from { transform: scale(1.02) translate(0, 0); }
  to   { transform: scale(1.14) translate(-2%, -2.4%); }
}
/* candle flicker — the warm glow over the shelves breathes a little */
.hero__bg-flicker {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse 40% 36% at 64% 46%, rgba(201,168,76,0.16) 0%, transparent 60%);
  mix-blend-mode: screen;
  animation: candle 5.5s ease-in-out infinite;
}
@keyframes candle {
  0%,100% { opacity: 0.5; transform: scale(1); }
  35%     { opacity: 0.85; transform: scale(1.03); }
  60%     { opacity: 0.42; transform: scale(0.99); }
  80%     { opacity: 0.7; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__bg-img { animation: heroBgIn 1s ease forwards; }
  .hero__bg-flicker { animation: none; opacity: 0.6; }
}

/* manuscript margin — a hairline rule with edition mark + folio,
   the kind of furniture a printed book carries, not a landing page */
.hero__margin {
  position: absolute;
  top: 9rem; bottom: 6rem; left: var(--pad);
  width: 1px; background: linear-gradient(to bottom, transparent, rgba(201,168,76,0.28) 30%, rgba(201,168,76,0.28) 70%, transparent);
  display: flex; flex-direction: column; justify-content: space-between;
  align-items: center;
  opacity: 0;
}
.intro-done .hero__margin { animation: fade 1.6s var(--ease) 0.9s forwards; }
.hero__edition {
  writing-mode: vertical-rl;
  transform: rotate(180deg) translateX(1.4rem);
  font-family: var(--font-body);
  font-size: 0.64rem; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-faint); white-space: nowrap;
}
.hero__folio {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.1rem; color: var(--gold);
  transform: translateX(1.2rem);
}

.hero__inner {
  width: 100%;
  padding-left: 0;
  margin-left: 0;
}

.hero__headline {
  font-family: var(--font-literary);
  font-weight: 400;
  font-size: clamp(1.9rem, 1.1rem + 3.2vw, 3.6rem);
  line-height: 1.4;
  letter-spacing: 0.005em;
  margin-bottom: 2.6rem;
  color: var(--ink);
  /* a quiet shadow, just enough to hold the type on the photograph */
  text-shadow: 0 1px 24px rgba(8,7,5,0.6);
}
.hero__headline .line {
  display: block;
  opacity: 0; transform: translateY(40px) scale(0.985); filter: blur(14px);
  transform-origin: left center;
}
/* the headline only rises once the intro card has lifted */
.intro-done .hero__headline .line {
  animation: heroRise 1.5s var(--ease) forwards;
}
@keyframes heroRise {
  60%  { filter: blur(0); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
/* drop cap on the very first letter — the opening of a chapter */
/* no drop-cap, no ornament — let it be plain */
/* slower, more deliberate stagger so each line lands like a line of verse */
.hero__headline .line:nth-child(1) { animation-delay: 0.45s; }
.hero__headline .line:nth-child(2) { animation-delay: 0.78s; }
.hero__headline .line:nth-child(3) { animation-delay: 1.12s; }
/* the hollow word arrives last, then glows up — the emotional beat */
.hero__headline em {
  font-style: italic; color: var(--ink-dim); /* quiet, almost a whisper */
  opacity: 0;
}
/* the hollow word simply fades in last — no glow, no bloom */
.intro-done .hero__headline em {
  animation: emptyIn 1.3s var(--ease) 1.6s forwards;
}
@keyframes emptyIn { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero__headline .line { opacity: 1; transform: none; filter: none; animation: none; }
  .hero__headline em { opacity: 1; animation: none; }
}
.hero__sub {
  font-family: var(--font-literary);
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.55rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-dim); max-width: 40ch; margin-bottom: 3rem;
  text-shadow: 0 1px 18px rgba(8,7,5,0.6);
  opacity: 0; transform: translateY(22px);
}
.intro-done .hero__sub { animation: rise 1.2s var(--ease) 1.7s forwards; }
.hero__actions {
  display: flex; align-items: center; gap: 2.4rem; flex-wrap: wrap;
  opacity: 0; transform: translateY(20px);
}
.intro-done .hero__actions { animation: rise 1.1s var(--ease) 2.1s forwards; }

/* editorial CTA — text + arrow with a gold rule that draws on hover,
   not a SaaS pill */
.hero__cta {
  position: relative;
  display: inline-flex; align-items: baseline; gap: 0.7rem;
  font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink); padding-bottom: 0.6rem;
}
.hero__cta::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: var(--gold);
  transform: scaleX(1); transform-origin: left;
  transition: transform 0.5s var(--ease);
}
.hero__cta-arrow {
  color: var(--gold);
  transition: transform 0.4s var(--ease);
}
.hero__cta:hover .hero__cta-arrow { transform: translateX(6px); }
.hero__quiet {
  font-family: var(--font-literary); font-style: italic;
  font-size: 1.05rem; color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.hero__quiet:hover { color: var(--ink-dim); border-color: var(--line); }
.hero__scrollcue {
  position: absolute; right: var(--pad); bottom: 2.4rem;
  font-size: 0.66rem; font-weight: 600; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--ink-faint);
  opacity: 0;
}
.intro-done .hero__scrollcue { animation: fade 1.4s var(--ease) 1.1s forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .hero__margin, .hero__headline .line, .hero__sub, .hero__actions, .hero__scrollcue {
    opacity: 1; transform: none; animation: none;
  }
}

/* ============================================================
   SISYPHUS SCRUB
   Framed cinematic panel — the dark page breathes around it.
   ============================================================ */
.scrub {
  /* taller = slower, more deliberate — 3 acts need room to breathe */
  height: 460vh;        /* fallback for browsers without svh */
  height: 460svh;       /* match sticky unit so travel calc is consistent on mobile */
  position: relative;
}
.scrub__sticky {
  position: sticky; top: 0;
  width: 100%;
  height: 100vh;        /* fallback */
  height: 100svh;       /* small viewport — stable while toolbar animates */
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1.5rem, 4vh, 3rem) var(--pad);
  overflow: hidden;
}
/* the contained art panel */
.scrub__stage {
  position: relative;
  width: min(1080px, 100%);
  aspect-ratio: 16 / 9;
  max-height: 84svh;
  border-radius: 6px;
  overflow: hidden;
  box-shadow:
    0 40px 90px -40px rgba(0,0,0,0.9),
    0 0 0 1px rgba(239,233,220,0.06);
}
.scrub__canvas {
  width: 100%; height: 100%;
  display: block;
}
/* soft inner vignette so the panel edges melt into the frame */
.scrub__vignette {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow: inset 0 0 120px 24px rgba(12,12,14,0.55);
}
/* permanent left scrim — keeps the side text legible over any frame */
.scrub__scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(to right,
    rgba(8,8,9,0.90) 0%,
    rgba(8,8,9,0.68) 26%,
    rgba(8,8,9,0.28) 52%,
    transparent 74%);
}

/* Captions — anchored to the left side, vertically centred */
.scrub__text {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  text-align: left;
  padding: clamp(2rem, 8%, 5rem);
  margin: 0;
  opacity: 0; pointer-events: none;
  /* JS sets opacity directly each frame for scrub precision */
}
/* chapter numeral — sits above the act label, never crossing the text */
.scrub__num {
  display: block;
  font-family: var(--font-display);
  font-style: italic; font-weight: 300;
  font-size: clamp(3rem, 1.5rem + 4vw, 5rem);
  line-height: 0.9; color: var(--gold);
  opacity: 0.55;
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 24px rgba(0,0,0,0.85);
  pointer-events: none; user-select: none;
}
.scrub__text figcaption {
  max-width: 22ch;
  position: relative; z-index: 1;
}
.scrub__act {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.4em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.scrub__act::after {
  content: ""; display: block;
  width: 26px; height: 1px; margin: 0.9rem 0 0;
  background: var(--gold); opacity: 0.5;
}
.scrub__line {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 1.8vw, 2.4rem);
  font-weight: 400; line-height: 1.32; letter-spacing: -0.01em;
  color: #f6f1e6;
  text-shadow: 0 2px 24px rgba(0,0,0,0.85);
}

@media (max-width: 640px) {
  /* svh is the short (toolbar-shown) viewport on phones, so 460svh is far
     shorter in px than it is on desktop — the 256 frames then race past in
     too little scroll. Give the section more travel back so the pace matches. */
  .scrub { height: 640vh; height: 640svh; }
  .scrub__stage { aspect-ratio: 4 / 5; max-height: 82svh; }
  /* on a tall phone panel, sit the text lower-left for breathing room */
  .scrub__text { justify-content: flex-end; padding-bottom: clamp(2rem, 8%, 3.5rem); }
  .scrub__scrim {
    background: linear-gradient(to top,
      rgba(8,8,9,0.92) 0%, rgba(8,8,9,0.55) 40%, transparent 80%);
  }
  .scrub__num { font-size: clamp(2.6rem, 10vw, 3.6rem); opacity: 0.6; margin-bottom: 0.4rem; }
  .scrub__line { font-size: 1.3rem; }
  .scrub__text figcaption { max-width: 22ch; }
}

@media (prefers-reduced-motion: reduce) {
  .scrub { height: auto; }
  .scrub__sticky { position: relative; height: auto; }
  .scrub__text:first-of-type { opacity: 1; }
}

/* ============================================================
   3 · WHAT THIS IS
   ============================================================ */
.what {
  padding: var(--section-gap) var(--pad);
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.what .eyebrow, .what__body { max-width: 720px; margin-left: auto; margin-right: auto; }
.what__body {
  font-family: var(--font-literary); font-weight: 400;
  font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem);
  line-height: 1.55; letter-spacing: 0.005em; color: var(--ink);
}
.what__names { color: var(--gold); font-style: italic; }

/* ============================================================
   LITERARY PANELS — Labor / Seeking / Camus / Found note
   ============================================================ */
.panels {
  display: flex;
  flex-direction: column;
}

.panel {
  position: relative;
  width: 100%;
  height: 92svh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* media wrapper carries the scroll parallax; image inside carries Ken Burns */
.panel__media {
  position: absolute; inset: -12%;
  width: 124%; height: 124%;
  will-change: transform;
}
.panel__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.62) saturate(0.86);
  transform: scale(1.02);
  transition: filter 0.6s var(--ease);
}
/* slow Ken Burns push once the panel is in view — the image keeps breathing */
.panel.is-seen .panel__img {
  animation: kenburns 18s ease-out forwards;
}
.panel--seeking.is-seen .panel__img { animation-direction: alternate; animation-iteration-count: infinite; animation-duration: 26s; }
@keyframes kenburns {
  from { transform: scale(1.02) translate(0, 0); }
  to   { transform: scale(1.12) translate(-1.5%, -1%); }
}
@media (hover: hover) {
  .panel:hover .panel__img { filter: brightness(0.78) saturate(1.02); }
}
@media (prefers-reduced-motion: reduce) {
  .panel.is-seen .panel__img,
  .panel--seeking.is-seen .panel__img { animation: none; transform: scale(1.04); }
}

/* overlays — directional gradients to make text legible */
.panel__overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to left,
    rgba(10,9,7,0.85) 0%,
    rgba(10,9,7,0.55) 45%,
    rgba(10,9,7,0.1) 100%);
}
.panel__overlay--left {
  background: linear-gradient(to right,
    rgba(10,9,7,0.88) 0%,
    rgba(10,9,7,0.5) 45%,
    rgba(10,9,7,0.05) 100%);
}
.panel__overlay--center {
  background: radial-gradient(ellipse at center,
    rgba(10,9,7,0.7) 0%,
    rgba(10,9,7,0.82) 100%);
}

/* text body — positioned per panel */
.panel__body {
  position: relative; z-index: 2;
  padding: clamp(2rem, 6vw, 5rem);
  max-width: 560px;
  margin-left: auto;
}
.panel__body--left  { margin-left: 0; margin-right: auto; }
.panel__body--center {
  margin: auto;
  text-align: center;
}

/* roman numeral — large faint marker */
.panel__num {
  display: block;
  font-family: var(--font-literary);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 400;
  color: var(--gold);
  opacity: 0.3;
  line-height: 0.9;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.panel__title {
  font-family: var(--font-literary);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
/* gold rule beneath the title — editorial anchor */
.panel__title::after {
  content: ""; display: block;
  width: 38px; height: 1px; margin-top: 1.1rem;
  background: var(--gold); opacity: 0.6;
}
.panel__body--center .panel__title::after { margin-left: auto; margin-right: auto; }

.panel__desc {
  font-family: var(--font-literary);
  font-size: clamp(1.1rem, 1.5vw, 1.35rem);
  line-height: 1.65;
  color: var(--ink-dim);
  font-style: italic;
}

/* --- panel entrance: content rises + fades as the panel enters --- */
.panel__body, .panel__quote {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.panel.is-seen .panel__body,
.panel.is-seen .panel__quote {
  opacity: 1; transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .panel__body, .panel__quote { opacity: 1; transform: none; }
}

/* camus panel — large quote */
.panel__quote {
  font-family: var(--font-literary);
  font-style: italic;
}
.panel__quote p {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.25;
  color: var(--ink);
  font-weight: 400;
  margin-bottom: 1.4rem;
}
.panel__quote cite {
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  color: var(--gold);
  font-style: normal;
  letter-spacing: 0.08em;
}

/* found note — raw photo, no overlay */
.panel__note {
  width: 100%;
  height: 70svh;
  max-height: 680px;
  min-height: 440px;
  overflow: hidden;
  transform: rotate(-0.6deg);
  box-shadow: 0 -4px 60px rgba(0,0,0,0.5);
}
.panel__note img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  filter: brightness(0.88) saturate(0.95);
  transform: scale(1.03);
  transition: transform 14s ease-out;
}
.panel__note.is-in img { transform: scale(1.1); }
@media (prefers-reduced-motion: reduce) {
  .panel__note img, .panel__note.is-in img { transform: scale(1.04); transition: none; }
}

/* ============================================================
   INFLUENCES — the thinkers behind the book
   ============================================================ */
.influences {
  padding: 0 var(--pad) var(--section-gap);
  background: var(--bg-soft);
  text-align: center;
}
.influences .eyebrow { margin-bottom: 2.8rem; }
.influences__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(1.5rem, 3vw, 2.8rem);
  max-width: var(--maxw); margin: 0 auto;
  text-align: left;
}
.influence img {
  width: 100%;
  aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 3px;
  filter: grayscale(1) contrast(1.02);
  box-shadow: 0 30px 50px -34px rgba(0,0,0,0.9);
  margin: 0 0 1.1rem;
  transition: filter 0.5s var(--ease);
}
.influence:hover img { filter: grayscale(0.55) contrast(1.05); }
.influence h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.1rem; margin-bottom: 0.5rem;
}
.influence p {
  font-family: var(--font-literary);
  font-size: 1rem; line-height: 1.4;
  color: var(--ink-dim); font-style: italic;
}
@media (max-width: 900px) {
  .influences__list { grid-template-columns: repeat(2, 1fr); gap: 2.2rem; }
}
@media (max-width: 460px) {
  .influences__list { grid-template-columns: 1fr; max-width: 320px; }
}

/* ============================================================
   4 · SUBSCRIBE — the centre of gravity
   ============================================================ */
.subscribe {
  padding: var(--section-gap) var(--pad);
  text-align: center; position: relative; overflow: hidden;
}
.subscribe::before {
  content: ""; position: absolute; top: 42%; left: 50%;
  width: min(820px, 96vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--gold-soft), transparent 62%);
  pointer-events: none; z-index: 0;
}
.subscribe__inner { position: relative; z-index: 1; max-width: 580px; margin: 0 auto; }
.subscribe__headline {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2rem, 1.3rem + 3vw, 3.3rem);
  line-height: 1.1; letter-spacing: -0.015em; margin-bottom: 1.3rem;
}
.subscribe__sub {
  color: var(--ink-dim); font-size: 1.1rem; max-width: 46ch; margin: 0 auto 2.6rem;
}
.subscribe__form { display: flex; justify-content: center; min-height: 150px; }
.subscribe__form iframe { width: 100%; max-width: 480px; background: transparent; border-radius: 4px; }
.subscribe__chapter {
  margin-top: 1.4rem;
  font-family: var(--font-literary); font-style: italic;
  font-size: 1.05rem; color: var(--gold); opacity: 0.85;
}
.subscribe__note {
  margin-top: 0.6rem; font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-faint);
}

/* ============================================================
   5 · THE BOOK
   ============================================================ */
.book {
  padding: var(--section-gap) var(--pad);
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 7vw, 6.5rem); align-items: center;
  max-width: var(--maxw); margin: 0 auto;
}
.book__stage { display: flex; justify-content: center; perspective: 1600px; }
.book__text { max-width: 40ch; }
.book__line {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 1.1rem + 1.7vw, 2.2rem);
  line-height: 1.22; margin-bottom: 1.3rem;
}
.book__body { color: var(--ink-dim); margin-bottom: 2.2rem; }
.book__actions { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.book__price {
  display: block; margin-top: 1.1rem; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
}

/* ---------- 3D book at rest (no spin); tilts toward cursor ---------- */
.book3d {
  width: clamp(210px, 26vw, 300px); aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
}
.book3d__inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(-22deg) rotateX(7deg);
  animation: bookfloat 7s ease-in-out infinite;
  transition: transform 0.3s var(--ease);
}
@keyframes bookfloat {
  0%, 100% { transform: rotateY(-22deg) rotateX(7deg) translateY(0); }
  50%      { transform: rotateY(-19deg) rotateX(6deg) translateY(-10px); }
}
.book3d__cover {
  position: absolute; inset: 0; transform: translateZ(16px);
  border-radius: 2px 5px 5px 2px; overflow: hidden;
  box-shadow: 0 50px 70px -34px rgba(0,0,0,0.95);
}
.book3d__cover img { width: 100%; height: 100%; object-fit: cover; }
.book3d__cover::after { /* light catching the right edge */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(255,255,255,0.16), transparent 22%, transparent 86%, rgba(0,0,0,0.28));
  pointer-events: none;
}
.book3d__spine {
  position: absolute; top: 0; bottom: 0; left: -16px; width: 32px;
  transform: rotateY(-90deg); transform-origin: right center;
  background: linear-gradient(to right, #0d0b08, #221c12 45%, #0d0b08);
  border-radius: 2px 0 0 2px;
}
.book3d__pages {
  position: absolute; top: 1.5%; bottom: 1.5%; right: -15px; width: 30px;
  transform: rotateY(90deg); transform-origin: left center;
  background: repeating-linear-gradient(to bottom, #e9e2d2, #e9e2d2 1px, #cfc6b2 2px, #e9e2d2 3px);
}
@media (prefers-reduced-motion: reduce) { .book3d__inner { animation: none; } }

/* ============================================================
   6 · RECENT ESSAYS
   ============================================================ */
.essays { padding: var(--section-gap) var(--pad); max-width: 760px; margin: 0 auto; }
.essays__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem);
  margin-bottom: 2.8rem; letter-spacing: -0.015em;
}
.essays__list { list-style: none; }
.essays__loading { color: var(--ink-faint); font-style: italic; }
.essay {
  border-top: 1px solid var(--line); padding: 1.6rem 0;
  transition: padding 0.4s var(--ease);
}
.essay:last-child { border-bottom: 1px solid var(--line); }
.essay a { display: block; }
.essay:hover { padding-left: 0.7rem; }
.essay__title {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 500;
  margin-bottom: 0.4rem; transition: color 0.4s var(--ease);
}
.essay:hover .essay__title { color: var(--gold); }
.essay__desc { color: var(--ink-dim); font-size: 0.98rem; line-height: 1.6; }
.essays__all {
  display: inline-block; margin-top: 2.6rem; color: var(--ink-dim);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  border-bottom: 1px solid var(--line); padding-bottom: 3px;
  transition: color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.essays__all:hover { color: var(--gold); border-color: var(--gold); }

/* ============================================================
   7 · ABOUT
   ============================================================ */
.about {
  padding: var(--section-gap) var(--pad);
  background: var(--bg-soft); border-top: 1px solid var(--line);
}
.about__inner {
  max-width: 760px; margin: 0 auto; text-align: center;
  position: relative;
}
.about .eyebrow { margin-bottom: 2.4rem; }
/* big faint quotation mark — sets the confessional tone without a face */
.about__inner::before {
  content: "\201C";
  position: absolute; top: -0.3em; left: 50%; transform: translateX(-50%);
  font-family: var(--font-display); font-style: italic;
  font-size: 9rem; line-height: 1; color: var(--gold);
  opacity: 0.12; pointer-events: none;
}
.about__quote {
  font-family: var(--font-literary); font-weight: 400; font-style: italic;
  font-size: clamp(1.65rem, 1.1rem + 1.8vw, 2.5rem); line-height: 1.45;
  letter-spacing: 0.005em; color: var(--ink);
  position: relative;
}
.about__sign {
  margin-top: 1.8rem;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.25rem; color: var(--gold);
}

/* ============================================================
   ★ THE ASCENT — fixed boulder you push by scrolling
   ============================================================ */
.ascent {
  position: fixed; left: 0; right: 0; bottom: 0; height: 64px;
  /* needed so the boulder img positions relative to this container */
  z-index: 40; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 60%, transparent);
          mask-image: linear-gradient(to top, #000 60%, transparent);
}
.ascent__svg { width: 100%; height: 100%; display: block; }
.ascent__slope {
  stroke: rgba(201,168,76,0.28); stroke-width: 0.25; stroke-linecap: round;
}
.ascent__rock {
  position: absolute;
  width: 36px; height: 36px;
  bottom: 0; left: 0;
  transform: translate(-50%, 40%);
  filter: drop-shadow(0 0 6px rgba(201,168,76,0.35));
  pointer-events: none;
  will-change: left, bottom;
}
@media (max-width: 640px) { .ascent__rock { width: 26px; height: 26px; } }
@media (max-width: 640px) { .ascent { height: 48px; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  padding: clamp(4.5rem, 9vh, 7rem) var(--pad) 5rem;
  text-align: center; border-top: 1px solid var(--line);
  background: var(--bg-deep);
}
.footer__line {
  font-family: var(--font-display); font-style: italic;
  font-size: 1.2rem; color: var(--ink-dim); margin-bottom: 2.4rem;
}
.footer__socials { display: flex; justify-content: center; gap: 1.7rem; margin-bottom: 2.2rem; }
.footer__socials a { color: var(--ink-faint); transition: color 0.4s var(--ease), transform 0.4s var(--ease); }
.footer__socials svg { width: 22px; height: 22px; fill: currentColor; }
.footer__socials a:hover { color: var(--gold); transform: translateY(-3px); }
.footer__links {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-faint); display: flex; justify-content: center; gap: 0.9rem;
}
.footer__links a { transition: color 0.4s var(--ease); }
.footer__links a:hover { color: var(--gold); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  .book { grid-template-columns: 1fr; text-align: center; }
  .book__text, .subscribe__sub { margin-left: auto; margin-right: auto; }
  .book__actions { justify-content: center; }
  .hero { padding-top: 8rem; min-height: 94svh; }
}

/* Mobile smoothness: keep entrance reveals, but stop the perpetual
   background loops — they're the heaviest thing for a phone to run and
   the most likely to jank. The library still fades in; the panels still
   rise and do their one-shot Ken Burns. */
@media (max-width: 760px) {
  .hero__bg-img {
    animation: heroBgIn 2.4s var(--ease) both;   /* no infinite drift */
    object-position: 58% 52%;                     /* keep the candle + armchair in frame */
  }
  .hero__bg-flicker {
    animation: none; opacity: 0.55;               /* no flicker loop */
    background: radial-gradient(ellipse 50% 30% at 58% 56%, rgba(201,168,76,0.18) 0%, transparent 60%);
  }
  .panel--seeking.is-seen .panel__img {                          /* no infinite zoom */
    animation: kenburns 18s ease-out forwards;
  }
}
