/*
 * Landing page. Surfaces that depict the running app use --app-* graphite so the
 * wheel and loading ring match the product. Accent is Lightphrase orange (#f54e00).
 *
 * Note: DESIGN.md's ban on blur/shadow is scoped by .cursor/rules/design.mdc to
 * src/renderer/src/** — the desktop UI — and does not govern this page.
 */

/* ---------------------------------------------------------------- fonts */

/*
 * San Francisco is not redistributable as a webfont, so it comes from the system: -apple-system
 * and BlinkMacSystemFont resolve to real SF on macOS and iOS. Geist is bundled as the fallback
 * for everyone else, because Apple's own fallback (Helvetica/Arial) reads nothing like SF.
 */
@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist Mono Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("./fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------- tokens */

:root {
  --white: #ffffff;
  --grey: #f5f5f7;
  --black: #000000;
  --ink: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #86868b;
  --separator: #d2d2d7;
  --accent: #f54e00;
  --accent-hover: #ff6428;
  --accent-active: #d04200;
  --on-accent: #ffffff;

  /* The running app, kept true to theme.css. */
  --app-canvas: #0c0c0e;
  --app-raised: #111114;
  --app-surface: #161619;
  --app-surface-strong: #1d1d21;
  --app-ink: #f4f3ef;
  --app-muted: #92908a;
  --app-muted-soft: #6f6d68;
  --app-hairline: rgb(255 255 255 / 0.09);
  --app-hairline-strong: rgb(255 255 255 / 0.16);
  --app-selection: rgb(245 78 0 / 0.55);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Geist Variable", "Segoe UI", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Geist Mono Variable",
    "Cascadia Mono", monospace;

  --r-card: 18px;
  --r-large: 28px;
  --r-pill: 980px;

  --gutter: 22px;
  --band: 120px;
  --content: 980px;
  --content-wide: 1200px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);

  color-scheme: light;
}

/* ---------------------------------------------------------------- reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
figure,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--app-selection);
  color: var(--ink);
}

:focus-visible {
  outline: 3px solid rgb(245 78 0 / 0.6);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
  transform: translateY(-250%);
}

.skip-link:focus-visible {
  transform: none;
}

/* ------------------------------------------------------------ typography */

