/*
 * velron.app: the waitlist page, the privacy notice and the 404 page.
 *
 * Ported from design round 3 (~/Desktop/design-review/waitlist/round-3/),
 * whose two pages each carried this CSS inline. It moved here because the
 * Content-Security-Policy (site/_headers) allows styles from 'self' only, which
 * also rules out style="" attributes: the illustrative chart's positions are
 * classes below (.y-*, .x-*, .dot-end) with round 3's values.
 */

/* Geist, the app's own subset (app/fonts/geist-subset.woff2). Licence beside the file. */
@font-face {
  font-family: "Geist";
  src: url("fonts/geist-subset.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   Tokens. Names and values mirror the dark theme in app/styles/app.css. The
   page is dark only; it does not follow the visitor's system setting.
--------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --background: #070d0a;
  --surface: #0f1813;
  --surface-subtle: #16211c;

  --foreground: #e8eee9;
  --foreground-muted: #b3beb7;
  --foreground-subtle: #8e9b93;

  --border-subtle: #1d2a23;
  --border-strong: #2e3d35;

  --card-from: #111b16;
  --card-to: #0c1410;
  --hero-from: #12291f;
  --hero-to: #0d1813;
  --hero-border: #24473a;
  --tile: #0c1611;

  --primary: #47d19b;
  --primary-hover: #6adcae;
  --primary-foreground: #03120b;
  --primary-subtle: #123024;

  --profit: #52d49e;

  --loss: #f28a7e;
  --loss-subtle: #331c19;
  --loss-border: #7a3b33;

  --input: #6d7d73;
  --focus-ring: #47d19b;

  --gutter: 1rem;
  --duration-quick: 120ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Page-local: how strongly the area under a chart line is tinted. */
  --chart-fade: 0.2;

  /* The form's row gap; a shown Turnstile widget keeps the same gap above the button. */
  --form-gap: 1.125rem;
}

@media (min-width: 40rem) { :root { --gutter: 1.5rem; } }
@media (min-width: 64rem) { :root { --gutter: 2rem; } }

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  background: var(--background);
  color: var(--foreground);
}
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-size: 0.9375rem; line-height: 1.5; }
h1, h2, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
main { flex: 1; }
a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
::selection { background: var(--primary-subtle); color: var(--foreground); }
.wrap { width: 100%; max-width: 75rem; margin-inline: auto; padding-inline: var(--gutter); }
.ic { width: 1em; height: 1em; flex: none; }

/* ---- Header ---- */
.site-head { padding-block: 1.375rem; }
.wordmark { display: inline-block; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1; color: var(--foreground); text-decoration: none; }
a.wordmark { padding-block: 0.75rem; margin-block: -0.75rem; }
a.wordmark:hover { color: var(--foreground); }

/* ---- Hero: intro, form, points, screen. This is the phone order. ---- */
.hero { padding-top: 1.25rem; }
.intro { display: grid; gap: 1rem; }
.headline { font-size: clamp(2.125rem, 1.45rem + 2.9vw, 3.25rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; text-wrap: balance; }
.subline { font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem); line-height: 1.5; color: var(--foreground-muted); text-wrap: pretty; }
.wl { margin-top: 1.75rem; max-width: 32.5rem; }

.points { margin-top: 2.5rem; }
.points li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.75rem; align-items: start; padding-block: 1rem; border-top: 1px solid var(--border-strong); font-size: 1rem; line-height: 1.5; text-wrap: pretty; }
.points li:last-child { border-bottom: 1px solid var(--border-strong); }
.points .ic { width: 1.25rem; height: 1.5rem; color: var(--foreground-muted); }

.screen { margin-top: 3rem; }

/* ---- Form ---- */
.wl-body { display: grid; gap: var(--form-gap); }
.field { display: grid; gap: 0.375rem; }
.field > label { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; font-size: 0.875rem; font-weight: 500; line-height: 1.4; }
.opt { font-size: 0.8125rem; font-weight: 400; color: var(--foreground-subtle); }

