/* StockSteer landing — tokens per DESIGN.md */

:root {
  /* Film grade: teal & blue on toned paper, amber for risk (teal-orange pairing) */
  --bg: oklch(0.976 0.006 200);        /* toned film-paper white, cool */
  --surface: oklch(0.945 0.01 202);
  --ink: oklch(0.27 0.022 220);        /* lifted film black, blue-teal cast */
  --muted: oklch(0.46 0.025 215);
  --primary: oklch(0.44 0.075 200);    /* film teal 青绿 — actions */
  --primary-hover: oklch(0.37 0.07 202);
  --blue: oklch(0.45 0.08 252);        /* film blue — links, numbers, kicker */
  --blue-hover: oklch(0.38 0.075 252);
  --deep: oklch(0.30 0.045 215);       /* deep teal-blue emulsion panel */
  --deep-ink: oklch(0.965 0.008 200);
  --deep-muted: oklch(0.80 0.03 200);
  --accent: oklch(0.50 0.115 55);      /* film amber — risk semantics only */
  --line: oklch(0.885 0.012 205);

  --font-display: "Zen Kaku Gothic New", system-ui, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, monospace;

  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: 1.953rem;
  --step-4: 2.441rem;

  --space-section: clamp(4rem, 10vw, 7.5rem);
  --radius: 10px;
  --radius-lg: 16px;

  --z-nav: 10;
  --z-toast: 20;
  --z-grain: 30;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Film grain — one fractal-noise overlay across the whole page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E") repeat;
  opacity: 0.05;
  mix-blend-mode: overlay;
}

h1, h2, h3 { text-wrap: balance; line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; }
p { margin: 0 0 1em; max-width: 68ch; text-wrap: pretty; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-hover); }

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

.wrap { max-width: 1120px; margin: 0 auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--ink); }
.wordmark svg { display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a { text-decoration: none; }
.nav-links a:not(.btn) { color: var(--muted); }
.nav-links a:not(.btn):hover { color: var(--ink); }

.btn .cta-short { display: none; }
@media (max-width: 720px) {
  .nav-links a:not(.btn) { display: none; }
  .nav-links .btn .cta-long { display: none; }
  .nav-links .btn .cta-short { display: inline; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.72rem 1.35rem;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px oklch(0.3 0.03 258 / 0.12);
  transition: background 160ms var(--ease-out), transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.btn:hover {
  background: var(--primary-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px oklch(0.3 0.05 258 / 0.22);
}
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px oklch(0.3 0.03 258 / 0.12); }

.btn-on-deep { background: var(--deep-ink); color: var(--deep); }
.btn-on-deep:hover { background: white; color: var(--deep); transform: translateY(-1px); }

/* ---------- Hero ---------- */

.hero {
  background-color: var(--deep);
  /* photographic vignette — darkened lower corner, breathed-on top */
  background-image:
    radial-gradient(120% 90% at 18% -10%, oklch(1 0 0 / 0.07), transparent 45%),
    radial-gradient(130% 130% at 105% 115%, oklch(0 0 0 / 0.28), transparent 58%);
  color: var(--deep-ink);
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4rem, 9vw, 7rem);
}

.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

@media (max-width: 880px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.22;
}

.hero .lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--deep-muted);
  max-width: 34rem;
}
.hero .lede strong { color: var(--deep-ink); font-weight: 600; }

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

.hero-trust {
  margin-top: 1.1rem;
  font-size: 0.92rem;
  color: var(--deep-muted);
}

/* ---------- Diagnosis specimen ---------- */

.specimen {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 54px oklch(0.16 0.03 215 / 0.4);
  padding: 1.4rem 1.5rem 1.2rem;
  font-size: 0.92rem;
  max-width: 33rem;
  justify-self: end;
  width: 100%;
}
@media (max-width: 880px) { .specimen { justify-self: start; } }

/* Desktop: the report card breaks out of the hero panel into the page.
   Uses the standalone `translate` property so it composes with the
   entrance animation's `transform` instead of fighting it. */
@media (min-width: 881px) {
  .hero { padding-block-end: clamp(2rem, 4.5vw, 3rem); }
  .specimen { align-self: end; translate: 0 clamp(2.5rem, 6vw, 4.5rem); }
  #diagnosis { padding-top: calc(var(--space-section) + clamp(2rem, 5vw, 3.5rem)); }
}

