/* Resurface: your backlog, as shorts.
   Four colour palettes share one set of tokens; pick with ?palette= (or ?pick for the swatch picker).
   Video previews play on a dark screen. */

:root {
  --display: "Funnel Display", "Funnel Sans", system-ui, sans-serif;
  --sans: "Funnel Sans", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;

  /* one accent per short, shared by every palette */
  --sh-violet: #b9a4f5;
  --sh-signal: #4cc38f;
  --sh-amber: #f2b84b;
  --sh-sky: #7fb2ff;
  --sh-coral: #f08079;
  --late-on-night: #f39a91;

  --ease-slide: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --inline: max(var(--gutter), calc((100% - var(--max)) / 2));
}

/* ---------- Palettes: light ---------- */

:root[data-palette="hn"] {
  --bg: #f6f6ef; --bg-2: #ededE3; --paper: #ffffff;
  --ink: #1f1d1a; --ink-soft: #5e5b53; --rule: #d8d6ca;
  --accent: #eb5a00; --on-accent: #ffffff; --accent-ink: #b84600;
  --late: #b8322b;
  --night: #221f1b; --night-2: #312c26; --on-night: #f6f6ef; --on-night-soft: #b7b2a6;
  --shadow: 0 1px 0 rgba(31, 29, 26, .06), 0 18px 40px -24px rgba(31, 29, 26, .45);
  color-scheme: light;
}
:root[data-palette="highlighter"] {
  --bg: #ffffff; --bg-2: #f5f5ee; --paper: #ffffff;
  --ink: #0f1b2d; --ink-soft: #4e5868; --rule: #dcdfe4;
  --accent: #ffd23f; --on-accent: #0f1b2d; --accent-ink: #7a5a00;
  --late: #b8322b;
  --night: #0f1b2d; --night-2: #1d2b42; --on-night: #f4f6fa; --on-night-soft: #a9b3c3;
  --shadow: 0 1px 0 rgba(15, 27, 45, .06), 0 18px 40px -24px rgba(15, 27, 45, .45);
  color-scheme: light;
}
:root[data-palette="cobalt"] {
  --bg: #f1f3fa; --bg-2: #e5e9f5; --paper: #ffffff;
  --ink: #0b1640; --ink-soft: #4a5378; --rule: #cad2ea;
  --accent: #2f54eb; --on-accent: #ffffff; --accent-ink: #2f54eb;
  --late: #c0392b;
  --night: #0b1640; --night-2: #1b2a66; --on-night: #eef1ff; --on-night-soft: #a7b1dd;
  --shadow: 0 1px 0 rgba(11, 22, 64, .06), 0 18px 40px -24px rgba(11, 22, 64, .5);
  color-scheme: light;
}
:root[data-palette="violet"] {
  --bg: #e3ebe5; --bg-2: #d5dfd8; --paper: #fbfcf9;
  --ink: #1d2340; --ink-soft: #4a5170; --rule: #a9bddc;
  --accent: #5a3cb0; --on-accent: #ffffff; --accent-ink: #5a3cb0;
  --late: #b8322b;
  --night: #191e36; --night-2: #262d4d; --on-night: #eef0f8; --on-night-soft: #a7aecb;
  --shadow: 0 1px 0 rgba(29, 35, 64, .08), 0 18px 40px -24px rgba(29, 35, 64, .5);
  color-scheme: light;
}

/* ---------- Palettes: dark ---------- */

