@layer tokens, reset, base, layout, components, sections, utilities;

/* ==========================================================================
   Gap Moment — main.css
   Hand-written, zero build step. Companion to site/index.html.
   :root tokens for hero-critical values are duplicated (small subset) in the
   inline <style> block in <head> for CLS-zero first paint; this file is the
   canonical, complete token set and every non-hero component.

   Cascade layers: everything below lives inside one of the seven layers
   declared above. Layer order (not source order, not selector specificity)
   decides who wins a conflict — so a later layer (e.g. "sections") can
   quietly override an earlier one (e.g. "components") with zero specificity
   fighting and no forced-priority overrides needed. When adding new rules, put them in the
   layer that matches their JOB, not where they happen to live in the file:
     tokens     — custom properties only
     reset      — bare element normalization, no classes
     base       — element defaults + the type scale, using the tokens
     layout     — macro structure: containers, section rhythm, grid/flex
                  scaffolding that arranges other things
     components — discrete, nameable UI pieces (buttons, cards, players…)
     sections   — one-off context/overrides scoped to a single named section
     utilities  — small generic helper classes usable anywhere
   ========================================================================== */

/* ==========================================================================
   @layer tokens
   ========================================================================== */
@layer tokens {
  :root {
    /* ROOM (warm, dominant) */
    --color-bg: #191410;
    --color-bg-raised: #1e1a15;
    --color-bg-void: #0f0c09;
    --color-text: #f0ebe2;
    --color-text-muted: #b8ae9d;
    --color-gold: #d9a84e;
    --color-hairline: rgba(240, 235, 226, 0.12);

    /* SCREEN (cold, restricted use: progress fill, app-chrome accents, hero rim) */
    --color-ice: #a6aedb;
    --color-ice-rim: rgba(166, 174, 219, 0.25);

    /* Inset surfaces ("paper") */
    --color-surface-cream: #f0ebe2;
    --color-surface-cream-text: #191410;

    /* Scrim stops (hero legibility gradient) */
    --scrim-0: rgba(25, 20, 16, 0.15);
    --scrim-15: rgba(25, 20, 16, 0.6);
    --scrim-55: rgba(25, 20, 16, 0.88);

    /* Spacing scale (8px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;
    --space-10: 128px;
    --space-11: 192px;

    /* Type */
    --font-serif: "Newsreader", "Newsreader Fallback Georgia",
      "Newsreader Fallback Times", Georgia, "Times New Roman", serif;

    --size-display: clamp(2.75rem, 2.1rem + 3vw, 4.75rem);
    --size-h2: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
    --size-h3: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --size-body-l: clamp(1.125rem, 1.05rem + 0.3vw, 1.3125rem);
    --size-body: 1rem;
    --size-caption: 0.8125rem;
    --size-micro: 0.75rem;

    /* Layout */
    --side-margin: clamp(20px, 5vw, 80px);
    --measure-text: 720px;
    --measure-wide: 1120px;
    --section-pad: clamp(64px, 8vw, 128px);
    --radius: 4px;
    --focus-ring: 2px solid var(--color-gold);
  }

  @media (min-width: 600px) {
    :root {
      --side-margin: clamp(24px, 5vw, 80px);
    }
  }
}

/* ==========================================================================
   @layer reset
   ========================================================================== */
@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

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

  img,
  picture,
  svg,
  audio {
    max-width: 100%;
    display: block;
  }

  a {
    color: inherit;
  }

  button {
    font: inherit;
    color: inherit;
  }

  ul,
  ol {
    padding-left: 1.2em;
  }

  h1,
  h2,
  h3,
  p,
  figure {
    margin: 0;
  }
}

/* ==========================================================================
   @layer base
   ========================================================================== */
