/* Treadlink website. Colours are the app's own tokens (src/theme/tokens.ts); light and dark follow the system.
   Layout: copy beside real app screens; a dark treadmill belt carries live walk numbers across the page. */
@font-face {
  font-family: 'Bricolage';
  src: url('fonts/bricolage.woff2?v=a97804dc9f') format('woff2-variations'), url('fonts/bricolage.woff2?v=a97804dc9f') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ground: #f5f5f2;
  --surface: #ffffff;
  --ink: #16161a;
  --ink-muted: #5e5e66;
  --divider: #ecece7;
  --accent: #ff5b14;
  --accent-lit: #ff9150;
  --accent-deep: #d63e06;
  --accent-text: #b23c08;
  --on-accent: #16161a;
  --belt: #121214;
  --belt-slat: #1d1d21;
  --on-belt: #b4b4bc;
  --bezel: #16161a;
  --glow: rgba(255, 91, 20, 0.22);
  --m-speed: #b23c08;
  --m-distance: #00739a;
  --m-steps: #5b4bc4;
  --m-elevation: #1a6b43;
  --m-heart: #c42235;
  --m-time: #8a6200;
  --display: 'Bricolage', ui-sans-serif, system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --measure: 66ch;
  --radius: 22px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --header: rgba(245, 245, 242, 0.72);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ground: #0c0c0e;
    --surface: #1b1b1f;
    --ink: #f3f3ef;
    --ink-muted: #a3a3ac;
    --divider: #2a2a2f;
    --accent-text: #ff7a3a;
    --belt: #060607;
    --belt-slat: #141417;
    --bezel: #2c2c32;
    --glow: rgba(255, 91, 20, 0.3);
    --header: rgba(12, 12, 14, 0.7);
    --m-speed: #ff9f0a;
    --m-distance: #40c8f4;
    --m-steps: #9f94ff;
    --m-elevation: #30d158;
    --m-heart: #ff453a;
    --m-time: #ffd60a;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ground: #0c0c0e;
  --surface: #1b1b1f;
  --ink: #f3f3ef;
  --ink-muted: #a3a3ac;
  --divider: #2a2a2f;
  --accent-text: #ff7a3a;
  --belt: #060607;
  --belt-slat: #141417;
  --bezel: #2c2c32;
  --glow: rgba(255, 91, 20, 0.3);
  --header: rgba(12, 12, 14, 0.7);
  --m-speed: #ff9f0a;
  --m-distance: #40c8f4;
  --m-steps: #9f94ff;
  --m-elevation: #30d158;
  --m-heart: #ff453a;
  --m-time: #ffd60a;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
html { scrollbar-color: var(--ink-muted) var(--ground); scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
::selection { background: var(--accent); color: var(--on-accent); }
input, textarea { caret-color: var(--accent); }
p, li, dd { text-wrap: pretty; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--header);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
/* A hairline appears only once content scrolls under the bar. */
@supports (animation-timeline: scroll()) {
  .top { animation: top-edge linear both; animation-timeline: scroll(); animation-range: 0 64px; }
  @keyframes top-edge { from { box-shadow: 0 1px 0 transparent; } to { box-shadow: 0 1px 0 var(--divider); } }
}
@media (prefers-reduced-transparency: reduce) {
  .top { background: var(--ground); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.25rem/1 var(--display); letter-spacing: -0.01em; }
.brand img { border-radius: 9px; }
.top-nav { display: flex; gap: 6px; font-size: 0.95rem; }
.top-nav a {
  text-decoration: none; padding: 8px 12px; border-radius: 999px; color: var(--ink-muted);
  transition: color 150ms ease, background-color 150ms ease;
}
.top-nav a[aria-current] { color: var(--ink); background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .top-nav a:hover { color: var(--ink); background: var(--surface); } }

/* Hero: the headline, then the product standing on a running belt */
.hero { padding-block: 32px 0; }
.hero-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.8rem); font-weight: 760; letter-spacing: -0.035em; line-height: 1; hyphens: manual; }
.hero-side { display: grid; gap: 22px; padding-bottom: 8px; }
.lead { margin: 0; font-size: 1.15rem; color: var(--ink-muted); }
.actions { display: grid; gap: 8px; justify-items: start; }
.button {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font: 650 1.05rem/1 var(--display);
  box-shadow: 0 10px 24px -12px rgba(214, 62, 6, 0.7);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform 160ms var(--ease-out), box-shadow 200ms var(--ease-out), background-color 150ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .button:hover { color: var(--on-accent); background: var(--accent-lit); box-shadow: 0 14px 28px -12px rgba(214, 62, 6, 0.8); }
}
/* Feedback on press, not on release. */
.button:active { transform: scale(0.97); transition-duration: 100ms; }
.beta { margin: 0; font-size: 0.88rem; color: var(--ink-muted); }
.stores { display: flex; flex-wrap: wrap; gap: 10px; }
.store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px; border-radius: 12px;
  background: var(--ink); color: var(--ground); text-decoration: none;
  font: 650 1rem/1.1 var(--display);
}
.store svg { width: 22px; height: 22px; flex: none; }
.store small { display: block; font: 500 0.7rem/1.2 var(--body); opacity: 0.75; }
.store.is-soon { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--divider); }
.store.is-soon small { color: var(--accent-text); opacity: 1; }

