/* Milestone1 website. The app's pit-wall look: near-black, hairlines instead of boxes, small spaced labels,
   tabular numbers, colour only where it means something. Tokens match app/renderer/style.css and the console's chart. */
:root {
  color-scheme: dark;
  --bg: #07080a;
  --panel: #0e1013;
  --line: #1f242b;
  --line-strong: #2c333c;
  --text: #e9ecf1;
  --soft: #b3bbc7;
  --muted: #7d8694;
  --faint: #4a525e;
  --ok: #2fd27a;
  --tight: #f5b83d;
  --short: #ff4d4d;
  --best: #b07cff;      /* purple: best of the session */
  --accent: #3d8bfd;
  --speed: #3d8bfd;     /* the chart's lines, as in the console */
  --throttle: #2fd27a;
  --brake: #ff4d4d;
  --gear: #e9ecf1;
  --font: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "Cascadia Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased;
  background: radial-gradient(1100px 620px at 78% -8%, rgba(61, 139, 253, .11), transparent 62%), var(--bg);
  background-color: var(--bg); min-height: 100vh; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; }

/* Page edges clear the notch and the rounded corners in landscape. */
.wrap { max-width: var(--max); margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }

.label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; box-shadow: 0 0 2px var(--ok); } }

/* top */
.top { display: flex; align-items: center; justify-content: space-between; height: 72px;
  padding-top: env(safe-area-inset-top); box-sizing: content-box; }
.brand { font-size: 20px; font-weight: 300; letter-spacing: .02em; text-decoration: none; }
.brand b { color: var(--accent); font-weight: 800; }
.brand.small { font-size: 16px; }
.tag { border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 11px; color: var(--soft);
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }

/* hero */
.hero { display: grid; gap: 48px; padding-top: 40px; padding-bottom: 72px; }
.hero-text { max-width: 36rem; }
h1 { margin: 14px 0 20px; font-size: clamp(38px, 5.2vw, 64px); line-height: 1.04; font-weight: 700;
  letter-spacing: -.028em; text-wrap: balance; }
.lede { color: var(--soft); font-size: clamp(17px, 1.5vw, 19px); }

/* sign-up: 16px text in the field, or iPhones zoom in on it */
.signup { margin-top: 28px; max-width: 30rem; }
.signup-row { display: flex; gap: 6px; padding: 5px; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 12px; transition: border-color .15s, box-shadow .15s; }
.signup-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 139, 253, .2); }
.signup input { flex: 1; min-width: 0; padding: 10px 12px; background: transparent; border: 0; outline: 0;
  color: var(--text); font: 16px var(--font); }
.signup input::placeholder { color: var(--faint); }
.signup button { flex: none; padding: 10px 18px; border: 0; border-radius: 8px; background: var(--accent); color: #fff;
  font: 600 15px var(--font); cursor: pointer; }
.signup button:hover { background: #5a9cff; }
.signup button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.signup button:disabled { opacity: .6; cursor: default; }
.signup-msg { margin-top: 10px; color: var(--soft); font-size: 14px; }
.signup-msg:empty { display: none; }
.signup-msg[data-kind="error"] { color: var(--short); }
.signup-msg[data-kind="ok"] { color: var(--ok); }
.signup-note { margin-top: 10px; color: var(--muted); font-size: 13px; }
.signup-note a { color: var(--soft); }
.signup.done .signup-row, .signup.done .signup-note { display: none; }
.signup.done .signup-msg { margin-top: 0; padding: 14px 16px; border: 1px solid rgba(47, 210, 122, .35); border-radius: 12px;
  background: rgba(47, 210, 122, .06); }
.hidden-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* the demo console */
.console { min-width: 0; padding: 16px 18px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .03); }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.call { display: inline-flex; align-items: center; gap: 8px; min-width: 112px; justify-content: flex-end;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s; }
.call[data-state="alongside"] { color: var(--text); }
.call[data-state="alongside"] .dot { background: var(--tight); box-shadow: 0 0 10px var(--tight); }
.call[data-state="clear"] { color: var(--text); }
.call[data-state="clear"] .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.readouts > div { display: grid; gap: 2px; min-width: 0; }
.big { font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; line-height: 1.15; white-space: nowrap; }
.big small { margin-left: 4px; font-size: 12px; color: var(--muted); font-weight: 400; }
#delta.gain { color: var(--ok); }
#delta.loss { color: var(--short); }
#delta.best, #clock.best { color: var(--best); }

/* The canvas fills a box of fixed height, so drawing it never changes the size it's drawn at. */
.chart { position: relative; height: clamp(220px, 26vw, 300px); margin-top: 14px; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
figcaption { margin-top: 10px; color: var(--faint); font-size: 12.5px; }

/* features */
.features { padding-top: 64px; padding-bottom: 88px; border-top: 1px solid var(--line); }
.features h2, .join h2 { margin-top: 10px; font-size: clamp(26px, 3vw, 36px); font-weight: 650; letter-spacing: -.02em; }
.grid { display: grid; gap: 36px 40px; margin-top: 40px; }
.grid article { padding-top: 20px; border-top: 1px solid var(--line); }
.icon { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round;
  stroke-linejoin: round; }
.grid h3 { margin: 14px 0 6px; font-size: 18px; font-weight: 600; }
.grid p { color: var(--muted); font-size: 15px; }

/* the closing sign-up */
.join { display: grid; gap: 28px; padding-top: 64px; padding-bottom: 88px; border-top: 1px solid var(--line); }
.join .lede { margin-top: 12px; max-width: 32rem; }
.join .signup { margin-top: 0; }

/* footer */
.foot { padding-top: 28px; padding-bottom: max(32px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-row a { color: var(--soft); text-decoration: none; font-size: 14px; }
.foot-row a:hover { color: var(--text); text-decoration: underline; }
.fine { margin-top: 14px; color: var(--faint); font-size: 12.5px; }

/* the privacy page */
.prose { max-width: calc(44rem + 40px); padding-top: 40px; padding-bottom: 80px; }
.prose h1 { font-size: clamp(32px, 4.4vw, 48px); margin-bottom: 8px; }
.prose h2 { margin: 36px 0 8px; font-size: 19px; font-weight: 600; }
.prose p { color: var(--soft); }
.prose p + p { margin-top: 12px; }
.prose a { color: var(--text); }
.prose .updated { color: var(--muted); font-size: 14px; }
.prose .back { margin-top: 44px; }

/* the small 404 page */
.lost { padding-top: 15vh; padding-bottom: 20vh; }
.lost p { margin-top: 14px; color: var(--soft); }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 980px) {
  .hero { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: 64px;
    padding-top: 64px; padding-bottom: 104px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .join { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 64px; }
  .join .signup { justify-self: end; width: 100%; }
}
@media (max-width: 520px) {
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .console { padding: 14px 14px 12px; border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot.live { animation: none; }
  .call, .signup-row { transition: none; }
}