@media (prefers-color-scheme: dark) {
  :root[data-palette="hn"] {
    --bg: #171613; --bg-2: #1f1d19; --paper: #25221d;
    --ink: #f2f0e8; --ink-soft: #b0ab9f; --rule: #3a362f;
    --accent: #ff7a1a; --on-accent: #1a1815; --accent-ink: #ff9447;
    --late: #ff8a75;
    --night: #0e0d0b; --night-2: #2a2722; --on-night: #f2f0e8; --on-night-soft: #a9a498;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
  :root[data-palette="highlighter"] {
    --bg: #0d1626; --bg-2: #132036; --paper: #17253c;
    --ink: #f1f4f9; --ink-soft: #a6b1c2; --rule: #2a3a55;
    --accent: #ffd23f; --on-accent: #0f1b2d; --accent-ink: #ffd23f;
    --late: #ff8f80;
    --night: #070e1a; --night-2: #1b2a43; --on-night: #f1f4f9; --on-night-soft: #a6b1c2;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
  :root[data-palette="cobalt"] {
    --bg: #0a1030; --bg-2: #0f1740; --paper: #151f4e;
    --ink: #eef1ff; --ink-soft: #a9b2da; --rule: #283572;
    --accent: #7d95ff; --on-accent: #0a1030; --accent-ink: #9db0ff;
    --late: #ff8a80;
    --night: #050a22; --night-2: #18225c; --on-night: #eef1ff; --on-night-soft: #a9b2da;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
  :root[data-palette="violet"] {
    --bg: #161b2d; --bg-2: #1e2439; --paper: #232a42;
    --ink: #e7eaf3; --ink-soft: #a9b0c8; --rule: #34406a;
    --accent: #a88ff0; --on-accent: #161b2d; --accent-ink: #b9a4f5;
    --late: #f08079;
    --night: #0f1326; --night-2: #1d2340; --on-night: #eef0f8; --on-night-soft: #a7aecb;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  overflow-x: clip;
}

h1, h2, h3 { margin: 0; font-family: var(--display); line-height: 1; }
p { margin: 0; }
a { color: inherit; }
code { font-family: var(--mono); font-size: .8125em; }
button { font: inherit; color: inherit; }

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

/* The hidden attribute always wins over a component's display value. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; padding: 0; margin: -1px; border: 0;
}

/* ---------- Video previews ---------- */

.hero-demo { margin: clamp(48px, 7vw, 88px) 0 0; }
.video-frame {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0;
  background: var(--night); border-radius: 24px; overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-demo figcaption, .watch-link { margin-top: 12px; font-size: .9375rem; color: var(--ink-soft); }
.walkthrough { background: var(--bg-2); }
.walkthrough .video-frame { margin-top: 32px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 700; font-size: 1.1875rem; line-height: 1;
  color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 12px; padding: 18px 26px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), 0 10px 22px -10px var(--accent); }
.btn:active { transform: translateY(0); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .16); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }
.btn-small { font-size: .9375rem; padding: 11px 16px; border-radius: 10px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.topbar-inner {
  padding: 12px var(--inline);
  display: flex; align-items: center; gap: 28px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em;
  text-decoration: none; margin-right: auto;
}
.wordmark svg { width: 26px; height: 26px; fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linejoin: round; }
.wordmark svg path { fill: var(--accent-ink); stroke: none; }
.topnav { display: flex; gap: 24px; }
.topnav a { text-decoration: none; font-weight: 600; font-size: .9375rem; color: var(--ink-soft); }
.topnav a:hover { color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding: clamp(40px, 7vw, 96px) var(--inline) clamp(64px, 9vw, 120px); }

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: .875rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 999px;
  padding: 6px 14px 6px 10px; margin-bottom: 28px;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

.hero-title {
  --ls: -.04em;
  font-weight: 800;
  font-size: clamp(3rem, 8.6vw, 8rem);
  line-height: .92;
  letter-spacing: var(--ls);
  max-width: 13ch;
}
.hero-title .line { display: block; }

/* Kinetic words: each arrives blurred and spaced out, then snaps tight. Plays once on load for the
   headline, and every time a short starts. */
.kw { display: inline-block; letter-spacing: var(--ls, 0); }
.play .kw { animation: kw-in .85s var(--ease-out) both; animation-delay: calc(var(--i) * 70ms + .1s); }
@keyframes kw-in {
  from { opacity: 0; transform: translateY(.3em); letter-spacing: .12em; filter: blur(8px); }
  to { opacity: 1; transform: none; letter-spacing: var(--ls, 0); filter: blur(0); }
}

.lede { margin-top: 28px; font-size: clamp(1.125rem, 1.6vw, 1.375rem); line-height: 1.5; color: var(--ink-soft); max-width: 38em; }

/* ---------- Forms ---------- */

.form-status { grid-column: 1 / -1; }
.form-status { min-height: 1.4em; font-size: .9375rem; font-weight: 600; }
.form-status[data-tone="error"] { color: var(--late); }
.form-status[data-tone="ok"] { color: var(--accent-ink); }

.works-with { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 18px; }
.works-with p { font-size: .9375rem; color: var(--ink-soft); }
.works-with ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.works-with li { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 1.0625rem; }
.works-with .logo { width: 20px; height: 20px; }

/* shared by the shorts' progress bars */
@keyframes fill-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ======================================================
   Sections
   ====================================================== */

.feed, .steps, .walkthrough { padding: clamp(72px, 10vw, 128px) var(--inline); }
.feed { background: var(--bg-2); }

.section-head { max-width: 46rem; }
.section-head h2 { font-weight: 800; font-size: clamp(2.25rem, 5.2vw, 4.25rem); letter-spacing: -.035em; line-height: .98; }
.section-head p { margin-top: 16px; font-size: 1.1875rem; color: var(--ink-soft); }

/* ======================================================
   A short: one takeaway, one motion scene
   ====================================================== */

.short {
  --acc: var(--sh-violet);
  position: relative;
  container-type: inline-size;
  background: var(--night); color: var(--on-night);
  display: flex; flex-direction: column;
  padding: 24px 22px 24px;
  overflow: hidden;
  user-select: none;
}
.short[data-accent="signal"] { --acc: var(--sh-signal); }
.short[data-accent="amber"] { --acc: var(--sh-amber); }
.short[data-accent="coral"] { --acc: var(--sh-coral); }
.short[data-accent="sky"] { --acc: var(--sh-sky); }

/* an accent disc behind the scene swells as the short starts */
.short::before {
  content: ""; position: absolute; width: 120cqi; aspect-ratio: 1; border-radius: 50%;
  left: 40cqi; bottom: -62cqi; background: var(--acc); opacity: .14;
}
.short.play::before { animation: swell 1.4s var(--ease-out) both; }
@keyframes swell { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: .14; } }

.short-progress { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .16); overflow: hidden; flex: none; }
.short-progress i { display: block; height: 100%; background: var(--acc); transform: scaleX(0); transform-origin: left; }
.short.play .short-progress i { animation: fill-x 6.5s linear both; }

.short-meta { display: flex; flex-direction: column; margin-top: 6cqi; font-size: 4.6cqi; line-height: 1.35; }
.short-source { font-weight: 700; }
.short-age { color: var(--late-on-night); }
.short-takeaway {
  --ls: -.025em;
  margin-top: 5cqi; position: relative;
  font-family: var(--display); font-weight: 800; font-size: 11cqi; line-height: 1; letter-spacing: var(--ls);
}
.short-scene { flex: 1; position: relative; display: grid; align-items: center; margin-top: 4cqi; }
.short-from { font-size: 4cqi; color: var(--on-night-soft); position: relative; }

.short-sent {
  position: absolute; right: 6cqi; top: 13cqi;
  font-family: var(--display); font-weight: 800; font-size: 4.8cqi;
  color: var(--acc); border: 3px double var(--acc); border-radius: 8px; padding: 1.5cqi 3cqi;
  transform: rotate(-8deg); opacity: 0; pointer-events: none;
}
.short[data-sent] .short-sent { animation: stamp .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.8); } to { opacity: 1; transform: rotate(-8deg) scale(1); } }

