/* getspotline.app. Tokens mirror the Spotline app (lib/core/theme in the trainer repo); see DESIGN.md. */

@font-face { font-family: "Barlow Condensed"; src: url("/fonts/BarlowCondensed-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/BarlowCondensed-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Manrope; src: url("/fonts/Manrope-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Manrope; src: url("/fonts/Manrope-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url("/fonts/Manrope-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Manrope; src: url("/fonts/Manrope-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --bg: #0E0F0C;
  --surface: #191B16;
  --surface-2: #23261F;
  --text: #F3F4EE;
  --muted: #A6AA9E;
  --line: #2D3028;
  --accent: #C6F432;
  --accent-hover: #D4FA5C;
  --ink: #C6F432;
  --on-accent: #121410;
  --danger: #FF6B6F;
  --shadow: 0 48px 96px -32px rgb(0 0 0 / 0.7);

  /* Training-day colors, as in the app. */
  --push: #C6F432;
  --pull: #9DC2FF;
  --legs: #FFA27F;
  --upper: #CDB0FF;
  --lower: #FFD66B;
  --full: #7FE0C4;

  --r-chip: 999px;
  --r-sm: 12px;
  --r-md: 14px;
  --r-btn: 16px;
  --r-card: 18px;
  --r-panel: 20px;
  --r-media: 22px;
  --r-hero: 28px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-press: 110ms;
  --t-quick: 180ms;
  --t-std: 260ms;
  --t-space: 420ms;
  --t-reveal: 600ms;
  --t-hero: 900ms;
  --t-busy: 1100ms;

  --max: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: Manrope, "Segoe UI", system-ui, sans-serif;

  color-scheme: dark;
  interpolate-size: allow-keywords;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F5EF;
    --surface: #FFFFFF;
    --surface-2: #E9EBE2;
    --text: #121410;
    --muted: #565B51;
    --line: #D9DCD0;
    --accent-hover: #B8E61F;
    --ink: #3F5C00;
    --danger: #C4282D;
    --shadow: 0 48px 96px -40px rgb(18 20 16 / 0.35);
    color-scheme: light;
  }
}

/* The phone and the closing plate always use the app's dark theme. */
.theme-dark {
  --surface: #191B16;
  --surface-2: #23261F;
  --text: #F3F4EE;
  --muted: #A6AA9E;
  --line: #2D3028;
  --ink: #C6F432;
  --accent-hover: #D4FA5C;
  --danger: #FF6B6F;
  color-scheme: dark;
  color: var(--text);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, fieldset, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
legend { padding: 0; }
img { max-width: 100%; display: block; }
svg { width: 1em; height: 1em; fill: currentColor; flex: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
p { text-wrap: pretty; }

.display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-wrap: balance;
  font-feature-settings: "tnum";
}

.skip {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 20;
  padding: 12px 16px;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
  translate: 0 -200%;
}
.skip:focus-visible { translate: 0 0; outline: 2px solid var(--text); outline-offset: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-color-scheme: light) { :focus-visible { outline-color: var(--ink); } }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  inset: 12px 0 auto;
  z-index: 10;
  pointer-events: none;
}
.nav-bar {
  container: nav / inline-size;
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav .brand {
  pointer-events: auto;
  padding: 8px 16px 8px 8px;
  border-radius: var(--r-chip);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--text) 8%, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.25rem;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.nav .nav-join {
  min-height: 48px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  visibility: hidden;
  transition: opacity var(--t-quick) var(--ease-in), transform var(--t-quick) var(--ease-in), visibility 0s var(--t-quick);
}
.nav-join.is-shown {
  pointer-events: auto;
  opacity: 1;
  transform: none;
  visibility: visible;
  transition: opacity var(--t-std) var(--ease-out), transform var(--t-std) var(--ease-out), visibility 0s;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: background-color var(--t-quick) var(--ease-out), transform var(--t-press) var(--ease-out);
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.btn-sm { min-height: 44px; padding: 0 18px; border-radius: var(--r-chip); font-size: 0.875rem; }
.btn.is-busy { cursor: progress; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--on-accent);
  transform-origin: left;
  animation: busy var(--t-busy) cubic-bezier(0.65, 0, 0.35, 1) infinite;
  @media (prefers-reduced-motion: reduce) { animation: busy-still var(--t-busy) ease-in-out infinite alternate; }
}
@keyframes busy {
  from { transform: translateX(-40%) scaleX(0.4); }
  to { transform: translateX(100%) scaleX(0.4); }
}
@keyframes busy-still { from { opacity: 0.35; } to { opacity: 1; } }
.link-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--t-quick) var(--ease-out);
}
.link-btn:hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 80px var(--gutter) 0; }
.hero-plate {
  position: relative;
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 48px;
  min-height: min(780px, max(640px, 100svh - 104px));
  padding: 64px 64px 0;
  border-radius: var(--r-hero);
  background: var(--surface);
  overflow: clip;
}
.hero-copy { align-self: center; padding-bottom: 64px; }
.hero-title { font-size: clamp(3.5rem, 6.4vw, 5.75rem); max-width: 680px; }
.lede {
  margin-top: 24px;
  max-width: 34em;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.6;
}
.hero-visual { position: relative; min-height: 560px; container-type: size; }

