/* KudoWrite public site — one stylesheet for the landing page, guides, author
   pages and the legal pages. The app (/write) has its own stylesheet in
   src/styles.css; the two share the same token values ("Night Draft").
   Add colours as tokens here, never inline. */

:root {
  color-scheme: dark;
  --bg: #0f0e12;
  --bg-deep: #0a090c;
  --surface: #16141a;
  --surface-raised: #1d1a22;
  --border: #27232d;
  --border-strong: #353040;
  --hairline: rgba(255, 255, 255, 0.06);
  --fg: #f3efea;
  --fg-soft: #d3cdd4;
  --fg-2: #a59ea8;
  --fg-3: #716a76;
  --accent: #f06a9b;
  --accent-2: #e58bb5;
  --accent-text: #ff9dc0;
  --accent-soft: rgba(240, 106, 155, 0.12);
  --accent-border: rgba(240, 106, 155, 0.45);
  --accent-ring: rgba(240, 106, 155, 0.28);
  --accent-strong: #d93a75;
  --grad: linear-gradient(120deg, #f06a9b 0%, #f58a7d 55%, #f5a66a 100%);
  --grad-btn: linear-gradient(135deg, #d93a75 0%, #ea5a8b 60%, #f07a86 100%);
  --grad-border: linear-gradient(135deg, rgba(240, 106, 155, 0.9), rgba(245, 166, 106, 0.5));
  --glow: 0 10px 30px -10px rgba(240, 106, 155, 0.55);
  --ok: #86d29a;
  --ok-soft: #17261b;
  --warn: #f0b36a;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --font-ui: "Manrope", system-ui, -apple-system, sans-serif;
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: 24px; }
.wrap-narrow { width: 100%; max-width: 720px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap, .wrap-narrow { padding-inline: 18px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 11px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 120ms, transform 120ms, background 120ms, border-color 120ms, color 120ms;
}
.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface-raised);
  color: var(--fg);
  border-color: var(--border-strong);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.btn-secondary:hover { background: #262230; border-color: #433d4d; }
.btn-ghost { background: transparent; color: var(--fg-2); }
.btn-ghost:hover { color: var(--fg); }
.btn-sm { font-size: 13px; padding: 8px 14px; }

/* ---------- nav ---------- */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; color: var(--fg); }
.brand-mark {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 13.5px; font-weight: 600; color: var(--fg-2); }
.nav-links a:not(.btn):hover { color: var(--fg); }
@media (max-width: 480px) {
  .nav-links { gap: 14px; }
  .nav-links .nav-support { display: none; }
}

/* ---------- footer ---------- */
.site-foot {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}
.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  padding-block: 18px;
  font-size: 12.5px;
  color: var(--fg-3);
}
.site-foot nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-foot nav a:hover { color: var(--fg-2); }

/* ---------- landing: hero ---------- */
.hero-wrap { position: relative; overflow: hidden; }
.hero-wrap::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto -10%;
  height: 720px;
  pointer-events: none;
  background:
    radial-gradient(720px 380px at 22% 8%, rgba(240, 106, 155, 0.2), transparent 70%),
    radial-gradient(620px 360px at 80% 18%, rgba(245, 166, 106, 0.13), transparent 70%);
}
.hero-wrap > * { position: relative; }
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 72px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin-bottom: 20px;
}
.hero h1 em, .grad-text {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { font-size: 17px; line-height: 1.6; color: var(--fg-2); max-width: 50ch; margin-bottom: 28px; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.hero-note { margin-top: 18px; font-size: 12.5px; color: var(--fg-3); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero-note span::before { content: "✓"; color: var(--ok); margin-right: 6px; font-weight: 800; }
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 32px 0 48px; }
  .hero-sub { font-size: 16px; }
}
@media (max-width: 480px) {
  .eyebrow { font-size: 10.5px; letter-spacing: 0.06em; padding: 5px 10px; margin-bottom: 18px; }
  .hero h1 { font-size: clamp(34px, 11vw, 44px); }
}

/* product shot (a static mockup of the editor) */
.shot { position: relative; }
.shot::before {
  content: "";
  position: absolute;
  inset: 10% -6% -10% -6%;
  background: radial-gradient(60% 60% at 50% 40%, rgba(240, 106, 155, 0.28), transparent 70%);
  filter: blur(24px);
  z-index: 0;
}
.shot-app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 148px 1fr;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  text-align: left;
  box-shadow: 0 0 0 1px rgba(240, 106, 155, 0.18), 0 30px 70px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 var(--hairline);
}
.shot-side { background: var(--bg-deep); border-right: 1px solid var(--border); padding: 14px 10px; display: flex; flex-direction: column; }
.shot-side-label { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; padding-left: 8px; }
.shot-chap { font-size: 12.5px; color: var(--fg-2); padding: 6px 8px; border-radius: 7px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-chap.on { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.shot-main { padding: 16px; min-width: 0; }
.shot-beat {
  border: 1px solid var(--border);
  background: var(--surface-raised);
  border-radius: var(--r-md);
  padding: 13px 15px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 var(--hairline);
}
.shot-beat:last-child { margin-bottom: 0; }
.shot-beat.on {
  border-color: transparent;
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    var(--grad-border) border-box;
  box-shadow: 0 12px 30px -16px rgba(240, 106, 155, 0.45);
}
.shot-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 9px;
}
.shot-state svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.shot-state.committed { background: var(--ok-soft); color: var(--ok); }
.shot-state.drafting { background: var(--accent-soft); color: var(--accent-text); }
.shot-prose { font-family: var(--font-display); font-size: 14px; line-height: 1.65; color: var(--fg); }
.shot-beat.committed .shot-prose { color: var(--fg-2); }
.shot-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.shot-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-2);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 5px 10px;
  border-radius: var(--r-sm);
}
.shot-pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.shot-pill.primary { background: var(--grad-btn); color: #fff; border-color: transparent; box-shadow: var(--glow); }
/* what the AI is reading for this beat (landing hero) */
.shot-ctx { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 11px; font-size: 10.5px; }
.shot-ctx span { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-2); }
.shot-ctx .shot-ctx-label { padding: 2px 0; border: 0; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-3); }
.shot-status {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  color: var(--fg-3);
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
  font-variant-numeric: tabular-nums;
}
/* The sidebar's Bible & Now line (the demo animates it after each commit). */
/* Pinned to the sidebar's bottom edge, as in the app. */
.shot-side-bible-label { margin-top: auto; padding-top: 16px; margin-bottom: 3px; }
/* The status itself stays quiet: small, dim, a soft dot. */
.shot-bible { font-size: 9px; color: var(--fg-3); opacity: 0.8; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.01em; }
.shot-bible b { color: var(--ok); opacity: 0.75; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.shot-bible b::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 4px var(--ok); }
@media (max-width: 480px) {
  .shot-app { grid-template-columns: 1fr; }
  .shot-side { display: none; }
}