/* Scene entrances run while the short plays; at rest each scene shows its end state. */
.short.play .sc [style*="--d"] { animation: pop-in .55s var(--ease-out) both; animation-delay: var(--d); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }

.sc { display: grid; gap: 3cqi; font-size: 4.6cqi; }

.bubble {
  width: fit-content; max-width: 88%;
  background: rgba(255, 255, 255, .09);
  border-radius: 14px 14px 14px 4px; padding: 2.4cqi 3.8cqi; font-weight: 600;
}
.mini-file {
  background: #f4f6fb; color: #1d2340; border-radius: 10px; padding: 3cqi 4cqi;
  display: grid; gap: 1.8cqi; margin-top: 2cqi; box-shadow: 0 0 0 2px var(--acc);
}
.mini-file code { font-size: 3.4cqi; font-weight: 600; }
.mini-file i { display: block; height: 1.6cqi; border-radius: 1cqi; background: rgba(29, 35, 64, .18); }
.mini-file i.half { width: 55%; }
.mini-file span { font-weight: 700; font-size: 4.6cqi; line-height: 1.3; }

.claim {
  display: flex; align-items: center; justify-content: space-between; gap: 3cqi;
  background: rgba(255, 255, 255, .07); border-radius: 10px; padding: 2.6cqi 3.6cqi;
}
.claim code { font-size: 3.4cqi; }
.claim b { background: var(--sh-coral); color: #1a1a1a; border-radius: 6px; padding: .6cqi 2cqi; font-size: 3.6cqi; transform: rotate(-4deg); }
.short.play .claim b[style*="--d"] { animation: stamp .35s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: var(--d); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.4cqi; }
.checks li { display: flex; align-items: center; gap: 3cqi; font-weight: 600; }
.checks li::before {
  content: ""; flex: none; width: 4.6cqi; height: 4.6cqi; border-radius: 50%;
  background: var(--acc); box-shadow: inset 0 0 0 1.2cqi var(--acc);
}
.short.play .checks li::before { animation: turn-green .5s var(--ease-out) both; animation-delay: calc(var(--d) + .4s); }
@keyframes turn-green { from { background: transparent; box-shadow: inset 0 0 0 .7cqi var(--sh-coral); } to { background: var(--acc); box-shadow: inset 0 0 0 1.2cqi var(--acc); } }
.verdict { font-family: var(--display); font-weight: 800; font-size: 7.4cqi; letter-spacing: -.02em; color: var(--acc); }

.sc-split svg { width: 100%; max-height: 100%; overflow: visible; }
.sc-split .blob { fill: var(--acc); opacity: 0; transform-box: fill-box; transform-origin: center; }
.short.play .sc-split .blob { animation: blob-out 2.2s var(--ease-out) .6s both; }
@keyframes blob-out {
  0% { opacity: .95; transform: scale(.6); }
  45% { opacity: .95; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(.35); }
}
.sc-split .node { transform: translate(var(--x), var(--y)); }
.sc-split .node circle { fill: var(--acc); }
.sc-split .node text { fill: #1a1a1a; font: 700 8px var(--sans); text-anchor: middle; }
.sc-split .edge { stroke: var(--acc); stroke-width: 1.5; stroke-dasharray: 90; stroke-dashoffset: 0; opacity: .6; }
.short.play .sc-split .node[style*="--d"] { animation: node-out .7s var(--ease-out) both; animation-delay: var(--d); }
.short.play .sc-split .edge[style*="--d"] { animation: draw .7s var(--ease-out) both; animation-delay: var(--d); }
@keyframes node-out { from { transform: translate(0, 0); opacity: 0; } to { transform: translate(var(--x), var(--y)); opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 90; } to { stroke-dashoffset: 0; } }

.fixes { display: grid; gap: 1.8cqi; opacity: .45; }
.fixes p { display: flex; justify-content: space-between; gap: 2cqi; font-family: var(--mono); font-size: 3.2cqi; color: var(--on-night-soft); }
.fixes b { color: #1a1a1a; background: var(--sh-coral); border-radius: 50%; width: 5.4cqi; height: 5.4cqi; display: grid; place-items: center; font-family: var(--sans); font-size: 3.2cqi; }
.short.play .fixes { animation: dim-down .5s ease 3s both; }
@keyframes dim-down { from { opacity: 1; } to { opacity: .45; } }

.stations { position: relative; display: grid; gap: 7cqi; padding-left: 10cqi; }
.stations::before { content: ""; position: absolute; left: 3.4cqi; top: 2cqi; bottom: 2cqi; width: 2px; background: rgba(255, 255, 255, .2); }
.stations span { position: relative; font-family: var(--display); font-weight: 800; font-size: 7.6cqi; letter-spacing: -.02em; color: var(--acc); }
.stations span::before {
  content: ""; position: absolute; left: -9.2cqi; top: 50%; width: 4cqi; height: 4cqi; margin-top: -2cqi;
  border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 2px var(--acc);
}
.short.play .stations span[style*="--d"] { animation: light-up .4s ease both; animation-delay: var(--d); }
.short.play .stations span::before { animation: dot-on .4s ease both; animation-delay: var(--d); }
@keyframes light-up { from { color: var(--on-night-soft); opacity: .5; } to { color: var(--acc); opacity: 1; } }
@keyframes dot-on { from { background: var(--night); } to { background: var(--acc); } }
.runner {
  position: absolute; left: 1.6cqi; width: 5.6cqi; height: 5.6cqi; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc) 40%, transparent);
  top: calc(100% - 7cqi);
}
.short.play .runner { animation: run-down 2.4s var(--ease-slide) .9s both; }
@keyframes run-down { from { top: 0; } to { top: calc(100% - 7cqi); } }

/* ======================================================
   Shorts feed: filmstrip
   ====================================================== */

.fb-strip { position: relative; margin: 44px calc(50% - 50vw) 0; }
.fb-viewport {
  overflow: hidden; padding: 18px 0 28px; touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fb-track { display: flex; gap: 28px; width: max-content; transition: transform .7s var(--ease-slide); }
.fb-track .short {
  flex: 0 0 clamp(280px, 30vw, 370px); aspect-ratio: 9 / 16; border-radius: 26px;
  transform: scale(.84); filter: brightness(.55) saturate(.7); cursor: pointer;
  transition: transform .7s var(--ease-slide), filter .7s;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.fb-track .short.is-near { filter: brightness(.75) saturate(.85); }
.fb-track .short.is-active { transform: scale(1); filter: none; cursor: default; }

.fb-panel { max-width: 640px; margin: 4px auto 0; display: grid; justify-items: center; gap: 18px; text-align: center; }
.fb-nav { display: flex; align-items: center; justify-content: center; gap: 22px; }
.arrow {
  width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--paper); cursor: pointer;
  display: grid; place-items: center; transition: background .15s, color .15s;
}
.arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.arrow:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.arrow:disabled { opacity: .3; cursor: default; }
.feed-counter { font-family: var(--display); font-weight: 700; font-size: 1.0625rem; font-variant-numeric: tabular-nums; min-width: 4ch; }
.feed-why { color: var(--ink-soft); font-size: 1.125rem; min-height: 3.4em; }

.feed-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; width: min(100%, 500px); }
.btn-copy {
  font-family: var(--display); font-weight: 700; font-size: 1.0625rem;
  background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: 12px; cursor: pointer;
}
.btn-copy:hover { background: var(--ink); color: var(--bg); }
.btn-send { font-size: 1.0625rem; padding: 16px 18px; }

.feed-status { min-height: 1.4em; font-size: .9375rem; font-weight: 600; color: var(--accent-ink); }

.nudge {
  margin: 40px auto 0; max-width: 760px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 18px 28px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 18px; padding: 22px 26px;
}
.nudge p { font-family: var(--display); font-weight: 700; font-size: 1.3125rem; letter-spacing: -.01em; }

/* ---------- Your import: progress and the reel ---------- */

.run-progress h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.units { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.units li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: baseline;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px;
}
.units a { font-family: var(--mono); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-stage { font-weight: 700; font-size: .875rem; color: var(--ink-soft); text-align: right; }
.units li[data-stage="ready"] .unit-stage { color: var(--accent-ink); }
.units li:is([data-stage="failed"], [data-stage="render_failed"]) .unit-stage { color: var(--late); }
.units li:is([data-stage="queued"], [data-stage="fetching"], [data-stage="digesting"], [data-stage="rendering"]) .unit-stage::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: currentColor; vertical-align: .1em; animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .25; } }
.unit-error { grid-column: 1 / -1; font-size: .875rem; color: var(--ink-soft); }