/* ---------- Join form ---------- */
.join { margin-top: 32px; max-width: 560px; container-type: inline-size; }
/* A narrow form stacks the button under the field, so the placeholder is never cut off. */
@container (max-width: 420px) {
  .field-row { flex-direction: column; }
  .field-row .btn { width: 100%; }
}

/* Phones only: the hero phone sits below the fold there, so this strip shows the replan in view. */
.plan-strip {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 16px 8px 8px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  view-transition-name: plan-strip;
}
.plan-strip-day {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: calc(var(--r-md) - 8px);
  background: var(--day);
  color: var(--on-accent);
  font-size: 1.25rem;
  flex: none;
  transition: background-color var(--t-std) var(--ease-out);
}
.plan-strip-text { display: grid; gap: 2px; min-width: 0; }
.plan-strip-text b { font-size: 0.9375rem; font-weight: 700; line-height: 1.3; }
.plan-strip-text small { color: var(--muted); font-size: 0.8125rem; font-weight: 600; line-height: 1.35; text-wrap: pretty; }
.goals legend, .field-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.875rem;
  font-weight: 700;
}
.optional { margin-left: 4px; color: var(--muted); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; cursor: pointer; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: var(--r-chip);
  background: var(--surface-2);
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background-color var(--t-quick) var(--ease-out), color var(--t-quick) var(--ease-out), transform var(--t-press) var(--ease-out);
}
.chip span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--day);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.12);
  transition: transform var(--t-std) var(--ease-spring);
}
.chip:has(input[value="muscle"]) { --day: var(--push); }
.chip:has(input[value="strength"]) { --day: var(--lower); }
.chip:has(input[value="fat"]) { --day: var(--full); }
.chip:has(input[value="restart"]) { --day: var(--upper); }
.chip:hover span { background: color-mix(in oklab, var(--surface-2), var(--text) 8%); }
.chip:active span { transform: scale(0.97); }
.chip input:checked + span { background: var(--day); color: var(--on-accent); }
.chip input:checked + span::before { background: var(--on-accent); transform: scale(0.6); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-color-scheme: light) { .chip input:focus-visible + span { outline-color: var(--ink); } }

.goals ~ .field { margin-top: 24px; }
.field-row {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: var(--r-panel);
  background: var(--surface-2);
  transition: box-shadow var(--t-quick) var(--ease-out);
}
.field-row:focus-within { box-shadow: 0 0 0 2px var(--accent); }
@media (prefers-color-scheme: light) { .field-row:focus-within { box-shadow: 0 0 0 2px var(--ink); } }
.field-row:has(:is(input:user-invalid, .user-invalid-fallback)) { box-shadow: 0 0 0 2px var(--danger); }
.field-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
}
.field-row input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.field-row input:focus { outline: none; }
.field-row .btn:focus-visible { outline-offset: 2px; }