.input, .select select {
  display: block; width: 100%; height: 3rem; margin: 0; padding: 0 0.875rem;
  border: 1px solid var(--input); border-radius: 0.625rem;
  background: var(--surface); color: var(--foreground);
  font: inherit; font-size: 1rem; line-height: 1.2;
}
.input::placeholder { color: var(--foreground-subtle); opacity: 1; }
.input:-webkit-autofill { -webkit-text-fill-color: var(--foreground); box-shadow: 0 0 0 100px var(--surface) inset; caret-color: var(--foreground); }
.select { position: relative; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 2.625rem; cursor: pointer; }
.select select:has(option[value=""]:checked) { color: var(--foreground-subtle); }
.select .ic { position: absolute; right: 0.875rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); pointer-events: none; color: var(--foreground-muted); }

/* The tickbox and its mark share one grid cell; the label's hit area reaches under the box. */
.consent { display: grid; grid-template-columns: 1.375rem minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.375rem; align-items: start; }
.consent input { grid-area: 1 / 1; appearance: none; -webkit-appearance: none; position: relative; z-index: 1; display: block; width: 1.375rem; height: 1.375rem; margin: 0; border: 1px solid var(--input); border-radius: 0.375rem; background: var(--surface); cursor: pointer; }
.consent input:checked { background: var(--primary); border-color: var(--primary); }
.consent .tick { grid-area: 1 / 1; position: relative; z-index: 2; align-self: start; justify-self: center; margin-top: 0.25rem; width: 0.875rem; height: 0.875rem; color: var(--primary-foreground); opacity: 0; pointer-events: none; }
.consent input:checked + .tick { opacity: 1; }
.consent label { grid-area: 1 / 2; min-height: 2.75rem; margin-left: -2.125rem; padding-left: 2.125rem; font-size: 0.875rem; line-height: 1.5; color: var(--foreground-muted); cursor: pointer; }
.consent label a { white-space: nowrap; }
.consent .msg { grid-area: 2 / 1 / 3 / 3; grid-template-columns: 1.375rem minmax(0, 1fr); gap: 0.75rem; }
.consent .msg .ic { justify-self: center; }

/*
 * Turnstile, rendered by main.js with appearance "interaction-only": the
 * widget shows only when Cloudflare needs the visitor to interact. Its holder
 * shares one grid row with the button and has no height while the widget is
 * hidden, so the form keeps round 3's spacing; once shown, it sits above the
 * button with the form's own gap.
 */
.wl-submit { display: grid; min-width: 0; }
.wl-turnstile { min-width: 0; }
.wl-turnstile[data-shown] { margin-bottom: var(--form-gap); }

.btn {
  display: block; width: 100%; height: 3rem; margin: 0; border: 0; border-radius: 0.625rem;
  background: var(--primary); color: var(--primary-foreground);
  font: inherit; font-size: 1rem; font-weight: 600; letter-spacing: -0.005em; cursor: pointer;
  transition: background-color var(--duration-quick) var(--motion-ease);
}
.btn:hover { background: var(--primary-hover); }
.btn:focus-visible { outline-offset: 3px; }
/* Sending: the button is disabled and its label changes. Nothing spins. */
.btn:disabled, .btn:disabled:hover { background: var(--primary-subtle); color: var(--primary); cursor: default; }
.btn-busy { display: none; }
.btn:disabled .btn-idle { display: none; }
.btn:disabled .btn-busy { display: inline; }

/*
 * Sending also locks the fields (main.js disables all four). They keep their
 * look and their text stays readable; only the pointer says they are not
 * live. The button above is the visible signal, as in round 3.
 */
.input:disabled, .select select:disabled, .consent input:disabled { cursor: default; opacity: 1; }
.consent input:disabled ~ label { cursor: default; }

/*
 * Form states, set by main.js:
 *   Invalid email       #email[aria-invalid="true"]     + aria-describedby="email-error"
 *   Consent not ticked  #consent[aria-invalid="true"]   + aria-describedby="consent-error"
 *   Sending             every field and the button disabled (it then reads "Joining…")
 *   Request failed      form[data-state="error"]
 *   Joined              form[data-state="success"]      then focus moves to .wl-done
 * The two field messages can show together. A state never rests on colour
 * alone: each has an icon and words.
 */
