/* ==========================================================================
   Glissé — site styles
   Warm paper ground, saturated accents, Fraunces display + Space Grotesk.
   Fonts are self-hosted, so the page makes no third-party requests.
   ========================================================================== */

/* ---------- fonts ---------- */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces-var.woff2") format("woff2-variations");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/spacegrotesk-var.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/spacemono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/spacemono-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  --paper:     #fff6e9;
  --paper-2:   #ffecd4;
  --paper-3:   #fbe3f2;
  --ink:       #191627;
  --ink-soft:  #443f5c;
  --ink-faint: #6f6889;

  --sun:       #ffc02e;
  --tangerine: #ff7a2f;
  --coral:     #ff5d73;
  --blue:      #2c4bff;
  --sky:       #8cc9ff;
  --mint:      #1fd0a3;
  --violet:    #7b4dff;
  --slate:     #46577a;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:    "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:    "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --rail-w: 4.25rem;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  /* Looping illustration motion uses a symmetric in-out ease, written as a
     literal inside @keyframes because var() in animation-timing-function is
     not honoured reliably across engines. Expo-out reads as a snap here. */
  --page-max: 80rem;
  --border: 2.5px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.is-wheel-scrolling { scroll-behavior: auto; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- type ---------- */

h1, h2, h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 820;
  line-height: 0.94;
  letter-spacing: -0.025em;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 100;
}

.display {
  font-size: clamp(3.5rem, 13.5vw, 12rem);
  line-height: 0.84;
  letter-spacing: -0.04em;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
}

.h2 { font-size: clamp(2rem, 5vw, 4rem); }
.h3 { font-size: clamp(1.3rem, 2.1vw, 1.75rem); font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 40; }

.label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.lede {
  font-size: clamp(1.09375rem, 1.5vw, 1.3125rem);
  line-height: 1.5;
  max-width: 46ch;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--coral); }

code, kbd, pre, samp { font-family: var(--mono); font-size: 0.9em; }

:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: 0.75rem 1.25rem; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 0.75rem;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- layout ---------- */

.wrap {
  width: 100%; max-width: var(--page-max);
  margin-inline: auto;
  /* the rails are fixed to the viewport edges, so always clear them */
  padding-inline: calc(var(--rail-w) + clamp(1rem, 3vw, 2.5rem));
}
main { position: relative; z-index: 1; }
section { position: relative; padding-block: clamp(4rem, 10vh, 8rem); }

/* colour blocks */
.block-ink    { background: var(--ink);    color: var(--paper); }
.block-sun    { background: var(--sun); }
.block-blue   { background: var(--blue);   color: var(--paper); }
.block-mint   { background: var(--mint); }
.block-violet { background: var(--violet); color: var(--paper); }
.block-paper2 { background: var(--paper-2); }
.block-ink a, .block-blue a, .block-violet a { text-decoration-color: var(--sun); }

/* soft wave divider */
.wave { display: block; width: 100%; height: clamp(2rem, 4vw, 4rem); }
.wave path { fill: currentColor; }

/* ---------- the dim layer ---------- */

#dim {
  position: fixed; inset: 0;
  background: #0d0a18;
  opacity: 0; pointer-events: none;
  z-index: 2;
  transition: opacity 90ms linear;
}

/* ---------- edge rails: the signature interaction ---------- */