.specimen-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}
.specimen-head .title { font-weight: 800; letter-spacing: -0.01em; font-size: 1rem; }
.specimen-head .meta { font-size: 0.8rem; color: var(--muted); }

.action-card { padding: 1rem 0 0.9rem; }
.action-card + .action-card { border-top: 1px solid var(--line); }

.card-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  background: var(--primary);
  color: white;
  margin-bottom: 0.5rem;
}
.card-label.risk { background: var(--accent); color: white; }

.action-card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 0.7rem;
  letter-spacing: -0.01em;
}
.action-card .sku { font-family: var(--font-mono); font-weight: 600; }

.cover-row {
  display: grid;
  grid-template-columns: 7.2em 1fr 6.5em;
  align-items: center;
  gap: 0.7em;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}
.cover-row .chan { color: var(--muted); }
.cover-row .days { font-family: var(--font-mono); text-align: right; }

.bar {
  height: 8px;
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transform-origin: left center;
}
.bar i.low { background: var(--accent); }

.loaded .bar i { animation: grow 700ms var(--ease-out) backwards; animation-delay: 350ms; }
.loaded .cover-row:nth-child(3) .bar i { animation-delay: 470ms; }

@keyframes grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Signature entrance — plays once, only when the page loads visible */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.loaded .hero h1 { animation: rise 650ms var(--ease-out) backwards; }
.loaded .hero .lede { animation: rise 650ms var(--ease-out) 90ms backwards; }
.loaded .hero-cta { animation: rise 650ms var(--ease-out) 170ms backwards; }
.loaded .hero-trust { animation: rise 650ms var(--ease-out) 240ms backwards; }
.loaded .specimen { animation: rise 750ms var(--ease-out) 220ms backwards; }

.why {
  margin-top: 0.7rem;
  background: var(--surface);
  border-radius: 8px;
  font-size: 0.83rem;
}
.why summary {
  cursor: pointer;
  padding: 0.55rem 0.8rem;
  font-weight: 600;
  color: var(--primary-hover);
  list-style: none;
}
.why summary::before { content: "▸ "; }
.why[open] summary::before { content: "▾ "; }
.why .math {
  padding: 0 0.8rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}
.why .math b { color: var(--ink); font-weight: 600; }

.risk-note { font-size: 0.85rem; color: var(--muted); margin: 0; }
.risk-note b { color: var(--accent); font-weight: 700; }

.specimen-foot {
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  display: flex;
  gap: 1.2em;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */

section { padding-block: var(--space-section); }
section[id] { scroll-margin-top: 72px; }

.section-title {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  max-width: 24ch;
}
.section-intro { color: var(--muted); font-size: var(--step-1); max-width: 56ch; }

/* What's in the diagnosis — definition rows */

.contents-list { margin-top: 2.5rem; border-top: 1px solid var(--line); }

.content-row {
  display: grid;
  grid-template-columns: minmax(14rem, 0.9fr) 1.6fr;
  gap: clamp(1rem, 4vw, 4rem);
  padding-block: 1.9rem;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 720px) { .content-row { grid-template-columns: 1fr; gap: 0.4rem; } }

.content-row h3 {
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
}
.content-row p { margin: 0; color: var(--muted); }
.content-row .example {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  width: fit-content;
  max-width: 100%;
}

.price-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-hover);
  background: var(--surface);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  margin-left: 0.6rem;
  vertical-align: middle;
  white-space: nowrap;
}

/* How it works — the one numbered sequence */

.steps { margin-top: 2.5rem; display: grid; gap: 0; }

.step {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.8rem;
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }

.step-num {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--blue);
  line-height: 1;
  padding-top: 0.2rem;
}

.step h3 { font-size: var(--step-1); font-weight: 700; margin: 0 0 0.4rem; letter-spacing: -0.015em; }
.step p { margin: 0; color: var(--muted); }
.step p + p { margin-top: 0.6rem; }
.step .fine { font-size: 0.9rem; }
.step .fine b { color: var(--ink); font-weight: 600; }

/* Argument section */

.argument { background: var(--surface); }
.argument .wrap { max-width: 860px; }
.argument p { font-size: var(--step-1); line-height: 1.6; max-width: 60ch; }
.argument p b { font-weight: 700; }
.argument .kicker-line {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  margin-top: 2rem;
  max-width: 30ch;
  line-height: 1.3;
  color: var(--blue);
}