.stage { position: relative; margin-top: 64px; overflow-x: clip; }
.glow {
  position: absolute; left: 50%; bottom: 40px; width: min(900px, 100%); height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  pointer-events: none;
}
.devices {
  position: relative; z-index: 1; display: flex; justify-content: center; align-items: flex-end;
  height: clamp(420px, 52vw, 600px); margin-bottom: -46px;
}
.phone {
  margin: 0; width: min(270px, 62vw); aspect-ratio: 645 / 1398;
  border-radius: 46px; padding: 7px; background: var(--bezel);
  box-shadow: 0 30px 50px -26px rgba(0, 0, 0, 0.55);
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: 39px; }
.devices .phone { position: relative; }
.devices .front { width: clamp(220px, 23vw, 290px); z-index: 2; }
.devices .back { width: clamp(190px, 19vw, 240px); margin-right: -40px; margin-bottom: 22px; }
.devices .watch { width: clamp(110px, 11vw, 150px); margin: 0 0 30px -34px; z-index: 3; }

/* Belt: the one moving thing. The devices stand on it. */
.belt {
  position: relative; overflow: hidden; background: var(--belt);
  border-block: 5px solid var(--accent);
  border-image: linear-gradient(90deg, var(--accent-lit), var(--accent), var(--accent-deep)) 1;
  padding-block: 64px 20px;
}
.belt-run {
  display: flex; width: max-content;
  background: repeating-linear-gradient(90deg, transparent 0 34px, var(--belt-slat) 34px 38px);
  animation: belt 48s linear infinite;
}
.belt-run span {
  font: 600 1.35rem/1 var(--display); font-variant-numeric: tabular-nums;
  color: var(--on-belt); white-space: nowrap; padding-inline: 28px;
  display: inline-flex; align-items: center; gap: 28px;
}
.belt-run span::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@keyframes belt { to { transform: translateX(-50%); } }
/* The product arrives once, on load: the phones rise onto the belt, a beat apart. */
@keyframes rise { from { transform: translateY(28px); opacity: 0.001; } }
.devices > * { animation: rise 900ms var(--ease-out) both; }
.devices .back { animation-delay: 60ms; }
.devices .front { animation-delay: 0ms; }
.devices .watch { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) {
  .belt-run { animation: none; }
  .devices > * { animation: none; }
  .button { transition: background-color 150ms ease; }
  .button:active { transform: none; }
}
.platforms { margin: 14px auto 0; font-size: 0.9rem; color: var(--ink-muted); text-align: center; }

/* Features */
.feature { padding-block: 112px 24px; }
.feature-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.feature.is-flipped .feature-copy { order: 2; }
.feature h2, .treadmills h2, .waitlist h2, .promise h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); }
.feature-copy > p { margin: 18px 0 0; max-width: 32em; color: var(--ink-muted); font-size: 1.12rem; }
.ticks { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 12px; align-items: baseline; }
.ticks li::before {
  content: ''; flex: none; width: 10px; height: 10px; border-radius: 3px; transform: translateY(-1px);
  background: linear-gradient(135deg, var(--accent-lit), var(--accent-deep));
}
.feature-art { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 0; }
.feature-art .phone { width: min(290px, 70vw); }
.feature-art .watch { margin: 0 0 24px -48px; }
.watch {
  margin: 0; width: 150px; padding: 9px; border-radius: 44px; background: var(--bezel);
  box-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.5); position: relative; z-index: 1;
}
.watch img { border-radius: 36px; width: 100%; }