@layer base {
  body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: var(--size-body);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums lining-nums;
  }

  /* Non-negotiable: gold focus ring everywhere, never outline:none without a
     replacement. */
  :focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
  }

  /* ---- Typography scale ---- */
  .eyebrow {
    font-size: var(--size-caption);
    line-height: 1.4;
    letter-spacing: 0.05em;
    font-weight: 460;
    text-transform: uppercase;
    color: var(--color-gold);
    margin: 0 0 var(--space-3);
  }

  h1,
  .h1 {
    font-size: var(--size-display);
    line-height: 1.05;
    letter-spacing: -0.01em;
    font-weight: 340;
  }

  h2,
  .h2 {
    font-size: var(--size-h2);
    line-height: 1.15;
    letter-spacing: -0.005em;
    font-weight: 440;
    margin: 0 0 var(--space-5);
  }

  h3,
  .h3 {
    font-size: var(--size-h3);
    line-height: 1.25;
    font-weight: 500;
  }

  .body-l {
    font-size: var(--size-body-l);
    line-height: 1.5;
    letter-spacing: 0.005em;
    font-weight: 380;
    color: var(--color-text-muted);
  }

  .caption {
    font-size: var(--size-caption);
    line-height: 1.4;
    letter-spacing: 0.03em;
    font-weight: 460;
  }

  .micro {
    font-size: var(--size-micro);
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--color-text-muted);
  }

  .section p + p {
    margin-top: var(--space-4);
  }

  /* Wordmark (non-linking, no nav) */
  .wordmark {
    font-size: var(--size-caption);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text);
    font-weight: 460;
    margin: 0 0 var(--space-6);
  }
}

/* ==========================================================================
   @layer layout — macro structure: containers, section rhythm, grid/flex
   scaffolding that arranges other components (visual styling of the things
   it arranges lives in @layer components instead).
   ========================================================================== */
@layer layout {
  .container {
    max-width: calc(var(--measure-wide) + 2 * var(--side-margin));
    margin-inline: auto;
    padding-inline: var(--side-margin);
  }

  .measure-text {
    max-width: var(--measure-text);
    margin-inline: auto;
  }

  .measure-wide {
    max-width: var(--measure-wide);
    margin-inline: auto;
  }

  /* Background alternates bg / bg-raised every beat; no rules/shadows between
     sections, just a tonal step. */
  .section {
    padding-block: var(--section-pad);
    background: var(--color-bg);
  }

  .section-raised {
    background: var(--color-bg-raised);
  }

  .section-quiet {
    padding-block: calc(var(--section-pad) * 0.7);
  }

  .step-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    margin-top: var(--space-8);
  }

  @media (min-width: 600px) {
    .step-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .world-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    margin-top: var(--space-8);
  }

  @media (min-width: 900px) {
    .world-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  .ritual-diagram {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-7) 0;
    color: var(--color-gold);
  }

  .ritual-diagram svg {
    flex: none;
  }

  .ritual-diagram .diagram-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--color-hairline);
  }

  .audio-players {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-7);
  }

  .streak-diagram {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    margin: var(--space-8) 0;
    flex-wrap: wrap;
  }

  .streak-diagram-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--color-gold);
    min-width: 60px;
  }

  .pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-top: var(--space-8);
  }

  @media (min-width: 900px) {
    .pricing-grid {
      grid-template-columns: repeat(3, 1fr);
      align-items: stretch;
    }

    .pricing-secondary {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 320px));
      gap: var(--space-4);
      justify-content: center;
      margin-top: var(--space-4);
    }
  }
}

/* ==========================================================================
   @layer components — discrete, nameable UI pieces.
   ========================================================================== */