/* ---- the live walkthrough (/hero-demo.js) ------------------------------
   Everything below only applies once the script has taken over (.shot-main.live).
   The static mockup above is the no-JS / reduced-motion frame. */
.shot-main.live { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; }
.shot-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px 8px;
  flex-wrap: wrap;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding: 0 2px 2px;
}
.shot-steps span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; transition: color 0.3s; }
.shot-steps span i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border-strong);
  transition: background 0.3s, box-shadow 0.3s;
}
.shot-steps span.done { color: var(--fg-2); }
.shot-steps span.done i { background: var(--fg-3); }
.shot-steps span.on { color: var(--accent-text); }
.shot-steps span.on i { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.shot-feed {
  position: relative;
  height: 392px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: opacity 0.45s;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 44px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 44px);
}
.shot-feed.fade { opacity: 0; }
.shot-feed .shot-beat { flex: 0 0 auto; }
.shot-feed .shot-beat:last-child { margin-bottom: 0; }
/* a new beat card grows in, pushing the committed ones up */
.shot-feed .shot-beat.enter { max-height: 0; opacity: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
.shot-feed .shot-beat {
  max-height: 520px;
  transition: max-height 0.5s ease, opacity 0.4s ease 0.1s, padding 0.5s ease, margin 0.5s ease,
    background 0.35s, border-color 0.35s, box-shadow 0.35s;
}
.shot-feed .shot-beat.committed { max-height: 320px; }
.live .shot-state.sketch { background: var(--surface); color: var(--fg-2); border: 1px solid var(--border-strong); }
.live .shot-state { transition: background 0.3s, color 0.3s; }
.live .shot-state.busy::after {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  animation: shot-pulse 0.9s ease-in-out infinite;
}
/* the writer typing (note, steer) vs the AI streaming (prose) */
.live .shot-prose { min-height: 1.65em; transition: opacity 0.3s; }
.live .shot-prose.dim { opacity: 0.3; }
.shot-caret {
  display: none;
  width: 1.5px; height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--accent);
  animation: shot-blink 1s steps(2, start) infinite;
}
.typing > .shot-caret { display: inline-block; }
.shot-w { animation: shot-word 0.35s ease both; }
.shot-extra { overflow: hidden; max-height: 200px; transition: max-height 0.45s ease, opacity 0.3s; }
.live .shot-beat.lock .shot-extra { max-height: 0; opacity: 0; }
.live .shot-ctx { display: none; }
.live .shot-beat.ctx-on .shot-ctx { display: flex; animation: shot-rise 0.35s ease both; }
.shot-steer {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  font-size: 12.5px;
  color: var(--fg);
}
.live .shot-beat.steer-on .shot-steer { display: flex; animation: shot-rise 0.35s ease both; }
.shot-steer-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.shot-steer .shot-caret { height: 0.95em; vertical-align: -0.1em; }
.live .shot-pill { transition: transform 0.15s ease, background 0.15s, border-color 0.15s, color 0.15s; }
.live .shot-pill.pressed { transform: scale(0.94); border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-soft); }
.live .shot-pill.primary.pressed { color: #fff; background: var(--accent-strong); }
.shot-chap.pub::after {
  content: "\2713";
  float: right;
  color: var(--ok);
  font-weight: 800;
  animation: shot-rise 0.3s ease both;
}
.shot-bible .busy { color: var(--warn); opacity: 1; }
.shot-bible .busy::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: shot-pulse 0.9s ease-in-out infinite; }
.shot-toast {
  position: absolute;
  left: 16px; right: 16px; bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--r-md);
  background: var(--ok-soft);
  border: 1px solid rgba(134, 210, 154, 0.4);
  color: var(--ok);
  font-size: 13px;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s, transform 0.35s;
  pointer-events: none;
  z-index: 2;
}
.shot-toast.show { opacity: 1; transform: none; }
.shot-toast svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.shot-toast b { font-weight: 700; }
.shot-main.live { position: relative; }
@keyframes shot-blink { to { visibility: hidden; } }
@keyframes shot-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes shot-word { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
@keyframes shot-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) {
  .shot-feed { height: 420px; }
  .shot-status { flex-wrap: wrap; gap: 4px 10px; }
  .shot-status span { white-space: nowrap; }
}

/* ---------- landing: sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 10px;
}
.section-head h2 em { font-style: italic; color: var(--accent-text); }
.section-head p { color: var(--fg-2); font-size: 15.5px; }

.feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.feat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
  box-shadow: inset 0 1px 0 var(--hairline);
  min-width: 0;
}
.ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  box-shadow: 0 0 20px -6px rgba(240, 106, 155, 0.6);
}
.ico svg { width: 17px; height: 17px; stroke: var(--accent-text); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.feat h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.01em; }
.feat p { font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.feats.feats-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) { .feats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .feats.feats-3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .feats { grid-template-columns: 1fr; } }

/* how it works: a real sequence, so the numbers stay */
.steps { display: grid; grid-template-columns: 1fr 1.3fr; gap: 36px; align-items: start; }
.step-list { display: grid; gap: 10px; }
.step {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.step i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--grad-btn);
  box-shadow: var(--glow);
}
.step b { display: block; font-size: 14.5px; font-weight: 700; margin-bottom: 2px; }
.step span { font-size: 13.5px; color: var(--fg-2); line-height: 1.55; }
.step span strong { color: var(--fg-soft); font-weight: 700; }
@media (max-width: 880px) { .steps { grid-template-columns: 1fr; gap: 20px; } }

/* guides teaser */
.home-guides-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.home-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 var(--hairline);
  transition: border-color 120ms, transform 120ms;
  min-width: 0;
}
.home-guide:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.home-guide-title { font-family: var(--font-display); font-size: 17px; line-height: 1.3; color: var(--fg); }
.home-guide-desc { font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.home-guides-all { list-style: none; margin: 20px 0 0; padding: 0; columns: 3; column-gap: 24px; }
.home-guides-all li { break-inside: avoid; padding: 4px 0; font-size: 13.5px; line-height: 1.4; }
.home-guides-all a { color: var(--fg-2); }
.home-guides-all a:hover { color: var(--fg); }
@media (max-width: 880px) { .home-guides-all { columns: 1; } }
.home-guides-foot { margin-top: 20px; }
.link-arrow { font-size: 14px; font-weight: 700; color: var(--accent-text); }
.link-arrow:hover { color: var(--fg); }
@media (max-width: 880px) { .home-guides-list { grid-template-columns: 1fr; } }

/* closing band */
.band {
  margin: 8px 0 56px;
  border-radius: var(--r-lg);
  padding: 44px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, rgba(240, 106, 155, 0.14), rgba(245, 166, 106, 0.05));
}
.band h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 38px);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  text-wrap: balance;
}
.band p { color: var(--fg-2); margin-bottom: 20px; }
.band-tip { display: block; margin-top: 16px; font-size: 13px; color: var(--fg-3); }
.band-tip a { color: var(--accent-2); }
@media (max-width: 600px) { .band { padding: 32px 20px; } }

