/* songcode landing site (songco.de).
 *
 * Same design system as the app (public/styles.css): the tokens below are a
 * copy of its surfaces, text tiers, accent, radii and motion. Dark only. The
 * accent is for the primary action and for things that are live.
 *
 *   1. tokens     3. nav       5. sections    7. small screens, motion
 *   2. base       4. hero      6. footer      8. waitlist
 */

/* ————————————————————————————— 1. tokens ————————————————————————————— */

:root {
  color-scheme: dark;

  --bg: #070708;
  --surface-0: #0d0d0f;
  --surface-1: #131315;
  --surface-2: #1c1c1f;
  --surface-3: #26262a;
  --surface-4: #333338;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --text: #f4f4f6;
  --text-2: rgba(235, 235, 245, 0.64);
  --text-3: rgba(235, 235, 245, 0.4);

  --accent: #b8ff2e;
  --accent-ink: #0d1300;
  --accent-soft: rgba(184, 255, 46, 0.12);
  --accent-line: rgba(184, 255, 46, 0.4);
  --danger: #ff5a4f;

  /* the editor theme the app uses, so code reads the same here as there */
  --code-comment: #7d8799;
  --code-fn: #c792ea;
  --code-value: #c3e88d;
  --code-op: #89ddff;
  --code-name: #82aaff;
  --code-paren: #525154;

  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  /* code is set in the face the app's editor uses */
  --font-code: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.3, 1.35, 0.5, 1);
  --dur-1: 0.12s;
  --dur-2: 0.2s;
  --dur-3: 0.34s;

  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);

  --nav-h: 60px;
  --page: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
}

/* ————————————————————————————— 2. base ————————————————————————————— */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, pre { margin: 0; }
img, svg { display: block; }
::selection { background: rgba(184, 255, 46, 0.28); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), opacity var(--dur-1) var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn-primary:hover { background: #c6ff52; }
.btn-lg { height: 52px; padding: 0 28px; font-size: 17px; }
.btn-quiet { background: transparent; color: var(--text-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn .arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur-2) var(--ease); }
.btn:hover .arrow { transform: translateX(2px); }

kbd {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--text-3);
}

/* code, colored like the app's editor */
.code {
  font-family: var(--font-code);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre;
  tab-size: 2;
}
/* <code> would otherwise fall back to the browser's default monospace */
.code code { font: inherit; }
.code i { font-style: normal; }
.code .l { display: block; }
.code .c { color: var(--code-comment); }
.code .f { color: var(--code-fn); }
.code .s { color: var(--code-value); }
.code .o { color: var(--code-op); }
.code .v { color: var(--code-name); }
.code .p { color: var(--code-paren); }

/* ————————————————————————————— 3. nav ————————————————————————————— */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  background: rgba(7, 7, 8, 0.72);
  -webkit-backdrop-filter: saturate(1.6) blur(20px);
  backdrop-filter: saturate(1.6) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; border-radius: var(--r-sm); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 1px var(--line-strong); }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 14px;
  transition: color var(--dur-1) var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav .btn { margin-left: 8px; }

/* ————————————————————————————— 4. hero ————————————————————————————— */