.reel { --h: min(78svh, 720px); width: calc(var(--h) * 9 / 16); }
.reel-track {
  height: var(--h);
  overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none;
  border-radius: 24px; background: var(--night); box-shadow: var(--shadow);
}
.reel-track::-webkit-scrollbar { display: none; }
.reel-item {
  position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always;
  container-type: inline-size; color: var(--on-night); overflow: hidden;
}
.reel-item video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel-caption {
  position: absolute; z-index: 2; top: 50%; left: 7%; right: 7%;
  text-align: center; white-space: pre-line; pointer-events: none;
  font-family: var(--display); font-weight: 800; font-size: clamp(1rem, 5.4cqi, 1.375rem); line-height: 1.25;
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .6);
}
.reel-caption:empty { display: none; }
.reel-item:has(.reel-sources:not([hidden])) .reel-caption { display: none; }
.reel-progress { position: absolute; z-index: 2; top: 12px; left: 14px; right: 14px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.reel-progress i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.reel-overlay {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
  padding: 64px 18px 18px; display: grid; gap: 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78) 45%);
  pointer-events: none;
}
.reel-overlay :is(a, button) { pointer-events: auto; }
.reel-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.reel-chip { font-size: .75rem; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .16); }
.reel-chip[data-ready] { background: var(--sh-signal); color: #0d1f16; }
.reel-title { font-size: 1.375rem; font-weight: 800; letter-spacing: -.015em; line-height: 1.1; }
.reel-reason { font-size: .875rem; line-height: 1.4; color: var(--on-night-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.reel-sources { background: rgba(0, 0, 0, .55); border-radius: 12px; padding: 10px 12px; pointer-events: auto; }
.reel-sources-head { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--on-night-soft); }
.reel-sources ul { margin: 6px 0 0; padding-left: 18px; font-size: .875rem; }
.reel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reel-btn {
  font-family: var(--display); font-weight: 700; font-size: .875rem;
  color: var(--on-night); background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.reel-btn:hover { background: rgba(255, 255, 255, .26); }
.reel-sound[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.reel-failed {
  position: absolute; z-index: 3; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center;
  background: rgba(0, 0, 0, .7); text-align: center; padding: 24px;
}
.reel-counter { margin-top: 10px; text-align: center; font-weight: 600; font-size: .875rem; color: var(--ink-soft); }
a.reel-btn { text-decoration: none; }

/* ---------- Saved -> Reel -> Skills -> Tasks on the signed-in home ---------- */

.journey { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.journey a {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink); text-decoration: none;
  font-family: var(--display); font-weight: 700; font-size: .9375rem;
}
.journey a:hover { border-color: var(--ink); }
.journey a + a::before { content: "→"; margin: 0 4px 0 -2px; color: var(--ink-soft); font-weight: 400; }
.journey b { min-width: 1.5em; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .75rem; text-align: center; }

.journey-section { margin-top: 56px; display: grid; gap: 12px; scroll-margin-top: 88px; }
.journey-section h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; scroll-margin-top: 88px; }
.journey-section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
.journey-section-head .hint { max-width: 44rem; margin-top: 4px; }
.journey-empty { padding: 22px; border: 2px dashed var(--rule); border-radius: 16px; color: var(--ink-soft); }
.agent-pick { display: grid; gap: 4px; font-weight: 700; font-size: .875rem; }
.agent-pick select {
  font: inherit; font-weight: 600; padding: 9px 12px; border-radius: 10px;
  border: 2px solid var(--rule); background: var(--paper); color: var(--ink);
}
.agent-pick select:focus-visible { border-color: var(--accent); outline: none; }

.skills, .tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.skill, .task {
  display: grid; gap: 12px; align-content: start; min-width: 0;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 16px; padding: 18px 20px; scroll-margin-top: 88px;
}
.skill:target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.skill-head { display: grid; gap: 6px; }
.skill h3, .task h3 { font-size: 1.125rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.skill-from { font-size: .8125rem; font-weight: 600; color: var(--ink-soft); }
.skill-desc { color: var(--ink-soft); line-height: 1.45; }
.skill-state { font-weight: 600; color: var(--ink-soft); }
.skill[data-status="failed"] .skill-state { color: var(--late); }
.skill:is([data-status="pending"], [data-status="running"]) .skill-state::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: currentColor; vertical-align: .1em; animation: pulse 1.2s ease-in-out infinite;
}
.skill-path { display: grid; gap: 4px; font-size: .8125rem; color: var(--ink-soft); }
.skill-path code, .skill-md { font-family: var(--mono); font-size: .75rem; }
.skill-path code { color: var(--ink); background: var(--bg-2); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; }
.skill-md { margin: 0; max-height: 22rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg-2); border-radius: 10px; padding: 12px; line-height: 1.55; }
.skill-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn-line { font: inherit; font-weight: 700; font-size: .9375rem; color: var(--accent-ink); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.task-block { display: grid; gap: 4px; }
.task-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.task-block :is(ul, ol) { margin: 0; padding-left: 20px; display: grid; gap: 4px; line-height: 1.45; }
.task-check { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); }
.task-evidence summary { cursor: pointer; font-weight: 700; font-size: .875rem; color: var(--accent-ink); }
.task-evidence ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: .875rem; }
.task-passage { color: var(--ink-soft); }
.task-evidence a { font-size: .8125rem; }

.handoff { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.handoff-form { display: grid; gap: 16px; justify-items: start; }
.handoff-field { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; min-width: 0; }
.handoff-field legend { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 8px; }
.handoff-skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.handoff-skill, .handoff-mode {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; cursor: pointer;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px;
}
.handoff-skill:has(input:checked), .handoff-mode:has(input:checked) { border-color: var(--accent); }
.handoff-skill input, .handoff-mode input { margin-top: 3px; accent-color: var(--accent); }
.handoff-skill span, .handoff-mode span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.handoff-skill small, .handoff-mode small { color: var(--ink-soft); font-size: .8125rem; line-height: 1.4; }
.handoff-result {
  display: grid; gap: 12px; min-width: 0;
  background: var(--paper); border: 2px solid var(--accent); border-radius: 16px; padding: 18px 20px;
}
.handoff-result h3 { font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: anywhere; }
.handoff-result .task-block :is(ul, ol) { margin: 0; padding-left: 20px; display: grid; gap: 4px; line-height: 1.45; }
.handoff-run { display: grid; gap: 6px; font-size: .875rem; color: var(--ink-soft); }
.handoff-run code { font-family: var(--mono); font-size: .75rem; color: var(--ink); background: var(--bg-2); border-radius: 8px; padding: 6px 8px; overflow-wrap: anywhere; }

/* ---------- Get started (landing) ---------- */

.hero-cta { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; max-width: 46rem; }
.hero-cta p { flex: 1 1 18rem; color: var(--ink-soft); font-size: 1rem; line-height: 1.5; }
.topnav-signin { font-weight: 600; font-size: .9375rem; color: var(--ink-soft); text-decoration: none; }
.topnav-signin:hover { color: var(--ink); }

/* ---------- Onboarding ---------- */

.onboard { padding: clamp(28px, 5vw, 64px) var(--inline) 96px; display: grid; justify-items: center; gap: 28px; }
.onboard-loading { color: var(--ink-soft); }

.onboard-card {
  width: min(100%, 34rem); display: grid; gap: 14px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 20px; padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow);
}
.onboard-card h1 { font-size: clamp(1.75rem, 4vw, 2.375rem); font-weight: 800; letter-spacing: -.03em; }
.onboard-lede { color: var(--ink-soft); font-size: 1.0625rem; line-height: 1.5; }

.onboard-form { display: grid; gap: 8px; margin-top: 6px; }
.onboard-form label, .add-links label { font-weight: 700; font-size: .9375rem; margin-top: 8px; }
.onboard-form input, .onboard-form textarea, .add-links textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 2px solid var(--rule); border-radius: 12px; padding: 12px 14px; min-width: 0; width: 100%;
}
.onboard-form textarea, .add-links textarea { font-family: var(--mono); font-size: .8125rem; line-height: 1.6; resize: vertical; }
.onboard-form input:focus-visible, .onboard-form textarea:focus-visible, .add-links textarea:focus-visible { border-color: var(--accent); outline: none; }
.onboard-form .btn { margin-top: 14px; justify-self: start; }
.hint { font-size: .875rem; color: var(--ink-soft); }
.opt { font-weight: 400; color: var(--ink-soft); }
.linkish { font: inherit; font-weight: 700; color: var(--accent-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.onboard-switch { display: flex; flex-wrap: wrap; gap: 6px; font-size: .9375rem; color: var(--ink-soft); }



/* ---------- Home (signed in) ---------- */

.who { margin-left: auto; font-size: .9375rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wordmark + .who { margin-left: auto; }
.topbar-inner:has(.who) .wordmark { margin-right: 0; }
.btn-quiet-top { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--rule); }
.btn-quiet-top:hover { box-shadow: inset 0 0 0 2px var(--ink); }

.home { padding: clamp(28px, 5vw, 56px) var(--inline) 96px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px 48px; align-items: start; }
.home-side { display: grid; gap: 28px; min-width: 0; }
.home-head { display: grid; gap: 8px; }
.home-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 800; letter-spacing: -.03em; }
.add-links { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; margin-top: 16px; }
.add-links label { grid-column: 1 / -1; margin: 0; }
.add-links .form-status { grid-column: 1 / -1; }
.reel-placeholder {
  --h: min(78svh, 720px); width: calc(var(--h) * 9 / 16); height: var(--h);
  display: grid; align-content: center; gap: 10px; padding: 28px; text-align: center;
  border: 2px dashed var(--rule); border-radius: 24px; color: var(--ink-soft);
}
.reel-placeholder-title { font-family: var(--display); font-weight: 800; font-size: 1.375rem; color: var(--ink); }

/* ---------- Full-screen reel (/app) ----------
   The signed-in page is the reel on a dark stage. Link stages sit in a top-bar popover, more videos come in
   through a sheet, and the first-run paste box takes the reel's frame until a short is ready. */

.app-page { --bar: 61px; background: var(--night); color: var(--on-night); }
.app-bar { background: color-mix(in srgb, var(--night) 90%, transparent); border-bottom-color: rgba(255, 255, 255, .08); color: var(--on-night); }
.app-bar .topbar-inner { gap: 10px; }
.app-page .btn-quiet-top { color: var(--on-night); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22); }
.app-page .btn-quiet-top:hover { box-shadow: inset 0 0 0 2px var(--on-night); }
.app-page .onboard-loading { color: var(--on-night-soft); }