/* ---------- pricing cards (landing #pricing, press page) ---------- */
.price-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 20px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.price-card.featured {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, rgba(240, 106, 155, 0.12), var(--surface) 70%);
  box-shadow: var(--glow), inset 0 1px 0 var(--hairline);
}
.price-tag {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--grad-btn);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.price-name { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.price-amount {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.05;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.price-credits { font-size: 14px; font-weight: 700; color: var(--accent-text); }
.price-blurb { flex: 1; margin: 6px 0 16px; font-size: 13.5px; line-height: 1.5; color: var(--fg-2); }
.price-card .btn { width: 100%; }
.price-fine { margin-top: 16px; font-size: 13px; color: var(--fg-3); max-width: 720px; }
@media (max-width: 880px) { .price-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .price-cards { grid-template-columns: 1fr; } }

/* ---------- article pages (guides, authors) ---------- */
.article-page { padding-bottom: 72px; }
.crumbs { font-size: 12.5px; color: var(--fg-3); margin: 8px 0 18px; }
.crumbs a { color: var(--fg-2); }
.crumbs a:hover { color: var(--fg); }
.article-page h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 14px;
}
.lead { font-size: 17px; color: var(--fg-2); margin-bottom: 28px; max-width: 60ch; }
.meta { font-size: 13px; color: var(--fg-3); margin-bottom: 36px; }
.meta .byline { color: var(--accent-2); font-weight: 600; }
article { font-size: 16.5px; line-height: 1.75; color: var(--fg-soft); }
article h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.25; color: var(--fg); margin: 2.4em 0 0.6em; }
article h3 { font-size: 18px; font-weight: 700; color: var(--fg); margin: 1.8em 0 0.5em; }
article p { margin: 0 0 1.15em; }
article a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
article ul, article ol { margin: 0 0 1.3em; padding-left: 1.4em; }
article li { margin-bottom: 0.45em; }
article strong { color: var(--fg); font-weight: 700; }
article blockquote { border-left: 2px solid var(--accent-border); padding: 0.2em 0 0.2em 1.1em; margin: 0 0 1.3em; color: var(--fg-2); font-style: italic; }
article code { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 5px; padding: 0.08em 0.4em; font-size: 0.86em; font-family: var(--font-mono); color: var(--accent-text); }
article hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }
.cta {
  margin: 3em 0 1em;
  padding: 26px 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, rgba(240, 106, 155, 0.14), rgba(245, 166, 106, 0.05));
}
.cta h3 { font-family: var(--font-display); font-weight: 400; font-size: 24px; color: var(--fg); margin: 0 0 8px; }
.cta p { font-size: 15px; color: var(--fg-2); margin-bottom: 16px; }
.more { margin-top: 3em; padding-top: 1.5em; border-top: 1px solid var(--border); }
.more h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-3); margin-bottom: 12px; }
.more ul { padding: 0; margin: 0; }
.more li { list-style: none; margin-bottom: 8px; font-size: 15px; }
.more li a { color: var(--fg-soft); text-decoration: none; }
.more li a:hover { color: var(--accent-text); }

.cards, .author-cards { display: grid; gap: 12px; margin-top: 8px; }
.card {
  display: block;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 var(--hairline);
  transition: border-color 120ms, transform 120ms;
}
.card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.card h2 { font-family: var(--font-display); font-weight: 400; font-size: 20px; color: var(--fg); margin-bottom: 6px; line-height: 1.3; }
.card p { font-size: 14px; color: var(--fg-2); margin-bottom: 8px; }
.card .meta { font-size: 12px; color: var(--fg-3); margin: 0; }
.card-author { display: flex; gap: 16px; align-items: center; }
.card-author img { border-radius: 50%; flex: 0 0 auto; }
.card-author h2 { margin-bottom: 2px; }
.card-author p { margin: 0; }
.author-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 16px; }
.author-hero img { border-radius: 50%; flex: 0 0 auto; }
.author-role { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-text); margin-bottom: 6px; }
.author-hero h1 { margin-bottom: 0; }
.author-page-bio { font-size: 17px; color: var(--fg-soft); margin: 0 0 12px; }
.author-contact { font-size: 14px; color: var(--fg-3); margin: 0 0 36px; }
.author-contact a { color: var(--accent-2); }
.author-list-head { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--fg); margin-bottom: 6px; }

/* ---------- legal pages ---------- */
.legal { padding-bottom: 72px; }
.legal h1 { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 5vw, 40px); line-height: 1.15; margin: 8px 0 6px; }
.legal .updated { font-size: 13px; color: var(--fg-3); margin-bottom: 36px; }
.legal h2 { font-size: 17px; font-weight: 700; color: var(--fg); margin: 2em 0 0.5em; }
.legal p, .legal li { color: var(--fg-soft); font-size: 15.5px; line-height: 1.7; }
.legal p { margin-bottom: 1em; }
.legal ul { padding-left: 1.4em; margin-bottom: 1em; }
.legal li { margin-bottom: 0.4em; }
.legal p a, .legal li a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.legal .callout {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 20px 0;
}
.legal .callout p { margin: 0; }
.legal .divider { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }
.legal .back-link { display: inline-block; font-size: 14px; font-weight: 600; color: var(--fg-2); }
.legal .back-link:hover { color: var(--accent-text); }

