/* ============================================================
   Whisper App Landing Page — styles.css
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   ---------------------------------------------------------- */
:root {
  --color-bg:            #0d0d0f;
  --color-surface:       #141418;
  --color-surface-2:     #1a1a22;
  --color-border:        #2a2a32;
  --color-accent:        #7C6FF7;
  --color-accent-hover:  #9488fa;
  /* Accent used as TEXT (section labels, in-prose links). The light theme
     overrides this to a darker shade below so it clears WCAG AA on light bg. */
  --color-accent-text:   #7C6FF7;
  /* Darker accent for white-on-accent surfaces (the primary button); dark
     enough for #fff text to clear AA in BOTH themes. */
  --color-accent-strong:       #5A4FD6;
  --color-accent-strong-hover: #6A5BE8;
  --color-accent-record: #F5A623;
  --color-text:          #f0f0f2;
  --color-text-muted:    #8e8e9a;
  --color-code-bg:       #101014;

  --font-sans:  -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
  --font-mono:  "SF Mono", "Fira Code", "Cascadia Code", "JetBrains Mono", Menlo, monospace;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.4);
  --transition:  0.25s ease;

  --max-w: 1080px;

  /* ----------------------------------------------------------
     VISUAL SIGNATURE SYSTEM — design tokens
     Encodes: signal → depth → compression → rise → embodiment.
     These are the *only* knobs the signature reads from; theme
     overrides (light mode, below) re-point them so the same
     classes render as deep-glow on dark and restrained-cartographic
     on light. Dark defaults here.
     ---------------------------------------------------------- */

  /* DEPTH — cool, submerged structure beneath the signal. */
  --sig-depth-core:  rgba(124, 111, 247, 0.16); /* pooled depth under the signal */
  --sig-depth-wash:  rgba(124, 111, 247, 0.08); /* fainter; sits behind body copy */
  --sig-depth-far:   rgba(58, 52, 120, 0.00);   /* fades to nothing at the rim   */
  --sig-deep-veil:   rgba(10, 10, 18, 0.55);     /* darkens the well below surface */

  /* RINGS — concentric contour lines (topography, not glow). */
  --sig-ring:        rgba(124, 111, 247, 0.20);
  --sig-ring-faint:  rgba(124, 111, 247, 0.07);
  --sig-ring-w:      1px;

  /* ROUTE — the earned path; cool where deep, warm where it rises. */
  --sig-route-cool:  rgba(124, 111, 247, 0.55);
  --sig-route-mid:   rgba(150, 120, 200, 0.50);
  --sig-route-warm:  rgba(245, 166, 35, 0.70);
  --sig-route-track: rgba(124, 111, 247, 0.14); /* faint full-length bed */

  /* MEASURE — one ruthless, crisp line of judgment across the field. */
  --sig-measure:     rgba(240, 240, 242, 0.30);
  --sig-measure-dim: rgba(240, 240, 242, 0.13);

  /* EMBODIMENT — warm, elevated, outward-facing arrival zone. */
  --sig-warm-tint:   rgba(245, 166, 35, 0.06);
  --sig-warm-edge:   rgba(245, 166, 35, 0.38);

  /* Ambient motion timings (slow, never competing with copy). */
  --sig-ripple-dur:  9s;
  --sig-drift-dur:   14s;
}