.stage { height: calc(100svh - var(--bar)); display: grid; place-items: center; padding: 12px var(--gutter); }
.stage-frame { width: 100%; height: 100%; display: grid; place-items: center; }
/* A fixed 9:16 width capped by max-width: a percentage inside this auto-sized grid would collapse. */
.app-page .reel { --h: calc(100svh - var(--bar) - 24px - 30px); width: calc(var(--h) * 9 / 16); max-width: 100%; }
.app-page .reel-counter { color: var(--on-night-soft); }

.frame-card {
  --h: calc(100svh - var(--bar) - 24px - 30px);
  width: calc(var(--h) * 9 / 16); max-width: 100%; height: var(--h); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 28px 24px;
  background: var(--night-2); border-radius: 24px;
}
/* Centred while it fits; once ten links overflow the card, the spacers shrink to nothing and the
   content starts at the top of the scroll area instead of being cut off above it. */
.frame-card::before, .frame-card::after { content: ""; flex: 1 1 0; min-height: 0; }
.frame-card h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.025em; }
.frame-lede { color: var(--on-night-soft); line-height: 1.5; }

.app-page .add-links { grid-template-columns: minmax(0, 1fr); margin: 0; }
.app-page .add-links label { color: var(--on-night); }
.app-page .add-links textarea { background: rgba(255, 255, 255, .06); color: var(--on-night); border-color: rgba(255, 255, 255, .18); }
.app-page .add-links textarea::placeholder { color: var(--on-night-soft); opacity: .7; }
.app-page .add-links .btn { justify-self: start; }
.app-page .form-status[data-tone="error"] { color: var(--late-on-night); }