/* ---------- press page ---------- */
.press-hero { position: relative; overflow: hidden; padding-bottom: 8px; }
.press-hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 820px;
  pointer-events: none;
  background:
    radial-gradient(640px 360px at 50% 12%, rgba(240, 106, 155, 0.22), transparent 70%),
    radial-gradient(520px 320px at 85% 30%, rgba(245, 166, 106, 0.12), transparent 70%),
    radial-gradient(520px 320px at 12% 40%, rgba(240, 106, 155, 0.08), transparent 70%);
}
.press-hero > * { position: relative; }
.press-head { max-width: 860px; margin: 0 auto; padding: 52px 0 36px; text-align: center; }
.press-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--accent-border);
  border-radius: 999px;
  background: rgba(240, 106, 155, 0.08);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--fg-soft);
}
.press-kicker b {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--grad-btn);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.press-head h1 {
  margin: 22px 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 6.4vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.press-head h1 em {
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.press-dek { max-width: 680px; margin: 0 auto; font-size: clamp(16px, 2vw, 19px); line-height: 1.6; color: var(--fg-2); text-wrap: pretty; }
.press-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.press-shot { position: relative; max-width: 820px; margin: 12px auto 0; }
.press-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: rgba(22, 20, 26, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.8), var(--glow);
  font-size: 14px;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}
.press-chip span { color: var(--accent-text); font-size: 17px; }
.press-chip.one { top: -18px; right: -14px; }
.press-chip.two { bottom: 26px; left: -22px; }
@media (max-width: 880px) {
  .press-chip.one { right: 8px; }
  .press-chip.two { left: 8px; bottom: -18px; }
}

.press-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; padding: 64px 0 24px; }
.press-article { max-width: 680px; }
.press-dateline { font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 18px; }
.press-article p { font-family: var(--font-display); font-size: 18.5px; line-height: 1.75; color: var(--fg-soft); margin-bottom: 1.1em; text-wrap: pretty; }
.press-article p.lede::first-letter {
  float: left;
  margin: 6px 12px 0 0;
  font-size: 4.1em;
  line-height: 0.8;
  font-style: italic;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.press-article h2 {
  margin: 1.9em 0 0.6em;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.press-article strong { color: var(--fg); font-weight: 500; }
.press-article a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.press-pull {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid transparent;
  border-image: var(--grad) 1;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  line-height: 1.4;
  color: var(--fg);
}
.press-aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.press-card {
  padding: 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.press-card h3 { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 12px; }
.press-facts { display: grid; gap: 12px; }
.press-facts div { display: grid; gap: 2px; }
.press-facts dt { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
.press-facts dd { font-size: 14px; line-height: 1.5; color: var(--fg-soft); }
.press-facts dd a { color: var(--accent-text); }
.press-card.contact { border-color: var(--accent-border); background: linear-gradient(180deg, rgba(240, 106, 155, 0.12), var(--surface)); }
.press-card.contact p { font-size: 14px; line-height: 1.55; color: var(--fg-2); margin-bottom: 14px; }
.press-card.contact .btn { width: 100%; }
.press-card.research p { font-size: 14px; line-height: 1.55; color: var(--fg-2); margin-bottom: 10px; }
.press-card.research p:last-child { margin-bottom: 0; }
@media (max-width: 980px) {
  .press-body { grid-template-columns: 1fr; gap: 32px; }
  .press-aside { position: static; }
}

.press-new { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.press-new .feat h3 { font-size: 16px; }
@media (max-width: 880px) { .press-new { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .press-new { grid-template-columns: 1fr; } }

.press-kit { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 12px; }
.kit-item {
  display: flex;
  flex-direction: column;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 120ms, transform 120ms;
}
.kit-item:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.kit-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1200 / 630;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
}
.kit-preview img { width: 100%; height: 100%; object-fit: cover; }
.kit-preview.icon img { width: 42%; height: auto; border-radius: 22%; box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.8); }
.kit-preview.swatches { display: grid; grid-template-columns: repeat(3, 1fr); place-items: stretch; }
.kit-preview.swatches i { display: block; }
.kit-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
.kit-meta b { display: block; font-size: 14px; color: var(--fg); }
.kit-meta small { font-size: 12px; color: var(--fg-3); font-family: var(--font-mono); }
.kit-meta .dl { font-size: 12.5px; font-weight: 700; color: var(--accent-text); white-space: nowrap; }
@media (max-width: 880px) { .press-kit { grid-template-columns: 1fr 1fr; } .press-kit .kit-item:first-child { grid-column: 1 / -1; } }
@media (max-width: 480px) { .press-kit { grid-template-columns: 1fr; } }

.press-boiler {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 28px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface);
}
.press-boiler h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.2; }
.press-boiler p { font-size: 15.5px; line-height: 1.7; color: var(--fg-soft); }
.press-boiler p + p { margin-top: 0.8em; }
.press-boiler a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.press-boiler .names { font-size: 13.5px; color: var(--fg-2); }
.press-boiler .names b { color: var(--fg); }
@media (max-width: 760px) { .press-boiler { grid-template-columns: 1fr; gap: 12px; padding: 22px; } }

/* ---------- guide pages: hero, two-column layout, sidebar ---------- */
/* A guide is a hero (crumbs, H1, lede, meta, CTA row) over a grid: the
   article in a ≤68ch column and, from 1024px, a sticky 300px sidebar (table
   of contents, CTA card, related guides). Narrower, the sidebar's blocks
   stack into the page grid (display: contents + order): TOC before the
   article, CTA card and related after it. */
.wrap-guide { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap-guide { padding-inline: 18px; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.guide-hero { max-width: 760px; padding: 4px 0 32px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.guide-hero .crumbs { margin: 0 0 20px; }
.guide-hero h1 { margin-bottom: 14px; }
.guide-hero .lede { font-size: 18px; line-height: 1.55; color: var(--fg-2); max-width: 62ch; margin: 0 0 16px; text-wrap: pretty; }
.guide-hero .meta { margin-bottom: 22px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cta-row .fine { font-size: 12.5px; color: var(--fg-3); }
.cta-row .fine::before { content: "✓"; color: var(--ok); margin-right: 6px; font-weight: 800; }

.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: start; }
.guide-body { min-width: 0; max-width: 68ch; }
.guide-side { display: contents; }
.guide-side .toc { order: -1; }
.guide-side .side-cta { order: 1; }
.guide-side .side-related { order: 2; }
.guide-side > :empty { display: none; }
@media (min-width: 1024px) {
  .guide-layout { grid-template-columns: minmax(0, 68ch) 300px; column-gap: 64px; }
  .guide-side {
    display: flex;
    flex-direction: column;
    gap: 22px;
    position: sticky;
    top: 24px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    scrollbar-width: none;
  }
  .guide-side::-webkit-scrollbar { display: none; }
  .guide-side .toc, .guide-side .side-cta, .guide-side .side-related { order: 0; }
}

.side-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-3); margin: 0 0 10px; }
.toc { padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: inset 0 1px 0 var(--hairline); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 5px 0 5px 14px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--fg-2);
  transition: color 120ms, border-color 120ms;
}
.toc a:hover { color: var(--fg); }
.toc a.is-active { color: var(--accent-text); border-left-color: var(--accent); }
@media (min-width: 1024px) { .toc { padding: 0; background: none; border: none; box-shadow: none; } }

.side-cta {
  padding: 22px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--accent-border);
  background: linear-gradient(180deg, rgba(240, 106, 155, 0.14), rgba(245, 166, 106, 0.05));
}
.side-cta h3 { font-family: var(--font-display); font-weight: 400; font-size: 21px; line-height: 1.25; color: var(--fg); margin: 0 0 12px; text-wrap: balance; }
.side-cta ul { list-style: none; padding: 0; margin: 0 0 18px; }
.side-cta li { position: relative; padding-left: 20px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.45; color: var(--fg-2); }
.side-cta li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--ok); font-weight: 800; }
.side-cta .btn { width: 100%; }
.side-cta .fine { margin: 10px 0 0; font-size: 12px; color: var(--fg-3); text-align: center; }

