/* RunWatch website.
   Dark only, like the widget itself. Color appears only where it means a status.
   Cards and panels share one "double bezel": a faint outer shell around a solid core. */

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --surface: #111113;
  --surface-raised: #18181b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ededef;
  --muted: #8e8e93;
  --blue: #0a84ff;
  --green: #30d158;
  --yellow: #ffd60a;
  --red: #ff453a;
  --gray: #8e8e93;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mac: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Geist", "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-glide: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius: 20px;
  --shell-radius: 26px;
  --shell-pad: 6px;
  --shell: rgba(255, 255, 255, 0.025);
  --shell-line: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  --core-light: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --gutter: 24px;
  --max: 1080px;
  /* Side padding that lines full-bleed layers up with .wrap. */
  --pad-x: max(var(--gutter), calc((100% - var(--max)) / 2));
  --section: clamp(96px, 12vw, 168px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

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

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 500;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type ---------- */

h1 {
  font-size: clamp(2.75rem, 5.6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.h2 {
  font-size: clamp(2rem, 3.8vw, 2.875rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.lead {
  margin-top: 24px;
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  line-height: 1.55;
}

.muted {
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  transition:
    transform 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover {
  background: #fafafa;
}

.btn-quiet {
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.btn-quiet:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
}

/* The main download button carries its icon in a small inner circle. */
.btn-cta {
  gap: 12px;
  padding-right: 6px;
}

.btn-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.08);
  transition: transform 0.5s var(--ease-glide);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-cta:hover .btn-icon {
  transform: translateY(2px) scale(1.06);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* ---------- Nav ---------- */

.nav-sentinel {
  position: absolute;
  top: 0;
  height: 8px;
  width: 1px;
}

/* A floating pill that turns to glass once the page scrolls. */
.nav {
  position: fixed;
  inset: 12px 0 auto;
  z-index: 20;
  pointer-events: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: calc(100% - var(--gutter) * 2);
  max-width: calc(var(--max) + 24px);
  height: 56px;
  padding: 0 10px 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  pointer-events: auto;
  transition:
    background-color 0.5s var(--ease-out),
    border-color 0.5s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}

.nav.is-scrolled .nav-inner {
  background: rgba(17, 17, 19, 0.72);
  border-color: var(--line);
  box-shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 24px;
  height: auto;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  font-size: 14px;
}

.nav-links a,
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}

.nav-links a:hover,
.footer-links a:hover {
  color: var(--text);
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--section);
}

.section-head {
  max-width: 640px;
}

.section-head p {
  margin-top: 16px;
  color: var(--muted);
  max-width: 52ch;
}

/* ---------- The four-ball story (hero and status legend) ----------
   html.motion: scene.js pins .stage and layers the copy over a WebGL canvas.
   Otherwise (no JS, reduced motion, no WebGL): a static logo with the statuses beside it. */

.stage {
  position: relative;
}

.hero-text {
  max-width: 600px;
}

.story-title {
  font-size: clamp(2rem, 3.8vw, 2.875rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.status-list {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.status-card {
  padding: 5px;
  border-radius: 22px;
  background: var(--shell);
  box-shadow: var(--shell-line);
}

.status-core {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 14px;
  padding: 14px 16px;
  border-radius: 17px;
  background: rgba(19, 19, 22, 0.94);
  box-shadow: var(--core-light);
}

.status-core > .dot {
  --size: 12px;
  margin: 6px 2px 0;
}

.status-text h3 {
  font-size: 1.0625rem;
}

.status-text p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

/* A tiny widget row, tinted like the real one. */
.status-example {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  font-family: var(--font-mac);
  font-size: 12.5px;
  line-height: 1.3;
}

.ex-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.ex-text b {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.ex-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c);
  font-weight: 500;
}

.ex-meta {
  color: rgba(235, 235, 245, 0.6);
  white-space: nowrap;
}

.story-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 15px;
}

/* The logo drawn without WebGL: the traced mark plus four balls in their slots. */
.logo-static {
  position: relative;
  aspect-ratio: 656 / 644;
}

.logo-static img {
  width: 100%;
  height: 100%;
}

.logo-ball {
  position: absolute;
  width: 15.549%; /* 102 / 656 */
  height: 15.839%; /* 102 / 644 */
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 58%, color-mix(in srgb, var(--c) 82%, #000));
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 40%, transparent);
}

/* Slot centers from the logo, (x - 51) / 656 and (y - 51) / 644. */
.logo-ball[data-s="run"] { --c: var(--blue); left: 81.555%; top: 20.497%; }
.logo-ball[data-s="ready"] { --c: var(--green); left: 79.268%; top: 38.509%; }
.logo-ball[data-s="wait"] { --c: var(--yellow); left: 75.915%; top: 56.366%; }
.logo-ball[data-s="multi"] { --c: var(--red); left: 72.409%; top: 74.224%; }

.leaders,
.payoff {
  display: none;
}

/* Static layout */

html:not(.motion) .stage {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-areas:
    "hero hero"
    "visual story"
    "how how"
    "features features"
    "pricing pricing";
  align-items: center;
  gap: clamp(72px, 10vw, 128px) clamp(40px, 6vw, 80px);
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding: clamp(136px, 18vh, 208px) var(--gutter) var(--section);
}

html:not(.motion) .hero-copy { grid-area: hero; }
html:not(.motion) .stage-visual { grid-area: visual; }
html:not(.motion) .story-copy { grid-area: story; }
html:not(.motion) #how { grid-area: how; }
html:not(.motion) #features { grid-area: features; }
html:not(.motion) #pricing { grid-area: pricing; }

html:not(.motion) .logo-static {
  width: min(100%, 420px);
  margin-inline: auto;
}

/* Motion layout: a full-viewport stage, pinned by scene.js */

.motion .stage {
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
}

.motion .stage-visual {
  position: absolute;
  inset: 0;
}

.motion .stage-visual canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}

.motion .stage.is-ready canvas {
  opacity: 1;
}

/* Until the scene is ready, the bare mark holds its place in the hero. */
.motion .stage-visual .logo-static {
  position: absolute;
  left: 73%;
  top: calc(50% + 24px);
  height: 46%;
  transform: translate(-50%, -50%);
  transition: opacity 1s var(--ease-out);
}

.motion .stage-visual .logo-ball {
  display: none;
}

.motion .stage.is-ready .logo-static {
  opacity: 0;
}

.motion .hero-copy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 88px var(--pad-x) 32px;
}

.motion .hero-text {
  max-width: 560px;
}

.motion .story-copy,
.motion .chapter {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  padding: 92px var(--pad-x) 28px;
  pointer-events: none;
}

.motion .story-panel,
.motion .chapter-panel {
  grid-column: 7 / -1;
  justify-self: end;
  width: 100%;
  max-width: 500px;
}

.motion .story-title,
.motion .chapter-title {
  font-size: clamp(1.5rem, 2.3vw, 2rem);
}

.motion .story-title {
  opacity: 0;
}

.motion .status-list {
  margin-top: 20px;
}

/* A card arrives when its ball docks, and leaves if you scroll back. */
.motion .status-card {
  opacity: 0;
  transform: translateX(36px);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.9s var(--ease-glide);
}

.motion .status-card.is-docked {
  opacity: 1;
  transform: none;
}

.motion .status-card .dot {
  transform: scale(0);
  transition: transform 0.6s var(--ease-spring) 0.12s;
}

.motion .status-card.is-docked .dot {
  transform: none;
}

.motion .status-card .status-example {
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.5s var(--ease-out) 0.22s,
    transform 0.7s var(--ease-out) 0.22s;
}

.motion .status-card.is-docked .status-example {
  opacity: 1;
  transform: none;
}

.motion .story-note {
  opacity: 0;
  transition: opacity 0.6s var(--ease-out) 0.3s;
}

.motion .story-copy[data-docked="4"] .story-note {
  opacity: 1;
}

/* Hairlines from each docked ball to its card, drawn by scene.js. */
.motion .leaders {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.leader {
  fill: none;
  stroke: var(--c);
  stroke-width: 1.5;
  stroke-opacity: 0.75;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.leader.is-on {
  stroke-dashoffset: 0;
}

.motion .payoff {
  position: absolute;
  inset: auto 0 10%;
  display: block;
  padding-inline: var(--gutter);
  font-size: clamp(2rem, 4.4vw, 3.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  pointer-events: none;
}

/* After the payoff: setup, features and pricing take turns in the panel beside the logo.
   scene.js fades each chapter in and out; until it runs, they stay hidden. */
.motion .chapter {
  opacity: 0;
  visibility: hidden;
}

.motion .chapter-panel {
  pointer-events: auto;
}

.motion .chapter-panel-wide {
  grid-column: 6 / -1;
  max-width: 600px;
}

/* Setup as a stepper: the current step's picture on top, the steps lighting up in turn below it. */
.motion .steps {
  --visual: 136px;
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  margin-top: 20px;
  padding-top: calc(var(--visual) + 12px);
  counter-reset: step;
}

.motion .steps::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: var(--visual);
  border-radius: var(--radius);
  background:
    radial-gradient(90% 80% at 50% 0%, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--surface);
  box-shadow: var(--shell-line), var(--core-light);
}

.motion .step-visual {
  position: absolute;
  inset: 0 0 auto;
  justify-content: center;
  height: var(--visual);
  margin: 0;
  opacity: 0;
  transform: scale(0.94);
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.8s var(--ease-glide);
}

.motion .step-visual > * {
  scale: 1.3;
}

.motion .steps li.is-current .step-visual {
  opacity: 1;
  transform: none;
}

.motion .steps li .step-visual::after {
  display: none;
}

.motion .steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  column-gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  opacity: 0.35;
  transition:
    opacity 0.5s var(--ease-out),
    background-color 0.5s var(--ease-out);
}

.motion .steps li::before {
  counter-increment: step;
  content: counter(step);
  grid-column: 1;
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: 13px;
  font-weight: 500;
  transition:
    background-color 0.5s var(--ease-out),
    color 0.5s var(--ease-out);
}

.motion .steps li.is-on {
  opacity: 1;
}

.motion .steps li.is-current {
  background: rgba(255, 255, 255, 0.04);
}

.motion .steps li.is-on::before {
  background: var(--text);
  color: var(--bg);
}

.motion .steps h3,
.motion .steps p {
  grid-column: 2;
}

.motion .steps p {
  margin-top: 2px;
  max-width: none;
  font-size: 14.5px;
  line-height: 1.5;
}

/* Features one at a time, each brought by its ball (the dot by the title is that ball's color). */
.motion .bento {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 20px;
}

.motion .cell {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.9s var(--ease-glide);
}

.motion .cell.is-past {
  transform: translateY(-16px);
}

.motion .cell.is-current {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.motion .cell-core {
  gap: 20px;
  padding: 24px 28px 26px;
}

.motion .cell-visual {
  min-height: 210px;
}

.motion .cell h3::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin: 0 10px 0 1px;
  border-radius: 50%;
  vertical-align: 0.12em;
  background: var(--c);
  box-shadow: 0 0 10px var(--c);
}

.motion .plans {
  max-width: none;
  margin-top: 20px;
  gap: 12px;
}

.motion .plan-core {
  padding: 26px;
}

.motion .price {
  margin-top: 14px;
}

.motion .amount {
  font-size: 2.5rem;
}

.motion .plan-note {
  margin: 10px 0 24px;
  font-size: 14px;
}

.motion .chapter .fine {
  margin-top: 16px;
  font-size: 14px;
}

/* ---------- Shared status layers ----------
   Each colored thing holds one layer per status and crossfades between them,
   so a status change animates opacity only. */

.lay {
  position: relative;
}

.lay > i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

[data-s="run"] > .s-run,
[data-s="ready"] > .s-ready,
[data-s="wait"] > .s-wait,
[data-s="multi"] > .s-multi,
[data-s="idle"] > .s-idle {
  opacity: 1;
}

.dot {
  display: block;
  flex: none;
  width: var(--size, 10px);
  height: var(--size, 10px);
  border-radius: 50%;
}

.dot > .s-run { background: var(--blue); box-shadow: 0 0 calc(var(--size, 10px) * 0.6) rgba(10, 132, 255, 0.9); }
.dot > .s-ready { background: var(--green); box-shadow: 0 0 calc(var(--size, 10px) * 0.6) rgba(48, 209, 88, 0.9); }
.dot > .s-wait { background: var(--yellow); box-shadow: 0 0 calc(var(--size, 10px) * 0.6) rgba(255, 214, 10, 0.9); }
.dot > .s-multi { background: var(--red); box-shadow: 0 0 calc(var(--size, 10px) * 0.6) rgba(255, 69, 58, 0.9); }
/* Gray: a session that finished its turn while its background runs still work. */
.dot > .s-idle { background: var(--gray); box-shadow: 0 0 calc(var(--size, 10px) * 0.6) rgba(142, 142, 147, 0.7); }

.dot.flat > i {
  box-shadow: none;
}

/* Sessions waiting on you send out a ring, like in the app. */
.ping {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  opacity: 0;
}

[data-s="wait"] > .ping { border-color: var(--yellow); }
[data-s="multi"] > .ping { border-color: var(--red); }

[data-s="wait"] > .ping,
[data-s="multi"] > .ping {
  animation: ping 1.6s cubic-bezier(0, 0, 0.58, 1) infinite;
}

@keyframes ping {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(2.2); opacity: 0; }
}

.is-offscreen .ping,
.is-offscreen.ping {
  animation-play-state: paused;
}

.hb-status[data-s="run"] { color: var(--blue); }
.hb-status[data-s="ready"] { color: var(--green); }
.hb-status[data-s="wait"] { color: var(--yellow); }
.hb-status[data-s="multi"] { color: var(--red); }

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 72px;
}

.step-visual {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
  margin-bottom: 32px;
}

.step-visual img {
  width: 56px;
  height: 56px;
}

/* A hairline leads from each step to the next. */
.steps li:not(:last-child) .step-visual::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
  transform-origin: left;
}

.steps p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 32ch;
}