@layer components {
  /* ---- Buttons ---- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 160px;
    padding: 0 var(--space-5);
    border-radius: var(--radius);
    font-size: var(--size-caption);
    font-weight: 460;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-variant-numeric: tabular-nums lining-nums;
  }

  .btn-gold {
    background: var(--color-gold);
    color: var(--color-bg);
  }

  .btn-outline {
    background: transparent;
    color: var(--color-text);
    border: 1px solid rgba(240, 235, 226, 0.18);
  }

  .btn[aria-disabled="true"] {
    opacity: 0.6;
    cursor: default;
  }

  /* Never render disabled — this rule exists only to make a stray `disabled`
     attribute visually obvious in review; the attribute itself must never
     ship on a real submit/CTA button. */
  .btn:disabled {
    outline: 3px dashed red;
  }

  /* ---- Forms ---- */
  .email-form {
    margin-top: var(--space-5);
  }

  .email-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .input {
    height: 48px;
    padding: 0 var(--space-4);
    border: 1px solid rgba(240, 235, 226, 0.18);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-serif);
    font-size: var(--size-body);
  }

  .input::placeholder {
    color: var(--color-text-muted);
  }

  .form-status {
    margin-top: var(--space-3);
    min-height: 1.4em;
    font-size: var(--size-micro);
    color: var(--color-text-muted);
  }

  /* Honeypot — real field, visually hidden, never display:none (bots that
     read computed style skip those); left off-screen instead. */
  .honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }

  .spots-line {
    margin-top: var(--space-4);
    font-size: var(--size-micro);
    color: var(--color-text-muted);
  }

  .spots-line strong {
    color: var(--color-text);
    font-weight: 500;
  }

  /* ---- Step card (ritual explainer) ---- */
  .step-card {
    position: relative;
  }

  .step-card .step-media {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-void);
  }

  .step-card .step-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .step-card .step-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
      120% 120% at 50% 50%,
      transparent 55%,
      rgba(15, 12, 9, 0.3) 100%
    );
    pointer-events: none;
  }

  .step-number {
    font-family: var(--font-serif);
    font-size: var(--size-h2);
    font-weight: 340;
    color: var(--color-gold);
    margin-bottom: var(--space-2);
  }

  .step-caption {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: var(--size-caption);
  }

  /* ---- Audio proof ---- */
  .audio-intro-media {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--space-7);
    background: var(--color-bg-void);
  }

  .audio-intro-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .audio-credit {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
  }

  .audio-player {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-4);
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius);
    background: var(--color-bg-raised);
  }

  .audio-toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid var(--color-gold);
    background: transparent;
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .audio-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
  }

  .audio-toggle .icon-pause {
    display: none;
  }

  .audio-toggle[aria-pressed="true"] .icon-play {
    display: none;
  }

  .audio-toggle[aria-pressed="true"] .icon-pause {
    display: block;
  }

  .audio-title {
    font-weight: 500;
    font-size: var(--size-h3);
  }

  .audio-waveform {
    --progress: 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 28px;
    margin: var(--space-3) 0;
    overflow: hidden;
  }

  .audio-waveform .bar {
    flex: 1 0 3px;
    width: 3px;
    background: rgba(240, 235, 226, 0.22);
    border-radius: 2px;
  }

  .audio-waveform .bar:nth-child(3n + 1) {
    height: 40%;
  }
  .audio-waveform .bar:nth-child(3n + 2) {
    height: 85%;
  }
  .audio-waveform .bar:nth-child(3n) {
    height: 60%;
  }
  .audio-waveform .bar:nth-child(7n) {
    height: 100%;
  }
  .audio-waveform .bar:nth-child(5n) {
    height: 25%;
  }

  .audio-fill {
    position: absolute;
    inset: 0;
    transform-origin: left center;
    transform: scaleX(var(--progress));
    background: linear-gradient(
      90deg,
      rgba(166, 174, 219, 0.85),
      rgba(166, 174, 219, 0.55)
    );
    mix-blend-mode: screen;
    pointer-events: none;
  }

  .audio-meta {
    color: var(--color-text-muted);
    font-size: var(--size-micro);
  }

  /* ---- World card ---- */
  .world-card {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-void);
  }

  .world-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .world-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      var(--color-bg-void) 0%,
      rgba(15, 12, 9, 0.35) 40%,
      transparent 65%
    );
  }

  .world-caption {
    position: absolute;
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    z-index: 1;
  }

  .world-caption .h3 {
    color: var(--color-text);
  }

  .world-caption .caption {
    color: var(--color-text-muted);
    text-transform: none;
    letter-spacing: 0;
    margin-top: var(--space-1);
  }

  .world-sample-link {
    display: inline-block;
    margin-top: var(--space-2);
    color: var(--color-ice);
    font-size: var(--size-caption);
    text-decoration: underline;
  }

  .world-tag {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    z-index: 1;
    border: 1px solid var(--color-gold);
    border-radius: var(--radius);
    padding: var(--space-1) var(--space-2);
    font-size: var(--size-micro);
    letter-spacing: 0.03em;
    color: var(--color-gold);
    background: rgba(25, 20, 16, 0.5);
  }

  /* ---- Interstitial strip ---- */
  .interstitial {
    position: relative;
    height: 40vh;
    min-height: 280px;
    margin-top: var(--space-9);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .interstitial img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .interstitial::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
      120% 100% at 50% 100%,
      var(--color-bg-void) 0%,
      rgba(15, 12, 9, 0.35) 55%,
      transparent 85%
    );
  }

  .interstitial-quote {
    position: absolute;
    left: 50%;
    bottom: var(--space-6);
    transform: translateX(-50%);
    width: min(90%, 640px);
    text-align: center;
    z-index: 1;
    font-size: var(--size-h3);
    color: var(--color-text);
    letter-spacing: 0.01em;
  }

  /* ---- Streak-calendar mini widget (ethos section) ---- */
  .streak-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 160px;
  }

  .streak-grid span {
    aspect-ratio: 1;
    border-radius: 2px;
    background: rgba(240, 235, 226, 0.1);
  }

  .streak-grid::before {
    content: none;
  }

  .interface-mock {
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius);
    padding: var(--space-6);
    text-align: center;
    margin-top: var(--space-7);
    background: var(--color-bg-raised);
  }

  .interface-mock .play-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--color-gold);
    margin: 0 auto var(--space-3);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .interface-mock figcaption {
    margin-top: var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--size-caption);
  }

  /* ---- Research / mechanism band ---- */
  .research-list {
    list-style: none;
    margin: var(--space-7) 0 0;
    padding: 0;
  }

  .research-list li {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--color-hairline);
  }

  .research-list li:first-child {
    border-top: none;
  }

  .footnote-marker {
    background: none;
    border: none;
    color: var(--color-gold);
    cursor: pointer;
    font-size: 0.7em;
    vertical-align: super;
    padding: 0 0.15em;
    text-decoration: underline;
  }

  .research-more {
    margin-top: var(--space-6);
  }

  .research-more summary {
    cursor: pointer;
    color: var(--color-gold);
    font-size: var(--size-caption);
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .research-more[open] summary {
    margin-bottom: var(--space-5);
  }

  .citations {
    margin-top: var(--space-7);
    padding: 0;
    list-style: none;
    counter-reset: cite;
  }

  .citations li {
    counter-increment: cite;
    font-size: var(--size-micro);
    color: var(--color-text-muted);
    padding-left: 1.6em;
    position: relative;
    margin-top: var(--space-3);
  }

  .citations li::before {
    content: counter(cite) ".";
    position: absolute;
    left: 0;
    color: var(--color-gold);
  }

  /* ---- Founder ---- */
  .founder-glyph {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 10vw, 7rem);
    line-height: 1;
    color: var(--color-gold);
    margin-bottom: var(--space-5);
  }

  .founder-quote {
    font-size: var(--size-h2);
    color: var(--color-text);
    letter-spacing: 0.01em;
    max-width: 760px;
    margin-inline: auto;
  }

  .founder-bio {
    max-width: var(--measure-text);
    margin: var(--space-7) auto 0;
    text-align: left;
    color: var(--color-text-muted);
  }

  .founder-crossref {
    margin-top: var(--space-5);
    font-size: var(--size-caption);
    color: var(--color-text-muted);
  }

  /* ---- Box contents / ingredients photo ---- */
  .box-media {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--space-7);
    background: var(--color-bg-void);
  }

  .box-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* ---- Ingredients / safety (printed-insert card) ---- */
  .cream-card {
    background: var(--color-surface-cream);
    color: var(--color-surface-cream-text);
    border-radius: var(--radius);
    padding: var(--space-7) var(--space-6);
    max-width: var(--measure-text);
    margin-inline: auto;
  }

  .cream-card p + p {
    margin-top: var(--space-4);
  }

  .cream-card a {
    color: var(--color-surface-cream-text);
    text-decoration: underline;
  }

  .ingredients-note {
    margin-top: var(--space-4);
    font-size: var(--size-micro);
    opacity: 0.75;
  }

  /* ---- Pricing table ---- */
  .price-card {
    border: 1px solid var(--color-hairline);
    border-radius: var(--radius);
    padding: var(--space-5);
    background: var(--color-bg-raised);
  }

  .price-muted {
    color: var(--color-text-muted);
  }

  .price-figure {
    font-size: var(--size-h2);
    font-weight: 440;
    color: var(--color-text);
    margin-top: var(--space-2);
  }

  .price-strike {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    color: var(--color-text-muted);
  }

  .price-tag {
    font-size: var(--size-micro);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }

  .price-label {
    margin-top: var(--space-3);
    font-weight: 500;
  }

  .price-sub {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: var(--size-caption);
  }

  .price-winner {
    border: 1.5px solid var(--color-gold);
    padding: calc(var(--space-5) + 8px);
    box-shadow: 0 0 32px rgba(217, 168, 78, 0.12);
    position: relative;
  }

  .price-winner .price-tag {
    color: var(--color-gold);
  }

  .price-winner .price-figure {
    font-size: clamp(2.25rem, 2rem + 1vw, 3rem);
    color: var(--color-gold);
  }

  .price-seats-note {
    margin-top: var(--space-3);
    font-size: var(--size-caption);
    color: var(--color-text-muted);
  }

  .price-winner .btn {
    margin-top: var(--space-5);
    width: 100%;
  }

  .price-fine {
    margin-top: var(--space-3);
    font-size: var(--size-micro);
    color: var(--color-gold);
  }

  .price-duo,
  .price-free {
    text-align: center;
  }

  /* ---- FAQ ---- */
  .faq-group + .faq-group {
    margin-top: var(--space-8);
  }

  .faq-group-title {
    color: var(--color-gold);
    font-size: var(--size-caption);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-4);
  }

  .faq-item {
    border-top: 1px solid var(--color-hairline);
  }

  .faq-item:last-child {
    border-bottom: 1px solid var(--color-hairline);
  }

  .faq-item summary {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    cursor: pointer;
    padding: var(--space-4) 0;
    list-style: none;
    font-weight: 500;
  }

  .faq-item summary::-webkit-details-marker {
    display: none;
  }

  .faq-item .chevron {
    flex: none;
    width: 12px;
    height: 12px;
    border-right: 1.5px solid var(--color-gold);
    border-bottom: 1.5px solid var(--color-gold);
    transform: rotate(45deg);
  }

  .faq-item[open] .chevron {
    transform: rotate(-135deg);
  }

  .faq-item p {
    padding-bottom: var(--space-4);
    color: var(--color-text-muted);
  }

  /* ---- Legal document pages (privacy/terms/shipping/refund) ----
     Pure content typography, reused across four standalone pages that each
     ship a bare <article class="legal-doc"> with no .container wrapper of
     their own. Not part of the ten-beat design system, so unaffected by any
     future AD-SPEC visual override. */
  .legal-doc {
    max-width: var(--measure-text);
    margin-inline: auto;
    padding: var(--space-9) var(--side-margin) var(--space-8);
  }

  .legal-doc h1 {
    font-size: var(--size-h2);
    line-height: 1.15;
    font-weight: 440;
    margin-bottom: var(--space-3);
  }

  .legal-doc > p:first-of-type {
    color: var(--color-text-muted);
    font-size: var(--size-caption);
    margin-bottom: var(--space-7);
  }

  .legal-doc h2 {
    font-size: var(--size-h3);
    font-weight: 500;
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
  }

  .legal-doc p {
    color: var(--color-text-muted);
  }

  .legal-doc p + p {
    margin-top: var(--space-4);
  }

  .legal-doc strong {
    color: var(--color-text);
    font-weight: 600;
  }

  .legal-doc ul {
    margin-top: var(--space-4);
    padding-left: 1.2em;
    color: var(--color-text-muted);
  }

  .legal-doc li + li {
    margin-top: var(--space-3);
  }

  .legal-doc a {
    color: var(--color-gold);
    text-decoration: underline;
  }

  /* Legal pages' plain <footer><nav> (no class — only these pages nest a
     bare <nav> directly inside a body-level <footer>; index.html's
     .site-footer contains no <nav>, so this selector can't collide). */
  body > footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    justify-content: center;
    padding: var(--space-7) var(--side-margin);
    border-top: 1px solid var(--color-hairline);
  }

  body > footer nav a {
    color: var(--color-text-muted);
    font-size: var(--size-caption);
    text-decoration: underline;
  }

  /* ---- Sticky bottom bar (mobile only) ---- */
  .sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    height: 64px;
    padding-inline: var(--space-4);
    padding-bottom: env(safe-area-inset-bottom, 0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    background: rgba(25, 20, 16, 0.92);
    /* Safari: literal px value, never var(); never nested with another backdrop-filter. */
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-hairline);
  }

  .sticky-bar[hidden] {
    display: none;
  }

  .sticky-link {
    font-size: var(--size-caption);
    text-decoration: underline;
    color: var(--color-text);
    white-space: nowrap;
  }

  .sticky-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-4);
    border-radius: 999px;
    background: var(--color-gold);
    color: var(--color-bg);
    font-size: var(--size-caption);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
  }

  @media (min-width: 900px) {
    .sticky-bar {
      display: none;
    }
  }

  /* ---- Motion: components ----
     Everything below lives inside prefers-reduced-motion:no-preference.
     Outside this query every component above ships in its final, visible,
     non-transitioning state (no opacity:0/transform there). */
  @media (prefers-reduced-motion: no-preference) {
    .audio-fill {
      transition: transform 0.1s linear;
    }

    .faq-item .chevron {
      transition: transform 200ms ease;
    }

    .sticky-bar {
      transition: transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sticky-bar[data-enter] {
      transform: translateY(0);
    }

    /* Hover, pointer:fine only */
    @media (hover: hover) and (pointer: fine) {
      .btn-gold {
        transition: transform 200ms ease-out, box-shadow 200ms ease-out;
      }

      .btn-gold:hover {
        transform: scale(1.015);
        box-shadow: 0 0 24px rgba(217, 168, 78, 0.35);
      }

      .world-card {
        transition: transform 250ms ease-out;
      }

      .world-card:hover {
        transform: translateY(-4px);
      }

      .world-card:hover::after {
        box-shadow: inset 0 0 0 1px var(--color-ice-rim);
      }
    }
  }
}