.side-related ul { list-style: none; padding: 0; margin: 0; }
.side-related li { margin-bottom: 12px; font-size: 14px; line-height: 1.4; }
.side-related li a { color: var(--fg-soft); }
.side-related li a:hover { color: var(--accent-text); }
.side-related .tag { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); }
@media (max-width: 1023px) { .side-related { padding-top: 24px; border-top: 1px solid var(--border); } }

/* in-article extras: tables, figures, callouts, the end CTA, the "made" box */
article h2 { scroll-margin-top: 24px; }
article blockquote p { margin: 0; }
article blockquote p + p { margin-top: 0.7em; }
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); -webkit-overflow-scrolling: touch; }
article table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
article th, article td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
article th { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); background: var(--surface-raised); white-space: nowrap; }
article td:first-child { color: var(--fg); font-weight: 600; }
article tbody tr:last-child td { border-bottom: none; }
article figure { margin: 0 0 1.5em; }
article figure img { display: block; width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--border); }
article figcaption { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--fg-3); }
article p.note {
  padding: 14px 18px;
  border: 1px solid var(--accent-border);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  font-size: 15px;
}
article p.note strong { color: var(--accent-text); }
.cta .fine { display: block; margin-top: 12px; font-size: 12.5px; color: var(--fg-3); }
.cta.cta-end { margin-top: 3.5em; background: var(--surface); border-color: var(--border-strong); box-shadow: inset 0 1px 0 var(--hairline); }
.made-box {
  margin: 2.5em 0 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: inset 0 1px 0 var(--hairline);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-2);
}
.made-box .made-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-3); margin: 0 0 6px; }
.made-box p { margin: 0; }
.made-box a { color: var(--accent-2); text-decoration: none; }
.made-box a:hover { color: var(--accent-text); }

/* /guides index: cards in two columns on wide screens, with a cluster tag */
.card-tag { display: inline-block; margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.guide-page .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .guide-page .cards { grid-template-columns: 1fr; } }
.card h2 { text-wrap: pretty; }

@media (prefers-reduced-motion: reduce) {
  .btn, .card, .home-guide, .kit-item, .toc a { transition: none; }
  .btn-primary:hover, .card:hover, .home-guide:hover, .kit-item:hover { transform: none; }
}

/* ---------- landing: the feature showcases (#features) ----------
   Four blocks, text one side and a live mock of the feature the other,
   alternating. /landing.js reveals them on scroll (.reveal → .in) and runs
   each mock as a silent loop while it is on screen (data-scene). The static
   markup is the no-JS / reduced-motion frame, so every mock reads as a
   finished picture before any script runs. */
.showcase { padding-bottom: 24px; }
.showcase .section-head { max-width: 760px; margin: 0 auto 8px; text-align: center; }
/* The text column is as wide as the text (so no slack opens between the
   two halves); the mock takes the rest, up to a sane width. */
.show {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
  padding: 44px 0;
}
.show + .show { border-top: 1px solid var(--hairline); }
.show.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 440px); }
.show.flip .show-text { order: 2; }
.show-text { min-width: 0; }
.show-visual { max-width: 720px; width: 100%; justify-self: end; }
.show.flip .show-visual { justify-self: start; }
.show-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 14px;
}
.show-kicker i { width: 18px; height: 2px; border-radius: 2px; background: var(--grad); }
.show-text h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 14px;
}
.show-text h3 em { font-style: italic; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.show-text p { font-size: 15.5px; line-height: 1.65; color: var(--fg-2); margin-bottom: 18px; }
.show-points { list-style: none; display: grid; gap: 8px; }
.show-points li { position: relative; padding-left: 24px; font-size: 14px; color: var(--fg-soft); line-height: 1.5; }
.show-points li b { color: var(--fg); font-weight: 700; }
.show-points li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 12px -2px rgba(240, 106, 155, 0.7);
}
.show-points li::after {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 6px; height: 3.5px;
  border-left: 1.8px solid var(--accent-text);
  border-bottom: 1.8px solid var(--accent-text);
  transform: rotate(-45deg);
}
.show-visual { position: relative; min-width: 0; }
.show-visual::before {
  content: "";
  position: absolute;
  inset: 8% -4% -8% -4%;
  background: radial-gradient(55% 55% at 50% 45%, rgba(240, 106, 155, 0.22), transparent 70%);
  filter: blur(26px);
  z-index: 0;
  pointer-events: none;
}
.show.flip .show-visual::before { background: radial-gradient(55% 55% at 50% 45%, rgba(245, 166, 106, 0.18), transparent 70%); }
@media (max-width: 880px) {
  .show, .show.flip { grid-template-columns: 1fr; gap: 26px; padding: 36px 0; }
  .show.flip .show-text { order: 0; }
  .show-text { max-width: 560px; }
  .show-visual, .show.flip .show-visual { justify-self: start; max-width: none; }
}

