/* ---- tokens ---- */
:root {
  /* ground: near-black, hue-biased toward volt (greenish cast, not pure grey) */
  --bg: #0a0b09;
  --bg-raised: #131510;
  --border: #24261f;
  --text: #f2f3ee;
  --text-dim: #a4a89b;
  --accent: #a3e635;
  --accent-soft: rgba(163, 230, 53, 0.14);
  --on-accent: #0a0b09;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* type scale (mobile values; clamp carries them upward) */
  --step-hero: clamp(2.1rem, 8.5vw, 3.4rem);
  --step-h2: clamp(1.6rem, 6vw, 2.3rem);
  --step-body: 1.0625rem;
  --step-small: 0.8125rem;

  --radius: 1rem;       /* rounded-2xl feel, echoing the app */
  --radius-pill: 999px;
  --space: 1.25rem;     /* base rhythm; sections use multiples */
}

/* ---- reset ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2 { font-family: var(--font-display); font-weight: 500; text-wrap: balance; line-height: 1.12; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.section { padding: calc(var(--space) * 3) var(--space); max-width: 44rem; margin: 0 auto; }
@media (min-width: 720px) {
  .section { padding: calc(var(--space) * 4) var(--space); }
}

/* ---- shared components ---- */
.badge {
  display: inline-block;
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.9rem;
}

.capture { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.capture input {
  flex: 1 1 12rem;
  min-width: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 0.75rem;
  padding: 0.8rem 1.1rem;
  font-size: 1rem;  /* 16px floor: stops iOS focus zoom */
  font-family: inherit;
}
.capture input::placeholder { color: var(--text-dim); }
.capture input:focus { border-color: var(--accent); }
.capture button {
  border: none;
  border-radius: 0.75rem;
  padding: 0.8rem 1.4rem;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
}
.capture button:hover { filter: brightness(1.08); }

.path {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
}
.path li {
  color: var(--text-dim);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}
.path li:not(:first-child) { position: relative; margin-left: 0.75rem; }
.path li:not(:first-child)::after {
  content: '→';
  position: absolute;
  left: -0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #4b4f42;
}
.path li.lit {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}
@media (max-width: 384px) {
  .path { font-size: 0.7rem; }
  .path li { padding: 0.28rem 0.5rem; }
  .path li:not(:first-child) { margin-left: 0.65rem; }
  .path li:not(:first-child)::after { left: -0.85rem; }
}

.phone {
  aspect-ratio: 320 / 651;  /* exact screenshot ratio — no crop */
  width: min(300px, 78vw);
  border-radius: 2rem;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.phone img { object-fit: cover; object-position: 50% 0%; width: 100%; height: 100%; }

/* ---- hero ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(var(--space) * 1.4);
  padding-top: calc(var(--space) * 1.1);
}
.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--space) * 0.9);
}
.hero h1 { font-size: var(--step-hero); }
.hero .sub { color: var(--text-dim); max-width: 30rem; }
.hero .capture { justify-content: center; width: 100%; max-width: 26rem; }
.hero .clipdemo { margin-top: calc(var(--space) * 0.4); text-align: left; }

/* hero goes two-column only when both columns genuinely fit (Kimi audit #1:
   at 720-786px the nowrap path chips force horizontal page scroll) */
@media (min-width: 880px) {
  .hero {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
    max-width: 60rem;
    gap: calc(var(--space) * 2.5);
  }
  .hero-copy { align-items: flex-start; min-width: 0; }
  .hero .capture { justify-content: flex-start; }
  .hero .clipdemo { margin-top: 0; flex-shrink: 0; width: min(24rem, 44%); }
}

/* ---- feature sections ---- */
.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(var(--space) * 1.6);
}
.feature h2 { font-size: var(--step-h2); margin-bottom: 0.7rem; }
.feature-copy p { color: var(--text-dim); max-width: 28rem; }
.feature .phone { width: min(260px, 70vw); }

@media (min-width: 720px) {
  .feature {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
    max-width: 56rem;
    gap: calc(var(--space) * 3);
  }
  .feature.flip { flex-direction: row-reverse; }
  .feature .phone { flex-shrink: 0; }
}

/* ---- principle sections ---- */
.principle {
  max-width: 38rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.8);
  margin-bottom: var(--space);
}
.principle > h2 { font-size: var(--step-h2); margin-bottom: 0.8rem; }
.principle > p { color: var(--text-dim); }
#data { margin-top: calc(var(--space) * 1.5); }
#why { margin-bottom: calc(var(--space) * 2); }

/* ---- clip demo: recording frame + set row (the moat, shown not told) ----
   Base styles are the FINISHED state (skeleton drawn, timer full, chip docked)
   so no-JS and reduced-motion viewers see a complete still. The .play class,
   added by the tiny deferred script, runs the choreography once per cycle. */