/* Apple sets display type semibold with tight negative tracking, never light. */
.display-hero {
  font-size: clamp(2.5rem, 6.6vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.display-section {
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Apple's "intro" copy: large, regular weight, secondary colour, sits under a headline. */
.intro {
  max-width: 34em;
  color: var(--secondary);
  font-size: clamp(1.1875rem, 2.1vw, 1.5rem);
  font-weight: 400;
  line-height: 1.29;
  letter-spacing: 0.004em;
  text-wrap: pretty;
}

.title {
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 0.011em;
}

.title-sm {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.23;
  letter-spacing: -0.022em;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 0.011em;
}

.body-copy {
  color: var(--secondary);
  font-size: 1.0625rem;
  line-height: 1.47059;
  letter-spacing: -0.022em;
}

.caption {
  color: var(--tertiary);
  font-size: 0.875rem;
  line-height: 1.42859;
  letter-spacing: -0.016em;
}

.footnote {
  color: var(--tertiary);
  font-size: 0.75rem;
  line-height: 1.33337;
  letter-spacing: -0.01em;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9375em;
  letter-spacing: 0;
}

.center {
  margin-inline: auto;
  text-align: center;
}

.center .intro {
  margin-inline: auto;
}

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide {
  max-width: var(--content-wide);
}

/*
 * Apple separates sections with background changes and whitespace, never rules.
 */
.band {
  padding-block: var(--band);
}

.band--grey {
  background: var(--grey);
}

.band--black {
  background: var(--black);
  color: var(--tertiary);
}

.band--black .display-section,
.band--black .title,
.band--black .title-sm {
  color: #f5f5f7;
}

.band--black .intro,
.band--black .body-copy {
  color: var(--tertiary);
}

.band-head {
  margin-bottom: 64px;
}

.band-head .intro {
  margin-top: 20px;
}

/* --------------------------------------------------------------- brand */

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brandmark__tile {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--app-surface-strong);
  color: var(--app-ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
}

.brandmark__dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.brandmark__word {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.band--black .brandmark__word,
.site-footer .brandmark__word {
  color: #f5f5f7;
}

.site-footer .brandmark__word {
  color: var(--ink);
}

/* --------------------------------------------------- buttons, Apple pills */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 12px 23px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.23536;
  letter-spacing: -0.022em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease),
    border-color 200ms var(--ease),
    color 200ms var(--ease);
}

.btn--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--primary:active {
  background: var(--accent-active);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.btn--secondary {
  border-color: var(--accent);
  background: transparent;
  color: var(--accent);
}

.btn--secondary:hover {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--small {
  min-height: 32px;
  padding: 5px 16px;
  font-size: 0.875rem;
}

/* Apple's inline call to action: accent text plus a chevron. */
.btn--link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 1.0625rem;
  cursor: pointer;
}

.btn--link:hover {
  text-decoration: underline;
}

.btn--link::after {
  content: "›";
  font-size: 1.35em;
  line-height: 0.8;
  translate: 0 -0.04em;
}

.band--black .btn--secondary {
  border-color: rgb(245 245 247 / 0.4);
  color: #f5f5f7;
}

.band--black .btn--secondary:hover {
  border-color: #f5f5f7;
  background: #f5f5f7;
  color: var(--black);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.center .cta-row {
  justify-content: center;
}

/* ------------------------------------------------------------- keycaps */

.keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.keycap {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 30px;
  padding-inline: 9px;
  border-radius: 7px;
  background: var(--grey);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  transition:
    background-color 140ms var(--ease),
    transform 140ms var(--ease);
}

.keycap[data-pressed="true"] {
  background: #e3e3e6;
  transform: translateY(1px);
}

.keys__plus {
  color: var(--tertiary);
  font-size: 12px;
}

.band--grey .keycap {
  background: var(--white);
}

.band--grey .keycap[data-pressed="true"] {
  background: #e3e3e6;
}

.band--black .keycap,
.app-surface .keycap {
  background: var(--app-surface-strong);
  color: var(--app-ink);
}

.band--black .keys__plus,
.app-surface .keys__plus {
  color: var(--app-muted-soft);
}

/* ------------------------------------------------------------------ nav */

/* Apple's translucent, blurred, 44px navigation bar. */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

@supports not (backdrop-filter: blur(20px)) {
  .nav {
    background: rgb(255 255 255 / 0.97);
  }
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 52px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.nav__link {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.33337;
  letter-spacing: -0.01em;
  opacity: 0.88;
  transition: opacity 160ms var(--ease);
}

.nav__link:hover {
  opacity: 1;
}

.nav__toggle {
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--grey);
  color: var(--ink);
  cursor: pointer;
}

/* ----------------------------------------------------------------- hero */

.hero {
  padding-block: clamp(64px, 9vw, 120px) clamp(56px, 7vw, 96px);
}

.hero__copy {
  max-width: 46rem;
}

.hero__copy .intro {
  margin-top: 20px;
}

.hero .cta-row {
  margin-top: 32px;
}

.hero__note {
  margin-top: 20px;
}

/* ---------------------------------------------------- the hero demo stage */

.demo {
  margin-top: clamp(48px, 6vw, 72px);
}

.demo__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-large);
  background: var(--white);
  box-shadow:
    0 2px 6px rgb(0 0 0 / 0.04),
    0 12px 40px rgb(0 0 0 / 0.08);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* The mock chrome is the OTHER app you were typing in, not Lightphrase. */
.demo__chrome {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: var(--grey);
}

.demo__dots {
  display: flex;
  gap: 7px;
}

.demo__dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d8d8dc;
}

.demo__tab {
  color: var(--tertiary);
  font-size: 0.8125rem;
}

.demo__stage {
  position: relative;
  min-height: 430px;
  padding: clamp(28px, 4vw, 52px);
  cursor: crosshair;
}

.demo__field {
  max-width: 44rem;
}

.demo__to {
  display: flex;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--separator);
  color: var(--tertiary);
  font-size: 0.875rem;
}

.demo__to strong {
  color: var(--secondary);
  font-weight: 500;
}

.demo__body {
  padding-top: 24px;
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.6;
}

/* The selection, using the real ::selection wash from the app. */
.demo__sel {
  border-radius: 3px;
  background: var(--app-selection);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 220ms linear;
}

.demo__frame[data-state="replaced"] .demo__sel {
  background: transparent;
}

.demo__caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  translate: 0 0.16em;
  background: var(--ink);
  opacity: 0;
}