/* the mock window every showcase sits in */
.sv {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  text-align: left;
  box-shadow: 0 0 0 1px rgba(240, 106, 155, 0.16), 0 30px 70px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 var(--hairline);
}
.sv-pane { min-width: 0; padding: 14px; }
.sv-pane + .sv-pane { border-left: 1px solid var(--border); background: var(--bg-deep); }
.sv-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 12px;
  white-space: nowrap;
}
.sv-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); margin-right: 6px; display: inline-block; vertical-align: 1px; }
.sv-prose { font-family: var(--font-display); font-size: 13.5px; line-height: 1.62; color: var(--fg); }
.sv .shot-pill { font-size: 11.5px; padding: 4px 9px; transition: transform 0.15s ease, background 0.15s, border-color 0.15s, color 0.15s; }
.sv .shot-pill.pressed { transform: scale(0.94); border-color: var(--accent-border); color: var(--accent-text); background: var(--accent-soft); }
.sv .shot-pill.primary.pressed { color: #fff; background: var(--accent-strong); }
.sv .shot-w { animation: shot-word 0.35s ease both; }
.sv .shot-caret { display: inline-block; }
.sv .t { white-space: pre-wrap; }
/* A mock never changes height while it plays: every text it can show sits
   in the same grid cell, the hidden ones only holding the room (so the
   box is as tall as its longest state at any width, no per-breakpoint
   fixed heights). */
.sv-stack { display: grid; }
.sv-stack > * { grid-area: 1 / 1; min-width: 0; }
.sv-ghost { visibility: hidden; pointer-events: none; }
@media (max-width: 480px) {
  .sv, .sv.sv-publish { grid-template-columns: 1fr; }
  .sv-pane + .sv-pane { border-left: 0; border-top: 1px solid var(--border); }
}

/* 1 · the story bible */
.sv-beat {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    var(--grad-border) border-box;
  border-radius: var(--r-md);
  padding: 12px 13px;
  box-shadow: 0 12px 30px -16px rgba(240, 106, 155, 0.45);
  transition: border-color 0.4s, box-shadow 0.4s, opacity 0.4s;
}
.sv-bible.done .sv-beat { background: var(--surface-raised); border-color: var(--border); box-shadow: none; }
.sv-bible.done .sv-beat .sv-prose { color: var(--fg-2); }
.sv-acts { display: flex; justify-content: flex-end; margin-top: 10px; }
.nm { font-weight: 500; border-radius: 4px; padding: 0 2px; margin: 0 -2px; transition: background 0.3s, color 0.3s, box-shadow 0.3s; }
.nm.lit { background: var(--accent-soft); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-border); }
.sv-next { margin-top: 12px; opacity: 0.45; transition: opacity 0.4s; }
.sv-bible.next-on .sv-next { opacity: 1; }
.sv-next-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 6px; }
.sv-mind { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 10.5px; }
.sv-mind span { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--fg-2); transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s; }
.sv-mind .sv-mind-label { padding: 2px 0; border: 0; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--fg-3); }
.sv-mind span.lit { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-border); box-shadow: 0 0 14px -4px var(--accent); }
.sv-bible-state { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; letter-spacing: 0.02em; text-transform: none; font-size: 10.5px; color: var(--ok); }
.sv-bible-state i { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.sv-bible-state.busy { color: var(--warn); }
.sv-bible-state.busy i { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: shot-pulse 0.9s ease-in-out infinite; }
.sv-entries { display: grid; gap: 6px; }
.sv-entry {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  align-items: center;
  padding: 7px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.35s, box-shadow 0.35s, background 0.35s, opacity 0.4s, transform 0.4s;
}
.sv-entry b { display: block; font-size: 12px; font-weight: 700; color: var(--fg); line-height: 1.2; }
.sv-entry small { display: block; font-size: 10.5px; color: var(--fg-3); margin-top: 1px; }
.sv-entry-ico {
  width: 24px; height: 24px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
}
.sv-entry.flash { border-color: var(--accent-border); background: var(--accent-soft); box-shadow: 0 0 18px -6px var(--accent); }
.sv-entry small .n { transition: color 0.3s; }
.sv-entry.flash small, .sv-entry.flash small .n { color: var(--accent-text); }
.sv-bible.live .sv-entry-new { opacity: 0; transform: translateY(6px); }
.sv-bible.live .sv-entry-new.shown { opacity: 1; transform: none; }
.sv-foot { margin-top: 12px; font-size: 10.5px; color: var(--fg-3); }
.sv-count { color: var(--fg-2); font-weight: 700; }
.sv-fly {
  position: absolute;
  z-index: 3;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  box-shadow: 0 0 16px -4px var(--accent);
  pointer-events: none;
  white-space: nowrap;
  transition: transform 0.75s cubic-bezier(0.3, 0.8, 0.25, 1), opacity 0.3s ease 0.55s;
}

/* 2 · versions: a map beside the picked draft */
.sv-tree { display: flex; flex-direction: column; }
.sv-graph { position: relative; }
.sv-graph svg { position: absolute; left: 0; top: 0; width: 56px; height: 100%; overflow: visible; }
.sv-line { fill: none; stroke: var(--border-strong); stroke-width: 1.5; }
.sv-versions.live .sv-line { stroke-dasharray: 400; stroke-dashoffset: 400; transition: stroke-dashoffset 0.8s ease; }
.sv-versions.live .sv-line.drawn { stroke-dashoffset: 0; }
.sv-rows { list-style: none; display: grid; }
.sv-row {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: calc(8px + var(--lane) * 24px);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-2);
  transition: color 0.3s, opacity 0.4s, transform 0.4s;
}
.sv-row small { display: block; font-size: 10.5px; font-weight: 500; color: var(--fg-3); }
.sv-row i {
  flex: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  box-shadow: 0 0 0 3px var(--bg-deep);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s, transform 0.3s;
}
.sv-row.current { color: var(--fg); }
.sv-row.current i { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--bg-deep), 0 0 16px var(--accent); transform: scale(1.15); }
.sv-row.picked:not(.current) i { border-color: var(--accent-text); }
.sv-versions.live .sv-row { opacity: 0; transform: translateX(-6px); }
.sv-versions.live .sv-row.shown { opacity: 1; transform: none; }
.sv-undo { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.sv-draft-name { color: var(--fg-2); }
.sv-draft-tag { font-size: 9.5px; letter-spacing: 0.08em; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-border); }
.sv-draft-tag.old { background: var(--surface); color: var(--fg-3); border-color: var(--border-strong); }
.sv-draft-text { transition: opacity 0.3s, transform 0.3s; }
.sv-draft-text.swap { opacity: 0; transform: translateY(5px); }