.app-page .units li { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); color: var(--on-night); }
.app-page .unit-stage, .app-page .unit-error, .app-page .hint { color: var(--on-night-soft); }
.app-page .units li[data-stage="ready"] .unit-stage { color: var(--accent); }
.app-page .units li:is([data-stage="failed"], [data-stage="render_failed"], [data-stage="not_selected"]) .unit-stage { color: var(--late-on-night); }
.frame-units { margin: 0; }

.status { position: relative; }
.status > summary {
  list-style: none; cursor: pointer; white-space: nowrap;
  font-size: .875rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1);
}
.status > summary::-webkit-details-marker { display: none; }
.status[data-busy="true"] > summary::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%;
  background: var(--accent); vertical-align: .1em; animation: pulse 1.2s ease-in-out infinite;
}
.status-panel {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); width: min(420px, calc(100vw - 2 * var(--gutter)));
  max-height: 60svh; overflow-y: auto; display: grid; gap: 10px; padding: 14px;
  background: var(--night-2); border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; box-shadow: var(--shadow);
}
.status-panel .units { margin: 0; }
.status-panel .hint:empty { display: none; }

.topbar-pill {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: .875rem; font-weight: 700; padding: 7px 12px; border-radius: 999px;
  color: var(--on-night); background: transparent; border: 1px solid rgba(255, 255, 255, .22);
}
.topbar-pill:hover { border-color: var(--on-night); }
.topbar-pill b { min-width: 1.5em; padding: 0 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .75rem; text-align: center; }