.msg { display: none; grid-template-columns: 1.125rem minmax(0, 1fr); gap: 0.5rem; align-items: start; font-size: 0.875rem; line-height: 1.45; }
.msg .ic { width: 1.125rem; height: 1.125rem; margin-top: 1px; }
.msg-field { color: var(--loss); }
.msg-error { padding: 0.625rem 0.75rem; border: 1px solid var(--loss-border); border-radius: 0.625rem; background: var(--loss-subtle); color: var(--foreground); }
.msg-error .ic { color: var(--loss); }

[aria-invalid="true"] ~ .msg-field { display: grid; }
.input[aria-invalid="true"] { border: 2px solid var(--loss); padding-inline: calc(0.875rem - 1px); }
.consent input[aria-invalid="true"] { border: 2px solid var(--loss); }
.wl[data-state="error"] .msg-error { display: grid; }

.wl-done { display: none; grid-template-columns: 1.75rem minmax(0, 1fr); column-gap: 0.75rem; row-gap: 0.5rem; align-items: start; }
.wl-done:focus { outline: none; }
.wl-done .ic { width: 1.75rem; height: 1.75rem; color: var(--primary); }
.wl-done > :not(.ic) { grid-column: 2; }
.done-title { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.75rem; }
.done-next { font-size: 1rem; color: var(--foreground-muted); }
.done-follow { margin-top: 0.5rem; font-size: 0.9375rem; }
.done-follow a { display: inline-block; padding-block: 0.25rem; }
.wl[data-state="success"] .wl-body { display: none; }
.wl[data-state="success"] .wl-done { display: grid; }

/* ---- Cards: 18px, hairline, faint gradient (as the app) ---- */
.card { min-width: 0; padding: 1rem; display: flex; flex-direction: column; border: 1px solid var(--border-subtle); border-radius: 1.125rem; background: var(--card-to) linear-gradient(180deg, var(--card-from), var(--card-to)); }
.card-hero { border-color: var(--hero-border); background: var(--hero-to) linear-gradient(160deg, var(--hero-from), var(--hero-to) 75%); }

