/* Tandem site. Colours are the app's own tokens (design-system/ds/project/tokens.json in the app). */

@font-face {
  font-family: "Nunito Tandem";
  src: url("/assets/fonts/nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #f2f5f1;
  --surface: #ffffff;
  --sunken: #e3eae5;
  --ink: #10231f;
  --muted: #4d615b;
  --hairline: #cfd9d3;
  --border: #7c8f88;
  --upright: #08664a;
  --on-upright: #ffffff;
  --upright-tint: #d5f0e3;
  --slouch: #d65314;
  --slouch-text: #b0440f;
  --slouch-tint: #ffece2;
  --neck: #3373cc;
  --neck-tint: #dbe9fa;
  --butter: #f6d860;
  --bezel: #10231f;
  --glass: rgb(255 255 255 / 0.78);
  --float: 0 12px 32px -12px rgb(16 35 31 / 0.28), 0 2px 6px rgb(16 35 31 / 0.08);

  /* the dark theme's values, for surfaces that are always dark (Watch, Lock Screen) */
  --d-ground: #0d1614;
  --d-surface: #16221f;
  --d-ink: #ecf3ef;
  --d-muted: #9db0a9;
  --d-upright: #4fd6a4;
  --d-slouch: #ec7441;
  --d-neck: #6aa6f0;
  --d-hairline: #2a3a36;

  --display: ui-rounded, "Nunito Tandem", "Nunito", "SF Pro Rounded", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1180px;
  --bar: 64px;
  --spring: cubic-bezier(0.34, 1.32, 0.5, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1614;
    --surface: #16221f;
    --sunken: #0a110f;
    --ink: #ecf3ef;
    --muted: #9db0a9;
    --hairline: #2a3a36;
    --border: #6b8079;
    --upright: #4fd6a4;
    --on-upright: #06241a;
    --upright-tint: #133a2e;
    --slouch: #ec7441;
    --slouch-text: #ff9a62;
    --slouch-tint: #40200f;
    --neck: #6aa6f0;
    --neck-tint: #14283f;
    --bezel: #34453f;
    --glass: rgb(22 34 31 / 0.82);
    --float: 0 12px 32px -12px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.3);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--neck); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--upright); color: var(--on-upright); }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--ground); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- posture line */
/* --lean (0 upright, 1 slouching) is set frame by frame while a line moves, so colour and bend stay in step */
.pl { --lean: 0; height: 100%; width: auto; overflow: visible; fill: currentColor; color: color-mix(in oklch, var(--upright), var(--slouch) calc(var(--lean) * 100%)); }
.pl circle { transform-box: fill-box; transform-origin: center; }
.pl .eye { fill: var(--on-upright); stroke: var(--on-upright); transform-box: fill-box; transform-origin: center; }
.pl ellipse.eye { stroke: none; }
.pl[data-pose="slouching"] { --lean: 1; }
.pl[data-pose="neck"] { color: var(--neck); }

/* The hero line waits for its welcome (main.js) instead of showing tall and then jumping. If the
   script never arrives, it appears anyway after a moment. */
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .hero-line:not(.live) circle, .hero-line:not(.live) .range { animation: pl-late 0.4s 1.6s both; }
}
@keyframes pl-late { from { opacity: 0; } }

/* a tall line stands at 21% of its box (the rest is room to lean); this puts the line itself in the middle */
.pl-center { translate: 28.9% 0; }

/* ---------------------------------------------------------------- header */
.bar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.bar-in { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; height: var(--bar); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.3rem/1 var(--display); letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.bar-nav { display: flex; gap: 24px; margin-left: auto; }
.bar-nav a { text-decoration: none; font-weight: 500; font-size: 0.97rem; color: var(--muted); transition: color 0.2s; }
.bar-nav a:hover, .bar-nav a[aria-current="page"] { color: var(--ink); }
.store-sm { padding: 9px 16px; font-size: 0.92rem; }
@media (max-width: 720px) {
  .bar-nav { display: none; }
  .bar .store, .bar .soon { margin-left: auto; }
}

/* ---------------------------------------------------------------- store buttons */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 14px 24px; border-radius: 999px;
  background: var(--ink); color: var(--ground);
  font: 700 1.05rem/1 var(--display); letter-spacing: -0.005em; text-decoration: none;
  transition: transform 0.25s var(--spring), background-color 0.2s;
}
a.store:hover { transform: translateY(-2px); }
a.store:active { transform: scale(0.97); }
.store-beta { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--border); }
.store span { white-space: nowrap; }
.price { margin-top: 14px; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 420px) { .stores .store { padding: 14px 18px; font-size: 1rem; } }

/* Not out yet: a status, not a button. The grey line is the app's colour for "nothing measured yet". */
.soon { display: inline-flex; align-items: center; gap: 14px; margin: 0; text-align: left; }
.soon .pl { flex: none; height: 52px; color: var(--border); }
.soon b { display: block; font: 800 1.18rem/1.2 var(--display); letter-spacing: -0.01em; }
.soon b + span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.97rem; }
.soon-sm { display: block; font: 700 0.95rem/1 var(--display); color: var(--muted); white-space: nowrap; }
@media (max-width: 1000px) { .soon-wide { display: none; } }