.hero { position: relative; padding: clamp(56px, 9vw, 112px) 0 0; text-align: center; }
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(44px, 8.6vw, 104px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.045em;
  color: var(--text-3);
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--text); }
.hero .lede {
  max-width: 740px;
  margin: 28px auto 0;
  color: var(--text-2);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.hero .lede-narrow { display: none; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 36px; }

/* the playable track */
.demo { position: relative; margin-top: clamp(48px, 7vw, 88px); }
.demo-glow {
  position: absolute;
  inset: -12% 4% 18%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(184, 255, 46, 0.2), rgba(184, 255, 46, 0) 70%);
  filter: blur(40px);
  opacity: 0.4;
  transition: opacity 0.8s var(--ease);
  pointer-events: none;
}
.demo[data-state='playing'] .demo-glow { opacity: 1; }
.demo-panel {
  position: relative;
  max-width: 980px;
  margin-inline: auto;
  border-radius: var(--r-xl);
  background: var(--surface-0);
  box-shadow: 0 0 0 1px var(--line-strong), 0 40px 120px rgba(0, 0, 0, 0.7), 0 8px 24px rgba(0, 0, 0, 0.4);
  text-align: left;
  overflow: hidden;
}
.demo-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 16px 0 14px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
}
.demo-play {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  transition: transform var(--dur-2) var(--ease-spring), background var(--dur-1) var(--ease);
}
.demo-play:hover { background: #c6ff52; transform: scale(1.06); }
.demo-play:active { transform: scale(0.94); }
.demo-play svg { width: 16px; height: 16px; fill: currentColor; grid-area: 1 / 1; }
.demo-play .icon-play { margin-left: 2px; }
.demo-play .icon-stop, .demo-play .spinner { display: none; }
[data-state='playing'] .demo-play .icon-play, [data-state='loading'] .demo-play .icon-play { display: none; }
[data-state='playing'] .demo-play .icon-stop { display: block; }
[data-state='loading'] .demo-play { background: var(--surface-3); color: var(--text); pointer-events: none; }
[data-state='loading'] .demo-play .spinner {
  display: block;
  grid-area: 1 / 1;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface-4);
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* a ring that invites the first press */
[data-state='idle'] .demo-play::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(184, 255, 46, 0.5);
  animation: ring 2.4s var(--ease) infinite;
}
@keyframes ring { 70%, 100% { box-shadow: 0 0 0 14px rgba(184, 255, 46, 0); } }