/* A macOS-style switch. */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--font-mac);
  font-size: 13px;
  font-weight: 500;
}

.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
}

.switch-track::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--blue);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4f4f5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  transition: transform 0.45s var(--ease-glide);
}

.switch[data-on="true"] .switch-track::before {
  opacity: 1;
}

.switch[data-on="true"] .switch-knob {
  transform: translateX(16px);
}

/* The compact widget: a strip of dots. */
.strip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 15px;
  background: rgba(24, 24, 27, 0.94);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16);
}

.strip > span {
  position: relative;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
}

.strip .dot {
  --size: 12px;
}

/* ---------- Features ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-top: 64px;
}

.cell {
  padding: var(--shell-pad);
  border-radius: var(--shell-radius);
  background: var(--shell);
  box-shadow: var(--shell-line);
}

.cell-core {
  display: flex;
  flex-direction: column;
  gap: 32px;
  height: 100%;
  padding: 32px;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, 0.035), transparent 60%),
    var(--surface);
  box-shadow: var(--core-light);
  overflow: hidden;
  transition: transform 0.7s var(--ease-glide);
}

.cell:hover .cell-core {
  transform: translateY(-3px);
}

.cell-wide { grid-column: span 7; }
.cell-narrow { grid-column: span 5; }

.cell-visual {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  flex: 1;
  min-height: 220px;
  container-type: inline-size;
}

.cell h3 {
  font-size: 1.125rem;
}

.cell p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  max-width: 44ch;
}

/* Jump demo */
.jump {
  width: 100%;
  max-width: 440px;
  font-family: var(--font-mac);
  font-size: 13px;
}