.error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
}
.error svg { font-size: 1.125rem; margin-top: 1px; }
.field:has(:is(input:user-invalid, .user-invalid-fallback)) .error:not(.error-server) { display: flex; }
.error-server:not([hidden]) { display: flex; }
.fine { margin-top: 16px; color: var(--muted); font-size: 0.875rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Confirmation. In the two-column hero the form keeps its height, so the panel sits in its middle. */
.join.is-joined { display: grid; align-content: center; }
.joined {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 16px 20px;
  border-radius: var(--r-panel);
  background: var(--surface-2);
}
.joined:focus { outline: none; }
.joined:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.joined-check {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.joined-check svg { width: 24px; height: 24px; fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.joined-title { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.joined-body { margin-top: 4px; color: var(--muted); font-size: 0.9375rem; }
.joined-body b { color: var(--text); font-weight: 700; overflow-wrap: break-word; }
.joined .link-btn { margin-top: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .joined { animation: rise var(--t-space) var(--ease-out) both; }
  .joined-check { animation: pop var(--t-space) var(--ease-spring) 60ms both; }
  .joined-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw var(--t-std) var(--ease-out) 240ms forwards; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- The phone ---------- */
/* Two-column hero: the plate's bottom edge always cuts the phone between its last exercise and its
   tab bar, 12.8% of the phone's height from its foot. The phone shrinks when the plate is short. */
.phone {
  --phone-w: min(344px, 100cqw, (100cqh - 40px) * 0.529);
  position: absolute;
  bottom: calc(var(--phone-w) * -0.2773);
  left: 50%;
  translate: -50% 0;
  width: var(--phone-w);
  aspect-ratio: 9 / 19.5;
  padding: 9px;
  border-radius: 54px;
  background: #0A0B08;
  box-shadow: 0 0 0 1.5px #3A3D35, var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .phone { animation: phone-in var(--t-hero) var(--ease-out) 150ms both; }
}
@keyframes phone-in { from { opacity: 0; transform: translateY(64px); } }

.screen {
  container-type: inline-size;
  position: relative;
  height: 100%;
  overflow: clip;
  border-radius: 45px;
  background: #121410;
  color: #F3F4EE;
  font-family: var(--font-body);
  line-height: 1.25;
  user-select: none;
}
.plan-strip[data-d="push"], .screen [data-d="push"] { --day: var(--push); }
.screen [data-d="pull"] { --day: var(--pull); }
.screen [data-d="legs"] { --day: var(--legs); }
.plan-strip[data-d="upper"], .screen [data-d="upper"] { --day: var(--upper); }
.plan-strip[data-d="lower"], .screen [data-d="lower"] { --day: var(--lower); }
.plan-strip[data-d="full"], .screen [data-d="full"] { --day: var(--full); }

.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 15cqi;
  padding: 2cqi 8cqi 0 11cqi;
  font-weight: 700;
  font-size: 4.4cqi;
}
.island { width: 30cqi; height: 9cqi; border-radius: 99px; background: #000; }
.sys { display: flex; gap: 1.6cqi; align-items: center; }
.sys .sig { width: 5cqi; height: 3.4cqi; }
.sys .bat { width: 7cqi; height: 3.4cqi; }
.app-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3cqi 5cqi 0;
}
.app-day { color: #A6AA9E; font-size: 3.3cqi; }
.app-hey { margin-top: 0.4cqi; font-family: var(--font-display); font-weight: 800; font-size: 7cqi; line-height: 1; }
.app-avatar { display: grid; place-items: center; width: 10.6cqi; height: 10.6cqi; border-radius: 50%; background: #23261F; font-size: 5cqi; }
.week {
  margin: 4cqi 5cqi 0;
  padding: 3.6cqi;
  border-radius: 4.4cqi;
  background: #191B16;
  box-shadow: inset 0 0 0 1px #2D3028;
}
.week-head { display: flex; justify-content: space-between; font-size: 3.4cqi; font-weight: 600; }
.week-done { color: #A6AA9E; font-weight: 500; }
.week-dots { display: grid; grid-template-columns: repeat(7, 1fr); margin-top: 3cqi; text-align: center; }
.week-dots li { display: grid; justify-items: center; gap: 1.6cqi; font-size: 3cqi; font-weight: 700; color: #A6AA9E; }
.week-dots i {
  display: block;
  width: 8cqi;
  height: 8cqi;
  border-radius: 50%;
  border: 0.55cqi solid var(--day, #3A3D35);
  transition: background-color var(--t-std) var(--ease-out), border-color var(--t-std) var(--ease-out);
}
.week-dots li[data-d="rest"] i { border-style: dashed; border-color: #3A3D35; }
.week-dots li.today { color: #F3F4EE; }
.week-dots li.today i { background: var(--day); border-color: #F3F4EE; }
.today-card {
  margin: 4cqi 5cqi 0;
  padding: 5cqi 5cqi 5cqi;
  border-radius: 6cqi;
  background: var(--day);
  color: #121410;
  view-transition-name: today-card;
}
.today-label { font-size: 2.8cqi; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.today-name {
  margin-top: 1.6cqi;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12.5cqi;
  line-height: 0.9;
  text-transform: uppercase;
  view-transition-name: today-name;
}
.today-meta { margin-top: 1.4cqi; font-size: 3.6cqi; font-weight: 600; view-transition-name: today-meta; }
.today-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.6cqi;
  height: 13cqi;
  margin-top: 4.4cqi;
  border-radius: 4.2cqi;
  background: #121410;
  color: #F3F4EE;
  font-size: 4cqi;
  font-weight: 700;
}
.today-start svg { font-size: 3.6cqi; }
.ex-head {
  display: flex;
  justify-content: space-between;
  margin: 7cqi 5cqi 0;
  color: #A6AA9E;
  font-size: 3cqi;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.ex-all { color: #C6F432; letter-spacing: 0; text-transform: none; font-weight: 700; font-size: 3.3cqi; }
.ex { margin: 3cqi 5cqi 0; display: grid; gap: 2.4cqi; view-transition-name: ex-list; }
.ex li { display: flex; align-items: center; gap: 3.4cqi; }
.ex-thumb { display: grid; place-items: center; width: 11.6cqi; height: 11.6cqi; border-radius: 3cqi; background: #23261F; color: #A6AA9E; font-size: 5.6cqi; flex: none; }
.ex-text { display: grid; gap: 0.6cqi; flex: 1; min-width: 0; }
.ex-text b { font-size: 3.9cqi; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-text small { color: #A6AA9E; font-size: 3.2cqi; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-go { color: #A6AA9E; font-size: 4.2cqi; }
.today-tip { display: flex; align-items: center; gap: 1.4cqi; margin-top: 2.4cqi; font-size: 3.4cqi; font-weight: 800; view-transition-name: today-tip; }
.today-tip svg { font-size: 3.4cqi; }
.ex-tip { display: flex; align-items: center; gap: 1.2cqi; min-width: 0; margin-top: 0.4cqi; color: #C6F432; font-size: 3cqi; font-weight: 600; }
.ex-tip svg { font-size: 3cqi; }
.ex-tip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbar {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 3cqi 2cqi 7cqi;
  background: #141612;
  box-shadow: 0 -1px 0 #2D3028;
  color: #A6AA9E;
  font-size: 2.9cqi;
  font-weight: 600;
  text-align: center;
}
.tabbar span { display: grid; justify-items: center; gap: 1cqi; }
.tabbar svg { font-size: 6cqi; }
.tabbar .on { color: #C6F432; }

/* Replanning. Only the phone parts and the plan strip are captured, and clicks pass through the
   overlay, so a second goal tap during the change is never lost. */
:root { view-transition-name: none; }
::view-transition { pointer-events: none; }
::view-transition-group(today-card),
::view-transition-group(ex-list),
::view-transition-group(plan-strip),
::view-transition-group(today-name),
::view-transition-group(today-meta),
::view-transition-group(today-tip) { animation-duration: var(--t-space); animation-timing-function: var(--ease-out); }
::view-transition-old(ex-list) { animation: 160ms var(--ease-in) both vt-out; }
::view-transition-new(ex-list) { animation: 360ms var(--ease-out) 160ms both vt-in; }
::view-transition-old(today-name) { animation: 140ms var(--ease-in) both vt-out; }
::view-transition-new(today-name) { animation: 320ms var(--ease-out) 140ms both vt-in; }
::view-transition-old(today-meta), ::view-transition-old(today-tip) { animation: 140ms var(--ease-in) both vt-out; }
::view-transition-new(today-meta), ::view-transition-new(today-tip) { animation: 320ms var(--ease-out) 140ms both vt-in; }
::view-transition-old(plan-strip) { animation: 160ms var(--ease-in) both vt-out; }
::view-transition-new(plan-strip) { animation: 360ms var(--ease-out) 160ms both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 0.18s !important; animation-name: -ua-view-transition-fade-in, -ua-view-transition-fade-out; }
  ::view-transition-old(*) { animation-name: vt-fade-out !important; }
  ::view-transition-new(*) { animation-name: vt-fade-in !important; }
}
@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
.replanned { animation: replan var(--t-space) var(--ease-out); }
@keyframes replan { from { opacity: 0.4; transform: translateY(6px); } }

/* ---------- Statement ---------- */
.statement {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 160px 0 128px;
}
.statement-text { max-width: 1040px; font-size: clamp(2.25rem, 5.2vw, 4.5rem); line-height: 0.98; text-wrap: pretty; }
.statement-text .w { color: color-mix(in oklab, var(--text) 26%, transparent); transition: color var(--t-reveal) var(--ease-out); }
.statement-text .w.lit { color: var(--text); }

/* ---------- Sections ---------- */
.section {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding-block: 64px;
}
.section-head { margin-bottom: 40px; }
.h2 { font-size: clamp(2.5rem, 5vw, 4rem); max-width: 16ch; }
.section-lede { margin-top: 16px; color: var(--muted); font-size: 1.125rem; }
.section-lede a { overflow-wrap: anywhere; color: var(--text); font-weight: 700; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.section-lede a:hover { color: var(--ink); }

/* Bento of real screens */
.bento {
  display: grid;
  grid-template-columns: 5fr 4fr 3fr;
  grid-template-rows: 440px 440px;
  grid-template-areas:
    "log chat chat"
    "log prog facts";
  gap: 16px;
}
.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 32px 32px 0;
  border-radius: var(--r-hero);
  background: var(--surface);
  overflow: clip;
}
.tile h3 { font-size: 1.375rem; font-weight: 800; line-height: 1.25; text-wrap: balance; }
.tile p { margin-top: 8px; color: var(--muted); font-size: 1rem; max-width: 34ch; }
.shot { flex: 1; min-height: 0; margin-top: 32px; display: flex; justify-content: center; }
.shot img {
  width: 100%;
  max-width: 400px;
  height: auto;
  align-self: flex-start;
  border-radius: var(--r-media) var(--r-media) 0 0;
  background: #121410;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.06);
}
.tile-log { grid-area: log; }
.tile-log .shot img { max-width: 420px; }
.tile-chat { grid-area: chat; display: grid; grid-template-columns: 1fr minmax(0, 320px); gap: 32px; padding-right: 48px; }
.tile-chat .tile-text { align-self: center; padding-bottom: 32px; }
.tile-chat .shot { margin-top: 0; }
.tile-progress { grid-area: prog; }
.tile-facts {
  grid-area: facts;
  display: grid;
  grid-auto-rows: 1fr;
  gap: 8px;
  padding: 0;
  background: none;
  border-radius: 0;
}
.tile-facts li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-panel);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}
.tile-facts b { display: block; margin-bottom: 4px; color: var(--text); font-size: 0.9375rem; font-weight: 800; line-height: 1.3; }
.fact-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--ink); font-size: 1.25rem; flex: none; }

/* Steps: a real sequence */
.step-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: none; }
.step-list li { padding: 28px; border-radius: var(--r-panel); background: var(--surface); }
.step-n { display: block; font-family: var(--font-display); font-weight: 800; font-size: 3rem; line-height: 1; color: var(--ink); }
.step-list h3 { margin-top: 24px; font-size: 1.125rem; font-weight: 800; line-height: 1.3; text-wrap: balance; }
.step-list p { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; line-height: 1.55; }

/* FAQ */
.faq { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; align-items: start; }
.faq-side { position: sticky; top: 96px; }
.faq-list { display: grid; gap: 8px; }
.faq details { border-radius: var(--r-panel); background: var(--surface); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 16px 24px;
  border-radius: var(--r-panel);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  transition: color var(--t-quick) var(--ease-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--ink); }
.faq summary:focus-visible { outline-offset: -2px; }
.faq summary svg { font-size: 1.25rem; color: var(--muted); transition: transform var(--t-std) var(--ease-out); }
.faq details[open] summary svg { transform: rotate(45deg); color: var(--ink); }
.answer { padding: 0 24px 24px; }
.answer p { color: var(--muted); max-width: 62ch; }
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .faq details::details-content {
      block-size: 0;
      overflow: clip;
      transition: block-size var(--t-std) var(--ease-out), content-visibility var(--t-std) allow-discrete;
    }
    .faq details[open]::details-content { block-size: auto; }
  }
}

/* Closing */
.closing-plate {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding: 64px;
  border-radius: var(--r-hero);
  background: #191B16;
  overflow: clip;
}
.closing-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 2.75rem;
}
.closing-form .join { margin-top: 0; }

/* Footer */
.footer { padding: 32px var(--gutter) 48px; }
.footer-inner {
  width: min(var(--max), 100%);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  color: var(--muted);
  font-size: 0.875rem;
}
.footer-note { flex: 1 1 320px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-chip);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: background-color var(--t-quick) var(--ease-out);
}
.footer-links a:hover { background: var(--surface-2); }

/* ---------- Narrower screens ---------- */
/* Between the one-row width and the phone layout, four chips wrap 3 + 1; two even rows read better. */
@media (min-width: 761px) and (max-width: 1279px) {
  .chips { display: grid; grid-template-columns: repeat(2, max-content); }
}

@media (max-width: 1080px) {
  .hero-plate { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); padding: 48px 40px 0; gap: 32px; }
  .bento { grid-template-columns: 1fr 1fr; grid-template-rows: 520px 440px auto; grid-template-areas: "log chat" "log prog" "facts facts"; }
  .tile-chat { grid-template-columns: 1fr; padding-right: 32px; gap: 0; }
  .tile-chat .tile-text { padding-bottom: 0; }
  .tile-chat .shot { margin-top: 32px; }
  .tile-facts { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; }
  .step-list { grid-template-columns: repeat(2, 1fr); }
  .closing-plate { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

@media (max-width: 820px) {
  .hero { padding-top: 72px; }
  .hero-plate { padding: 40px 32px 0; gap: 24px; }
  .hero-copy { padding-bottom: 40px; }
  .statement { padding: 112px 0 80px; }
  .bento { grid-template-columns: 1fr; grid-template-rows: none; grid-template-areas: "log" "chat" "prog" "facts"; }
  .tile { min-height: 0; }
  .shot { max-height: 400px; overflow: hidden; }
  .tile-log .shot { max-height: 460px; }
  .tile-facts { grid-template-columns: 1fr; }
  .faq { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .faq-side { position: static; }
  .closing-plate { grid-template-columns: 1fr; padding: 40px 24px; gap: 32px; }
  .closing-mark { width: 64px; height: 64px; margin-bottom: 24px; font-size: 2.5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-note { flex: none; }
  .footer-links { margin-inline-start: -12px; }
}

/* Short desktop windows: less air around the hero so the whole form stays on screen. */
@media (min-width: 761px) and (max-height: 760px) {
  .hero { padding-top: 72px; }
  .hero-plate { padding-top: 40px; }
  .hero-copy { padding-bottom: 40px; }
}

@media (max-width: 760px) {
  .hero-plate { grid-template-columns: 1fr; gap: 0; min-height: 0; padding: 40px 24px 0; }
  .hero-title { font-size: clamp(3rem, 13vw, 4.75rem); }
  .hero-visual { min-height: min(132vw, 600px); }
  .phone { top: 0; bottom: auto; width: min(78vw, 340px); }
  .plan-strip { display: flex; }
}

@media (max-width: 600px) {
  .step-list { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .joined { flex-direction: column; gap: 12px; }
}

@media (max-width: 480px) {
  .chip span { min-height: 44px; padding: 0 14px 0 12px; font-size: 0.875rem; }
  .lede { font-size: 1.0625rem; }
  .faq summary { padding: 16px 20px; font-size: 1rem; }
  .answer { padding: 0 20px 20px; }
  .tile { padding: 24px 24px 0; }
  .tile-chat { padding-right: 24px; }
  .step-list li { padding: 24px; }
  .nav .brand { padding-right: 12px; }
}

@container nav (max-width: 18.25em) {
  .nav .wordmark { display: none; }
  .nav .brand { padding: 8px; }
}

/* ---------- 404 ---------- */
.lost { min-height: 100svh; display: grid; place-items: center; padding: 24px var(--gutter); }
.lost-plate { width: min(640px, 100%); padding: 40px; border-radius: var(--r-hero); background: var(--surface); }
.lost-code { margin-top: 40px; font-size: clamp(6rem, 22vw, 10rem); line-height: 0.8; color: var(--ink); }
.lost-title { margin-top: 16px; font-size: clamp(2.25rem, 7vw, 3.5rem); }
.lost-btn { margin-top: 32px; border-radius: var(--r-btn); }