/* ---------------------------------------------------------------- hero */
.hero { padding: 8px var(--gutter) 0; }
.hero-in {
  position: relative; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  min-height: min(calc(100svh - var(--bar) - 24px), 860px);
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: center; gap: 24px;
  padding: clamp(28px, 6vw, 88px);
  border-radius: clamp(28px, 4vw, 44px);
  background: var(--upright-tint);
  transition: background-color 0.6s var(--ease);
  overflow: hidden; isolation: isolate;
}
.hero[data-state="slouch"] .hero-in { background: var(--slouch-tint); }
.hero h1 { font-size: clamp(2.7rem, 6.4vw, 5.8rem); font-weight: 850; line-height: 0.98; letter-spacing: -0.03em; max-width: 9.5em; }
.lede { margin: 26px 0 34px; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; max-width: 30em; }

.toy { position: relative; height: 100%; min-height: 420px; display: grid; place-items: end center; padding-bottom: 6%; }
.toy-line { position: relative; height: clamp(280px, 54vh, 520px); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.toy-line.dragging { cursor: grabbing; }

.range path { fill: none; stroke-width: 0.15; stroke-linecap: round; stroke-dasharray: 0 0.42; }
.range-up { stroke: color-mix(in srgb, var(--upright) 45%, transparent); }
.range-sl { stroke: color-mix(in srgb, var(--slouch) 70%, transparent); }
.toy-hint {
  position: absolute; z-index: 2; left: var(--hint-x, 60%); top: var(--hint-y, 10%);
  padding: 7px 13px; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: var(--float);
  font: 700 0.85rem/1 var(--display); white-space: nowrap; pointer-events: none;
  transition: opacity 0.4s, transform 0.4s var(--spring);
}
.toy-hint::before { content: ""; position: absolute; left: -5px; top: 50%; width: 10px; height: 10px; background: inherit; transform: translateY(-50%) rotate(45deg); border-radius: 2px; }
.toy-hint.below::before { left: calc(var(--tip-x) - 5px); top: -4px; transform: rotate(45deg); }
.toy-hint.gone { opacity: 0; transform: scale(0.8); }

/* ripples: a tap when a nudge lands, a softer one when you straighten */
.toy-arcs, .taps { position: absolute; left: var(--hx, 50%); top: var(--hy, 10%); width: 0; height: 0; pointer-events: none; }
.toy-arcs i, .taps i { position: absolute; left: 50%; top: 50%; width: var(--r, 90px); height: var(--r, 90px); margin: calc(var(--r, 90px) / -2); border-radius: 50%; border: 3px solid currentColor; opacity: 0; }
.toy-arcs { color: var(--slouch); }
.toy-arcs.up { color: var(--upright); }
.toy-arcs.go i, .taps.go i { animation: ripple 1s var(--ease) both; }
.toy-arcs.go i + i, .taps.go i + i { animation-delay: 0.16s; }
@keyframes ripple { from { transform: scale(0.45); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }

.note-banner {
  position: absolute; z-index: 3; top: 0; left: 50%; width: min(360px, 100%);
  display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 24px; background: var(--glass); box-shadow: var(--float);
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  transform: translate(-50%, -24px) scale(0.96); opacity: 0; pointer-events: none;
  transition: transform 0.55s var(--spring), opacity 0.3s;
}
.note-banner.show { transform: translate(-50%, 0) scale(1); opacity: 1; }
.note-banner img { width: 38px; height: 38px; border-radius: 9px; }
.note-banner b { display: block; font-size: 0.95rem; font-weight: 650; }
.note-banner span { display: block; font-size: 0.9rem; color: var(--muted); }
.note-banner time { align-self: start; font-size: 0.8rem; color: var(--muted); }
.toy .note-banner { top: 4%; }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; min-height: 0; padding-bottom: 0; }
  .toy { min-height: 0; height: auto; padding: 72px 0 28px; }
  .toy-line { height: clamp(220px, 46vh, 340px); }
}

/* ---------------------------------------------------------------- how it works */
section { position: relative; }
.how { padding: clamp(80px, 12vw, 150px) 0 40px; }
/* the "How it works" link lands on the heading, with the hero's edge out of sight under the header */
.how { scroll-margin-top: calc(16px - clamp(80px, 12vw, 150px)); }
.how h2, .screens h2, .everywhere h2, .private h2, .why h2, .needs h2, .cta h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.section-lede { margin-top: 16px; color: var(--muted); font-size: 1.15rem; max-width: 34em; }
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "steps stage"; gap: clamp(32px, 6vw, 96px); margin-top: 24px; }
.steps { grid-area: steps; list-style: none; margin: 0; padding: 0; counter-reset: step; }
/* room after the last step, so the coach scene stays pinned long enough to finish and be read */
.steps::after { content: ""; display: block; height: 26vh; }
.step { counter-increment: step; min-height: 74vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; transition: opacity 0.5s var(--ease); }
.js .step:not(.on) { opacity: 0.4; }
.step::before {
  content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 22px; border-radius: 50%;
  font: 800 1.15rem/1 var(--display); color: var(--upright); box-shadow: inset 0 0 0 2.5px currentColor;
  transition: background-color 0.4s, color 0.4s;
}
.step.on::before { background: var(--upright); color: var(--on-upright); box-shadow: none; }
.step h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
.step p { margin-top: 14px; font-size: 1.12rem; color: var(--muted); max-width: 28em; }