.jump-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  transition: transform 0.3s var(--ease-out);
}

.jump-row::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
}

.jump-row.is-active::before {
  opacity: 1;
}

.jump-row.is-pressed {
  transform: scale(0.98);
}

.jump-row > * {
  position: relative;
}

.jump-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jump-dest {
  text-align: right;
  opacity: 0.38;
  transform: translateX(6px);
  transition:
    opacity 0.45s var(--ease-out),
    transform 0.45s var(--ease-out);
}

.jump-row.is-active .jump-dest {
  opacity: 1;
  transform: none;
}

.jump-dest b {
  display: block;
  font-weight: 500;
}

.jump-dest span {
  display: block;
  color: rgba(235, 235, 245, 0.6);
  font-size: 12px;
}

/* Hover demo */
.hover-demo {
  display: grid;
  justify-items: center;
  gap: 12px;
  font-family: var(--font-mac);
  zoom: 1.25;
}

.hb {
  width: 252px;
  padding: 9px 11px 10px;
  border-radius: 10px;
  background: rgba(24, 24, 27, 0.94);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.16),
    0 24px 48px -24px rgba(0, 0, 0, 0.9);
}

.hb-lights {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.hb-lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}

.hb-lights i:first-child { background: #ff5f57; }
.hb-lights i:last-child { background: #28c840; }

.hb-details {
  display: grid;
  gap: 2px;
  font-size: 10.5px;
  line-height: 1.25;
  transition: opacity 0.22s var(--ease-out);
}

.hb-details.is-fading {
  opacity: 0;
}

.hb-details > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hb-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.hb-status {
  font-weight: 500;
}

.hb-line {
  color: rgba(235, 235, 245, 0.6);
}

.strip .hover-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.strip .is-hover .hover-ring {
  opacity: 1;
}

/* Snap demo */
.screen {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01));
  overflow: hidden;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.snap-area {
  --x: 0.5;
  --y: 0.45;
  --dur: 1.2s;
  --curve: var(--ease-out);
  position: absolute;
  inset: 20px 6px 6px;
}

.snap-area.is-snapping {
  --dur: 0.42s;
  --curve: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Two nested translations add up to x * (area - widget): no measuring needed. */
.snap-track {
  position: absolute;
  inset: 0;
  transform: translate(calc(var(--x) * 100%), calc(var(--y) * 100%));
  transition: transform var(--dur) var(--curve);
}

.snap-track .strip {
  position: absolute;
  top: 0;
  left: 0;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 10px;
  transform: translate(calc(var(--x) * -100%), calc(var(--y) * -100%));
  transition: transform var(--dur) var(--curve);
}

.snap-track .strip > span {
  width: 9px;
  height: 9px;
}

.snap-track .strip .dot {
  --size: 8px;
}

/* Menu bar demo */
.mb {
  width: 100%;
  max-width: 420px;
  font-family: var(--font-mac);
  font-size: 13px;
}

.mb-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
  height: 30px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.mb-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.14);
}

