/* SubGen website. Plain CSS, no build step, system fonts only. */

:root {
  color-scheme: light dark;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Same palette as the web app: true-neutral greys with one signal blue (see
     subgen/static/css/tokens.css). Light mode. */
  --bg: #f7f7f8;
  --bg-raised: #ffffff;
  --surface: #ffffff;
  --surface-2: #efeff1;
  --line: #e2e2e6;
  --line-strong: #c9c9d0;
  --text: #18181b;
  --muted: #62626a;
  --accent-ink: #2563eb;   /* blue, text-safe on white */
  --accent: #2563eb;       /* primary fills */
  --accent-hover: #1d4fd8;
  --accent-fg: #ffffff;    /* text placed on an accent fill */
  --mint: #0e7490;         /* secondary signal (cache, success ticks) */
  --warn: #a15c07;
  --warn-bg: #fcf1dc;
  --removed: #c42525;
  --focus: #2563eb;
  --shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 18px 40px -24px rgba(0, 0, 0, .28);

  /* Things that are always "on screen" (frame, terminal) stay dark in both modes */
  --screen: #161617;
  --screen-2: #1e1e20;
  --screen-line: #2f2f33;
  --screen-text: #ededee;
  --screen-muted: #9b9ba3;

  --radius-lg: 16px;
  --radius: 10px;
  --radius-sm: 6px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161617;
    --bg-raised: #1a1a1c;
    --surface: #1e1e20;
    --surface-2: #242427;
    --line: #2f2f33;
    --line-strong: #45454b;
    --text: #ededee;
    --muted: #9b9ba3;
    --accent-ink: #6ea2ff;
    --accent: #2f6be8;
    --accent-hover: #2860d6;
    --accent-fg: #ffffff;
    --mint: #5fcde3;
    --warn: #e5b04a;
    --warn-bg: #33270f;
    --removed: #f2726d;
    --focus: #6ea2ff;
    --shadow: 0 1px 0 rgba(255, 255, 255, .02), 0 24px 60px -30px rgba(0, 0, 0, .8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: .9em; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--accent); color: var(--accent-fg); padding: 10px 14px;
  border-radius: var(--radius-sm); font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

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

/* ---------- Type scale ---------- */
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.022em; text-wrap: balance; }
h1 { font-size: clamp(2.35rem, 1.4rem + 3.6vw, 4.15rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 1.3rem + 1.9vw, 2.75rem); font-weight: 800; }
h3 { font-size: 1.375rem; font-weight: 750; letter-spacing: -.012em; line-height: 1.2; }
.lede { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); color: var(--muted); max-width: 36em; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; flex: none; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: inline-block; padding: 8px 12px; border-radius: 999px;
  text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 550;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav .nav-cta a { color: var(--accent-fg); background: var(--accent); font-weight: 700; }
.site-nav .nav-cta a:hover { background: var(--accent-hover); color: var(--accent-fg); }

@media (max-width: 860px) {
  .site-nav .nav-optional { display: none; }
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--text);
}
.button:hover { border-color: var(--text); }
.button-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button svg { width: 18px; height: 18px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 6vw, 84px) clamp(56px, 8vw, 104px); }
.hero-grid { display: grid; gap: clamp(36px, 5vw, 64px); align-items: center; }
@media (min-width: 1020px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
}
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 22px; }
.hero-note { margin-top: 22px; font-size: .95rem; color: var(--muted); }
.hero-note a { color: var(--accent-ink); font-weight: 650; }