.rail {
  position: fixed; top: 0; bottom: 0;
  width: var(--rail-w);
  z-index: 5;
  display: grid; place-items: center;
  border: 0; padding: 0; margin: 0;
  cursor: ns-resize;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  color: var(--ink);
}
.rail-left {
  left: 0;
  background: linear-gradient(180deg, #ffe3a0, var(--sun) 55%, var(--tangerine));
  border-right: var(--border);
}
.rail-right {
  right: 0;
  background: linear-gradient(180deg, var(--sky), var(--blue) 60%, #1a2fb8);
  border-left: var(--border);
  color: var(--paper);
}

.rail::after {
  content: ""; position: absolute; inset: 0;
  background: #fff; opacity: 0;
  transition: opacity 200ms var(--ease);
}
.rail:hover::after, .rail:focus-visible::after { opacity: 0.16; }
.rail.is-live::after { opacity: 0.26; }

.rail-ticks {
  position: absolute; top: 11%; bottom: 11%; left: 50%;
  transform: translateX(-50%);
  width: 2px; background: rgba(25, 22, 39, 0.22);
  display: flex; flex-direction: column; justify-content: space-between; align-items: center;
}
.rail-right .rail-ticks { background: rgba(255, 246, 233, 0.3); }
.rail-ticks i {
  display: block; width: 10px; height: 2px;
  background: rgba(25, 22, 39, 0.25);
  transition: background 160ms var(--ease), width 160ms var(--ease);
}
.rail-right .rail-ticks i { background: rgba(255, 246, 233, 0.35); }
.rail .rail-ticks i.lit { background: var(--ink); width: 18px; }
.rail-right .rail-ticks i.lit { background: var(--paper); }

.rail-thumb {
  position: absolute; left: 50%; bottom: 0;
  width: 1.9rem; height: 0.7rem;
  border-radius: 999px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  transform: translate(-50%, 50%) rotate(-22deg);
  transition: bottom 90ms linear, transform 240ms var(--ease);
}
.rail.is-live .rail-thumb { transform: translate(-50%, 50%) rotate(0deg) scale(1.08); }

.rail-cap {
  position: absolute; bottom: 1.15rem;
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-weight: 700;
  font-size: 0.625rem; letter-spacing: 0.24em; text-transform: uppercase;
  white-space: nowrap;
}
.rail-left .rail-cap { bottom: auto; top: 1.15rem; }

@media (max-width: 48rem) {
  :root { --rail-w: 2.25rem; }
  .rail-cap { display: none; }
  /* confetti would land on top of the copy at this width */
  .confetti { display: none; }
}

/* ---------- HUD ---------- */

#hud {
  position: fixed; left: 50%; bottom: 11vh;
  translate: -50% 0; z-index: 6;
  width: 11.5rem; padding: 1.4rem 1.1rem 1.15rem;
  border-radius: 1.4rem;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  display: grid; justify-items: center; gap: 1rem;
  opacity: 0; scale: 0.9; pointer-events: none;
  transition: opacity 140ms var(--ease), scale 140ms var(--ease);
}
#hud.show { opacity: 1; scale: 1; transition-duration: 200ms; }
#hud svg { width: 3.25rem; height: 3.25rem; }
.hud-segs { display: flex; gap: 3px; width: 100%; }
.hud-segs i { flex: 1; height: 0.55rem; border-radius: 2px; background: rgba(25, 22, 39, 0.15); }
.hud-segs i.on { background: var(--ink); }

/* ---------- decorative confetti ---------- */

.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti svg { position: absolute; }
.float { animation: bob 7s ease-in-out infinite; }
.float-2 { animation: bob 9s ease-in-out infinite reverse; }
.spin { animation: spin 26s linear infinite; transform-origin: 50% 50%; }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- hero ---------- */

.hero { padding-top: clamp(3rem, 9vh, 6rem); padding-bottom: clamp(2.5rem, 6vh, 5rem); }

.hero-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: clamp(2rem, 6vh, 4rem);
}
.brandmark { display: flex; align-items: center; gap: 0.7rem; }
.brandmark img { width: 2.1rem; height: 2.1rem; border-radius: 0.5rem; border: 2px solid var(--ink); }
.brandmark b { font-family: var(--display); font-size: 1.375rem; font-weight: 820; letter-spacing: -0.02em; }

.pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  justify-self: start; width: fit-content;
  padding: 0.4rem 0.85rem;
  border: var(--border); border-radius: 999px;
  background: var(--mint);
  font-family: var(--mono); font-weight: 700;
  font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase;
}

.hero-grid { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }

.hero h1 { margin-bottom: 1.5rem; }
.hero h1 mark {
  background: none; color: var(--tangerine);
  -webkit-text-stroke: 0;
}
.hero h1 span {
  display: block; margin-top: clamp(0.9rem, 2vh, 1.4rem);
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(0.8125rem, 1.15vw, 1rem);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); line-height: 1.4;
}

.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; margin-top: 2rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: var(--border); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease), background 160ms var(--ease);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--coral); color: var(--paper); }
.btn-sun { background: var(--sun); }