/* ==========================================================================
   @layer sections — one-off context/overrides scoped to a single named
   section. This layer sits after "components" in the declared order, so a
   rule here (e.g. .final-cta .email-row) beats a components-layer rule on
   the same selector with zero specificity gymnastics.
   ========================================================================== */
@layer sections {
  /* ---- Hero (base rules live in the inline critical <style>; this is only
     the part that's safe to arrive after first paint) ---- */
  .hero-actions {
    margin-top: var(--space-6);
  }

  .cta-support {
    margin-top: var(--space-3);
    font-size: var(--size-micro);
    color: var(--color-text-muted);
  }

  .micro-reassurance {
    margin-top: var(--space-3);
    font-size: var(--size-micro);
    color: var(--color-text-muted);
  }

  @media (prefers-reduced-motion: no-preference) {
    .hero-grain {
      animation: grain-drift 45s linear infinite;
    }

    @keyframes grain-drift {
      from {
        transform: translate(0, 0);
      }
      to {
        transform: translate(2%, 2%);
      }
    }
  }

  /* ---- Ethos band (permission-not-optimization) ----
     Design calls for a quiet, no-imagery, narrow centered column. */
  .ethos {
    max-width: 560px;
    margin-inline: auto;
  }

  .ethos p {
    margin-top: var(--space-5);
  }

  /* ---- Founder ---- */
  .founder-section {
    padding-block: calc(var(--section-pad) * 1.5);
    text-align: center;
  }

  /* ---- What we won't do ---- */
  .wont-do {
    max-width: var(--measure-text);
    margin-inline: auto;
  }

  /* ---- Pricing ---- */
  .pricing-footer {
    margin-top: var(--space-6);
    font-size: var(--size-micro);
    color: var(--color-text-muted);
    max-width: var(--measure-text);
  }

  /* ---- Final CTA ---- */
  .final-cta {
    position: relative;
    text-align: center;
    overflow: hidden;
  }

  .final-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        60% 60% at 15% 10%,
        rgba(217, 168, 78, 0.08),
        transparent 60%
      ),
      radial-gradient(60% 60% at 85% 90%, var(--color-bg-void), transparent 60%),
      var(--color-bg);
    z-index: -1;
  }

  .final-cta .email-row {
    flex-direction: row;
    max-width: 480px;
    margin-inline: auto;
  }

  .final-cta .free-link {
    display: inline-block;
    margin-top: var(--space-5);
    color: var(--color-text-muted);
    font-size: var(--size-caption);
    text-decoration: underline;
  }

  /* ---- Footer ---- */
  .site-footer {
    padding: var(--space-8) 0;
    border-top: 1px solid var(--color-hairline);
    text-align: center;
  }

  .site-footer .legal {
    max-width: var(--measure-text);
    margin: var(--space-4) auto 0;
    color: var(--color-text-muted);
    font-size: var(--size-micro);
  }

  .site-footer .legal a {
    color: var(--color-text-muted);
    text-decoration: underline;
  }
}