.demo-meta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.demo-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.demo-readouts { display: flex; gap: 12px; color: var(--text-3); font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.demo[data-state='playing'] #demo-clock { color: var(--accent); }
.demo-bar .btn { margin-left: auto; height: 32px; padding: 0 14px; font-size: 13px; }
.demo-bar .btn kbd { margin-left: 2px; }

.demo-body { position: relative; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.demo-code { width: max-content; min-width: 100%; padding: 18px 20px 18px 0; counter-reset: line; }
.demo-code .l { display: block; position: relative; padding-left: 60px; min-height: 1.7em; }
.demo-code .l::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 42px;
  text-align: right;
  color: var(--text-3);
  -webkit-user-select: none;
  user-select: none;
}

/* the live editor (CodeMirror, mounted by Strudel on first play), tuned to
   sit exactly where the static code was */
.demo-editor > strudel-editor { display: block; }
.demo-editor > strudel-editor > div { background: transparent !important; }
.demo-editor .cm-editor { background: transparent !important; }
.demo-editor .cm-editor.cm-focused { outline: none !important; }
.demo-editor .cm-scroller { padding: 18px 0; line-height: 1.7 !important; font-family: var(--font-code) !important; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.demo-editor .cm-content { padding: 0 !important; }
/* the gutter stays put while long lines scroll sideways, so it is opaque, in
   the panel's own surface, and the code passes under it */
.demo-editor .cm-gutters { padding-right: 10px; border: 0 !important; background: var(--surface-0) !important; color: var(--text-3) !important; }
.demo-editor .cm-lineNumbers .cm-gutterElement { min-width: 42px; padding: 0 !important; text-align: right; }
.demo-editor .cm-line { padding: 0 20px 0 8px !important; background: transparent !important; }
.demo-editor .cm-activeLine, .demo-editor .cm-activeLineGutter { background: transparent !important; }
.demo-editor .cm-editor.cm-focused .cm-activeLine { background: rgba(255, 255, 255, 0.035) !important; }
.demo-editor .cm-cursor { border-left: 2px solid var(--accent) !important; }
.demo-editor .cm-selectionBackground { background: rgba(184, 255, 46, 0.16) !important; }

.demo-status {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13px;
}
.demo-status .dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--surface-4); transition: background var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.demo[data-state='playing'] .demo-status { color: var(--text-2); }
.demo[data-state='playing'] .demo-status .dot { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.demo[data-state='error'] .demo-status .dot { background: var(--danger); }
.demo-status a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.demo-caption { margin-top: 22px; color: var(--text-3); font-size: 15px; text-align: center; }

/* ————————————————————————————— 5. sections ————————————————————————————— */

.section { padding: clamp(96px, 13vw, 176px) 0 0; }
.section-head { max-width: 760px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section h2 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.038em;
  text-wrap: balance;
}
.section .lede {
  margin-top: 22px;
  color: var(--text-2);
  font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.card {
  border-radius: var(--r-xl);
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* why code: audio out against source out */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(40px, 6vw, 72px); }
.cmp { display: flex; flex-direction: column; padding: 28px; min-height: 300px; }
.cmp figcaption { color: var(--text-3); font-family: var(--font-mono); font-size: 13px; }
.cmp-view { flex: 1; display: flex; align-items: center; margin: 24px 0; min-height: 132px; }
.cmp-view svg { width: 100%; height: 96px; }
.cmp-view .code { font-size: 14px; overflow: hidden; }
.cmp p { color: var(--text-2); font-size: 17px; letter-spacing: -0.01em; }
.cmp p strong { color: var(--text); font-weight: 600; }
.cmp-audio .wave rect { fill: var(--surface-4); }
.cmp-code { box-shadow: inset 0 0 0 1px var(--line-strong); background: linear-gradient(180deg, #17171a, var(--surface-1)); }
.cmp-code figcaption { color: var(--text); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.fact { padding: 28px; }
.fact h3, .feature h3, .step h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.fact p, .feature p, .step p { margin-top: 8px; color: var(--text-2); font-size: 16px; line-height: 1.5; }

/* stems: the same track as lanes. Lit notes are neutral, the notes under the
   playhead are live. */
.daw { margin-top: clamp(40px, 6vw, 72px); overflow: hidden; }
.daw-bar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.daw-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.daw-title strong { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.daw-title span { color: var(--text-3); font-family: var(--font-mono); font-size: 12.5px; }
.daw-body { position: relative; --pad: 16px; --head: 162px; padding: 8px var(--pad) 14px; }
.daw-ruler, .daw-row { display: grid; grid-template-columns: 84px 30px 30px minmax(0, 1fr); column-gap: 6px; align-items: center; }
.daw-ruler { height: 24px; }
.daw-bars { grid-column: 4; display: grid; grid-template-columns: repeat(var(--bars, 8), 1fr); color: var(--text-3); font-family: var(--font-mono); font-size: 11px; }
.daw-bars span { padding-left: 4px; }
.daw-row { height: 36px; border-radius: var(--r-md); transition: background var(--dur-1) var(--ease); }
.daw-row[aria-selected='true'] { background: var(--surface-2); }
.daw-name, .daw-ms { border: 0; cursor: pointer; }
.daw-name { height: 100%; background: none; padding: 0 10px; overflow: hidden; color: var(--text-2); font-family: var(--font-code); font-size: 13px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.daw-row[aria-selected='true'] .daw-name, .daw-name:hover { color: var(--text); }
.daw-ms { justify-self: center; width: 28px; height: 22px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); font-size: 11px; font-weight: 600; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.daw-ms:hover { color: var(--text); }
.daw-ms[data-act='mute'][aria-pressed='true'] { background: var(--text); color: var(--bg); }
.daw-ms[data-act='solo'][aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); }
.daw-lane {
  display: block;
  width: 100%;
  height: 24px;
  border-radius: 6px;
  /* a line at each bar */
  background: var(--surface-0) repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px calc(100% / var(--bars, 8)));
  transition: opacity var(--dur-2) var(--ease);
}
.daw-lane rect { fill: #4a4a51; transition: fill 0.3s linear; }
.daw-row[aria-selected='true'] .daw-lane rect { fill: #8e8e97; }
.daw-lane rect.live { fill: var(--accent); transition: none; }
.daw-row[data-off] .daw-lane { opacity: 0.28; }
.daw-row[data-off] .daw-name { color: var(--text-3); }
.daw-playhead {
  position: absolute;
  top: 30px;
  bottom: 12px;
  left: calc(var(--pad) + var(--head) + (100% - 2 * var(--pad) - var(--head)) * var(--p, 0));
  width: 1.5px;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(184, 255, 46, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease);
}
.daw[data-state='playing'] .daw-playhead { opacity: 1; }
.daw-code { min-height: 76px; padding: 16px 20px; border-top: 1px solid var(--line); overflow-x: auto; font-size: 13px; line-height: 1.7; scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }
.daw-code .l { white-space: pre; }
.daw + .facts { margin-top: 16px; }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(40px, 6vw, 72px); }
.step { display: flex; flex-direction: column; padding: 28px; }
.step-view {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  height: 196px;
  margin-bottom: 28px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface-0);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.mock-prompt { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-size: 14px; line-height: 1.45; }
.mock-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mock-chip { padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.mock-chip.active { background: var(--text); color: #0b0b0c; font-weight: 550; }
.mock-seg { align-self: flex-start; display: inline-flex; padding: 3px; border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; }
.mock-seg span { padding: 4px 16px; border-radius: 8px; color: var(--text-3); }
.mock-seg .active { background: var(--surface-4); color: var(--text); }
.step-view .code { font-size: 12.5px; overflow: hidden; }
.caret { display: inline-block; width: 7px; height: 15px; margin-left: 2px; border-radius: 1.5px; background: var(--accent); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.diff .l { padding: 1px 10px 1px 0; border-radius: 5px; }
.diff .l::before { content: ''; display: inline-block; width: 26px; text-align: center; color: var(--text-3); }
.diff .del, .diff .del i { color: var(--text-3); }
.diff .del::before { content: '−'; }
.diff .add { background: var(--accent-soft); }
.diff .add::before { content: '+'; color: var(--accent); }
.mock-update { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.mock-update::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: clamp(40px, 6vw, 72px); border-radius: var(--r-xl); background: var(--line); box-shadow: 0 0 0 1px var(--line); overflow: hidden; }
.feature { padding: 28px 26px 32px; background: var(--surface-1); }
.feature h3 { font-size: 18px; }
.feature p { font-size: 15px; }
.feature a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

/* who it is for */
.for h2 { max-width: 900px; margin-inline: auto; }
.for .lede { max-width: 640px; margin-inline: auto; }
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 36px; }
.tags span { padding: 7px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); font-family: var(--font-mono); font-size: 13px; }

/* your key, and the slot where plans go */
.key { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 16px; align-items: stretch; margin-top: clamp(40px, 6vw, 72px); }
.key-main { padding: clamp(28px, 4vw, 48px); }
.key-main h2 { font-size: clamp(30px, 4.2vw, 48px); }
.key-main .lede { font-size: 18px; }
.key-side { display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; padding: clamp(28px, 4vw, 40px); background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.key-side h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.key-side p { margin-top: 8px; color: var(--text-2); font-size: 16px; }
.soon { display: inline-block; margin-left: 8px; vertical-align: 2px; padding: 4px 10px; font-weight: 400; letter-spacing: 0; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-family: var(--font-mono); font-size: 12px; }
.providers { display: flex; gap: 8px; margin-top: 28px; }
.providers span { padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 14px; }
/* plans: one .plan card per tier inside .plans, when there are plans to show */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.plan { display: flex; flex-direction: column; gap: 10px; padding: 28px; }
.plan h3 { margin: 0; }
.plan p { margin: 0; color: var(--text-2); }
.plan .plan-price { color: var(--text); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.plan .plan-price small { color: var(--text-3); font-size: 14px; font-weight: 400; letter-spacing: 0; }

/* closing call */
.closing { padding-bottom: clamp(96px, 13vw, 176px); text-align: center; }
.closing h2 { font-size: clamp(40px, 7vw, 88px); letter-spacing: -0.045em; line-height: 1; }
.closing .lede { margin-top: 20px; }
.closing .btn { margin-top: 36px; }

/* ————————————————————————————— 6. footer ————————————————————————————— */

.footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--text-3); font-size: 14px; }
.footer .wrap { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 28px; }
.footer .brand-name { color: var(--text); }
.footer-tag { margin-top: 12px; font-family: var(--font-mono); font-size: 12.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer-links a { color: var(--text-2); transition: color var(--dur-1) var(--ease); }
.footer-links a:hover { color: var(--text); }
.footer-note { width: 100%; }
.footer-note a { color: var(--text-2); }
.footer-note a:hover { color: var(--text); }

/* terms and privacy */
.legal { padding: clamp(48px, 8vw, 104px) 0 clamp(72px, 10vw, 128px); }
.legal .wrap { max-width: calc(720px + 2 * var(--gutter)); }
.legal h1 { font-family: var(--font-display); font-size: clamp(40px, 7vw, 72px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.legal .updated { margin-top: 18px; color: var(--text-3); font-family: var(--font-mono); font-size: 13px; }
.legal .summary { margin-top: 32px; color: var(--text); font-size: clamp(19px, 2.2vw, 22px); line-height: 1.45; letter-spacing: -0.01em; text-wrap: pretty; }
.legal h2 { margin: 56px 0 0; font-size: 21px; font-weight: 650; letter-spacing: -0.02em; scroll-margin-top: calc(var(--nav-h) + 24px); }
.legal p, .legal li { color: var(--text-2); font-size: 16.5px; line-height: 1.65; text-wrap: pretty; }
.legal p { margin-top: 14px; }
.legal ul { margin: 14px 0 0; padding-left: 20px; }
.legal li + li { margin-top: 8px; }
.legal li::marker { color: var(--text-3); }
.legal strong { color: var(--text); font-weight: 600; }
.legal code { font-family: var(--font-code); font-size: 0.9em; color: var(--text); }
.legal a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; transition: text-decoration-color var(--dur-1) var(--ease); }
.legal a:hover { text-decoration-color: var(--accent); }
.nav-links a[aria-current='page'] { color: var(--text); }

/* not found */
.notfound { min-height: calc(100dvh - var(--nav-h) - 160px); display: grid; place-items: center; padding: 80px 0; text-align: center; }
.notfound h1 { font-family: var(--font-display); font-size: clamp(40px, 7vw, 80px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.notfound p { margin-top: 18px; color: var(--text-2); font-size: 19px; }
.notfound .btn { margin-top: 32px; }

/* ————————————————————————————— 7. small screens, motion ————————————————————————————— */

@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps, .facts { grid-template-columns: 1fr; }
  .step { flex-direction: row; gap: 24px; align-items: center; }
  .step-view { flex: 0 0 46%; margin-bottom: 0; }
  .key { grid-template-columns: 1fr; }
  .plans { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero .lede-wide { display: none; }
  .hero .lede-narrow { display: block; }
  .nav-links a { display: none; }
  .nav .btn { margin-left: auto; }
  .compare { grid-template-columns: 1fr; }
  .cmp { min-height: 0; }
  .step { flex-direction: column; align-items: stretch; gap: 0; }
  .step-view { flex: none; margin-bottom: 24px; }
  .demo-panel { border-radius: var(--r-lg); }
  .demo-bar { height: 58px; padding: 0 12px; gap: 12px; }
  .demo-bar .btn kbd { display: none; }
  .demo-code { font-size: 12px; }
  .demo-code .l { padding-left: 44px; }
  .demo-code .l::before { width: 30px; }
  .demo-editor .cm-lineNumbers .cm-gutterElement { min-width: 30px; }
  .demo-editor .cm-line { padding: 0 14px 0 14px !important; }
  .cmp-view .code { font-size: 12px; }
  .hero-actions .btn-lg { width: 100%; max-width: 340px; }
  .daw-bar { height: 58px; padding: 0 12px; }
  .daw-body { --pad: 10px; --head: 126px; }
  .daw-ruler, .daw-row { grid-template-columns: 58px 25px 25px minmax(0, 1fr); }
  .daw-name { padding: 0 8px; font-size: 12px; }
  .daw-ms { width: 24px; }
  .daw-bars { font-size: 10px; }
  .daw-code { padding: 14px; font-size: 12px; }
}
@media (max-width: 520px) {
  .features { grid-template-columns: 1fr; }
}

/* sections rise into place as they are scrolled to (only when scripts run) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  [data-state='idle'] .demo-play::after, .caret { animation: none; }
  .btn, .demo-play { transition: none; }
}

/* ————————————————————————————— 8. waitlist ————————————————————————————— */

/* <body data-access> picks the calls to action: the sign-up form while the
   app is invite only, the links to the app once it is open (src/site.ts). */
body[data-access='waitlist'] .when-open,
body[data-access='open'] .when-waitlist { display: none !important; }

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

.wl-form { width: 100%; max-width: 480px; margin-inline: auto; text-align: left; }
/* one pill: the address on the left, the action on the right */
.wl-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 56px;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.wl-field:hover { background: var(--surface-2); }
.wl-field:focus-within { background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 4px var(--accent-soft); }
.wl-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  letter-spacing: -0.01em;
}
.wl-field input::placeholder { color: var(--text-3); }
.wl-field input:focus-visible { box-shadow: none; }
/* keep the browser's autofill from painting the pill */
.wl-field input:-webkit-autofill { -webkit-text-fill-color: var(--text); caret-color: var(--text); transition: background-color 9999s ease-out 0s; }
.wl-field .btn { position: relative; flex: none; height: 44px; padding: 0 20px; font-size: 15px; }
.wl-field .spinner { display: none; }
.wl-form[data-state='sending'] .wl-field .btn { opacity: 1; background: var(--surface-3); }
.wl-form[data-state='sending'] .wl-label { visibility: hidden; }
.wl-form[data-state='sending'] .spinner {
  display: block;
  position: absolute;
  inset: 0;
  width: 16px;
  height: 16px;
  margin: auto;
  border-radius: 50%;
  border: 2px solid var(--surface-4);
  border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}
.wl-form[data-state='error'] .wl-field { box-shadow: inset 0 0 0 1px var(--danger); }
/* the field no person sees */
.wl-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.wl-done {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 22px;
  border-radius: 28px;
  background: var(--surface-1);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  animation: wl-in var(--dur-3) var(--ease);
}
.wl-done .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@keyframes wl-in { from { opacity: 0; transform: translateY(4px); } }

.wl-msg { min-height: 20px; margin-top: 10px; padding-inline: 22px; color: var(--text-3); font-size: 14px; line-height: 20px; }
.wl-msg.error { color: var(--danger); }
.wl-msg:empty { min-height: 0; margin-top: 0; }
.wl-note { margin-top: 16px; color: var(--text-3); font-size: 14px; text-align: center; }
.wl-note a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); transition: color var(--dur-1) var(--ease); }
.wl-note a:hover { color: var(--text); }

.hero-join { margin-top: 36px; }
.closing-join { margin-top: 36px; }
.closing .wl-field .btn { margin-top: 0; }

/* the page that stands in for the app while it is invite only */
.nav .btn-quiet { margin-left: auto; }
.gate { min-height: calc(100dvh - var(--nav-h)); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 56px 0 96px; text-align: center; }
.gate h1 { font-family: var(--font-display); font-size: clamp(44px, 8vw, 88px); font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.gate-lede { max-width: 520px; margin: 22px auto 0; color: var(--text-2); font-size: clamp(17px, 2vw, 20px); line-height: 1.45; letter-spacing: -0.012em; text-wrap: balance; }
.gate-join { margin-top: 36px; }
.gate-code { width: 100%; max-width: 380px; margin: 56px auto 0; padding-top: 28px; border-top: 1px solid var(--line); }
.gate-code label { display: block; color: var(--text-3); font-size: 14px; }
.gate-signin { margin-top: 28px; color: var(--text-3); font-size: 14px; }
.gate-signin a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.gate-signin a:hover { color: var(--text); }
.wl-field-sm { height: 48px; margin-top: 14px; padding: 5px 5px 5px 18px; }
.wl-field-sm input { font-size: 15px; }
.wl-field-sm .btn { height: 38px; padding: 0 16px; font-size: 14px; }
.gate-code .wl-msg { padding-inline: 0; text-align: center; }

@media (max-width: 520px) {
  /* the pill splits into a field and a full-width button */
  .wl-field:not(.wl-field-sm), .wl-field:not(.wl-field-sm):hover, .wl-field:not(.wl-field-sm):focus-within { flex-direction: column; align-items: stretch; gap: 10px; height: auto; padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .wl-field:not(.wl-field-sm) input { flex: none; height: 52px; padding: 0 20px; border-radius: 999px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 16px; }
  .wl-field:not(.wl-field-sm) input:focus-visible { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 4px var(--accent-soft); }
  .wl-form[data-state='error'] .wl-field:not(.wl-field-sm) { box-shadow: none; }
  .wl-form[data-state='error'] .wl-field:not(.wl-field-sm) input { box-shadow: inset 0 0 0 1px var(--danger); }
  .wl-field:not(.wl-field-sm) .btn { height: 52px; font-size: 16px; }
  .wl-msg { text-align: center; }
  .wl-done { border-radius: var(--r-xl); font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .wl-done { animation: none; }
  .wl-field { transition: none; }
}