/* Light mode overrides */
@media (prefers-color-scheme: light) {
  :root {
    --color-bg:        #f5f5f7;
    --color-surface:   #ffffff;
    --color-surface-2: #eeeef3;
    --color-border:    #d0d0da;
    --color-text:      #1a1a1f;
    --color-text-muted: #5a5a6a;
    --color-code-bg:   #ececf0;
    /* Darker accent so labels + in-prose links clear AA on the light bg. */
    --color-accent-text: #5A4FD6;

    /* Signature, light theme: restrained cartographic, not deep glow.
       Depth reads as a cool paper-shadow; rings as faint survey lines;
       measure as a crisp dark rule. */
    --sig-depth-core:  rgba(90, 79, 214, 0.07);
    --sig-depth-wash:  rgba(90, 79, 214, 0.045);
    --sig-depth-far:   rgba(90, 79, 214, 0.00);
    --sig-deep-veil:   rgba(214, 216, 230, 0.45);

    --sig-ring:        rgba(90, 79, 214, 0.16);
    --sig-ring-faint:  rgba(90, 79, 214, 0.06);

    --sig-route-cool:  rgba(90, 79, 214, 0.50);
    --sig-route-mid:   rgba(130, 110, 190, 0.46);
    --sig-route-warm:  rgba(214, 140, 20, 0.72);
    --sig-route-track: rgba(90, 79, 214, 0.12);

    --sig-measure:     rgba(26, 26, 31, 0.34);
    --sig-measure-dim: rgba(26, 26, 31, 0.16);

    --sig-warm-tint:   rgba(245, 166, 35, 0.09);
    --sig-warm-edge:   rgba(214, 140, 20, 0.45);
  }

  /* macOS template icons are black-on-transparent — invert for light bg */
  .state img {
    filter: invert(0.85) !important;
  }
}

/* Reduced-motion: kill all animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
  }

  .bar {
    height: 20px !important;
    animation: none !important;
  }

  /* Scroll-reveal is motion. With reduced motion, never hide the cards —
     show them immediately regardless of the JS-gated start state. */
  .feature-card {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ----------------------------------------------------------
   2. Reset & Base
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--color-bg);
  color:            var(--color-text);
  font-family:      var(--font-sans);
  line-height:      1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-accent-text);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent-hover);
}

/* In-prose links must be distinguishable without relying on color alone
   (WCAG link-in-text-block). Standalone links — nav, CTAs, footer, badges —
   are excluded; they read as links by position and shape. */
.section-sub a,
.feature-card p a,
.req-list a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--color-text);
}

ul {
  list-style: none;
}

/* ----------------------------------------------------------
   3. Layout Utilities
   ---------------------------------------------------------- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 1.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.section-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 600px;
}

.section-sub--centered {
  margin-left: auto;
  margin-right: auto;
}

/* ----------------------------------------------------------
   4. Navbar
   ---------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: rgba(13, 13, 15, 0.75);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
}

@media (prefers-color-scheme: light) {
  .navbar {
    background: rgba(245, 245, 247, 0.82);
  }
}

.nav-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.nav-github {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.nav-github img {
  height: 20px;
  width: auto;
}

/* ----------------------------------------------------------
   5. Hero
   ---------------------------------------------------------- */
.hero {
  padding: 7rem 1.5rem 5rem;
  text-align: center;
  max-width: var(--max-w);
  margin: 0 auto;
  /* Hold the signal-field behind the content in its own stacking context
     so the decorative depth never paints over copy or steals clicks. */
  position: relative;
  isolation: isolate;
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, var(--color-text) 40%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--color-text-muted);
  max-width: 540px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

/* Waveform animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 56px;
  margin: 2.25rem auto;
}

.bar {
  width: 5px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 99px;
  animation: pulse 1.2s ease-in-out infinite;
}

.bar:nth-child(1) { animation-delay: 0s;    background: #7C6FF7; }
.bar:nth-child(2) { animation-delay: 0.1s;  background: #8a7cf8; }
.bar:nth-child(3) { animation-delay: 0.2s;  background: #9488fa; }
.bar:nth-child(4) { animation-delay: 0.3s;  background: var(--color-accent-record); }
.bar:nth-child(5) { animation-delay: 0.4s;  background: #9488fa; }
.bar:nth-child(6) { animation-delay: 0.5s;  background: #8a7cf8; }
.bar:nth-child(7) { animation-delay: 0.6s;  background: #7C6FF7; }

@keyframes pulse {
  0%, 100% { height: 8px;  opacity: 0.55; }
  50%       { height: 44px; opacity: 1;   }
}

/* CTA buttons */
.cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.75rem;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--color-accent-strong);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-strong-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(90, 79, 214, 0.35);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  transform: translateY(-2px);
}

/* ----------------------------------------------------------
   6. Feature Grid
   ---------------------------------------------------------- */