/* ---- The illustrative screen ---- */
.screen { position: relative; border: 1px solid var(--border-strong); border-radius: 1.625rem; padding: 1.5rem 0.5rem 0.5rem; }
.screen-cap { position: absolute; top: -0.6875rem; left: 1.875rem; padding: 0 0.625rem; background: var(--background); font-size: 0.8125rem; line-height: 1.375rem; color: var(--foreground-muted); }
.screen-grid { display: grid; gap: 0.625rem; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.eyebrow { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--foreground-muted); }
.est { font-size: 0.8125rem; color: var(--foreground-muted); }
.card-title { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.hero-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.875rem; margin-block: auto; padding-top: 1.625rem; }
.figure { font-size: 2.5rem; font-weight: 600; line-height: 1; letter-spacing: -0.045em; white-space: nowrap; color: var(--profit); font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.figure-sign { font-weight: 400; opacity: 0.75; margin-inline-end: 0.03em; }
.figure-minor { font-size: 0.48em; font-weight: 500; letter-spacing: -0.01em; opacity: 0.75; }
.spark { flex: 0 1 auto; min-width: 0; height: 3.5rem; aspect-ratio: 120 / 56; overflow: visible; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.625rem; margin-top: 1.25rem; }
.tile { min-width: 0; padding: 0.75rem; border: 1px solid var(--border-strong); border-radius: 0.75rem; background: var(--tile); }
.tile b { display: block; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile span { display: block; margin-top: 0.25rem; font-size: 0.8125rem; line-height: 1.4; color: var(--foreground-muted); }

.plot { flex: 1; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 0.625rem; min-height: 13.125rem; margin-top: 1.375rem; padding-right: 5px; }
.yax { position: relative; width: 1.625rem; font-size: 0.75rem; color: var(--foreground-muted); font-variant-numeric: tabular-nums; }
.yax span { position: absolute; right: 0; line-height: 1; transform: translateY(-50%); }
.area { position: relative; min-width: 0; }
.area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grid { stroke: var(--border-subtle); stroke-width: 1; vector-effect: non-scaling-stroke; }
.grid.zero { stroke: var(--border-strong); }
.line { fill: none; stroke: var(--profit); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fade-a { stop-color: var(--profit); stop-opacity: var(--chart-fade); }
.fade-b { stop-color: var(--profit); stop-opacity: 0; }
.enddot { fill: var(--profit); }
.dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--profit); transform: translate(-50%, -50%); }
.xax { grid-column: 2; position: relative; height: 1rem; font-size: 0.75rem; color: var(--foreground-muted); font-variant-numeric: tabular-nums; }
.xax span { position: absolute; line-height: 1rem; white-space: nowrap; transform: translateX(-50%); }
.xax span:last-child { transform: translateX(-100%); }
.xax .wide-only { display: none; }

/* Round 3's inline positions for the illustrative chart, as classes. */
.y-0 { top: 100%; }
.y-1k { top: 70.59%; }
.y-2k { top: 41.18%; }
.y-3k { top: 11.76%; }
.x-0940 { left: 7.69%; }
.x-1032 { left: 23.08%; }
.x-1151 { left: 46.15%; }
.x-1243 { left: 61.54%; }
.x-1401 { left: 84.62%; }
.x-1454 { left: 100%; }
.dot-end { left: 100%; top: 17.71%; }

/* ---- The privacy notice and the 404 page: one reading column ---- */
.prose { max-width: 42rem; padding-top: 1.25rem; font-size: 1rem; line-height: 1.65; }
.prose h1 { font-size: clamp(2rem, 1.6rem + 1.7vw, 2.75rem); font-weight: 600; letter-spacing: -0.035em; line-height: 1.08; }
.prose p, .prose ul { margin-top: 1rem; text-wrap: pretty; }
.prose ul { list-style: disc; padding-left: 1.25rem; }
.prose li + li { margin-top: 0.375rem; }
.prose li::marker { color: var(--foreground-muted); }
.prose .notice-meta { margin-top: 0.875rem; font-size: 0.9375rem; color: var(--foreground-muted); }
/* Section headings as round 3 set them: 2.25rem above (carried by the section), 1rem to the text below. */
.prose section { margin-top: 2.25rem; }
.prose section > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.prose .back { margin-top: 2.5rem; font-size: 0.9375rem; }
.prose .back a { display: inline-block; padding-block: 0.625rem; }

/* ---- Footer ---- */
.site-foot { margin-top: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--border-subtle); font-size: 0.875rem; color: var(--foreground-muted); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.25rem 1.5rem; padding-block: 0.875rem; }
.foot-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem; }
.site-foot p { line-height: 2.75rem; }
.site-foot a { display: inline-block; }

@media (min-width: 40rem) {
  .screen { padding: 1.875rem 1.25rem 1.25rem; }
  .screen-grid { gap: 0.875rem; }
  .card { padding: 1.375rem; }
  .tile { padding: 0.75rem 0.875rem; }
  .spark { height: 4rem; }
  .plot { min-height: 15rem; }
  .xax .wide-only { display: inline; }
}

/* Desktop: form left, screen right, the three points below. Source order is unchanged. */
@media (min-width: 60rem) {
  .site-head { padding-block: 1.875rem; }
  .hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: auto 1fr auto; column-gap: 4.5rem; padding-top: 2.75rem; }
  .intro { grid-column: 1; grid-row: 1; gap: 1.375rem; }
  .headline { font-size: clamp(2.75rem, 1.2rem + 2.6vw, 3.25rem); }
  .wl { grid-column: 1; grid-row: 2; align-self: start; margin-top: 2.25rem; max-width: 27.5rem; }
  .screen { grid-column: 2; grid-row: 1 / span 2; align-self: start; margin-top: 0.875rem; }
  .points { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 2.5rem; margin-top: 5rem; }
  .points li { grid-template-columns: 1fr; gap: 0.875rem; padding-block: 1.25rem 0; }
  .points li:last-child { border-bottom: 0; }
  .figure { font-size: 2.875rem; }
  .spark { height: 5.25rem; }
  .hero-main { padding-top: 1.125rem; }
  .plot { min-height: 14.75rem; }
  .prose { padding-top: 2.75rem; font-size: 1.0625rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
