:root {
  --rose: #f4b8ce;
  --rose-deep: #d48a9f;
  --cream: #faf6ec;
  --charcoal: #232221;
  --slate: #6c6968;
  --mute: #8e8b86;
  --paper: #fff;
  --line: #e8e0d8;
  --gold: #bc5c4f;
  --dark: #1a1512;
  --dark-warm: #241c16;
  --seam: #a68e79;
  --font-display: "Spectral", Georgia, serif;
  --font-body: "Lora", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
  --font-hand: "Caveat", cursive;
  --ease-out: cubic-bezier(.16,1,.3,1);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--charcoal);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--rose); color: var(--charcoal); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
#film-scroll { position: relative; height: 850vh; }
#film-stage { position: sticky; top: 0; height: 100vh; overflow: hidden; background: var(--dark); }
#film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#loader { position: fixed; inset: 0; z-index: 200; background: var(--dark); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; transition: opacity .6s var(--ease-out); }
#loader.done { opacity: 0; pointer-events: none; }
#loader .wordmark { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 400; color: #fff; font-style: italic; }
#loader .bar { width: 200px; height: 2px; background: rgba(255,255,255,.1); border-radius: 1px; overflow: hidden; }
#loader .bar-fill { height: 100%; width: 0%; background: var(--rose); transition: width .3s var(--ease-out); }
#loader .status { font-family: var(--font-mono); font-size: .7rem; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .12em; }
.beat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; z-index: 10; }
.beat-inner { text-align: center; max-width: 700px; padding: 0 32px; }
.beat h2 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.75rem); font-weight: 400; color: #fff; line-height: 1.1; text-shadow: 0 1px 22px rgba(0,0,0,.55); }
.beat p { font-family: var(--font-body); font-size: clamp(1rem, 2vw, 1.25rem); color: rgba(255,255,255,.75); margin-top: 16px; line-height: 1.5; text-shadow: 0 1px 12px rgba(0,0,0,.4); }
.beat .eyebrow { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; color: var(--rose); margin-bottom: 20px; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.beat::before { content: ""; position: absolute; z-index: -1; inset: -70% -24% -70% -14%; background: radial-gradient(60% 58% at 22% 50%, rgba(26,21,18,.72), rgba(26,21,18,.42) 45%, transparent 78%); }
#beat-hero { z-index: 20; }
#beat-hero .wordmark { font-family: var(--font-display); font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 400; color: #fff; line-height: 1.05; text-shadow: 0 1px 30px rgba(0,0,0,.6); font-style: italic; }
#beat-hero .wordmark .accent { color: var(--rose); }
#beat-hero .tagline { font-family: var(--font-body); font-size: clamp(1rem, 1.8vw, 1.25rem); color: rgba(255,255,255,.6); margin-top: 20px; letter-spacing: .02em; }
#chapter-readout { position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%); z-index: 30; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.5); text-align: center; transition: opacity .4s var(--ease-out); pointer-events: none; }
#chapter-readout .label { display: block; margin-bottom: 6px; }
#chapter-readout .bar { width: 120px; height: 1px; background: rgba(255,255,255,.15); margin: 0 auto; position: relative; }
#chapter-readout .bar-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; background: var(--rose); transition: width .3s var(--ease-out); }
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; transition: all .4s var(--ease-out); }
.site-header::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 180%; z-index: -1; background: linear-gradient(to bottom, rgba(26,21,18,.62), rgba(26,21,18,0)); transition: opacity .4s var(--ease-out); }
.site-header.on-light::before { background: linear-gradient(to bottom, rgba(250,246,236,.85), rgba(250,246,236,0)); }
.site-header.on-light .brand-word, .site-header.on-light nav a { color: var(--charcoal); text-shadow: none; }
.brand-word { font-family: var(--font-display); font-size: 1.25rem; font-weight: 400; color: #fff; text-shadow: 0 1px 22px rgba(0,0,0,.55); transition: color .4s var(--ease-out); font-style: italic; }
.brand-word .dot { color: var(--rose); }
nav { display: flex; gap: 28px; }
nav a { font-family: var(--font-body); font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.7); text-shadow: 0 1px 12px rgba(0,0,0,.4); transition: color .3s var(--ease-out); }
nav a:hover { color: #fff; }
.site-header.on-light nav a { color: var(--slate); }
.site-header.on-light nav a:hover { color: var(--charcoal); }
.header-cta { font-family: var(--font-body); font-size: .8rem; font-weight: 600; padding: 8px 20px; border-radius: 999px; background: var(--rose); color: var(--charcoal); transition: background .3s var(--ease-out); }
.header-cta:hover { background: var(--rose-deep); color: #fff; }
#content { position: relative; z-index: 5; background: var(--cream); }
.section { display: flex; align-items: center; justify-content: center; padding: 5.5rem 24px; }
.section + .section { padding-top: 2.5rem; }
.section:first-child { padding-top: 7rem; }
.section .wrap { max-width: 820px; width: 100%; }
.section .wrap > * { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.section.in .wrap > * { opacity: 1; transform: none; }
.section.in .wrap > *:nth-child(2) { transition-delay: .09s; }
.section.in .wrap > *:nth-child(3) { transition-delay: .18s; }
.section.in .wrap > *:nth-child(4) { transition-delay: .27s; }
.eyebrow { font-family: var(--font-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .16em; color: var(--slate); margin-bottom: 16px; }
.section h2 { font-family: var(--font-display); font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 400; line-height: 1.15; color: var(--charcoal); margin-bottom: 20px; }
.section p { font-size: 1.125rem; color: var(--slate); line-height: 1.65; max-width: 52ch; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; padding: 14px 32px; font-family: var(--font-body); font-size: .9rem; font-weight: 600; background: var(--rose); color: var(--charcoal); border: none; border-radius: 999px; cursor: pointer; transition: all .3s var(--ease-out); }
.btn-primary:hover { background: var(--rose-deep); color: #fff; transform: translateY(-1px); }
.site-footer { padding: 48px 32px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; background: var(--cream); }
.site-footer .brand { font-family: var(--font-display); font-weight: 400; color: var(--charcoal); font-style: italic; }
.site-footer .brand .dot { color: var(--rose); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: .85rem; color: var(--slate); transition: color .3s; }
.footer-links a:hover { color: var(--rose); }
#film-grain { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: .06; }
#film-vignette { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.5) 100%); }
#seam-handoff { position: absolute; bottom: 0; left: 0; right: 0; height: 40vh; z-index: 6; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--cream)); opacity: 0; }

/* === TESTIMONIALS === */
#testimonials .wrap { max-width: 980px; }
.tm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin-top: 40px; align-items: stretch; }
.tm-stack { position: relative; height: 400px; }
.tm-card { position: absolute; inset: 0; border-radius: 24px; overflow: hidden; box-shadow: 0 18px 50px rgba(35,34,33,.14); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); transform-origin: bottom center; }
.tm-card img { width: 100%; height: 100%; object-fit: cover; }
.tm-card .tm-post-tag { position: absolute; left: 14px; bottom: 14px; font-family: var(--font-mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; color: #fff; background: rgba(26,21,18,.55); padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.tm-panel { display: flex; flex-direction: column; justify-content: space-between; padding: 8px 0; }
.tm-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--charcoal); }
.tm-desig { font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--mute); margin-top: 6px; }
.tm-quote { font-family: var(--font-body); font-size: 1.15rem; line-height: 1.65; color: var(--slate); margin-top: 26px; }
.tm-quote .w { display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(5px); transition: opacity .3s var(--ease-out), filter .3s var(--ease-out), transform .3s var(--ease-out); }
.tm-quote.play .w { opacity: 1; filter: blur(0); transform: none; }
.tm-arrows { display: flex; gap: 14px; margin-top: 34px; }
.tm-arrows button { height: 40px; width: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--charcoal); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .3s var(--ease-out); }
.tm-arrows button:hover { background: var(--rose); border-color: var(--rose); }
.tm-arrows svg { height: 18px; width: 18px; transition: transform .3s var(--ease-out); }
.tm-arrows button:first-child:hover svg { transform: rotate(12deg); }
.tm-arrows button:last-child:hover svg { transform: rotate(-12deg); }
.tm-note { font-size: .85rem; color: var(--mute); margin-top: 30px; }
.tm-note a { color: var(--gold); border-bottom: 1px solid var(--line); }
@media (max-width: 768px) {
  .tm-grid { grid-template-columns: 1fr; gap: 32px; }
  .tm-stack { height: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #film-scroll { height: auto; }
  #film-stage { position: relative; height: auto; min-height: 100vh; }
}
/* === MOBILE MENU (hidden on desktop) === */
#menu-toggle { display: none; }
#mobile-menu { display: none; }

@media (max-width: 768px) {
  .site-header { padding: 16px 20px; }
  .site-header nav { display: none; }
  .header-cta { margin-left: auto; margin-right: 16px; }

  #menu-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 40px; height: 40px; padding: 0 8px;
    background: none; border: none; cursor: pointer; z-index: 160;
  }
  #menu-toggle span {
    display: block; height: 2px; width: 100%; background: #fff;
    border-radius: 1px; transition: transform .35s var(--ease-out), background .35s var(--ease-out);
    box-shadow: 0 1px 8px rgba(0,0,0,.35);
  }
  .site-header.on-light #menu-toggle span { background: var(--charcoal); box-shadow: none; }
  body.menu-open #menu-toggle span { background: var(--charcoal); box-shadow: none; }
  body.menu-open #menu-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  body.menu-open #menu-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }

  #mobile-menu {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
    position: fixed; inset: 0; z-index: 150; background: var(--cream);
    opacity: 0; pointer-events: none; transition: opacity .4s var(--ease-out);
  }
  body.menu-open #mobile-menu { opacity: 1; pointer-events: auto; }
  #mobile-menu nav { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  #mobile-menu nav a {
    font-family: var(--font-display); font-size: 2rem; color: var(--charcoal);
    padding: 10px 20px; opacity: 0; transform: translateY(14px);
    transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
  }
  body.menu-open #mobile-menu nav a { opacity: 1; transform: none; }
  body.menu-open #mobile-menu nav a:nth-child(2) { transition-delay: .06s; }
  body.menu-open #mobile-menu nav a:nth-child(3) { transition-delay: .12s; }
  body.menu-open #mobile-menu nav a:nth-child(4) { transition-delay: .18s; }
  #mobile-menu .menu-foot {
    position: absolute; bottom: max(28px, env(safe-area-inset-bottom));
    font-family: var(--font-display); font-style: italic; color: var(--mute); font-size: 1rem;
  }
  #mobile-menu .menu-foot .dot { color: var(--rose); }

  /* shorter film scrub under a thumb */
  #film-scroll { height: 500vh; }

  /* chapter readout clear of the phone home bar */
  #chapter-readout { bottom: calc(20px + env(safe-area-inset-bottom)); }

  /* Chapter 05: inline desktop styles push it left; recentre on mobile */
  #beat-slice .beat-inner { text-align: center !important; margin: 0 auto !important; max-width: 100% !important; }

  .section { padding: 4rem 20px; }
  .beat-inner { padding: 0 20px; }
  .beat h2 { font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .site-footer { flex-direction: column; text-align: center; }

  /* testimonials: roomier photo, tighter panel */
  .tm-stack { height: min(88vw, 380px); }
  .tm-quote { font-size: 1.05rem; }
  .tm-arrows { margin-top: 26px; }

  /* HEADER AUTO-HIDE — slides away on scroll down, returns on scroll up */
  .site-header {
    transform: translateY(0);
    transition: transform .35s var(--ease-out), padding .4s var(--ease-out);
    will-change: transform;
  }
  .site-header.hide { transform: translateY(-115%); }
  body.menu-open .site-header { transform: translateY(0) !important; }

  /* Nothing may print underneath the bar. Anchor jumps land clear of it too. */
  #content .section { scroll-margin-top: 78px; }
  #content .section:first-child { padding-top: 5.5rem; }
  .tm-note { margin-top: 22px; }

  /* Cleaner film-to-page handover: shorter, and fully opaque at the join */
  #seam-handoff {
    height: 26vh;
    background: linear-gradient(to bottom,
      rgba(250,246,236,0) 0%,
      rgba(250,246,236,.55) 55%,
      var(--cream) 100%);
  }
}

/* used only while measuring the tallest quote — never painted */
.tm-quote.measuring { visibility: hidden; }
.tm-quote.measuring .w { opacity: 1; filter: none; transform: none; }