.features {
  position: relative; /* routed seam drawn via ::before (signature system) */
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.feature-card {
  background:    var(--color-surface);
  border:        1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding:       1.75rem 1.5rem;
  box-shadow:    var(--shadow-card);

  /* Visible by DEFAULT — the core value props are never gated on JS. The
     scroll-fade is progressive enhancement: only when JS sets `html.js` do
     the cards start hidden and animate in (rules below + the head flag). */
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* JS present: start hidden, then fade up as each card scrolls into view. */
html.js .feature-card {
  opacity: 0;
  transform: translateY(24px);
}

html.js .feature-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ----------------------------------------------------------
   7. How It Works
   ---------------------------------------------------------- */
.how-it-works {
  position: relative; /* routed seam drawn via ::before (signature system) */
  text-align: center;
}

.state-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2.75rem;
  flex-wrap: wrap;
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.state img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  /* dark mode: template icons are already white or light */
}

.state span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.arrow {
  font-size: 1.25rem;
  color: var(--color-border);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
   8. Install / Code Block
   ---------------------------------------------------------- */
.install {
  position: relative; /* routed seam drawn via ::before (signature system) */
}

.code-wrap {
  position: relative;
  margin-top: 2rem;
  border-radius: var(--radius-md);
  background: var(--color-code-bg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--color-border);
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #febc2e; }
.code-dots span:nth-child(3) { background: #28c840; }

pre {
  padding: 1.5rem 1.5rem 1.5rem;
  overflow-x: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--color-text);
  white-space: pre;
}

.copy-btn {
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  font-family: var(--font-sans);
}

.copy-btn:hover,
.copy-btn.copied {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ----------------------------------------------------------
   9. Requirements
   ---------------------------------------------------------- */
.requirements {
  position: relative; /* routed seam drawn via ::before (signature system) */
}

.req-list {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

.req-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.req-list li .req-emoji {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ----------------------------------------------------------
   10. Roadmap
   ---------------------------------------------------------- */
.roadmap {
  position: relative; /* routed seam drawn via ::before (signature system) */
}

.roadmap-list {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.roadmap-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
}

.roadmap-list li:last-child {
  border-bottom: none;
}

.roadmap-checkbox {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--color-surface);
}

/* ----------------------------------------------------------
   11. Footer
   ---------------------------------------------------------- */
.footer {
  position: relative; /* routed seam drawn via ::before (signature system) */
  padding: 2.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

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

.footer a:hover {
  color: var(--color-accent);
}

.footer img {
  height: 20px;
  width: auto;
}

.footer-tagline {
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------
   12. Responsive Adjustments
   ---------------------------------------------------------- */

/* Tablet (≤ 768px) */
@media (max-width: 768px) {
  section {
    padding: 3.5rem 1.25rem;
  }

  .hero {
    padding: 5rem 1.25rem 3.5rem;
  }

  .state-flow {
    gap: 0.75rem;
  }

  .arrow {
    font-size: 1rem;
  }
}

/* Mobile (≤ 480px) */
@media (max-width: 480px) {
  section {
    padding: 2.75rem 1rem;
  }

  .hero {
    padding: 4rem 1rem 2.75rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .state-flow {
    gap: 0.5rem;
  }

  .state img {
    width: 38px;
    height: 38px;
  }

  .arrow {
    font-size: 0.9rem;
  }

  .cta-group {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* How-It-Works flow: on narrow screens the four states + arrows wrap
   awkwardly (a dangling → at the end of row 1, the 4th state orphaned
   below). Stack the flow vertically with downward arrows so the
   sequence reads cleanly top-to-bottom. */
@media (max-width: 600px) {
  .state-flow {
    flex-direction: column;
    gap: 0.85rem;
  }

  .arrow {
    transform: rotate(90deg);
    font-size: 1.1rem;
  }
}

/* ============================================================
   13. VISUAL SIGNATURE SYSTEM
   ------------------------------------------------------------
   One visual law governs the page: a small SIGNAL on the surface
   reveals hidden DEPTH; repeated passes COMPRESS into an earned
   path that RISES into warm, usable EMBODIMENT.

   Three recurring motifs (repetition with variation) + a cool→warm
   field migration carry it — driven entirely by the --sig-* tokens
   so the same classes render as deep-glow on dark and restrained
   cartography on light:

     • signal-field / deep-field / contour-rings  (signal over depth)
     • scope-rule  (one ruthless line of measure, on every label)
     • earned-path (braided passes compress into one warming route)
     • elevated-field (warm embodiment zone at the install/CTA)

   Every layer here is decorative: pointer-events:none, behind
   content, and authored so its STILL state is the intended image —
   ambient motion only breathes on top (see reduced-motion, §1).
   ============================================================ */

/* Station numbering for the scope-rule labels. Hero is the unnumbered
   origin (its own "00 · signal" coordinate); Features → Roadmap are 01–05. */
main { counter-reset: sig-station; }

/* ---- Motif 1: scope-rule — measure crossing the organic field --------- */
/* Each section label becomes a measured station: a monospace index, a crisp
   tick, the label, then a rule extending into the field. Repeated with no
   variation, this is the "same hand" signing every section. */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  counter-increment: sig-station;
}
.section-label::before {
  content: counter(sig-station, decimal-leading-zero);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
  padding-right: 0.6rem;
  border-right: 1px solid var(--sig-measure);
}
.section-label::after {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: linear-gradient(90deg, var(--sig-measure-dim), transparent);
}

/* ---- Motif 2 (glue): routed seams — the earned path crossing each
        boundary, migrating cool (discovery) → warm (embodiment) downward -- */
.features::before, .how-it-works::before, .install::before,
.requirements::before, .roadmap::before, .footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  pointer-events: none;
  /* a faint measured horizon, with a brighter route segment threading the
     left edge (under the scope-rule index it aligns with). */
  background:
    linear-gradient(90deg,
      var(--seam-route, var(--sig-route-cool)) 0,
      var(--seam-route, var(--sig-route-cool)) 56px,
      var(--sig-measure-dim) 56px,
      var(--sig-measure-dim) 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 72%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 72%, transparent 100%);
}
/* discovery zones run cool; from Install down the route has warmed. */
.features, .how-it-works { --seam-route: var(--sig-route-cool); }
.install, .requirements, .roadmap, .footer { --seam-route: var(--sig-route-warm); }

/* ---- Motif 3: signal-field over deep-field (the hero) ----------------- */
/* A small signal (the waveform, in flow above) sitting over a much larger
   submerged structure, crossed by one precise line of measure. */
.signal-field {
  position: absolute;
  /* break out to the full viewport behind the centered hero column */
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: 0;
  bottom: -2.5rem;          /* spill into the seam below = depth pooling down */
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  --cx: 50%;                /* signal center — tuned to the waveform's place */
  --cy: 62%;
}

/* DEPTH: a glow pooled around the signal, and a darker well beneath the
   surface implying the vast structure below. */
.deep-field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(46% 42% at var(--cx) var(--cy),
      var(--sig-depth-core) 0%, var(--sig-depth-far) 72%),
    radial-gradient(120% 80% at 50% 128%,
      var(--sig-deep-veil) 0%, transparent 62%);
}

/* RINGS: concentric contour lines (topography, not decoration), focal near
   the signal and dissolving toward the rim. */
.contour-rings {
  position: absolute;
  inset: 0;
  transform-origin: var(--cx) var(--cy);
  background:
    repeating-radial-gradient(circle at var(--cx) var(--cy),
      transparent 0 37px,
      var(--sig-ring) 37px 38px,
      transparent 38px 76px);
  -webkit-mask-image: radial-gradient(circle at var(--cx) var(--cy),
      #000 0%, #000 16%, transparent 60%);
          mask-image: radial-gradient(circle at var(--cx) var(--cy),
      #000 0%, #000 16%, transparent 60%);
  animation: sig-ripple var(--sig-ripple-dur) ease-in-out infinite;
}

/* MEASURE: a faint horizon at the signal's depth, pierced by one crisp tick
   where the signal breaks the surface. */
.hero-threshold {
  position: absolute;
  left: 0; right: 0;
  top: var(--cy);
  border-top: 1px solid var(--sig-measure-dim);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
}
.hero-threshold::before {
  content: "";
  position: absolute;
  left: var(--cx);
  top: -4px;
  width: 1px;
  height: 9px;
  background: var(--sig-measure);
  transform: translateX(-50%);
}

/* A cartographic coordinate tag, aligned to the content column on wide
   screens. The "00" station: the origin signal. */
.scope-coord {
  position: absolute;
  top: 1.4rem;
  left: max(1.5rem, calc(50% - (var(--max-w) / 2) + 1.5rem));
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  opacity: 0.75;
}
.scope-coord::before {
  content: "\2316\00a0";          /* ⌖ position marker */
  color: var(--sig-route-warm);
}

/* Faint topographic basin behind the discovery (Features) zone — denser,
   cooler, lower-left, per the compositional default. */
.features { isolation: isolate; }
.features::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* The basin pools lower-left, behind the cards (where the discoveries are
     pulled from) — kept clear of the label/heading so copy contrast is never
     reduced. Faint wash + faint survey rings. */
  background:
    radial-gradient(95% 70% at 12% 62%, var(--sig-depth-wash), transparent 60%),
    repeating-radial-gradient(circle at 10% 64%,
      transparent 0 33px, var(--sig-ring-faint) 33px 34px, transparent 34px 67px);
  -webkit-mask-image: radial-gradient(100% 62% at 14% 64%, #000 0%, #000 22%, transparent 66%);
          mask-image: radial-gradient(100% 62% at 14% 64%, #000 0%, #000 22%, transparent 66%);
}

/* ---- Motif 2: earned-path — braided passes compress into one warm route - */
.state-flow {
  position: relative;
  isolation: isolate;
}
.earned-path-track {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  height: 120px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}
.route-braid {
  stroke: var(--sig-route-cool);
  stroke-width: 1.4;
  opacity: 0.55;
}
.route-spine {
  stroke: url(#routeWarm);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 7;
  animation: sig-route-drift var(--sig-drift-dur) linear infinite;
}
.rs-cool { stop-color: var(--sig-route-cool); }
.rs-mid  { stop-color: var(--sig-route-mid); }
.rs-warm { stop-color: var(--sig-route-warm); }

/* ---- Embodiment: elevated-field — the warm, resolved arrival zone ------ */
.install { isolation: isolate; }
.elevated-field::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* warmth rising in the upper-right = resolved, outward-facing. */
  background:
    radial-gradient(75% 60% at 82% 14%, var(--sig-warm-tint), transparent 72%);
}

/* The code block, framed like an instrument pulled from the field: a warm
   lit top edge (the route resolving into use) and a carved inner highlight. */
.install .code-wrap {
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.install .code-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 1;
  background: linear-gradient(90deg, var(--sig-route-cool), var(--sig-route-warm));
  opacity: 0.85;
}
.code-scope {
  margin-left: 0.85rem;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

/* ---- Ambient motion (slow; never competes with copy) ------------------ */
@keyframes sig-ripple {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.045); }
}
@keyframes sig-route-drift {
  to { stroke-dashoffset: -48; }
}

/* ---- Signature responsive recomposition ------------------------------- */
/* The system recomposes intentionally on small screens — it must not
   collapse into visual rubble. */
@media (max-width: 768px) {
  .signal-field { --cy: 58%; }
  .scope-coord  { left: 1.25rem; font-size: 0.66rem; }
}

@media (max-width: 600px) {
  /* How-It-Works stacks vertically here; swap the horizontal route for a
     vertical spine that warms top→bottom, behind the stacked states. */
  .earned-path-track { display: none; }
  .state-flow::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 6%;
    bottom: 6%;
    width: 2px;
    transform: translateX(-50%);
    border-radius: 2px;
    background: linear-gradient(180deg,
      var(--sig-route-cool) 0%, var(--sig-route-mid) 55%, var(--sig-route-warm) 100%);
    opacity: 0.5;
  }
}

@media (max-width: 480px) {
  /* tighten the contour rings + measure rule so they read on a narrow column */
  .signal-field { --cy: 56%; bottom: -1.5rem; }
  .section-label::after { width: 1.5rem; }
}

/* Reduced motion: freeze the ambient layers to their still state. The global
   reduce block (§1) already neutralizes durations; these make the frozen
   frame the cleanest one (rings calm, route solid). */
@media (prefers-reduced-motion: reduce) {
  .contour-rings { animation: none !important; opacity: 0.5 !important; transform: none !important; }
  .route-spine   { animation: none !important; stroke-dasharray: none !important; }
}