/* The icon's open side gets a notch for the live status dot, as in MenuBarIcon.swift. */
.mb-icon img {
  width: 15px;
  height: auto;
  -webkit-mask: radial-gradient(circle 3.75px at 13.15px 8.4px, transparent 98%, #000 100%);
  mask: radial-gradient(circle 3.75px at 13.15px 8.4px, transparent 98%, #000 100%);
}

.mb-badge {
  position: absolute;
  left: calc(50% + 5.5px - 2.75px);
  top: calc(50% + 0.8px - 2.75px);
  width: 5.5px;
  height: 5.5px;
  border-radius: 50%;
}

.mb-badge > .s-run { background: var(--blue); }
.mb-badge > .s-ready { background: var(--green); }
.mb-badge > .s-wait { background: var(--yellow); }
.mb-badge > .s-multi { background: var(--red); }

.mb-clock {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.mb-menu {
  width: 248px;
  margin: 6px 0 0 auto;
  padding: 5px;
  border-radius: 10px;
  background: rgba(30, 30, 33, 0.96);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.14),
    0 24px 48px -20px rgba(0, 0, 0, 0.9);
}

.mb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.88);
}

.mb-item .dot {
  --size: 9px;
}

.mb-item small {
  color: rgba(235, 235, 245, 0.55);
  font-size: 13px;
}