.clipdemo {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(22rem, 100%);
}
.vidframe {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(120% 120% at 50% 0%, #14160f 0%, #0d0f0a 70%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.vidframe video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.35s ease;
}
.vidframe video.back { opacity: 0; }
.vf-mode {
  position: absolute; top: 0.7rem; right: 0.8rem;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  background: rgba(10, 11, 9, 0.6);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.6rem;
}
.vf-rec {
  position: absolute; top: 0.7rem; left: 0.8rem;
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em;
  color: var(--text-dim);
}
.vf-rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff5f56; }
.vf-timer {
  position: absolute; bottom: 0.7rem; left: 0.8rem;
  font-size: var(--step-small); font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
  background: rgba(10, 11, 9, 0.65);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
}
/* the marked window is "live" — reads as the hold button being held down */
.vf-timer.holding {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}
@media (prefers-reduced-motion: no-preference) {
  .vf-timer.holding { animation: hold-pulse 0.7s ease-in-out infinite; }
  @keyframes hold-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.55); }
    50% { box-shadow: 0 0 0 7px rgba(163, 230, 53, 0); }
  }
}
.vf-bar {
  position: absolute; bottom: 0; left: 0; height: 3px;
  width: 100%; background: var(--accent);
}
.session {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.4rem 1rem 0.6rem;
  text-align: left;
}
.s-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--step-small);
  color: var(--text-dim);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.s-live { display: none; color: var(--accent); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.clipdemo.live .s-live { display: inline; }
.s-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}
.s-row + .s-row { border-top: 1px solid var(--border); }
/* demo choreography: rows fade/slide in when "logged"; space stays reserved (no layout shift) */
.s-row.pending { opacity: 0; transform: translateY(6px); }
.s-row.logged {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.s-row.logged .cd-chip { animation: chip-pop 0.6s ease-out; }
@keyframes chip-pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.pr-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 0.375rem;
  padding: 0.1rem 0.4rem;
  vertical-align: 0.15em;
}
.s-row.logged .pr-tag { animation: chip-pop 0.5s ease-out 0.45s backwards; }
.cd-set { display: flex; flex-direction: column; gap: 0.1rem; }
.cd-ex { font-family: var(--font-display); font-size: 1.05rem; }
.cd-val { font-size: var(--step-small); color: var(--text-dim); }
.cd-chip {
  font-size: var(--step-small);
  font-weight: 700;
  color: var(--on-accent);
  background: var(--accent);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .vf-rec-dot { animation: vf-blink 1.2s steps(2, start) infinite; }
  @keyframes vf-blink { to { opacity: 0.25; } }
}

/* ---- entrance + scroll motion (progressive enhancement only) ---- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .hero .clipdemo { animation: rise-in 0.7s ease-out backwards; }
  .hero-copy > :nth-child(1) { animation-delay: 0.05s; }
  .hero-copy > :nth-child(2) { animation-delay: 0.15s; }
  .hero-copy > :nth-child(3) { animation-delay: 0.25s; }
  .hero-copy > :nth-child(4) { animation-delay: 0.35s; }
  .hero-copy > :nth-child(5) { animation-delay: 0.45s; }
  .hero .clipdemo { animation-delay: 0.3s; }
  @keyframes rise-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .principle {
      animation: scroll-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
    @keyframes scroll-rise {
      from { transform: translateY(22px); }
      to   { transform: translateY(0); }
    }
  }
}

/* ---- footer ---- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: calc(var(--space) * 1.1);
  padding-bottom: calc(var(--space) * 3.5);
}
.footer h2 { font-size: var(--step-h2); }
.footer .capture { justify-content: center; width: 100%; max-width: 26rem; }
.footer nav { font-size: var(--step-small); color: var(--text-dim); }
.footer nav a { color: var(--text-dim); text-underline-offset: 3px; }
.footer nav a:hover { color: var(--accent); }
.fine { font-size: var(--step-small); color: #8a8f80; }

/* ---- legal page ---- */
.legal { max-width: 38rem; display: flex; flex-direction: column; gap: 0.9rem; }
.legal h1 { font-size: var(--step-h2); margin-top: 0.5rem; }
.legal h2 { font-size: 1.25rem; margin-top: 1.1rem; }
.legal p { color: var(--text-dim); }
.legal code {
  font-size: 0.875em;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.1rem 0.35rem;
}

/* ---- pre-launch Play pill (swaps to the official badge once listed) ---- */
.play-soon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--step-small);
  font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  border-radius: var(--radius-pill);
  padding: 0.45rem 1rem;
}
.play-soon svg { color: var(--accent); }

/* ---- brand lockup ---- */
.brand {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--text);
}
.brand span { color: var(--accent); }


/* ---- inline form feedback ---- */
.form-msg {
  font-size: 0.9375rem;
  margin-top: 0.6rem;
  color: #ff8a80;
}
.form-msg.good { color: var(--accent); }
.hero .form-msg, .footer .form-msg { text-align: center; }
@media (min-width: 880px) { .hero .form-msg { text-align: left; } }

/* ---- form expectation line ---- */
.form-note { font-size: 0.8125rem; color: var(--text-dim); max-width: 26rem; }