.stage { grid-area: stage; position: sticky; top: calc(var(--bar) + 24px); height: min(calc(100svh - var(--bar) - 48px), 700px); }
.stage-card {
  position: relative; height: 100%; border-radius: 40px; overflow: hidden; isolation: isolate;
  background: var(--upright-tint); container-type: size;
  transition: background-color 0.6s var(--ease);
}
.stage[data-step="day"] .stage-card, .stage[data-step="coach"] .stage-card { background: var(--surface); }
.stage.slouch .stage-card { background: var(--slouch-tint); }

/* The line is placed by the centre of its base bead (21.08% across, 92.66% down its box), so a
   tall line stands exactly where it is put and scales around its own feet. Day and coach are
   placed from the page in main.js, next to the text they belong to. */
.stage-line {
  position: absolute; z-index: 2; left: 50%; top: 50%; height: 58cqh;
  transform-origin: 21.08% 92.66%;
  transform: translate(-21.08%, -92.66%) translate(var(--tx, 0px), var(--ty, 0px)) scale(var(--s, 1));
  transition: transform 0.95s var(--spring);
}
.stage[data-step="airpods"] .stage-line { --ty: 30cqh; }
.stage[data-step="calibrate"] .stage-line { --s: 0.56; --ty: 9cqh; }
.stage[data-step="nudge"] .stage-line { --ty: 27cqh; --s: 0.9; --tx: -4cqw; }
.stage[data-step="day"] .stage-line { --s: 0.3; --tx: -36cqw; --ty: -24cqh; }
.stage[data-step="coach"] .stage-line { --s: 0.1; --tx: -40cqw; --ty: -26cqh; }

/* sensing arcs: AirPods read the head */
.sense { position: absolute; left: var(--hx, 50%); top: var(--hy, 10%); width: 0; height: 0; color: var(--upright); }
.sense i { position: absolute; left: 0; top: 0; width: var(--r); height: var(--r); margin: calc(var(--r) / -2); border-radius: 50%; border: 3px solid; border-color: transparent currentColor; opacity: 0; transition: opacity 0.4s; }
.sense i:nth-child(1) { --r: 14cqh; }
.sense i:nth-child(2) { --r: 19cqh; }
.sense i:nth-child(3) { --r: 24cqh; }
.stage[data-step="airpods"] .sense i { opacity: 1; animation: sense 2.2s ease-in-out infinite; }
.stage[data-step="airpods"] .sense i:nth-child(2) { animation-delay: 0.2s; }
.stage[data-step="airpods"] .sense i:nth-child(3) { animation-delay: 0.4s; }
@keyframes sense { 0%, 100% { opacity: 0.15; } 40% { opacity: 1; } }
.taps { color: var(--slouch); }
.taps i { --r: 22cqh; }
.taps.up { color: var(--upright); }

.ring { position: absolute; z-index: 1; left: 50%; top: 42%; width: 54cqh; height: 54cqh; transform: translate(-50%, -50%) rotate(-90deg) scale(0.9); opacity: 0; transition: opacity 0.4s, transform 0.6s var(--spring); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-track { stroke: color-mix(in srgb, var(--upright) 18%, transparent); }
.ring-fill { stroke: var(--upright); stroke-dasharray: 100; stroke-dashoffset: 100; }
.stage[data-step="calibrate"] .ring { opacity: 1; transform: translate(-50%, -50%) rotate(-90deg) scale(1); }
.stage[data-step="calibrate"] .ring-fill { animation: fill 3s 0.4s linear forwards; }
@keyframes fill { to { stroke-dashoffset: 0; } }

.scene { position: absolute; inset: 0; z-index: 3; padding: 7cqh 7cqw; opacity: 0; visibility: hidden; transition: opacity 0.45s var(--ease), visibility 0s 0.45s; }
.stage[data-step="airpods"] .scene-airpods, .stage[data-step="calibrate"] .scene-calibrate, .stage[data-step="nudge"] .scene-nudge, .stage[data-step="day"] .scene-day, .stage[data-step="coach"] .scene-coach { opacity: 1; visibility: visible; transition-delay: 0.2s, 0s; }

.pill { display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px 10px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--float); font: 700 1rem/1 var(--display); }
.pods { width: 22px; height: 22px; fill: currentColor; }
.scene-airpods { display: flex; justify-content: center; align-items: flex-start; }
.scene-calibrate { display: flex; flex-direction: column; justify-content: flex-end; text-align: center; }
.scene-big { font: 800 clamp(1.3rem, 6.4cqw, 2.1rem)/1.1 var(--display); letter-spacing: -0.02em; }
.scene-small { margin-top: 8px; color: var(--muted); }
.scene-nudge { display: flex; flex-direction: column; align-items: center; }
.scene-nudge .pill { margin-top: auto; }
.pill-pl { height: 18px; color: var(--slouch); }
.pill.up .pill-pl { color: var(--upright); }
.scene-nudge .note-banner { top: 6cqh; width: min(360px, 86cqw); }