/* 3 · rewrite control: the gearbox */
.sv-gears { grid-template-columns: 1fr; }
.sv-words { text-transform: none; letter-spacing: 0.02em; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.sv-words b { color: var(--fg-2); }
.sv-note {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--fg-2);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-strong);
  background: var(--surface-raised);
}
.sv-note-label { display: block; font-family: var(--font-ui); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 3px; }
.sv-shift { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin: 12px 0; }
.sv-shift-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-3); }
.sv-gearbox {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-deep);
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.5);
}
.sv-knob {
  position: absolute;
  top: 3px; bottom: 3px; left: 3px;
  width: calc((100% - 6px) / 3);
  border-radius: 999px;
  background: var(--grad-btn);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transform: translateX(calc(var(--g, 1) * 100%));
  transition: transform 0.45s cubic-bezier(0.3, 0.8, 0.25, 1.15);
}
.sv-gear {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0;
  color: var(--fg-3);
  transition: color 0.3s;
}
.sv-gear.on { color: #fff; }
.sv-gauge { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.sv-gauge i { width: 7px; border-radius: 2px; background: var(--border-strong); transition: background 0.35s, box-shadow 0.35s; }
.sv-gauge i:nth-child(1) { height: 9px; }
.sv-gauge i:nth-child(2) { height: 15px; }
.sv-gauge i:nth-child(3) { height: 22px; }
.sv-gauge i.on { background: var(--accent); box-shadow: 0 0 10px -2px var(--accent); }
.sv-out {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    var(--grad-border) border-box;
  border-radius: var(--r-md);
  padding: 12px 13px;
  box-shadow: 0 12px 30px -16px rgba(240, 106, 155, 0.45);
}
.sv-out-text { transition: opacity 0.3s; }
.sv-out-text.dim { opacity: 0.3; }

/* 4 · publish */
.sv-publish { grid-template-columns: 1fr 1.05fr; }
.sv-pub-meta { text-transform: none; letter-spacing: 0.02em; }
.sv-chaps { list-style: none; display: grid; gap: 5px; margin-bottom: 12px; }
.sv-chaps li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-2);
  padding: 7px 9px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  transition: border-color 0.35s, background 0.35s;
}
.sv-chaps li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-chaps li b { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; color: var(--fg-3); border: 1px solid var(--border-strong); white-space: nowrap; transition: color 0.35s, background 0.35s, border-color 0.35s; }
.sv-chaps li.is-pub b { color: var(--ok); background: var(--ok-soft); border-color: rgba(134, 210, 154, 0.4); }
.sv-chaps li.sv-chap-new { border-color: var(--accent-border); }
.sv-chaps li.sv-chap-new.is-pub { border-color: var(--border); }
.sv-pub-btn { width: 100%; font-size: 13px; padding: 10px 14px; transition: transform 0.15s ease, filter 0.15s, background 0.3s, box-shadow 0.3s; }
.sv-pub-btn.pressed { transform: scale(0.96); filter: brightness(0.92); }
.sv-pub-btn.done { background: var(--ok-soft); color: var(--ok); box-shadow: inset 0 0 0 1px rgba(134, 210, 154, 0.4); }
.sv-pub-out { display: flex; flex-direction: column; gap: 10px; }
.sv-book {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: inset 0 1px 0 var(--hairline);
}
.sv-cover {
  aspect-ratio: 2 / 3;
  border-radius: 5px;
  display: flex;
  align-items: flex-end;
  padding: 6px 5px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 9.5px;
  line-height: 1.15;
  color: #fff;
  background: linear-gradient(160deg, #3a1f3a 0%, #d93a75 55%, #f5a66a 100%);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.sv-book-meta b { display: block; font-size: 13.5px; color: var(--fg); line-height: 1.2; }
.sv-book-meta small { display: block; font-size: 11px; color: var(--fg-3); margin: 2px 0 6px; }
.sv-book-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; font-size: 10.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.sv-book-stats span { white-space: nowrap; }
.sv-book-meta .sv-kudos b { display: inline; font-size: inherit; line-height: inherit; color: var(--accent-text); font-weight: 700; }
.sv-epub { padding: 1px 6px; line-height: 1.4; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em; }
.sv-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px 7px 11px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-2);
}
.sv-share-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-share-copy { flex: none; font-family: var(--font-ui); font-size: 11px; font-weight: 700; color: var(--accent-text); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--accent-border); background: var(--accent-soft); transition: background 0.3s, color 0.3s, border-color 0.3s; }
.sv-share-copy.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(134, 210, 154, 0.4); }
.sv-readers { display: flex; align-items: center; font-size: 11px; color: var(--fg-2); }
.sv-readers i {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  margin-right: -6px;
  background: linear-gradient(135deg, #e58bb5, #f5a66a);
}
.sv-readers i:nth-child(2) { background: linear-gradient(135deg, #86d29a, #e58bb5); }
.sv-readers i:nth-child(3) { background: linear-gradient(135deg, #f0b36a, #d93a75); }
.sv-readers span { margin-left: 12px; }
.sv-readers b { color: var(--fg); }
.sv-publish.live .sv-pub-out > * { opacity: 0; transform: translateY(8px); transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.sv-publish.live .sv-pub-out > .shown { opacity: 1; transform: none; }
.sv-publish.live .sv-book { transition-delay: 0s; }
.sv-publish.live .sv-cover { transform: rotateY(18deg); transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s; }
.sv-publish.live .sv-book.shown .sv-cover { transform: none; }

/* ---------- scroll reveal ----------
   Anything .reveal (or a child of .reveal-stagger) rises in once it scrolls
   into view. Only when the script is there to show it (html.js), so no-JS
   readers see everything at once. */
html.js .reveal,
html.js .reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--d, 0ms);
}
html.js .show-visual.reveal { transform: translateY(26px) scale(0.965); }
html.js .reveal.in,
html.js .reveal-stagger.in > * { opacity: 1; transform: none; }
html.js .reveal-stagger.in > :nth-child(2) { --d: 90ms; }
html.js .reveal-stagger.in > :nth-child(3) { --d: 180ms; }
html.js .reveal-stagger.in > :nth-child(4) { --d: 270ms; }
html.js .show-visual.reveal.in { --d: 120ms; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal, html.js .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
  .sv *, .sv-knob, .sv-line { transition: none !important; animation: none !important; }
}

/* ---------- landing: beat by beat → one manuscript (#beats) ----------
   A centred manuscript page with one slot per beat. Live, a card flies in
   over its slot, is drafted, steered and committed there, then dissolves
   into the slot's prose. Each slot holds its final text as a ghost, so the
   page is the same height before, during and after. */
.beatflow .section-head { max-width: 760px; margin: 0 auto 28px; text-align: center; }
.bf { position: relative; max-width: 720px; margin: 0 auto; }
.bf-rail {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 22px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.bf-rail span { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 18px; transition: color 0.3s; }
.bf-rail span + span::before {
  content: "";
  position: absolute;
  left: -14px;
  width: 28px;
  height: 1px;
  background: var(--border-strong);
}
.bf-rail span i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: background 0.3s, box-shadow 0.3s, transform 0.3s; }
.bf-rail span.done { color: var(--fg-2); }
.bf-rail span.done i { background: var(--fg-3); }
.bf-rail span.on { color: var(--accent-text); }
.bf-rail span.on i { background: var(--accent); box-shadow: 0 0 12px var(--accent); transform: scale(1.3); }
.bf-rail span.skip { opacity: 0.45; }
.bf-stage { position: relative; padding: 6px 10px; overflow: hidden; }
.bf-stage::before {
  content: "";
  position: absolute;
  inset: 10% 0 -6% 0;
  background: radial-gradient(55% 60% at 50% 50%, rgba(240, 106, 155, 0.2), transparent 70%);
  filter: blur(28px);
  pointer-events: none;
}
.bf-page {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 18px 22px 16px;
  box-shadow: 0 0 0 1px rgba(240, 106, 155, 0.16), 0 30px 70px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 var(--hairline);
  overflow: hidden;
  transition: box-shadow 0.8s, background 0.8s, border-radius 0.8s, color 0.8s;
}
.bf-page-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.bf-words { text-transform: none; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; transition: color 0.3s; }
.bf-words b { color: var(--fg-2); }
.bf-slots { display: grid; gap: 10px; }
.bf-slot {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 12px;
  transition: border-color 0.5s, background 0.5s;
}
.bf-slot.filled { border-color: transparent; }
.bf-slot .bf-text { transition: opacity 0.5s; }
.bf.live .bf-slot:not(.filled) .bf-text { opacity: 0; }
.bf-slot.filled .bf-text { color: var(--fg-soft); }
/* the beat card: same box as a slot, so its text wraps the same way */
.bf-card {
  position: absolute;
  z-index: 2;
  display: none;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 10px 12px;
  background:
    linear-gradient(var(--surface-raised), var(--surface-raised)) padding-box,
    var(--grad-border) border-box;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.9), 0 12px 30px -16px rgba(240, 106, 155, 0.5);
  transform: translateY(-6px) scale(1.015);
  transition: transform 0.5s cubic-bezier(0.2, 0.75, 0.2, 1), opacity 0.35s, box-shadow 0.4s, background 0.4s, border-color 0.4s;
  will-change: transform;
}
/* a card shows only once the script has placed it over its slot */
.bf.live .bf-card.placed { display: block; }
.bf-card.from-left { transform: translate(-115%, -6px) rotate(-3deg); opacity: 0; }
.bf-card.from-right { transform: translate(115%, -6px) rotate(3deg); opacity: 0; }
.bf-card.landed { transform: none; box-shadow: none; background: var(--surface-raised); border-color: var(--border); }
.bf-card.dissolve { opacity: 0; }
/* "Beat N" rides the card's top-left edge, the stage its top-right: no
   room taken, so the card is exactly its slot's box. */
.bf-tag, .bf-stage-tag {
  position: absolute;
  top: -10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 55%;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  transition: opacity 0.3s, background 0.3s, color 0.3s, border-color 0.3s;
}
.bf-tag { left: 12px; color: var(--fg-soft); background: var(--surface-raised); border: 1px solid var(--border-strong); }
.bf-stage-tag { right: 12px; color: var(--accent-text); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-raised); border: 1px solid var(--accent-border); text-transform: none; letter-spacing: 0.02em; font-weight: 700; }
.bf-stage-tag.busy::after { content: ""; flex: none; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: shot-pulse 0.9s ease-in-out infinite; }
.bf-stage-tag.ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(134, 210, 154, 0.4); }
.bf-card.landed .bf-tag, .bf-card.landed .bf-stage-tag { opacity: 0; }
.bf-card .sv-prose { transition: opacity 0.22s; }
/* the poof: out = blur, swell and vanish; in = condense from a blur */
.bf-card .sv-prose.poof-out { animation: bf-poof-out 0.28s ease-in both; }
.bf-card .sv-prose.poof-in { animation: bf-poof-in 0.42s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes bf-poof-out { to { opacity: 0; filter: blur(7px); transform: scale(1.05); letter-spacing: 0.06em; } }
@keyframes bf-poof-in { from { opacity: 0; filter: blur(9px); transform: scale(0.96); } 60% { filter: blur(0); } to { opacity: 1; filter: none; transform: none; } }
.bf-spark {
  position: absolute;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  pointer-events: none;
  animation: bf-spark 0.6s cubic-bezier(0.1, 0.6, 0.3, 1) both;
}
.bf-spark:nth-child(odd) { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.bf-spark:nth-child(3n) { width: 3px; height: 3px; }
@keyframes bf-spark { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); } }
.bf-card .sv-prose.dim { opacity: 0.3; }
.bf-card .sv-prose.note-style { color: var(--fg-2); }
.bf.clearing .bf-slot .bf-text { opacity: 0; }
@media (max-width: 600px) {
  .bf-rail { flex-wrap: wrap; gap: 6px 14px; }
  .bf-rail span { padding: 0; font-size: 10px; }
  .bf-rail span + span::before { display: none; }
  .bf-page { padding: 14px 14px 12px; }
}

/* ---- the finale: stitch, book page, publish ---- */
.bf-page-foot { height: 34px; display: grid; place-items: end center; }
.bf-pageno { font-family: var(--font-display); font-style: italic; font-size: 11.5px; color: var(--bg); opacity: 0; transition: opacity 0.6s 0.3s; }
/* a seam sweeps down the page as the beats join */
.bf-seam {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--grad);
  box-shadow: 0 0 18px 2px rgba(240, 106, 155, 0.6);
  opacity: 0;
  pointer-events: none;
}
.bf.stitch .bf-seam { animation: bf-sweep 1.1s cubic-bezier(0.4, 0, 0.3, 1) both; }
@keyframes bf-sweep { 0% { opacity: 0; transform: translateY(0); } 10% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(var(--sweep, 320px)); } }
.bf.stitch .bf-slot.filled .bf-text { animation: bf-join 0.5s ease both; }
.bf.stitch .bf-slot[data-i="1"] .bf-text { animation-delay: 0.3s; }
.bf.stitch .bf-slot[data-i="2"] .bf-text { animation-delay: 0.6s; }
@keyframes bf-join { 0% { color: var(--fg-soft); } 40% { color: var(--accent-text); } 100% { color: inherit; } }
/* the page becomes a book page: paper, ink, a drop cap, a running head */
.bf.book .bf-page {
  background: var(--fg);
  color: var(--bg);
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 40px 80px -30px rgba(0, 0, 0, 0.95), inset 14px 0 24px -18px rgba(0, 0, 0, 0.45);
}
.bf-page-head { transition: color 0.8s, border-color 0.8s; }
.bf.book .bf-page-head { color: rgba(15, 14, 18, 0.55); border-bottom-color: rgba(15, 14, 18, 0.15); }
.bf.book .bf-words b { color: var(--bg); }
.bf-slot .bf-text { transition: opacity 0.5s, color 0.8s; }
.bf.book .bf-slot.filled .bf-text { color: var(--bg); }
.bf.book .bf-slot[data-i="0"] .bf-text::first-letter {
  float: left;
  font-size: 3.1em;
  line-height: 0.78;
  margin: 5px 7px 0 0;
  font-style: italic;
  color: var(--accent-strong);
}
.bf.book .bf-pageno { opacity: 0.6; }
/* the stamp slams on */
.bf-stamp {
  position: absolute;
  right: 22px; bottom: 16px;
  padding: 4px 12px;
  border: 2.5px solid var(--accent-strong);
  border-radius: 6px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-9deg) scale(1.8);
  pointer-events: none;
}
.bf.published .bf-stamp { opacity: 0.88; transform: rotate(-9deg) scale(1); transition: opacity 0.25s, transform 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
.bf-after {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--ok);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s, transform 0.4s;
}
.bf-after svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.bf-after b { font-family: var(--font-mono); font-weight: 500; color: var(--fg-soft); }
.bf.published .bf-after, html:not(.js) .bf-after { opacity: 1; transform: none; }
.bf.clearing .bf-stamp, .bf.clearing .bf-after { opacity: 0; transition: opacity 0.4s; }
@media (max-width: 600px) { .bf-after { font-size: 12px; flex-wrap: wrap; text-align: center; } }