/* Treadmills: what it reads, set like the app's walk details */
.treadmills { padding-block: 128px 40px; }
.treadmills-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.treadmills-copy p { margin: 18px 0 0; max-width: 32em; color: var(--ink-muted); font-size: 1.12rem; }
.readout { background: var(--surface); border-radius: var(--radius); padding: 24px 26px 8px; }
.readout-title { margin: 0 0 6px; font-size: 0.9rem; color: var(--ink-muted); }
.readout dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.readout dl div { padding-block: 14px; border-top: 1px solid var(--divider); }
.readout dt { font-size: 0.85rem; color: var(--ink-muted); letter-spacing: 0.01em; }
.readout dd { margin: 4px 0 0; font: 650 1.7rem/1.1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.m-speed { color: var(--m-speed); } .m-distance { color: var(--m-distance); } .m-steps { color: var(--m-steps); }
.m-elevation { color: var(--m-elevation); } .m-heart { color: var(--m-heart); } .m-time { color: var(--m-time); }

/* Waitlist */
.waitlist { padding-block: 112px 24px; }
.waitlist-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.waitlist-copy p { margin: 18px 0 0; max-width: 32em; color: var(--ink-muted); font-size: 1.12rem; }
.waitlist-form { position: relative; display: grid; gap: 18px; background: var(--surface); border-radius: var(--radius); padding: 28px 26px; }
.field { display: grid; gap: 8px; font-weight: 600; font-size: 0.95rem; }
.field input {
  font: 400 1.05rem/1.2 var(--body); color: var(--ink); background: var(--ground);
  border: 1.5px solid var(--divider); border-radius: 14px; padding: 14px 16px; min-height: 52px; width: 100%;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field input::placeholder { color: var(--ink-muted); opacity: 0.8; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.choice { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.choice legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; padding: 0; }
.choice label {
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: border-color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out);
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--divider); cursor: pointer;
}
.choice label:active { transform: scale(0.97); }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--ground); }
.choice input { accent-color: var(--accent); margin: 0; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.waitlist-form .button { justify-self: start; border: 0; cursor: pointer; }
.waitlist-form .button:disabled { opacity: 0.6; cursor: progress; transform: none; }
.turnstile:empty { display: none; }
.form-status { margin: 0; min-height: 1.4em; font-weight: 600; transition: opacity 200ms ease, transform 200ms var(--ease-out); }
.form-status:empty { opacity: 0; transform: translateY(4px); }
.form-status[data-kind='error'] { color: var(--m-heart); }
.form-status[data-kind='done'] { color: var(--m-elevation); }
.form-note { margin: 0; font-size: 0.88rem; color: var(--ink-muted); }

/* Privacy promise */
.promise { padding-block: 112px 128px; }
.promise-inner { text-align: left; }
.promise ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 32px; }
.promise li { font: 700 clamp(1.5rem, 3vw, 2.2rem)/1.1 var(--display); color: var(--accent-text); letter-spacing: -0.02em; }
.promise p { margin: 24px 0 0; max-width: 40em; color: var(--ink-muted); font-size: 1.12rem; }

/* Documents */
.doc { padding-block: 32px 96px; max-width: calc(var(--measure) + 40px); }
.doc h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.doc .updated { margin: 12px 0 0; color: var(--ink-muted); font-size: 0.95rem; }
.doc .summary {
  margin: 32px 0 0; padding: 20px 22px; border-radius: var(--radius);
  background: var(--surface); font-size: 1.1rem;
}
.doc h2 { font-size: 1.6rem; margin-top: 48px; }
.doc h3 { font-size: 1.2rem; margin-top: 28px; font-weight: 650; }
.doc p, .doc ul { margin: 14px 0 0; }
.doc ul { padding-left: 1.2em; display: grid; gap: 8px; }
.doc li::marker { color: var(--accent); }
.doc details { border-bottom: 1px solid var(--divider); padding-block: 4px; }
.doc details:first-of-type { margin-top: 18px; border-top: 1px solid var(--divider); }
.doc summary {
  cursor: pointer; list-style: none; padding-block: 16px; padding-right: 32px; position: relative;
  font: 650 1.12rem/1.3 var(--display);
}
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after {
  content: ''; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(45deg);
  transition: transform 200ms var(--ease-out);
}
.doc details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.doc details p { margin: 0 0 18px; color: var(--ink-muted); }

/* Footer */
.foot { border-top: 1px solid var(--divider); padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); font-size: 0.92rem; }
.foot-grid { display: grid; grid-template-columns: auto 1fr; gap: 18px 32px; align-items: center; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.05rem/1 var(--display); }
.foot-brand img { border-radius: 7px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: flex-end; }
.foot-nav a { text-decoration: none; color: var(--ink-muted); }
.foot-nav a:hover, .foot-nav a[aria-current] { color: var(--ink); }
.foot-note { grid-column: 1 / -1; margin: 0; color: var(--ink-muted); font-size: 0.82rem; max-width: 80ch; }

@media (max-width: 860px) {
  .hero-head, .feature-grid, .treadmills-grid, .waitlist-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .feature.is-flipped .feature-copy { order: 0; }
  .feature { padding-block: 72px 8px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-nav { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .devices { height: 380px; }
  .devices .front { width: 190px; }
  .devices .back { width: 150px; margin-right: -36px; }
  .devices .watch { width: 96px; margin-left: -30px; }
  .feature-art .phone { width: 240px; }
  .watch { width: 120px; border-radius: 36px; }
  .feature-art .watch { margin-left: -40px; }
  .watch img { border-radius: 28px; }
  .belt-run span { font-size: 1.1rem; }
}