.scene-day { padding-left: 32cqw; padding-top: 9cqh; }
.share { font: 850 clamp(3rem, 19cqw, 7rem)/0.9 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.share-unit { margin-top: 6px; color: var(--muted); }
.ribbon-wrap { position: absolute; left: 7cqw; right: 7cqw; top: 44cqh; }
.ribbon { width: 100%; height: 30px; }
.scene-day .ribbon { height: clamp(34px, 9cqh, 56px); }
.ribbon .rb-off { fill: var(--hairline); }
.ribbon .rb-up { fill: var(--upright); }
.ribbon .rb-sl { fill: var(--slouch); }
.ribbon .rb-nk { fill: var(--neck); }
.ribbon-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 0.85rem; }
.stage[data-step="day"] .ribbon-wrap .ribbon { animation: wipe 1.4s 0.35s var(--ease) both; }
@keyframes wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.scene-sentence { position: absolute; left: 7cqw; right: 7cqw; top: 66cqh; font: 700 clamp(1.05rem, 4.6cqw, 1.45rem)/1.3 var(--display); letter-spacing: -0.01em; }

.scene-coach { display: flex; flex-direction: column; gap: 3cqh; }
.bubble-q { align-self: flex-end; max-width: 78%; padding: 14px 20px; border-radius: 24px 24px 8px 24px; background: var(--upright); color: var(--on-upright); font-weight: 600; font-size: 1.05rem; line-height: 1.35; }
.answer { padding-left: 13cqw; }
.answer p { font-size: 1.08rem; line-height: 1.45; min-height: 3em; transition: opacity 0.25s; }
.answer p.swap { opacity: 0; }
.bars { margin-top: 2.4cqh; padding: 16px 14px 10px; border-radius: 20px; background: var(--ground); }
.bars svg { width: 100%; height: auto; }
.bars .bar { fill: var(--sunken); stroke: var(--border); stroke-width: 1.5; }
.bars .bar-hot { fill: var(--slouch); }
.stage[data-step="coach"] .bars rect { animation: grow 0.7s 0.4s var(--spring) both; transform-box: fill-box; transform-origin: bottom; }
.stage[data-step="coach"] .bars rect:nth-child(1) { animation-delay: 0.40s; }
.stage[data-step="coach"] .bars rect:nth-child(2) { animation-delay: 0.44s; }
.stage[data-step="coach"] .bars rect:nth-child(3) { animation-delay: 0.48s; }
.stage[data-step="coach"] .bars rect:nth-child(4) { animation-delay: 0.52s; }
.stage[data-step="coach"] .bars rect:nth-child(5) { animation-delay: 0.56s; }
.stage[data-step="coach"] .bars rect:nth-child(6) { animation-delay: 0.60s; }
.stage[data-step="coach"] .bars rect:nth-child(7) { animation-delay: 0.64s; }
.stage[data-step="coach"] .bars rect:nth-child(8) { animation-delay: 0.68s; }
.stage[data-step="coach"] .bars rect:nth-child(9) { animation-delay: 0.72s; }
.stage[data-step="coach"] .bars rect:nth-child(10) { animation-delay: 0.76s; }
.stage[data-step="coach"] .bars rect:nth-child(11) { animation-delay: 0.80s; }
.stage[data-step="coach"] .bars rect:nth-child(12) { animation-delay: 0.84s; }

@keyframes grow { from { transform: scaleY(0.05); } }
.voices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.voices button {
  min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 0; background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--border); font: 700 0.95rem/1 var(--display); cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s var(--spring);
}
.voices button:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.voices button:active { transform: scale(0.95); }
.voices button[aria-checked="true"] { background: var(--ink); color: var(--ground); box-shadow: none; }

@media (max-width: 860px) {
  .how-grid { grid-template-columns: 1fr; grid-template-areas: "stage" "steps"; gap: 0; }
  .stage { top: var(--bar); height: calc(50svh + 4px); z-index: 2; padding: 4px 0 12px; background: var(--ground); }
  .stage-card { border-radius: 28px; }
  .step { min-height: 46svh; justify-content: flex-start; padding: 28px 0 32px; }
  .steps::after { height: 16svh; }
  .step::before { width: 38px; height: 38px; margin-bottom: 14px; }
  .step p { font-size: 1.05rem; }
  .answer p { font-size: 0.98rem; }
  .bubble-q { font-size: 0.95rem; padding: 10px 16px; }
  .voices button { min-height: 36px; padding: 6px 12px; font-size: 0.85rem; }
  .bars { padding: 10px 10px 6px; }
}