.demo__frame[data-state="replaced"] .demo__caret {
  opacity: 1;
  animation: caret-blink 1100ms steps(1, end) infinite;
}

@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.demo__hint {
  position: absolute;
  right: clamp(28px, 4vw, 52px);
  bottom: clamp(22px, 3vw, 34px);
  left: clamp(28px, 4vw, 52px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--tertiary);
  font-size: 0.875rem;
}

.demo__hint-keys {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.demo__replay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms linear;
}

.demo__frame[data-state="replaced"] .demo__replay {
  opacity: 1;
  pointer-events: auto;
}

/* The ghost pointer that performs the gesture once, unprompted, on first view. */
.demo__ghost {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  width: 24px;
  height: 24px;
  margin: -3px 0 0 -3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms linear;
}

.demo__ghost[data-visible="true"] {
  opacity: 1;
}

/* ------------------------------------------------------- the action wheel */

/*
 * A straight port of src/renderer/src/lib/radial.ts: 360x360 viewBox, R_INNER 68,
 * R_OUTER 168, slice 0 centred at twelve, running clockwise.
 */
.wheel {
  display: block;
  width: 100%;
  height: 100%;
}

.wheel__slice {
  fill: var(--app-surface);
  stroke: var(--app-hairline);
  stroke-width: 1;
  transition:
    fill 90ms ease-out,
    stroke 90ms ease-out;
}

.wheel__slice[data-active="true"] {
  fill: color-mix(in oklab, var(--accent) 28%, var(--app-surface));
  stroke: var(--accent);
  stroke-width: 2;
}

.wheel__label {
  fill: var(--app-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: fill 90ms ease-out;
}

.wheel__icon {
  color: var(--app-muted);
  transition: color 90ms ease-out;
}

.wheel__group[data-active="true"] .wheel__label {
  fill: var(--app-ink);
  font-weight: 600;
}

.wheel__group[data-active="true"] .wheel__icon {
  color: var(--on-accent);
}

.wheel__hub {
  fill: var(--app-raised);
  stroke: var(--app-hairline);
  stroke-width: 1;
}

.wheel__hub-title {
  fill: var(--app-ink);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.wheel__hub-sub,
.wheel__hub-foot {
  fill: var(--app-muted);
  font-family: var(--font-sans);
}

.wheel__hub-sub {
  font-size: 11px;
}

.wheel__hub-foot {
  font-size: 9px;
  letter-spacing: 0.3px;
  opacity: 0.8;
}

.wheel__rim {
  fill: none;
  stroke: var(--app-hairline);
  stroke-width: 1;
}

/* The wheel as it appears over your work: placed at the pointer. */
.wheel-layer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  visibility: hidden;
  pointer-events: none;
}

.wheel-layer[data-open="true"] {
  visibility: visible;
  animation: wheel-in 200ms var(--ease);
}

@keyframes wheel-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* -------------------------------------- loading ring, ported from overlay.css */

.rp-loader {
  --rp-accent: 150 130 255;
  --rp-size: 30px;
  --rp-stroke: 2.5px;
  --rp-scrim: 0.58;
  --rp-track: 0.2;
  --rp-arc: 1;

  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  width: var(--rp-size);
  height: var(--rp-size);
  margin-top: calc(var(--rp-size) / -2);
  margin-left: calc(var(--rp-size) / -2);
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
  transition:
    opacity 150ms ease-out,
    transform 150ms var(--ease);
}

.rp-loader[data-visible="true"] {
  opacity: 1;
  transform: scale(1);
}

.rp-loader::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(9 9 14 / var(--rp-scrim)) 0%,
    rgb(9 9 14 / calc(var(--rp-scrim) * 0.94)) 48%,
    rgb(9 9 14 / 0) 68%
  );
}