.mb-item kbd {
  margin-left: auto;
  color: rgba(235, 235, 245, 0.45);
  font: inherit;
}

.mb-check {
  width: 9px;
  text-align: center;
  font-size: 11px;
}

.mb-sep {
  height: 1px;
  margin: 5px 9px;
  background: rgba(255, 255, 255, 0.1);
}

/* Background runs demo: a slice of the widget, sized like the app (one row is 12pt type). */
.runs-demo,
.hd-row {
  font-family: var(--font-mac);
  font-size: 12px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.9);
}

/* Drawn larger than life on wide screens, like the hover demo, so they read at a glance. */
.runs-demo,
.headline-demo {
  zoom: 1.25;
}

.runs-demo {
  display: grid;
  gap: 3px;
  width: 100%;
  max-width: 300px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(24, 24, 27, 0.94);
  box-shadow:
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.16),
    0 24px 48px -24px rgba(0, 0, 0, 0.9);
}

.rd-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 7px;
}

/* Every dot sits in a 12px column, so a session's dot and its runs' dots line up. */
.rd-row > .dot,
.rd-row > .ring-dot {
  margin-inline: calc((12px - var(--size)) / 2);
}

.rd-row > .dot {
  --size: 10px;
}

.rd-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rd-meta {
  color: rgba(235, 235, 245, 0.6);
  font-size: 10.5px;
  white-space: nowrap;
}