/* Skills and Tasks sheet: a dark drawer over the reel. The page tokens point at the night palette here,
   so the skill and task cards keep their own styles. */
.skills-sheet {
  --bg: var(--night); --bg-2: rgba(255, 255, 255, .06); --paper: var(--night-2);
  --ink: var(--on-night); --ink-soft: var(--on-night-soft); --rule: rgba(255, 255, 255, .14);
  --accent-ink: var(--accent); --late: var(--late-on-night);
  margin: 0 0 0 auto; width: min(720px, 100vw); max-width: 100vw; height: 100svh; max-height: 100svh;
  padding: 0 clamp(16px, 3vw, 32px) 48px; border: 0; overflow-y: auto;
  background: var(--bg); color: var(--ink); display: none;
}
.skills-sheet[open] { display: grid; align-content: start; gap: 8px; }
.skills-sheet::backdrop { background: rgba(0, 0, 0, .55); }
.skills-sheet-head { position: sticky; top: 0; z-index: 1; padding: 16px 0 12px; background: var(--bg); }
.skills-sheet .journey-section { margin-top: 20px; }
.skills-sheet .journey-section, .skills-sheet .journey-section h2, .skills-sheet .skill { scroll-margin-top: 64px; }

.add-open { gap: 6px; }
.add-open span[aria-hidden] { font-weight: 800; }

.add-sheet {
  width: min(520px, calc(100vw - 2 * var(--gutter))); padding: 24px; border: 0; border-radius: 20px;
  background: var(--night-2); color: var(--on-night); display: none;
}
.add-sheet[open] { display: grid; gap: 14px; }
.add-sheet::backdrop { background: rgba(0, 0, 0, .6); }
.add-sheet h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.add-sheet .linkish { justify-self: start; color: var(--on-night-soft); }