/* The film frame */
.player { min-width: 0; margin: 0; }
.frame {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 46% at 72% 44%, rgba(255, 226, 170, .55), rgba(255, 196, 120, .12) 40%, transparent 70%),
    linear-gradient(180deg, #0f1a2c 0%, #233a5a 34%, #5f7491 52%, #c8b98f 57%, #1f2a3a 57.4%, #121a26 70%, #0a0e15 100%);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .85), inset 0 0 0 1px rgba(255, 255, 255, .06);
  isolation: isolate;
  outline: 1px solid rgba(255, 255, 255, .09); outline-offset: -1px;
}
/* water shimmer and a low sun on the horizon */
.frame::before {
  content: ""; position: absolute; inset: 57.4% 0 0 0; z-index: -1;
  background:
    repeating-linear-gradient(180deg, rgba(255, 228, 180, .16) 0 2px, transparent 2px 9px),
    radial-gradient(30% 60% at 72% 0, rgba(255, 220, 160, .35), transparent 70%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}
.frame::after {
  content: ""; position: absolute; z-index: -1;
  width: 9%; aspect-ratio: 1; left: 67.5%; top: 47%;
  border-radius: 50%; background: #ffe6b3; box-shadow: 0 0 60px 18px rgba(255, 214, 150, .45);
}
.frame-silhouette { position: absolute; inset: auto 0 0 0; height: 62%; z-index: -1; color: #06080c; }
.frame-silhouette svg { width: 100%; height: 100%; }
.frame-meta {
  position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; gap: 12px;
  font-family: var(--font-mono); font-size: .78rem; color: rgba(237, 237, 238, .8);
}
.frame-meta span { background: rgba(10, 10, 12, .55); padding: 3px 8px; border-radius: 4px; }

.cue {
  position: absolute; left: 6%; right: 6%; bottom: 8%;
  margin: 0; text-align: center;
  color: #fff; font-weight: 700; line-height: 1.3;
  font-size: clamp(.95rem, .55rem + 1.55vw, 1.6rem);
  text-shadow: 0 0 2px #000, 0 0 2px #000, 0 2px 3px rgba(0, 0, 0, .9), 0 0 14px rgba(0, 0, 0, .55);
  transition: opacity .28s ease;
}
.cue span { display: block; }
.cue.is-swapping { opacity: 0; }

/* Timeline under the frame */
.timeline {
  position: relative; margin-top: 14px; padding: 12px 14px 10px;
  background: var(--screen); border: 1px solid var(--screen-line); border-radius: var(--radius);
  color: var(--screen-muted);
}
.timeline-cues { position: relative; height: 22px; margin-bottom: 8px; }
.timeline-cues span {
  position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding-inline: 8px;
  border-radius: 4px; background: #242427; border: 1px solid #3a3a40;
  font-family: var(--font-mono); font-size: .72rem; color: var(--screen-muted); overflow: hidden; white-space: nowrap;
}
.timeline-cues span.is-active { background: rgba(76, 141, 255, .18); border-color: #4c8dff; color: #dbe7ff; }
.timeline-wave { height: 40px; width: 100%; color: #3a3a40; }
.timeline-wave .wave-active { color: #4c8dff; }
.playhead { position: absolute; top: 6px; bottom: 6px; left: 49%; width: 2px; background: #4c8dff; border-radius: 2px; box-shadow: 0 0 10px rgba(76, 141, 255, .7); }
.playhead::before { content: ""; position: absolute; top: -2px; left: -4px; width: 10px; height: 6px; border-radius: 2px; background: #4c8dff; }
@media (prefers-reduced-motion: no-preference) {
  .player.is-playing .playhead { animation: scrub 3.2s linear infinite; }
}
@keyframes scrub { from { left: 36%; } to { left: 62%; } }

/* Output card + language switcher */
.player-bar { display: flex; flex-direction: column-reverse; gap: 12px; margin-top: 12px; }

.srt {
  margin: 0; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .86rem; line-height: 1.55; color: var(--text);
  min-width: 0;
}
.srt-file { display: block; color: var(--accent-ink); font-weight: 650; margin-bottom: 6px; overflow-wrap: anywhere; }
.srt-body { display: block; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.srt-body b { color: var(--text); font-weight: 600; }

.lang-switch { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lang-switch button, .icon-button {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  min-height: 36px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.lang-switch button:hover, .icon-button:hover { color: var(--text); border-color: var(--line-strong); }
.lang-switch button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.icon-button { display: inline-grid; place-items: center; width: 36px; padding: 0; }
.icon-button svg { width: 14px; height: 14px; }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); }
.section-head { max-width: 46rem; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head p { text-wrap: pretty; margin-top: 18px; color: var(--muted); font-size: 1.125rem; }

/* Feature rows: copy on the left, a real artifact on the right */
.feature { display: grid; gap: 28px; padding-block: clamp(32px, 4.5vw, 56px); }
.feature + .feature { border-top: 1px dashed var(--line); }
@media (min-width: 940px) {
  .feature { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(40px, 6vw, 88px); align-items: start; }
}
.feature-copy h3 { margin-bottom: 14px; }
.feature-copy > p { color: var(--muted); max-width: 34em; }
.ticks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 26px; max-width: 34em; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .55em; width: 12px; height: 7px;
  border-left: 2.5px solid var(--mint); border-bottom: 2.5px solid var(--mint); transform: rotate(-45deg);
}
.ticks strong { font-weight: 700; }
.ticks code { white-space: nowrap; }

.artifact {
  min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.artifact-title {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  font-size: .85rem; color: var(--muted); font-weight: 600;
}
.artifact-title code { font-size: .82rem; overflow-wrap: anywhere; }
.artifact-body { padding: 18px 16px; }

/* Local stack definition list */
.stack { margin: 0; display: grid; }
.stack > div { display: grid; gap: 4px 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.stack > div:last-child { border-bottom: 0; }
@media (min-width: 560px) { .stack > div { grid-template-columns: 11rem minmax(0, 1fr); } }
.stack dt { font-weight: 700; }
.stack dd { margin: 0; color: var(--muted); }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: .85rem; font-weight: 600; }

/* Before / after cues */
.cue-compare { display: grid; }
.cue-block { padding: 16px; font-family: var(--font-mono); font-size: .86rem; line-height: 1.55; }
.cue-block + .cue-block { border-top: 1px solid var(--line); }
.cue-block h4 { margin: 0 0 10px; font-family: var(--font-sans); font-size: .9rem; font-weight: 700; color: var(--muted); letter-spacing: 0; }
.cue-block .tc { color: var(--muted); display: block; }
.cue-block .txt { display: block; color: var(--text); white-space: pre-wrap; }
.cue-block del { color: var(--removed); text-decoration-thickness: 2px; }
.cue-block .one { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cue-block .one + .one { margin-top: 8px; }
.cue-note { display: block; margin-top: 10px; font-family: var(--font-sans); font-size: .85rem; color: var(--removed); }
.rules { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.rules .pill { background: var(--surface); font-weight: 550; }

/* Fan-out: one transcript, many sidecars */
.fanout { display: grid; gap: 14px; padding: 18px 16px; }
@media (min-width: 620px) { .fanout { grid-template-columns: minmax(0, .9fr) 28px minmax(0, 1.2fr); align-items: center; } }
.fan-node { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .92rem; }
.fan-node + .fan-node { margin-top: 10px; }
.fan-node b { display: block; font-size: .95rem; }
.fan-node small { color: var(--muted); font-size: .85rem; }
.fan-node.is-cache { border-color: var(--mint); }
.fan-arrow { color: var(--muted); justify-self: center; }
.fan-arrow svg { width: 24px; height: 24px; }
@media (max-width: 619px) { .fan-arrow svg { transform: rotate(90deg); } }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-family: var(--font-mono); font-size: .84rem; }
.files li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); overflow-wrap: anywhere; }
.files li span:first-child { min-width: 0; }
.files li span:last-child { color: var(--muted); }
.files li.is-later { flex-direction: column; }
.files li.is-later { border-style: dashed; color: var(--muted); }

/* Scan verdicts */
.scan { list-style: none; margin: 0; padding: 0; }
.scan li { display: grid; gap: 4px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.scan li:last-child { border-bottom: 0; }
@media (min-width: 560px) { .scan li { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; } }
.scan .file { font-family: var(--font-mono); font-size: .84rem; overflow-wrap: anywhere; }
.scan .file small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.verdict { font-size: .85rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; justify-self: start; white-space: nowrap; }
.v-queue { background: var(--accent); color: var(--accent-fg); }
.v-skip { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.v-ignore { color: var(--muted); border: 1px dashed var(--line-strong); }
.v-prune { color: var(--removed); border: 1px solid currentColor; }
.scan .is-gone .file { text-decoration: line-through; color: var(--muted); }

/* Mini editor */
.editor-rows { display: grid; }
.editor-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 4px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.editor-row:last-of-type { border-bottom: 0; }
.editor-row .n { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); padding-top: 2px; }
.editor-row .tc { display: block; font-family: var(--font-mono); font-size: .8rem; color: var(--muted); }
.editor-row .txt { white-space: pre-wrap; }
.editor-row.is-warn { background: var(--warn-bg); }
.editor-row .warn { grid-column: 2; font-size: .85rem; font-weight: 650; color: var(--warn); }
.editor-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.editor-tools span { font-size: .85rem; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }

/* Operations + security lists */
.ops { display: grid; gap: 40px; }
@media (min-width: 860px) { .ops { grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 88px); } }
.ops h3 { margin-bottom: 8px; }
.ops > div > p { color: var(--muted); }
.ops dl { margin: 22px 0 0; display: grid; border-top: 1px solid var(--line); }
.ops dl > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ops dt { font-weight: 700; }
.ops dd { margin: 2px 0 0; color: var(--muted); }

/* ---------- Pipeline ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; counter-reset: stage; display: grid; gap: 0; }
.pipeline li { counter-increment: stage; position: relative; display: grid; align-content: start; grid-template-columns: 44px minmax(0, 1fr); gap: 0 18px; padding-bottom: 28px; }
.pipeline li::before {
  content: counter(stage); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--bg); font-weight: 800; font-size: 1rem; z-index: 1;
}
.pipeline li::after { content: ""; position: absolute; left: 21px; top: 44px; bottom: 0; width: 2px; background: var(--line); }
.pipeline li:last-child::after { display: none; }
.pipeline li:last-child { padding-bottom: 0; }
.pipeline h3 { font-size: 1.125rem; padding-top: 9px; }
.pipeline p { margin: 6px 0 0; color: var(--muted); font-size: 1rem; }
.pipeline code { font-size: .85em; }

@media (min-width: 1000px) {
  .pipeline { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0 14px; }
  .pipeline li { grid-template-columns: 1fr; padding-bottom: 0; }
  .pipeline li::after { left: 44px; right: -14px; top: 21px; bottom: auto; width: auto; height: 2px; }
  .pipeline h3 { padding-top: 16px; }
}

/* ---------- Screenshots ---------- */
.gallery { display: grid; gap: 32px 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 680px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shot { margin: 0; min-width: 0; }
.shot-frame {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--line); background: var(--screen-2);
  text-decoration: none;
}
.shot-frame img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.shot-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; padding: 16px;
  color: var(--screen-muted); font-size: .92rem;
  background:
    linear-gradient(90deg, transparent 0 15%, rgba(255, 255, 255, .03) 15% 15.2%, transparent 15.2%),
    repeating-linear-gradient(180deg, transparent 0 38px, rgba(255, 255, 255, .025) 38px 39px),
    var(--screen-2);
}
.shot-fallback b { color: var(--screen-text); font-size: 1rem; }
.shot.is-missing img { display: none; }
.shot.is-missing .shot-frame { cursor: default; }
.shot figcaption { margin-top: 10px; font-size: .95rem; color: var(--muted); }
.shot figcaption b { color: var(--text); font-weight: 700; }

/* ---------- Quick start ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 40px; }
@media (min-width: 940px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 56px; } }
.steps > li { counter-increment: step; min-width: 0; }
.steps h3 { display: flex; align-items: baseline; gap: 12px; font-size: 1.2rem; margin-bottom: 10px; }
.steps h3::before { content: counter(step); flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 800; transform: translateY(-2px); }
.steps p { color: var(--muted); }
.steps p code, .callout code, .section-head code, .faq code, .ops code, .feature code:not(.artifact-title code) { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: .85em; overflow-wrap: anywhere; }

.code {
  position: relative; margin: 14px 0 0; border-radius: var(--radius); overflow: hidden;
  background: var(--screen); border: 1px solid var(--screen-line); color: var(--screen-text);
}
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--screen-line); font-size: .8rem; color: var(--screen-muted); font-family: var(--font-mono); }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font-size: .86rem; line-height: 1.65; tab-size: 2; }
.code .c { color: #8b8b94; }
.copy {
  font: inherit; font-family: var(--font-sans); font-size: .8rem; font-weight: 650; cursor: pointer;
  min-height: 30px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--screen-line); background: #242427; color: var(--screen-text);
}
.copy:hover { border-color: #55555c; }
.copy[data-state="done"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.copy[hidden] { display: none; }

.callout { margin-top: 48px; display: grid; gap: 8px 28px; padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 860px) { .callout { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.callout p { margin: 0; color: var(--muted); }
.callout strong { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { max-width: 52rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 20px 2px; font-weight: 700; font-size: 1.1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 12px; height: 12px; margin-right: 6px;
  border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg) translateY(-3px);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
@media (prefers-reduced-motion: no-preference) { .faq summary::after { transition: transform .2s ease; } }
.faq .answer { padding: 0 2px 22px; color: var(--muted); max-width: 44rem; }
.faq .answer p:last-child { margin-bottom: 0; }
.faq a { color: var(--accent-ink); font-weight: 650; }

/* ---------- Links strip ---------- */
.resources { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (min-width: 720px) { .resources { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1020px) { .resources { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.resources a { display: block; padding: 22px; background: var(--surface); text-decoration: none; }
.resources a:hover { background: var(--surface-2); }
.resources b { display: block; font-size: 1.05rem; margin-bottom: 4px; }
.resources span { color: var(--muted); font-size: .95rem; }
.resources code { font-size: .8rem; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 40px 48px; color: var(--muted); font-size: .95rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.site-footer .brand { color: var(--text); }
.legal { margin-top: 22px; font-size: .9rem; }

/* ---------- Prose pages (privacy, 404) ---------- */
.prose { max-width: 44rem; padding-block: clamp(48px, 7vw, 96px); }
.prose h1 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); margin-bottom: 18px; }
.prose h2 { font-size: 1.45rem; margin: 2.2em 0 .6em; letter-spacing: -.015em; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .5em; }
.prose a { color: var(--accent-ink); font-weight: 650; }
.prose .updated { font-size: .95rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media (max-width: 420px) {
  .actions .button { width: 100%; }
  .frame-meta { font-size: .68rem; top: 10px; left: 10px; right: 10px; }
}