.rd-main {
  --tint: var(--blue);
  background: color-mix(in srgb, var(--tint) 14%, transparent);
  transition: background-color 0.6s var(--ease-out);
}

.rd-main[data-s="idle"] { --tint: var(--gray); }
.rd-main[data-s="ready"] { --tint: var(--green); background: color-mix(in srgb, var(--tint) 22%, transparent); }

/* The fold arrow under the session's dot. */
.rd-fold {
  position: absolute;
  left: 13px;
  top: calc(50% + 6px);
  width: 4px;
  height: 4px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
  transition: transform 0.35s var(--ease-glide);
}

.runs-demo[data-folded="true"] .rd-fold {
  transform: translate(-1px, 1px) rotate(-45deg);
}

/* The runs fold away by shrinking their row of the grid to nothing. */
.rd-runs {
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 0.45s var(--ease-glide),
    opacity 0.3s var(--ease-out);
}

.rd-runs > div {
  display: grid;
  gap: 3px;
  min-height: 0;
  overflow: hidden;
}

.runs-demo[data-folded="true"] .rd-runs {
  grid-template-rows: 0fr;
  opacity: 0;
}

/* The hairline from the arrow down to the last run's dot. */
.rd-runs::before {
  content: "";
  position: absolute;
  left: 14.5px;
  top: -2px;
  bottom: 10px;
  width: 1px;
  background: rgba(255, 255, 255, 0.28);
}

.rd-run {
  padding-block: 3px;
}

.rd-row.rd-run > .dot {
  --size: 7px;
}

.rd-run .rd-title,
.rd-detached .rd-title {
  color: rgba(235, 235, 245, 0.6);
  font-size: 11px;
  font-weight: 500;
}

.rd-run .rd-meta,
.rd-detached .rd-meta {
  color: rgba(235, 235, 245, 0.35);
}

.rd-detached {
  padding-block: 3px;
}