.nudge {
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-top: 2.25rem; transition: opacity 400ms var(--ease);
}
.nudge.done { opacity: 0.3; }
.nudge-arrow { width: 2.4rem; height: 2.5px; background: var(--coral); position: relative; animation: slide 2.4s var(--ease) infinite; }
.nudge-arrow::after {
  content: ""; position: absolute; left: 0; top: -3.5px;
  border-right: 7px solid var(--coral);
  border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
}
@keyframes slide { 0%, 100% { opacity: 0.4; transform: translateX(0) } 50% { opacity: 1; transform: translateX(-7px) } }

/* hero illustration */
.scene { width: 100%; height: auto; display: block; overflow: visible; }

/* ---------- edges two-up ---------- */

.edges { display: grid; }
@media (min-width: 56rem) { .edges { grid-template-columns: 1fr 1fr; } }
.edge {
  padding: clamp(2.25rem, 5vw, 4rem);
  display: grid; gap: 1.25rem; align-content: start;
}
.edge-illo { width: 100%; max-width: 22rem; height: auto; }

/* ---------- features ---------- */

.feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 42rem) { .feat { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 68rem) { .feat { grid-template-columns: repeat(3, 1fr); } }
.feat li {
  background: var(--paper);
  border: var(--border); border-radius: 1.1rem;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.4rem;
  display: grid; gap: 0.5rem; align-content: start;
}
.feat .chip {
  width: 2.75rem; height: 2.75rem; border-radius: 0.8rem;
  border: 2.5px solid var(--ink);
  display: grid; place-items: center; margin-bottom: 0.4rem;
}
.feat .chip svg { width: 1.5rem; height: 1.5rem; }
.feat b { font-family: var(--display); font-size: 1.1875rem; font-weight: 800; font-variation-settings: "SOFT" 30, "WONK" 1; }
.feat span { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.5; }

.c-sun { background: var(--sun) }
.c-coral { background: var(--coral) }
.c-blue { background: var(--sky) }
.c-mint { background: var(--mint) }
.c-violet { background: #c7b3ff }
.c-tang { background: #ffb787 }

/* ---------- install ---------- */

/* The DMG is the only install path, so the download is the primary action
   rather than one option among several. */
.download {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-block: 1.75rem;
}
.download .btn {
  font-size: 1.0625rem;
  padding: 1rem 1.75rem;
}
.download-meta {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* First-launch block: the app is not notarised, so this step is unavoidable
   and needs to be impossible to miss rather than buried in a footnote. */
.firstrun {
  margin-top: 2rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  background: var(--paper);
  border: var(--border);
  border-radius: 1.1rem;
  box-shadow: var(--shadow);
}
.firstrun h3 { margin-bottom: 0.75rem; }
.firstrun p { max-width: 60ch; }
.firstrun .cmd { margin-block: 1rem 0; }
.steps {
  margin: 0 0 1.1em;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.5rem;
  max-width: 60ch;
}
.steps li { padding-left: 0.2rem; }

.cmd {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--ink); color: var(--paper);
  border: var(--border); border-radius: 0.9rem;
  box-shadow: var(--shadow);
  margin-block: 1.75rem; overflow-x: auto;
}
.cmd code { white-space: nowrap; font-size: 0.875rem; }
.cmd button { flex-shrink: 0; margin-left: auto; }

/* On a phone, a nowrap command scrolls the Copy button out of sight, which
   hides the one control that matters. Wrap the command and give Copy its own
   full-width row instead. */
@media (max-width: 48rem) {
  .cmd {
    flex-wrap: wrap;
    overflow-x: visible;
    align-items: stretch;
    gap: 0.75rem;
  }
  .cmd code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .cmd button {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

/* ---------- honest list ---------- */

.honest { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
@media (min-width: 54rem) { .honest { grid-template-columns: 1fr 1fr; } }
.honest li {
  background: var(--paper); border: var(--border); border-radius: 1.1rem;
  padding: 1.4rem 1.4rem; display: grid; gap: 0.4rem; align-content: start;
}
.honest b { font-family: var(--display); font-size: 1.125rem; font-weight: 800; }
.honest span { color: var(--ink-soft); font-size: 0.9375rem; }

/* ---------- footer ---------- */

footer { padding-block: 4rem 4.5rem; }
.foot-grid { display: grid; gap: 2.5rem; }
@media (min-width: 50rem) { .foot-grid { grid-template-columns: 1.5fr 1fr 1fr; } }
footer nav { display: grid; gap: 0.55rem; align-content: start; }
footer nav a { text-decoration: none; opacity: 0.85; }
footer nav a:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--sun); }
.foot-note { opacity: 0.7; font-size: 0.875rem; margin-top: 2.5rem; max-width: 60ch; }

/* ---------- doc pages ---------- */

.doc { max-width: 44rem; padding-block: clamp(3rem, 8vh, 6rem); }
.doc h1 { font-size: clamp(2.2rem, 5.5vw, 3.75rem); margin-bottom: 1.5rem; line-height: 1 }
.doc h2 { font-size: clamp(1.45rem, 2.8vw, 2.1rem); margin: 3rem 0 1rem; }
.doc h3 { margin: 2.25rem 0 0.75rem; font-size: 1.2rem; }
.doc > p:first-of-type { font-size: 1.1875rem; }
.doc ul, .doc ol { padding-left: 1.35rem; display: grid; gap: 0.6rem; margin: 0 0 1.4em; }
.doc pre {
  background: var(--ink); color: #eee8ff;
  border: var(--border); border-radius: 0.9rem;
  box-shadow: var(--shadow);
  padding: 1.15rem 1.3rem; overflow-x: auto; margin: 0 0 1.6em; line-height: 1.55;
}
.doc :not(pre) > code {
  background: var(--paper-2); border: 2px solid var(--ink);
  padding: 0.05em 0.35em; border-radius: 0.35em;
}
.doc strong { font-weight: 700; }
.doc hr { border: 0; height: 2.5px; background: var(--ink); margin-block: 3rem; opacity: 0.15; }
.doc blockquote {
  margin: 0 0 1.5em; padding: 1rem 1.25rem;
  background: var(--paper-2); border: var(--border); border-radius: 0.9rem;
}

.backlink {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono); font-weight: 700; font-size: 0.6875rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  text-decoration: none; margin-bottom: 2.5rem;
  padding: 0.5rem 0.9rem; border: var(--border); border-radius: 999px;
  background: var(--sun);
}
.backlink:hover { background: var(--coral); color: var(--paper); }

/* toast */
#toast {
  position: fixed; bottom: 2rem; left: 50%;
  translate: -50% 8px; z-index: 20;
  padding: 0.75rem 1.2rem; border-radius: 999px;
  background: var(--mint); color: var(--ink);
  border: var(--border); box-shadow: var(--shadow);
  font-family: var(--mono); font-weight: 700;
  font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0; pointer-events: none;
  transition: opacity 160ms var(--ease), translate 160ms var(--ease);
}
#toast.show { opacity: 1; translate: -50% 0; }

/* ---------- product-led motion system ---------- */

/* Illustration motion is decorative only; the live fixed rails remain the input surface. */
.hero-scene,
.edge-illo,
.activation-scene,
.motion-wave {
  pointer-events: none;
}

.hero-scene {
  --stage-x: 0px;
  --stage-y: 0px;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --back-x: 0px;
  --back-y: 0px;
  --device-x: 0px;
  --device-y: 0px;
  --front-x: 0px;
  --front-y: 0px;
  perspective: 900px;
}

.hero-stage,
.hero-depth-layer,
.hero-loop {
  transform-box: fill-box;
  transform-origin: center;
}

.hero-stage {
  transform: translate3d(var(--stage-x), var(--stage-y), 0)
    rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
  transform-style: preserve-3d;
}

.hero-depth-layer--shadow {
  transform: translate(var(--back-x), var(--back-y));
}
.hero-depth-layer--violet,
.hero-depth-layer--sky {
  transform: translate(var(--front-x), var(--front-y));
}
.hero-depth-layer--device {
  transform: translate(var(--device-x), var(--device-y));
}
.hero-depth-layer--gesture {
  transform: translate(var(--front-x), var(--front-y));
}

/* One 8.4s product story: brightness first, then volume, with deliberate rests. */
.hero-thumb--brightness {
  animation: hero-brightness-thumb 9.2s linear infinite both;
}
.hero-finger {
  animation: hero-brightness-finger 9.2s linear infinite both;
}
.hero-sun {
  animation: hero-sun-response 9.2s linear infinite both;
}
.hero-sun-rays {
  animation: hero-sun-rays 9.2s linear infinite both;
}
.hero-gesture-ticks {
  animation: hero-gesture-ticks 9.2s linear infinite both;
}
.hero-thumb--volume {
  animation: hero-volume-thumb 9.2s linear infinite both;
}
.hero-speaker {
  animation: hero-speaker-response 9.2s linear infinite both;
}
.hero-speaker-waves {
  transform-origin: left center;
  animation: hero-speaker-waves 9.2s linear infinite both;
}

/* Each segment carries its own ease so the travel accelerates and settles
   like a real finger instead of snapping to every keyframe stop. */
@keyframes hero-brightness-thumb {
  0%   { transform: translateY(12px); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  26%  { transform: translateY(-38px); animation-timing-function: linear; }
  44%  { transform: translateY(-38px); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  62%  { transform: translateY(12px); animation-timing-function: linear; }
  100% { transform: translateY(12px); }
}
@keyframes hero-brightness-finger {
  0%   { transform: translateY(12px) rotate(0deg); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  26%  { transform: translateY(-38px) rotate(-1.5deg); animation-timing-function: linear; }
  44%  { transform: translateY(-38px) rotate(-1.5deg); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  62%  { transform: translateY(12px) rotate(0deg); animation-timing-function: linear; }
  100% { transform: translateY(12px) rotate(0deg); }
}
/* The sun tracks the same travel, so brightness reads as the cause. */
@keyframes hero-sun-response {
  0%   { transform: rotate(-3deg) scale(0.97); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  26%  { transform: rotate(8deg) scale(1.06); animation-timing-function: linear; }
  44%  { transform: rotate(8deg) scale(1.06); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  62%  { transform: rotate(-3deg) scale(0.97); animation-timing-function: linear; }
  100% { transform: rotate(-3deg) scale(0.97); }
}
@keyframes hero-sun-rays {
  0%   { opacity: 0.5; transform: scale(0.93); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  26%  { opacity: 1; transform: scale(1.07); animation-timing-function: linear; }
  44%  { opacity: 1; transform: scale(1.07); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  62%  { opacity: 0.5; transform: scale(0.93); animation-timing-function: linear; }
  100% { opacity: 0.5; transform: scale(0.93); }
}
/* Speed marks only exist while the finger is actually travelling. */
@keyframes hero-gesture-ticks {
  0%   { opacity: 0; transform: translateY(10px) scaleX(0.8); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  10%  { opacity: 0.9; transform: translateY(4px) scaleX(1); }
  22%  { opacity: 0.5; transform: translateY(-6px) scaleX(0.9); animation-timing-function: linear; }
  30%  { opacity: 0; transform: translateY(-10px) scaleX(0.82); }
  62%  { opacity: 0; transform: translateY(10px) scaleX(0.8); }
  100% { opacity: 0; transform: translateY(10px) scaleX(0.8); }
}
/* Volume takes over in the back half of the loop, so only one edge acts at a time. */
@keyframes hero-volume-thumb {
  0%   { transform: translateY(0); animation-timing-function: linear; }
  66%  { transform: translateY(0); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  80%  { transform: translateY(-26px); animation-timing-function: linear; }
  90%  { transform: translateY(-26px); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  100% { transform: translateY(0); }
}
@keyframes hero-speaker-response {
  0%   { transform: scale(1) rotate(0deg); animation-timing-function: linear; }
  66%  { transform: scale(1) rotate(0deg); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  80%  { transform: scale(1.05) rotate(-1.5deg); animation-timing-function: linear; }
  90%  { transform: scale(1.05) rotate(-1.5deg); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes hero-speaker-waves {
  0%   { opacity: 0.5; transform: scaleX(0.9); animation-timing-function: linear; }
  66%  { opacity: 0.5; transform: scaleX(0.9); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  80%  { opacity: 1; transform: scaleX(1.08); animation-timing-function: linear; }
  90%  { opacity: 1; transform: scaleX(1.08); animation-timing-function: cubic-bezier(0.45, 0.05, 0.35, 1); }
  100% { opacity: 0.5; transform: scaleX(0.9); }
}

/* JS owns these explicit lifecycle states. Pausing never changes a real rail value. */
.hero.is-motion-paused .confetti svg,
.hero.is-motion-paused .nudge-arrow,
.nudge.done .nudge-arrow,
.hero-scene.is-motion-paused .hero-loop {
  animation-play-state: paused;
}
.hero-scene.is-user-owned .hero-loop {
  animation: none;
}

/* Content is visible by default. JS adds pending classes only after the observer exists. */
.reveal-item {
  --reveal-delay: 0ms;
}
.reveal-item.is-reveal-pending:not(.is-revealed) {
  opacity: 0;
  transform: translateY(14px);
}
.reveal-item.is-reveal-pending.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 520ms var(--ease) var(--reveal-delay),
    transform 700ms var(--ease) var(--reveal-delay);
}

/* The two edge diagrams play once as they enter. */
.edge-illo .edge-sun > circle,
.edge-illo .edge-sun > g,
.edge-speaker-bar,
.edge-speaker-wave,
.edge-brightness-arrow,
.edge-brightness-path {
  transform-box: fill-box;
  transform-origin: center;
}
.edge-speaker-bar { transform-origin: center bottom; }

.edge-illo--brightness.is-motion-pending:not(.is-animated) .edge-sun > circle,
.edge-illo--brightness.is-motion-pending:not(.is-animated) .edge-sun > g {
  opacity: 0.35;
  transform: scale(0.86);
}
.edge-illo--brightness.is-motion-pending:not(.is-animated) .edge-brightness-path {
  stroke-dashoffset: 60;
}
.edge-illo--brightness.is-motion-pending:not(.is-animated) .edge-brightness-arrow {
  opacity: 0;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}
.edge-illo--brightness.is-animated .edge-sun > circle,
.edge-illo--brightness.is-animated .edge-sun > g {
  animation: edge-sun-in 720ms var(--ease) both;
}
.edge-illo--brightness.is-animated .edge-sun--bright > circle,
.edge-illo--brightness.is-animated .edge-sun--bright > g {
  animation-delay: 180ms;
}
.edge-illo--brightness.is-animated .edge-brightness-path {
  animation: edge-dash-travel 800ms var(--ease) 130ms both;
}
.edge-illo--brightness.is-animated .edge-brightness-arrow {
  animation: edge-arrow-draw 620ms var(--ease) 260ms both;
}

.edge-illo--volume.is-motion-pending:not(.is-animated) .edge-speaker-bar {
  transform: scaleY(0.16);
}
.edge-illo--volume.is-motion-pending:not(.is-animated) .edge-speaker-wave {
  opacity: 0;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
}
.edge-illo--volume.is-animated .edge-speaker-bar {
  animation: edge-bar-rise 720ms var(--ease) var(--bar-delay, 0ms) both;
}
.edge-illo--volume.is-animated .edge-speaker-wave {
  animation: edge-wave-draw 760ms var(--ease) 220ms both;
}

@keyframes edge-sun-in {
  0%   { opacity: 0.35; transform: scale(0.86) rotate(-8deg); }
  70%  { opacity: 1; transform: scale(1.08) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes edge-dash-travel {
  from { stroke-dashoffset: 60; opacity: 0.45; }
  to   { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes edge-arrow-draw {
  from { opacity: 0; stroke-dasharray: 30; stroke-dashoffset: 30; }
  to   { opacity: 1; stroke-dasharray: 30; stroke-dashoffset: 0; }
}
@keyframes edge-bar-rise {
  0%   { transform: scaleY(0.16); }
  72%  { transform: scaleY(1.08); }
  100% { transform: scaleY(1); }
}
@keyframes edge-wave-draw {
  from { opacity: 0; stroke-dasharray: 90; stroke-dashoffset: 90; }
  to   { opacity: 1; stroke-dasharray: 90; stroke-dashoffset: 0; }
}

/* Activation paths trace once, reinforcing that origin—not proximity—is the rule. */
.activation-path,
.activation-arrow,
.activation-origin,
.activation-result {
  transform-box: fill-box;
  transform-origin: center;
}
.activation-scene.is-motion-pending:not(.is-animated) .activation-path,
.activation-scene.is-motion-pending:not(.is-animated) .activation-arrow {
  opacity: 0;
}
.activation-scene.is-motion-pending:not(.is-animated) .activation-origin,
.activation-scene.is-motion-pending:not(.is-animated) .activation-result {
  opacity: 0.25;
}
.activation-scene.is-animated .activation-path--accepted {
  animation: activation-path-accepted 900ms var(--ease) 80ms both;
}
.activation-scene.is-animated .activation-arrow--accepted {
  animation: activation-arrow-in 420ms var(--ease) 780ms both;
}
.activation-scene.is-animated .activation-origin--accepted,
.activation-scene.is-animated .activation-result--accepted {
  animation: activation-marker-in 420ms var(--ease) 120ms both;
}
.activation-scene.is-animated .activation-path--rejected {
  animation: activation-path-rejected 980ms var(--ease) 620ms both;
}
.activation-scene.is-animated .activation-origin--rejected,
.activation-scene.is-animated .activation-result--rejected {
  animation: activation-marker-in 420ms var(--ease) 700ms both;
}

@keyframes activation-path-accepted {
  from { opacity: 0; stroke-dasharray: 180; stroke-dashoffset: 180; }
  to   { opacity: 1; stroke-dasharray: 180; stroke-dashoffset: 0; }
}
@keyframes activation-path-rejected {
  0%   { opacity: 0; stroke-dasharray: 190 190; stroke-dashoffset: 190; }
  88%  { opacity: 1; stroke-dasharray: 190 190; stroke-dashoffset: 0; }
  100% { opacity: 1; stroke-dasharray: 10 9; stroke-dashoffset: 0; }
}
@keyframes activation-arrow-in {
  from { opacity: 0; stroke-dasharray: 40; stroke-dashoffset: 40; }
  to   { opacity: 1; stroke-dasharray: 40; stroke-dashoffset: 0; }
}
@keyframes activation-marker-in {
  from { opacity: 0.25; }
  to   { opacity: 1; }
}

/* Divider waves breathe into place once rather than looping forever. */
.motion-wave path {
  transform-box: fill-box;
  transform-origin: center bottom;
}
.motion-wave.is-motion-pending:not(.is-animated) path {
  opacity: 0.84;
  transform: translateY(7px) scaleY(0.9);
}
.motion-wave.is-animated path {
  animation: wave-settle 900ms var(--ease) both;
}
@keyframes wave-settle {
  0%   { opacity: 0.84; transform: translateY(7px) scaleY(0.9); }
  70%  { opacity: 1; transform: translateY(-1px) scaleY(1.015); }
  100% { opacity: 1; transform: translateY(0) scaleY(1); }
}

/* A tiny, non-looping response for pointer-capable cards only. */
@media (hover: hover) and (pointer: fine) {
  .feat li {
    transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
  }
  .feat li:hover {
    transform: translateY(-3px) rotate(-0.2deg);
    box-shadow: 7px 8px 0 var(--ink);
    transition-duration: 200ms;
  }
}

/* Live reduced-motion changes land on complete, readable static art. */
@media (prefers-reduced-motion: reduce) {
  .hero-stage,
  .hero-depth-layer,
  .hero-loop,
  .edge-illo .edge-sun > circle,
  .edge-illo .edge-sun > g,
  .edge-speaker-bar,
  .motion-wave path,
  .reveal-item {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .edge-illo .edge-sun > circle,
  .edge-illo .edge-sun > g,
  .motion-wave path,
  .reveal-item {
    opacity: 1 !important;
  }

  .edge-speaker-wave,
  .edge-brightness-path,
  .edge-brightness-arrow,
  .activation-path,
  .activation-arrow {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }

  .edge-brightness-arrow,
  .activation-arrow--accepted {
    stroke-dasharray: none !important;
  }
  .activation-path--accepted {
    stroke-dasharray: none !important;
  }
  .activation-path--rejected {
    stroke-dasharray: 10 9 !important;
  }
  .activation-origin,
  .activation-result {
    animation: none !important;
    opacity: 1 !important;
  }
}