@media (max-width: 640px) {
  .app-page { --bar: 57px; }
  .stage { padding: 0; }
  .app-page .reel, .frame-card { --h: calc(100svh - var(--bar)); width: 100vw; }
  .app-page .reel-track, .frame-card { border-radius: 0; }
  .app-page .reel-counter { display: none; }
  /* Icon-only wordmark and a "+" add button keep the bar to one row at 390 px. */
  .app-bar .btn-small { padding: 9px 12px; }
  .app-bar .add-label { display: none; }
  .add-open span[aria-hidden] { font-size: 1.25rem; line-height: .8; }
  .status > summary { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
  /* Anchored to the bar's edges, not the small chip, so the list stays on screen. The bar's backdrop
     filter makes it the containing block for this fixed panel. */
  .status-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--bar) + 6px); width: auto; }
  .app-bar .wordmark { display: none; }
  .app-bar .topbar-inner { justify-content: flex-end; }
  .topbar-tasks { display: none; }
  .topbar-pill { padding: 6px 10px; font-size: .8125rem; }
  .status > summary { padding: 6px 10px; font-size: .8125rem; }
}

/* ---------- How it works ---------- */

.steps ol {
  list-style: none; counter-reset: step; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px;
}
.steps li { counter-increment: step; border-top: 3px solid var(--ink); padding-top: 20px; }
.steps li::before {
  content: counter(step); display: block;
  font-family: var(--display); font-weight: 800; font-size: 3.5rem; line-height: 1; letter-spacing: -.04em;
  color: var(--accent-ink); margin-bottom: 18px;
}
.steps h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 10px; }
.steps p { color: var(--ink-soft); }

/* ---------- Agent logos: monochrome masks that follow the text colour ---------- */

.logo {
  display: inline-block; flex: none; width: 1.15em; height: 1.15em;
  background: currentColor;
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}
.logo-claude-code { --logo: url(/logos/claude-code.svg); }
.logo-codex { --logo: url(/logos/codex.svg); }
.logo-cursor { --logo: url(/logos/cursor.svg); }
.logo-hermes { --logo: url(/logos/hermes.svg); }

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

.footer {
  padding: 36px var(--inline) 48px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: .9375rem; color: var(--ink-soft);
}
.footer a { font-weight: 700; color: var(--ink); }

/* ---------- Palette picker (review only, ?pick) ---------- */

.palette-picker {
  position: fixed; left: 16px; bottom: 16px; z-index: 30;
  display: flex; align-items: center; gap: 6px;
  background: #15161a; color: #f2f2f2; border-radius: 16px; padding: 8px 10px;
  font-size: .8125rem; font-weight: 700;
  box-shadow: 0 14px 40px -12px rgba(0, 0, 0, .6);
}
.palette-picker[hidden] { display: none; }
.palette-picker > p { padding: 0 6px; color: #a8a8b0; }
.palette-picker button {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 6px 9px; cursor: pointer;
}
.palette-picker button[aria-pressed="true"] { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); }
.sw { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.sw-hn { background: linear-gradient(135deg, #f6f6ef 50%, #eb5a00 50%); }
.sw-highlighter { background: linear-gradient(135deg, #0f1b2d 50%, #ffd23f 50%); }
.sw-cobalt { background: linear-gradient(135deg, #f1f3fa 50%, #2f54eb 50%); }
.sw-violet { background: linear-gradient(135deg, #e3ebe5 50%, #5a3cb0 50%); }

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

@media (max-width: 960px) {
  .steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-feed { justify-self: center; }
}

@media (max-width: 640px) {
  .topnav { display: none; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-feed { justify-self: center; }
  .reel-placeholder { --h: min(70svh, calc((100vw - 2 * var(--gutter)) * 16 / 9)); }
  .topbar-inner { gap: 12px; }
  .reel { --h: min(80svh, calc((100vw - 2 * var(--gutter)) * 16 / 9)); justify-self: center; }
  .works-with ul { gap: 10px 16px; }

  .fb-strip { margin-top: 28px; }
  .fb-viewport { padding: 8px 0 18px; -webkit-mask-image: none; mask-image: none; }
  .fb-track { gap: 14px; }
  .fb-track .short { flex-basis: min(82vw, 360px); border-radius: 22px; }
  .fb-track .short:not(.is-active) { transform: scale(.9); }
  .feed-why { min-height: 0; }
  .nudge { flex-direction: column; text-align: center; }

  .steps ol { grid-template-columns: minmax(0, 1fr); }
  .palette-picker { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; }
  .palette-picker span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* ---------- Forms ---------- */

.signup input[type="email"] {
  font: inherit; font-size: 1.125rem; color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink); border-radius: 12px;
  padding: 0 18px; height: 60px; min-width: 0;
}
.signup input[type="email"]::placeholder { color: var(--ink-soft); opacity: .7; }
.signup input[type="email"]:focus-visible { outline-offset: 2px; }

.signup-hero {
  margin-top: 34px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  max-width: 38rem;
}
.signup-hero .btn { height: 60px; }
.signup-hero .form-status { grid-column: 1 / -1; }
@media (max-width: 640px) { .signup-hero { grid-template-columns: minmax(0, 1fr); } }