.ring-dot {
  --size: 9px;
  flex: none;
  width: var(--size);
  height: var(--size);
  border: 1.5px solid var(--c);
  border-radius: 50%;
  box-shadow: 0 0 6px color-mix(in srgb, var(--c) 60%, transparent);
}

/* Better headlines demo: a prompt arrives, then the session's name follows it. */
.headline-demo {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.hd-prompt {
  display: flex;
  gap: 8px;
  min-height: 2.6em;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.1);
  color: rgba(235, 235, 245, 0.75);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  line-height: 1.45;
}

.hd-caret {
  color: var(--green);
}

.hd-row {
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
}

.hd-text,
.hd-title {
  transition:
    opacity 0.3s var(--ease-out),
    filter 0.3s var(--ease-out);
}

.hd-text.is-fading,
.hd-title.is-fading {
  opacity: 0;
  filter: blur(3px);
}

/* ---------- Pricing ---------- */

.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 760px;
  margin-top: 64px;
}

.plan {
  padding: var(--shell-pad);
  border-radius: var(--shell-radius);
  background: var(--shell);
  box-shadow: var(--shell-line);
}

.plan-core {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 32px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--core-light);
}

.plan-featured {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.plan-featured .plan-core {
  background: var(--surface-raised);
}

.plan h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
}

.tag {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 20px;
}