/* ==========================================================================
   @layer utilities — small generic helper classes usable in more than one
   section.
   ========================================================================== */
@layer utilities {
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    left: var(--space-4);
    top: -48px;
    background: var(--color-gold);
    color: var(--color-bg);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    z-index: 100;
    font-size: var(--size-caption);
    font-weight: 600;
  }

  .skip-link:focus {
    top: var(--space-4);
  }

  /* No forced-priority override needed here: utilities is the last-declared
     layer, so this already beats any earlier-layer display value (e.g.
     components' .sticky-bar {display:flex}) regardless of selector
     specificity — that's the whole point of @layer ordering. */
  [hidden] {
    display: none;
  }

  /* Aesthetic arrow, since the self-hosted Newsreader subset has no U+2192
     glyph — drawn, not a text character, so no cross-font fallback flash. */
  .arrow::after {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    margin-left: 0.35em;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    vertical-align: middle;
  }

  /* Sentinels (IntersectionObserver triggers; zero footprint) */
  .sentinel {
    height: 1px;
  }

  /* Repeated verbatim CTA touchpoint spacing, used after more than one
     section (four-worlds, why-it-works) — not tied to one named section. */
  .inline-cta {
    margin-top: var(--space-7);
  }

  /* Scroll reveals — animation-timeline: view() is the ONLY place the
     hidden initial state is declared, so non-supporting browsers never see
     stuck-invisible content (they simply never enter this @supports block,
     and the base/components rules above already render everything visible). */
  @media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
      .reveal {
        opacity: 0;
        transform: translateY(16px);
        animation: reveal-in linear both;
        animation-timeline: view();
        animation-range: cover 0% 30%;
      }

      @keyframes reveal-in {
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }
    }
  }
}