/* ---------------------------------------------------------------- screens: one phone you can tap through */
.screens { padding: clamp(80px, 10vw, 140px) 0; }
.screens-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 7vw, 110px); align-items: center; }
.tabs { margin-top: 40px; display: grid; gap: 6px; max-width: 30em; }
.tabs input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.tabs label { display: grid; gap: 4px; padding: 16px 22px 18px; border-radius: 24px; cursor: pointer; transition: background-color 0.3s var(--ease); }
.tabs label b { font: 800 1.4rem/1.2 var(--display); letter-spacing: -0.015em; }
.tabs label span { color: var(--muted); font-size: 1.05rem; }
.tabs label:hover { background: color-mix(in srgb, var(--upright-tint) 55%, transparent); }
.tabs input:checked + label { background: var(--upright-tint); }
.tabs input:focus-visible + label { outline: 3px solid var(--neck); outline-offset: 2px; }

.phone { margin: 0; width: clamp(270px, 27vw, 340px); }
.phone-frame { position: relative; display: grid; padding: 10px; border-radius: 52px; background: var(--bezel); box-shadow: 0 40px 70px -36px rgb(16 35 31 / 0.5); }
.shot { grid-area: 1 / 1; width: 100%; height: auto; aspect-ratio: 460 / 1000; object-fit: cover; border-radius: 42px; background: var(--surface); }
.shot-trends, .shot-coach { opacity: 0; }
@supports selector(:has(*)) {
  .shot { opacity: 0; transition: opacity 0.25s ease-out; }
  .screens:has(#tab-today:checked) .shot-today,
  .screens:has(#tab-trends:checked) .shot-trends,
  .screens:has(#tab-coach:checked) .shot-coach { opacity: 1; }
}
/* the screenshots' own tab bar works too: three targets laid over it */
.tabbar { position: absolute; left: 25%; right: 25%; bottom: 3.6%; height: 6.6%; display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar label { cursor: pointer; border-radius: 999px; }

@media (max-width: 860px) {
  .screens-in { grid-template-columns: 1fr; justify-items: center; }
  .screens-copy { width: 100%; }
  /* a segmented row, with the chosen tab's sentence underneath */
  .tabs { grid-template-columns: repeat(3, 1fr); gap: 0 4px; max-width: none; margin-top: 28px; }
  .tabs::before { content: ""; grid-row: 1; grid-column: 1 / -1; margin: -4px; border-radius: 999px; background: var(--sunken); }
  .tabs label { display: contents; }
  .tabs label b { position: relative; grid-row: 1; grid-column: 1; padding: 11px 0; border-radius: 999px; text-align: center; font-size: 1rem; transition: background-color 0.3s var(--ease); }
  .tabs label:nth-of-type(2) b { grid-column: 2; }
  .tabs label:nth-of-type(3) b { grid-column: 3; }
  .tabs label span { grid-row: 2; grid-column: 1 / -1; display: none; min-height: calc(3lh + 18px); padding: 18px 8px 0; text-align: center; }
  .tabs input:checked + label b { background: var(--surface); box-shadow: 0 1px 3px rgb(16 35 31 / 0.12); }
  .tabs input:checked + label span { display: block; }
  .tabs input:focus-visible + label b { outline: 3px solid var(--neck); outline-offset: 1px; }
  .tabs label:hover { background: none; }
  .tabs input:checked + label { background: none; }
  .phone { width: min(72vw, 300px); margin-top: 28px; }
  .phone-frame { border-radius: 44px; padding: 8px; }
  .shot { border-radius: 36px; }
}

/* ---------------------------------------------------------------- everywhere (always the dark theme's values) */
.everywhere { padding: 0 var(--gutter); }
.everywhere-in {
  width: auto; max-width: calc(var(--max) + 2 * var(--gutter)); padding: clamp(40px, 7vw, 88px);
  border-radius: clamp(28px, 4vw, 44px); background: var(--d-ground); color: var(--d-ink);
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: center;
}
@media (prefers-color-scheme: dark) { .everywhere-in { background: #070d0c; box-shadow: inset 0 0 0 1px var(--d-hairline); } }
.everywhere-copy p { margin-top: 18px; color: var(--d-muted); font-size: 1.12rem; max-width: 26em; }
.devices { display: grid; grid-template-columns: auto 150px minmax(0, 1fr); grid-template-areas: "watch live live" "watch widget siri"; gap: 16px; align-items: stretch; }
.devices .pl { color: var(--d-upright); }
.dev-watch { grid-area: watch; align-self: center; padding: 10px; border-radius: 52px; background: #1d2522; box-shadow: inset 0 0 0 2px #2d3834, 0 20px 40px -20px #000; }
.watch-face { width: 168px; height: 204px; border-radius: 42px; background: #000; padding: 22px 18px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr auto; column-gap: 10px; }
/* fixed sizes: in these grids Safari gives a line with height: 100% almost no room */
.w-pl { grid-row: span 2; height: 158px; aspect-ratio: 0.6886; }
.w-share { align-self: end; font: 850 2.6rem/1 var(--display); letter-spacing: -0.03em; }
.w-unit { font-size: 0.8rem; color: var(--d-muted); line-height: 1.2; }
.dev-live { grid-area: live; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px 22px; border-radius: 28px; background: rgb(255 255 255 / 0.08); }
.la-pl { height: 96px; }
.la-state { font: 700 1.1rem/1.2 var(--display); }
.la-share { color: var(--d-muted); font-size: 0.92rem; margin-bottom: 12px; }
.dev-live .ribbon { height: 18px; }
.dev-live .ribbon .rb-off { fill: var(--d-hairline); }
.dev-live .ribbon .rb-up { fill: var(--d-upright); }
.dev-live .ribbon .rb-sl { fill: var(--d-slouch); }
.dev-live .ribbon .rb-nk { fill: var(--d-neck); }
.dev-widget { grid-area: widget; width: 150px; height: 150px; padding: 16px; border-radius: 30px; background: var(--d-surface); display: grid; grid-template-columns: auto 1fr; align-items: end; }
.wg-pl { height: 116px; aspect-ratio: 0.6006; align-self: end; }
.dev-widget p { justify-self: end; font: 850 1.9rem/1 var(--display); letter-spacing: -0.03em; }
.dev-siri { grid-area: siri; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.siri-q { align-self: flex-end; padding: 10px 16px; border-radius: 20px 20px 6px 20px; background: rgb(255 255 255 / 0.1); font-size: 0.95rem; }
.siri-a { align-self: flex-start; padding: 12px 16px; border-radius: 20px 20px 20px 6px; background: linear-gradient(120deg, #1a3a52, #2d2350 55%, #3d2236); font-size: 0.98rem; line-height: 1.4; }
.devices > div { opacity: 1; }
.devices.armed > div { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.8s var(--spring); }
.devices.armed.in > div { opacity: 1; transform: none; }
.devices.armed.in > div:nth-child(2) { transition-delay: 0.1s; }
.devices.armed.in > div:nth-child(3) { transition-delay: 0.2s; }
.devices.armed.in > div:nth-child(4) { transition-delay: 0.3s; }
@media (max-width: 900px) {
  .everywhere-in { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .devices { grid-template-columns: 1fr 1fr; grid-template-areas: "live live" "watch widget" "siri siri"; }
  .dev-watch { justify-self: center; padding: 7px; border-radius: 40px; }
  .watch-face { width: 124px; height: 152px; border-radius: 33px; padding: 16px 13px; }
  .w-share { font-size: 1.9rem; }
  .w-pl { height: 118px; }
  .wg-pl { height: 92px; }
  .dev-widget { width: auto; max-width: 150px; height: auto; aspect-ratio: 1; justify-self: center; align-self: center; }
  .la-pl { height: 76px; }
}

/* ---------------------------------------------------------------- privacy: what stays, what can leave */
.private { padding: clamp(90px, 12vw, 160px) 0; }
.private h2 { max-width: 13em; }
.private-in { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.private-label { font: 800 1.3rem/1.2 var(--display); letter-spacing: -0.01em; }
.private-phone { position: relative; min-height: 440px; padding: 70px clamp(24px, 3vw, 36px) 32px; border-radius: 52px; box-shadow: inset 0 0 0 3px var(--ink); display: flex; flex-direction: column; }
.private-phone::before { content: ""; position: absolute; top: 18px; left: 50%; width: 76px; height: 22px; border-radius: 999px; background: var(--ink); transform: translateX(-50%); }
.private-phone ul { list-style: none; margin: 14px 0 24px; padding: 0; }
.private-phone li { padding: 12px 0; border-top: 1px solid var(--hairline); font-size: 1.08rem; }
.private-pl { height: 120px; margin-top: auto; align-self: flex-end; }
.private-out dl { margin: 14px 0 0; }
.private-out dl > div { padding: 16px 0 18px; border-top: 1px solid var(--hairline); }
.private-out dt { font: 700 1.12rem/1.3 var(--display); }
.private-out dd { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; max-width: 34em; }
.private-out > p:last-child { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 1.05rem; }
.private-out .text-link { margin-top: 12px; display: block; width: fit-content; }
.text-link { display: inline-block; font: 700 1.05rem/1.2 var(--display); color: var(--upright); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.text-link:hover { text-decoration-thickness: 3px; }
@media (max-width: 760px) {
  .private-in { grid-template-columns: 1fr; }
  .private-phone { min-height: 0; border-radius: 44px; }
  .private-pl { position: absolute; right: 26px; bottom: 26px; height: 92px; }
  .private-phone ul { margin-bottom: 0; margin-right: 56px; }
}

/* ---------------------------------------------------------------- why */
.why { padding: 0 0 clamp(90px, 12vw, 150px); }
.why-in { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(24px, 6vw, 80px); padding-top: clamp(60px, 8vw, 100px); border-top: 1px solid var(--hairline); }
.why-note p { font: 600 clamp(1.3rem, 2.3vw, 1.8rem)/1.4 var(--display); letter-spacing: -0.012em; max-width: 26em; }
.why-note p + p { margin-top: 0.8em; }
.why-note .why-sign { margin-top: 1.4em; font-weight: 800; color: var(--upright); }
@media (max-width: 720px) { .why-in { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- needs */
.needs { padding-bottom: clamp(90px, 12vw, 150px); }
.needs-list { margin: 40px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 5vw, 64px); }
.needs-list > div { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; padding: 22px 0; border-top: 1px solid var(--hairline); }
.needs-list dt { font: 800 1.15rem/1.3 var(--display); }
.needs-list dd { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .needs-list { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .needs-list > div { grid-template-columns: 1fr; gap: 4px; } }

/* ---------------------------------------------------------------- final call */
.cta { padding: 0 var(--gutter) clamp(60px, 8vw, 100px); }
.cta-in { width: auto; max-width: calc(var(--max) + 2 * var(--gutter)); display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(56px, 8vw, 100px) var(--gutter); border-radius: clamp(28px, 4vw, 44px); background: var(--upright-tint); }
.cta-pl { height: 150px; margin-bottom: 30px; }
.cta h2 { max-width: 12em; margin-bottom: 30px; }
.cta .stores { justify-content: center; }
.cta .price { text-align: center; }

/* ---------------------------------------------------------------- footer */
.foot { border-top: 1px solid var(--hairline); padding: 40px 0 48px; color: var(--muted); font-size: 0.93rem; }
.foot-in { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: center; }
.foot-mark { display: flex; align-items: center; gap: 14px; }
.foot-line { height: 36px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-nav a { text-decoration: none; color: var(--ink); font-weight: 500; }
.foot-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot-legal { grid-column: 1 / -1; font-size: 0.82rem; }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- documents: privacy, support */
.doc { width: min(720px, 100% - 2 * var(--gutter)); margin-inline: auto; padding: clamp(48px, 8vw, 96px) 0 clamp(80px, 10vw, 120px); }
.doc-head { display: grid; grid-template-columns: auto 1fr; gap: 0 22px; align-items: end; margin-bottom: 44px; }
.doc-head .pl { grid-row: span 2; height: 108px; }
.doc h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 850; letter-spacing: -0.03em; }
.doc-date { margin-top: 10px; color: var(--muted); }
.doc h2 { font-size: 1.5rem; margin: 44px 0 12px; }
.doc p, .doc li { font-size: 1.08rem; line-height: 1.65; }
.doc p + p { margin-top: 14px; }
.doc ul { padding-left: 1.2em; margin: 12px 0 0; }
.doc li + li { margin-top: 6px; }
.doc .short { padding: 24px 26px; border-radius: 24px; background: var(--upright-tint); font-size: 1.18rem; font-weight: 500; }
.doc a:not(.store) { color: var(--upright); text-underline-offset: 3px; }

.faq { margin-top: 12px; border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; cursor: pointer; font: 700 1.15rem/1.3 var(--display); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 15px; height: 15px; color: var(--muted);
  background: linear-gradient(currentColor, currentColor) center / 100% 2.5px no-repeat, linear-gradient(currentColor, currentColor) center / 2.5px 100% no-repeat;
  border-radius: 2px; transition: transform 0.4s var(--spring), color 0.2s;
}
.faq summary:hover::after { color: var(--ink); }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--ink); }
.faq details::details-content { height: 0; overflow: clip; transition: height 0.4s var(--ease), content-visibility 0.4s allow-discrete; }
.faq details[open]::details-content { height: auto; }
.faq details > div { opacity: 0; transition: opacity 0.3s var(--ease); }
.faq details[open] > div { opacity: 1; }
:root { interpolate-size: allow-keywords; }
.faq details > div { padding: 0 0 22px; color: var(--muted); }
.faq details > div p { font-size: 1.04rem; }

/* The form is ruled rows on the page, like the questions above it: no card, no boxes inside it. */
.form { margin-top: 18px; }
.rows { border-top: 1px solid var(--hairline); }
.row { position: relative; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); align-items: baseline; gap: 4px 16px; margin: 0; padding: 6px 14px; min-width: 0; border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; transition: background-color 0.2s, border-radius 0.2s, box-shadow 0.2s; }
.row > label, .row-label { font: 700 1.05rem/1.2 var(--display); padding: 0; }
.row-topic { align-items: center; }
.row input[type="email"], .row textarea {
  width: 100%; min-height: 52px; padding: 14px 0; margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 1.08rem; outline: none; -webkit-appearance: none; appearance: none;
}
.row textarea { min-height: 9.5em; resize: vertical; line-height: 1.5; field-sizing: content; max-height: 24em; }
.row-msg { align-items: start; }
.row-msg > label { padding-top: 15px; }
.row:focus-within { background: var(--surface); border-radius: 16px; border-bottom-color: transparent; box-shadow: 0 0 0 3px var(--neck); z-index: 1; }
.row:has(+ .row:focus-within) { border-bottom-color: transparent; }
@media (hover: hover) { .row:not(:focus-within):hover { background: color-mix(in srgb, var(--surface) 55%, transparent); } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chips span {
  display: inline-grid; place-items: center; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  box-shadow: inset 0 0 0 2px var(--border); font: 700 0.98rem/1 var(--display);
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.25s var(--spring);
}
.chips label:hover span { box-shadow: inset 0 0 0 2px var(--ink); }
.chips label:active span { transform: scale(0.95); }
.chips input:checked + span { background: var(--ink); color: var(--ground); box-shadow: none; }
.chips input:focus-visible + span { outline: 3px solid var(--neck); outline-offset: 2px; }
.row-topic:focus-within { background: none; box-shadow: none; border-bottom-color: var(--hairline); }

.row-file { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-block: 14px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; cursor: pointer; }
.file-pick svg { width: 44px; height: 44px; padding: 10px; border-radius: 14px; background: var(--upright-tint); fill: none; stroke: var(--upright); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.3s var(--spring); }
.file-pick:hover svg { transform: translateY(-2px); }
.file-text b { display: block; font: 700 1.05rem/1.3 var(--display); overflow-wrap: anywhere; }
.file-text > span { display: block; margin-top: 3px; color: var(--muted); font: 400 0.95rem/1.45 var(--text); }
.row-file.has-file .file-pick svg { background: var(--upright); stroke: var(--on-upright); }
.row-file.drag { background: var(--upright-tint); border-radius: 16px; box-shadow: 0 0 0 2px var(--upright); }
.file-clear { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.file-clear:hover { background: var(--sunken); color: var(--ink); }
.file-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.file-clear[hidden] { display: none; }

.doc .row-err { grid-column: 2; margin: -4px 0 10px; font-weight: 600; font-size: 0.95rem; display: flex; gap: 8px; align-items: center; }
.row-err::before { content: "!"; flex: none; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--ground); font: 800 0.75rem/1 var(--display); }
.row-err:empty { display: none; }
.doc .row-file .row-err { grid-column: 1 / -1; margin: 10px 0 0 58px; }
.row.bad { border-bottom: 2px solid var(--ink); }

.send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.send-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 16px 30px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--upright); color: var(--on-upright); font: 800 1.08rem/1 var(--display); letter-spacing: -0.005em;
  transition: transform 0.25s var(--spring), opacity 0.2s;
}
.send-btn:hover { transform: translateY(-2px); }
.send-btn:active { transform: scale(0.97); }
.send-btn:disabled { cursor: progress; opacity: 0.75; transform: none; }
.send-btn:disabled::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(1turn); } }
.form-status { font-weight: 600; }
.form-status:empty { display: none; }
.doc .form-note { margin-top: 22px; color: var(--muted); font-size: 0.95rem; line-height: 1.5; }

.sent-inline { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; margin-top: 24px; padding: 28px 30px; border-radius: 28px; background: var(--upright-tint); outline: none; }
.sent-inline[hidden] { display: none; }
.sent-pl { height: 96px; }
.sent-inline h3 { font-size: 1.7rem; }
.sent-inline p { margin-top: 6px; overflow-wrap: anywhere; }

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; gap: 0; padding: 10px 12px 4px; }
  .row-label { padding-top: 4px; }
  .row input[type="email"], .row textarea { padding-top: 8px; }
  .row-msg > label { padding-top: 4px; }
  .doc .row-err { grid-column: 1; }
  .row-file { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 12px; }
  .chips { padding-top: 8px; }
  .send-btn { width: 100%; justify-content: center; }
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sent { text-align: center; padding: 30px 0; }
.sent .pl { height: 120px; margin: 0 auto 24px; }

.lost { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px var(--gutter); }
.lost .pl { height: 150px; margin: 0 auto 30px; }
.lost p { margin: 14px 0 28px; color: var(--muted); }
.lost .store { display: inline-flex; }

/* ---------------------------------------------------------------- reduced motion: cross-fades only */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .stage-line { transition: opacity 0.4s; }
  .send-btn:disabled::before { animation: none; border-right-color: currentColor; opacity: 0.5; }
  .toy-arcs, .taps { display: none; }
  .note-banner { transition: opacity 0.3s; transform: translate(-50%, 0); }
  .devices.armed > div { transform: none; transition: opacity 0.5s; }
  .stage[data-step="calibrate"] .ring-fill { stroke-dashoffset: 0; }
}
.lost h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 850; letter-spacing: -0.03em; }
.lost .pl[data-pose="neck"] { color: var(--neck); }