.amount {
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.per {
  color: var(--muted);
  font-size: 15px;
}

.plan-note {
  margin-top: 12px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 15px;
}

.plan-core .btn {
  margin-top: auto;
}

.fine {
  max-width: 62ch;
  margin-top: 32px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Closing call to action ---------- */

.closing {
  display: grid;
  justify-items: center;
  text-align: center;
}

.closing .logo-static {
  width: 112px;
  margin-bottom: 40px;
}

/* The four balls drop into their slots as the closing logo comes into view. */
.logo-drop .logo-ball {
  transition:
    opacity 0.4s var(--ease-out),
    transform 0.9s var(--ease-spring);
}

.logo-drop .logo-ball:nth-of-type(1) { transition-delay: 0.35s; }
.logo-drop .logo-ball:nth-of-type(2) { transition-delay: 0.47s; }
.logo-drop .logo-ball:nth-of-type(3) { transition-delay: 0.59s; }
.logo-drop .logo-ball:nth-of-type(4) { transition-delay: 0.71s; }

.closing .actions {
  justify-content: center;
}

.closing .fine {
  margin-top: 20px;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding-block: 32px 40px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

/* ---------- Legal pages and 404 ---------- */

.page {
  padding-block: 136px 112px;
}

.legal {
  max-width: 680px;
}

.legal .updated {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.legal h2 {
  margin-top: 48px;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.legal p,
.legal li {
  margin-top: 12px;
  color: #b4b4ba;
  font-size: 16px;
  line-height: 1.7;
}

.legal ul {
  padding-left: 20px;
  list-style: disc;
}

.legal strong {
  color: var(--text);
  font-weight: 500;
}

.legal a {
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 3px;
}

.legal a:hover {
  text-decoration-color: currentColor;
}

.callout {
  margin-top: 40px !important;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.legal code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  color: var(--text);
}

.not-found {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding-block: 96px;
  text-align: center;
}

.not-found .dot {
  --size: 16px;
  margin-bottom: 40px;
}

.not-found p {
  margin-top: 16px;
  color: var(--muted);
}

/* ---------- Scroll reveals (only when motion is welcome and the script runs) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
    transition:
      opacity 1s var(--ease-out),
      transform 1.1s var(--ease-out),
      filter 1s var(--ease-out);
    transition-delay: calc(var(--d, 0) * 90ms);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .js .logo-drop:not(.is-in) .logo-ball {
    opacity: 0;
    transform: translate(70%, -160%) scale(0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  /* Keep the "needs you" ring visible, just still. */
  [data-s="wait"] > .ping,
  [data-s="multi"] > .ping {
    animation: none !important;
    opacity: 0.45;
    transform: scale(1.7);
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .cell-wide,
  .cell-narrow {
    grid-column: span 12;
  }

  /* The panel beside the logo is narrow here. */
  .motion .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 16px;
  }

  .nav-links {
    display: none;
  }

  .nav-inner > .btn {
    margin-left: auto;
  }

  html:not(.motion) .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hero"
      "visual"
      "story"
      "how"
      "features"
      "pricing";
    gap: 64px;
    padding-top: 120px;
  }

  html:not(.motion) .logo-static {
    width: min(70%, 300px);
  }

  .motion .hero-copy {
    align-items: flex-start;
    padding-top: 100px;
    text-align: center;
  }

  .motion .hero-text,
  .motion .hero-text .lead {
    margin-inline: auto;
  }

  .motion .hero-copy .actions {
    justify-content: center;
  }

  .motion .stage-visual .logo-static {
    left: 50%;
    top: 74%;
    height: 25%;
  }

  .motion .story-copy,
  .motion .chapter {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    padding: 80px var(--gutter) 20px;
  }

  /* One card at a time on phones: the latest docked ball's. */
  .motion .story-panel,
  .motion .chapter-panel {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: none;
  }

  .motion .story-title,
  .motion .chapter-title {
    font-size: 1.5rem;
    text-align: center;
  }

  /* Chapters: the title on top, the content at the bottom, and the logo in the space between. */
  .motion .chapter-panel {
    justify-content: flex-start;
  }

  .motion .chapter-title + * {
    margin-top: auto;
  }

  .motion .steps {
    --visual: 104px;
  }

  .motion .steps li {
    padding: 10px 12px;
  }

  .motion .steps p {
    font-size: 14px;
  }

  .motion .cell-core {
    gap: 16px;
    padding: 20px;
  }

  .motion .cell-visual {
    min-height: 170px;
  }

  .motion .plan-core {
    padding: 18px 20px;
  }

  .motion .price {
    margin-top: 8px;
  }

  .motion .amount {
    font-size: 2rem;
  }

  .motion .plan-note {
    margin: 6px 0 14px;
    font-size: 13.5px;
  }

  .motion .plan-core .btn {
    height: 40px;
  }

  .motion .chapter .fine {
    margin-top: 12px;
    font-size: 13px;
  }

  .motion .status-list {
    margin-top: 0;
  }

  .motion .status-card {
    grid-area: 1 / 1;
    transform: translateY(18px);
  }

  .motion .status-card.is-docked:not(.is-current) {
    opacity: 0;
    transform: translateY(-14px);
  }

  .motion .story-note,
  .motion .leaders {
    display: none;
  }

  .motion .payoff {
    bottom: 18%;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .steps li .step-visual::after {
    display: none;
  }

  .step-visual {
    margin-bottom: 20px;
  }

  .cell-core {
    padding: 24px;
  }

  .cell-visual {
    min-height: 180px;
  }

  .hover-demo {
    zoom: 1.08;
  }

  .runs-demo,
  .headline-demo {
    zoom: 1;
  }

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

  .page {
    padding-block: 112px 88px;
  }
}

/* In a narrow card, each destination goes under its session's name. */
@container (max-width: 360px) {
  .jump-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .jump-dest {
    grid-column: 2;
    text-align: left;
    transform: none;
  }
}

/* Short laptop screens: keep all four cards, and each chapter, on screen beside the logo. */
@media (min-width: 768px) and (max-height: 820px) {
  .motion .status-list {
    gap: 8px;
    margin-top: 14px;
  }

  .motion .status-core {
    gap: 6px 12px;
    padding: 10px 14px;
  }

  .motion .status-text p {
    font-size: 13.5px;
  }

  .motion .story-note {
    display: none;
  }

  .motion .steps {
    --visual: 112px;
  }

  .motion .steps li {
    padding-block: 9px;
  }

  .motion .cell-visual {
    min-height: 180px;
  }

  .motion .plan-core {
    padding: 22px;
  }
}