/* Promise strip */

.promises { padding-block: calc(var(--space-section) * 0.7); }
.promise-strip {
  display: flex;
  flex-wrap: wrap;
  border-block: 1px solid var(--line);
}
.promise {
  flex: 1 1 220px;
  padding: 1.6rem 1.5rem;
  border-inline-start: 1px solid var(--line);
}
.promise:first-child { border-inline-start: 0; }
@media (max-width: 720px) {
  .promise { border-inline-start: 0; border-top: 1px solid var(--line); }
  .promise:first-child { border-top: 0; }
}
.promise h3 { font-size: 1rem; font-weight: 700; margin: 0 0 0.3rem; }
.promise p { font-size: 0.92rem; color: var(--muted); margin: 0; }
.promise a { color: var(--primary-hover); }

/* ---------- CTA / form ---------- */

.cta {
  background-color: var(--deep);
  background-image: radial-gradient(130% 130% at -5% 115%, oklch(0 0 0 / 0.24), transparent 55%);
  color: var(--deep-ink);
}
.cta .wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
}
@media (max-width: 880px) { .cta .wrap { grid-template-columns: 1fr; } }

.cta h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.cta .section-intro { color: var(--deep-muted); }
.cta .alt-channel { font-size: 0.95rem; color: var(--deep-muted); }
.cta .alt-channel a { color: var(--deep-ink); }

.form {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 54px oklch(0.16 0.03 215 / 0.35);
  padding: 1.8rem;
  display: grid;
  gap: 1.1rem;
  align-self: start;
}

.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .hint { font-size: 0.83rem; color: var(--muted); }

.field input[type="email"],
.field input[type="text"],
.field select {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  width: 100%;
}
.field input:focus-visible, .field select:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}

.file-drop {
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.file-drop:hover, .file-drop.drag { border-color: var(--primary); background: var(--surface); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop .picked { color: var(--ink); font-weight: 600; font-family: var(--font-mono); font-size: 0.86rem; }

.consent { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.87rem; color: var(--muted); }
.consent input { margin-top: 0.25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--primary); flex: none; }

.form .btn { justify-content: center; font-size: 1.05rem; padding-block: 0.85rem; }

.form-note { font-size: 0.83rem; color: var(--muted); margin: 0; text-align: center; }

.form-status {
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  display: none;
}
.form.sent > :not(.form-status) { display: none; }
.form-status.ok { display: block; background: var(--surface); color: var(--ink); }
.form-status.err { display: block; background: oklch(0.955 0.02 60); color: oklch(0.43 0.1 55); }

/* ---------- FAQ ---------- */

.faq .wrap { max-width: 860px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:first-of-type { border-top: 1px solid var(--line); margin-top: 2rem; }
.faq-item summary {
  cursor: pointer;
  padding: 1.1rem 0;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--primary); flex: none; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .answer { padding: 0 0 1.2rem; color: var(--muted); max-width: 62ch; }
.faq-item .answer p { margin: 0 0 0.6em; }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line);
  padding-block: 2.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}
footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
}
footer nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
footer a { color: var(--muted); }
footer a:hover { color: var(--ink); }
footer .legal-note { flex-basis: 100%; font-size: 0.8rem; margin: 0; }

/* ---------- Legal pages ---------- */

.legal-main { padding-block: clamp(3rem, 7vw, 5rem); }
.legal-main .wrap { max-width: 760px; }
.legal-main h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.legal-main .updated { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin-bottom: 2.5rem; }
.legal-main h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; margin-top: 2.2em; }
.legal-main h3 { font-size: 1.05rem; font-weight: 700; margin-top: 1.6em; }
.legal-main p, .legal-main li { color: var(--ink); max-width: 68ch; }
.legal-main ul { padding-left: 1.2rem; }
.legal-main li { margin-bottom: 0.4em; }

/* ---------- Reveal motion ----------
   Content is visible by default. JS adds .pre only to below-fold elements
   while the page is actually visible; anything else never gets hidden. */

.reveal.pre { opacity: 0; transform: translateY(12px); }
.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal.pre { opacity: 1; transform: none; }
  .loaded .bar i { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