.rp-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: var(--rp-stroke) solid rgb(255 255 255 / var(--rp-track));
}

.rp-arc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0turn,
    rgb(var(--rp-accent) / 0) 0turn,
    rgb(var(--rp-accent) / 0) 0.4turn,
    rgb(var(--rp-accent) / var(--rp-arc)) 0.96turn,
    rgb(var(--rp-accent) / var(--rp-arc)) 1turn
  );
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--rp-stroke)), #000 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--rp-stroke)), #000 0);
  /*
   * Only spins while the ring is up. A masked conic gradient repaints every frame, and the app
   * only mounts this overlay for the length of one generation.
   */
  animation: rp-spin 850ms linear infinite paused;
}

.rp-loader[data-visible="true"] .rp-arc {
  animation-play-state: running;
}

@keyframes rp-spin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes rp-breathe {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/* ------------------------------------------------------------- the gesture */

.beats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.beat {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  padding: 28px;
  border-radius: var(--r-card);
  background: var(--white);
}

.band--grey .beat {
  background: var(--white);
}

.beat__art {
  display: flex;
  align-items: center;
  min-height: 76px;
}

.beat__step {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.beat__scrap {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.beat__scrap mark {
  border-radius: 3px;
  background: var(--app-selection);
  color: var(--ink);
}

.beat__wedge {
  width: 76px;
  height: 76px;
}

.beat__replaced {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.beat__bar {
  display: inline-block;
  width: 2px;
  height: 1em;
  translate: 0 0.16em;
  background: var(--accent);
}

.gesture-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 56px;
  margin-top: 56px;
}

.gesture-note dt {
  margin-bottom: 4px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.gesture-note dd {
  color: var(--secondary);
  font-size: 1.0625rem;
  line-height: 1.47059;
}

/* -------------------------------------------------------------- actions */

/* The wheel gets Apple's black full-bleed treatment: one object, centred, nothing else. */
.wheel-stage {
  display: grid;
  place-items: center;
  margin-bottom: 56px;
}

.wheel-stage .wheel {
  width: min(420px, 78vw);
  height: min(420px, 78vw);
}

.action-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.action-row {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 24px;
  border-radius: var(--r-card);
  background: rgb(255 255 255 / 0.06);
  transition: background-color 200ms var(--ease);
}

.action-row[data-active="true"] {
  background: rgb(245 78 0 / 0.16);
}

/* The position on the ring, which is the real ordering device in the app. */
.action-row__pos {
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.action-row__name {
  color: #f5f5f7;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.022em;
}

.action-row__hint {
  color: var(--tertiary);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.actions-foot {
  max-width: 40em;
  margin: 40px auto 0;
  text-align: center;
}

/* ---------------------------------------------------------------- tones */

.tone-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}

.tone-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 26px 24px;
  border-radius: var(--r-card);
  background: var(--grey);
}

.band--grey .tone-card {
  background: var(--white);
}

.tone-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Sized to sit beside a card title on one line at the five-up tone grid. */
.badge {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The verbatim instruction the app sends. Mono, because it is a runtime value. */
.tone-card__instruction {
  color: var(--secondary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0;
}

/* --------------------------------------------------------------- speeds */

.speed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.speed-card {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 32px;
  border-radius: var(--r-large);
  background: var(--white);
}

.speed-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.speed-card__model {
  padding-top: 16px;
  border-top: 1px solid var(--separator);
  color: var(--tertiary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0;
}

.speed-card__model b {
  color: var(--ink);
  font-weight: 600;
}

/* A real metric line from the app, on an app surface. */
.metric-strip {
  margin-top: 32px;
  padding: 20px 24px;
  border-radius: var(--r-card);
  background: var(--app-canvas);
  color: var(--app-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.metric-strip b {
  color: var(--app-ink);
  font-weight: 500;
}

/* ------------------------------------------------------------ privacy */

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 64px;
}

.privacy-item p {
  margin-top: 10px;
  color: var(--secondary);
  font-size: 1.0625rem;
  line-height: 1.47059;
}

/* ----------------------------------------------------------- download */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.platform-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  padding: 32px;
  border-radius: var(--r-large);
  background: var(--white);
  text-align: center;
}

.platform-card[data-detected="true"] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.platform-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.platform-card__note {
  color: var(--secondary);
  font-size: 0.9375rem;
  line-height: 1.47;
}

.platform-card__file {
  color: var(--tertiary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.platform-card .btn {
  width: 100%;
}

.terms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 72px;
  text-align: center;
}

.terms__value {
  display: block;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.terms__item .caption {
  margin-top: 8px;
}

.fine-print {
  max-width: 44em;
  margin: 56px auto 0;
  text-align: center;
}

/* ------------------------------------------------------------- footer */

.site-footer {
  padding-block: 44px 56px;
  background: var(--grey);
}

.site-footer__note {
  max-width: 60em;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--separator);
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 36px 32px;
  padding-block: 32px;
}

.site-footer__blurb {
  max-width: 22em;
  margin-top: 14px;
}

.footer-col h3 {
  margin-bottom: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.footer-col li + li {
  margin-top: 9px;
}

.footer-col a {
  color: var(--secondary);
  font-size: 0.75rem;
  line-height: 1.33337;
  transition: color 160ms var(--ease);
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
}

/* --------------------------------------------------------- responsive */

@media (max-width: 1024px) {
  :root {
    --band: 92px;
  }

  .beats,
  .action-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tone-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --band: 76px;
  }

  .nav__links {
    position: absolute;
    top: 52px;
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 24px;
    background: rgb(255 255 255 / 0.97);
  }

  .nav__links[hidden] {
    display: none;
  }

  .nav__link {
    padding-block: 14px;
    border-bottom: 1px solid var(--separator);
    font-size: 1rem;
  }

  .nav__links .btn {
    margin-top: 20px;
  }

  .nav__toggle {
    display: grid;
  }

  .speed-grid,
  .platform-grid,
  .terms,
  .gesture-notes,
  .privacy-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tone-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gesture-notes {
    gap: 24px;
  }

  .privacy-grid {
    gap: 32px;
  }

  .demo__stage {
    min-height: 370px;
  }

  .band-head {
    margin-bottom: 48px;
  }
}

@media (max-width: 560px) {
  :root {
    --band: 64px;
    --gutter: 20px;
  }

  .beats,
  .action-list,
  .tone-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo__hint {
    justify-content: flex-start;
  }

  .demo__stage {
    min-height: 330px;
  }

  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

/* ------------------------------------------------------- reduced motion */

/*
 * Mirrors the app rule in index.css and overlay.css: nonessential transforms and animation
 * come off entirely, and the ring switches from a spin to the breathe pulse.
 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .rp-loader[data-visible="true"] .rp-arc {
    animation: rp-breathe 1600ms ease-in-out infinite !important;
    animation-duration: 1600ms !important;
    animation-iteration-count: infinite !important;
    animation-play-state: running !important;
  }

  .demo__frame[data-state="replaced"] .demo__caret {
    animation: none;
    opacity: 1;
  }
}
