/* Shared styles for rafchn-recursos (hub + guides). No build step.
   Tokens follow DESIGN.md (Rafael Chacon identity): warm near-black canvas,
   Geist / Geist Mono, one coral accent. Dark is the base look; light applies
   when the OS asks for it or <html data-theme="light"> is set. */

:root {
  /* Surfaces and lines */
  --bg: #121010;
  --surface: #1a1716;
  --surface-2: #231f1d;
  --line: #2e2826;
  --line-strong: #3d3532;
  /* Text */
  --text: #f6f2f0;
  --text-muted: #a8a09b;
  --text-subtle: #6f6763; /* decorative only: below 4.5:1, never for readable copy */
  /* Accent (coral) */
  --accent: #ff6b3d;
  --accent-hover: #ff8257;
  --accent-text: #ff7a50;
  --on-accent: #2a0f05;
  --accent-soft: #3a1e14;
  /* Verdicts */
  --success: #4ade80;
  --success-soft: #13251a;
  --warning: #f5b83d;
  --warning-soft: #231c10;
  --warning-line: #4a3a17;
  --danger: #f04f5f;
  /* Terminal block stays dark in both themes */
  --code-bg: #1a1716;
  --code-text: #f6f2f0;
  --grid-line: color-mix(in srgb, var(--line) 55%, transparent);
  --shadow: none;
  --shadow-hover: none;
  --radius: 14px;
  --radius-sm: 10px;
  /* Motion tokens (DESIGN.md section 7) */
  --dur-fast: 120ms; --dur-base: 200ms; --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --cursor-blink: 1.1s;
  /* Type scale (DESIGN.md section 3) */
  --fs-label: 12px; --fs-foot: 12px; --fs-sub: 14px; --fs-body: 16px; --fs-title: 20px;
  --fs-h3: 24px;
  --fs-h2: clamp(26px, 2.4vw + 14px, 32px);
  --fs-h1: clamp(32px, 4.4vw + 8px, 44px);
  --fs-display: clamp(40px, 7vw, 64px);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f2f0;
    --surface: #ffffff;
    --surface-2: #fbf8f7;
    --line: #e4ddd9;
    --line-strong: #cfc6c1;
    --text: #121010;
    --text-muted: #5e5652;
    --text-subtle: #6f6763;
    --accent-hover: #f0592b;
    --accent-text: #c2461f; /* coral as TEXT on light */
    --accent-soft: #fff1eb;
    --success: #137536;
    --success-soft: #e3f5e9;
    --warning: #8a5300;
    --warning-soft: #fff4dc;
    --warning-line: #f0d8a0;
    --danger: #c0283a;
    --shadow: 0 1px 2px rgba(18, 16, 16, .06), 0 8px 24px rgba(18, 16, 16, .06);
    --shadow-hover: 0 1px 2px rgba(18, 16, 16, .06), 0 8px 24px rgba(18, 16, 16, .06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f2f0; --surface: #ffffff; --surface-2: #fbf8f7; --line: #e4ddd9; --line-strong: #cfc6c1;
  --text: #121010; --text-muted: #5e5652; --text-subtle: #6f6763;
  --accent-hover: #f0592b; --accent-text: #c2461f; --accent-soft: #fff1eb;
  --success: #137536; --success-soft: #e3f5e9;
  --warning: #8a5300; --warning-soft: #fff4dc; --warning-line: #f0d8a0; --danger: #c0283a;
  --shadow: 0 1px 2px rgba(18, 16, 16, .06), 0 8px 24px rgba(18, 16, 16, .06);
  --shadow-hover: 0 1px 2px rgba(18, 16, 16, .06), 0 8px 24px rgba(18, 16, 16, .06);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--font);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; font-weight: 500; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
strong { font-weight: 600; }
p { margin: 0 0 16px; }
h1, h2, h3 { line-height: 1.15; }
h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: var(--fs-body); font-weight: 600; margin: 0 0 8px; letter-spacing: -.01em; line-height: 1.25; }
ul, ol { padding-left: 24px; margin: 0 0 16px; }
li { margin-bottom: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 30; }
.skip:focus { left: 16px; }

/* Mono micro-label (DESIGN.md "Label") */
.label, .eyebrow, .kicker, .tag, .badge-new, .count, .brand small {
  font-family: var(--mono); font-size: var(--fs-label); line-height: 1.4; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
}

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 760px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Top bar: sticky, bg at 85% + blur 12px (the only blur used as material) */
.topbar {
  position: sticky; top: 0; z-index: 20; padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; min-height: 44px; }
.brand img { width: 32px; height: 32px; border-radius: 8px; flex: none; outline: 1px solid var(--line-strong); outline-offset: -1px; }
.brand small { display: block; margin-top: 2px; font-size: 11px; letter-spacing: .06em; color: var(--text-muted); font-weight: 400; text-transform: none; }
.ig-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent;
  color: var(--text); text-decoration: none; font-size: var(--fs-sub); font-weight: 600;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.ig-pill:hover { background: var(--surface-2); text-decoration: none; }
.ig-pill svg { width: 18px; height: 18px; }

/* Eyebrow + badges. The ">" prompt prefix is the brand signature. */
.eyebrow, .kicker { color: var(--accent-text); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before, .section > .kicker::before { content: ">"; color: var(--accent); font-weight: 700; }
.section > .kicker::before { margin-right: 8px; }
.eyebrow .dot { display: none; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.badge-new { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 700; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font: 600 var(--fs-body)/1 var(--font); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:not(.ghost):not(:has(svg))::before { content: ">"; font-family: var(--mono); font-weight: 700; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 480px) { .btn-row .btn { flex: 1 1 100%; } }

/* Cards: borders, not shadows, on dark */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .card { padding: 24px; } }

/* ---------- Hub ---------- */
.hero { position: relative; padding: 32px 0 8px; overflow: clip; }
@media (min-width: 720px) { .hero { padding: 64px 0 16px; } }
/* Faint blueprint grid, home hero only */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 30% 35%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 90% at 30% 35%, #000 10%, transparent 75%);
  opacity: .8;
}
.hero > .wrap { position: relative; z-index: 1; }
.hero h1 { font-size: var(--fs-display); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; margin: 16px 0 16px; max-width: 11.5ch; }
.hero h1 .hl { color: var(--accent-text); white-space: nowrap; }
.cursor {
  display: inline-block; width: .42em; height: .82em; margin-left: .1em; vertical-align: -.04em;
  background: var(--accent); animation: blink var(--cursor-blink) steps(1) infinite;
}
@keyframes blink { 0%, 49.99% { opacity: 1; } 50%, 100% { opacity: 0; } }
.hero .lead { font-size: var(--fs-body); color: var(--text-muted); max-width: 56ch; margin-bottom: 20px; }
@media (min-width: 720px) { .hero .lead, .g-hero .lead { font-size: var(--fs-title); line-height: 1.5; } }
.trust { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; margin: 0; list-style: none; color: var(--text-muted); font-size: var(--fs-sub); font-weight: 500; }
.trust li { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: var(--fs-sub); }
.trust svg { width: 18px; height: 18px; color: var(--success); flex: none; }

.finder { padding: 16px 0 4px; margin-top: 16px; }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-muted); pointer-events: none; }
.search input {
  width: 100%; min-height: 44px; height: 48px; padding: 0 16px 0 48px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  font: 400 var(--fs-body)/1 var(--font);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255, 107, 61, .4); }
.chips { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text-muted);
  font: 500 var(--fs-label)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip .n { opacity: .7; margin-left: 6px; }
.count { margin: 12px 4px 0; color: var(--text-muted); text-transform: none; letter-spacing: .02em; }

.grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 8px 0 24px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.res {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 200px;
  color: inherit; text-decoration: none; font-weight: 400;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
@media (hover: hover) {
  .res:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); text-decoration: none; }
}
.res:focus-visible { text-decoration: none; }
.res .top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res .icon { width: 46px; height: 46px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-title); }
.res h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -.01em; margin: 4px 0 0; }
.res p { color: var(--text-muted); font-size: var(--fs-sub); line-height: 1.5; margin: 0; }
.res .meta { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; color: var(--text-muted); font: 400 var(--fs-label)/1.4 var(--mono); }
.res .go { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font: 600 var(--fs-sub)/1 var(--font); }
.res .go svg { width: 16px; height: 16px; transition: transform var(--dur-base) var(--ease-out); }
@media (hover: hover) { .res:hover .go svg { transform: translateX(3px); } }
.res:focus-visible .go svg { transform: translateX(3px); }
.res .kw { font: 500 var(--fs-label)/1 var(--mono); color: var(--text-muted); }

.soon {
  display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 200px;
  border: 1px dashed var(--line-strong); background: transparent; box-shadow: none; color: var(--text-muted);
}
.soon h3 { color: var(--text); font-size: var(--fs-title); }
.soon p { margin: 0; font-size: var(--fs-sub); }
.soon .pulse { width: 10px; height: 18px; background: var(--accent); animation: blink var(--cursor-blink) steps(1) infinite; }
.empty { text-align: center; padding: 32px 20px; color: var(--text-muted); }
.empty[hidden] { display: none; }

/* Follow banner: surface card, one coral primary button */
.follow {
  margin: 20px 0 8px; display: grid; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line-strong);
}
.follow h2 { margin: 0 0 8px; }
.follow p { margin: 0; color: var(--text-muted); }
@media (min-width: 720px) { .follow { grid-template-columns: 1fr auto; padding: 32px; } }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--text-muted); font-size: var(--fs-sub); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: var(--text-muted); font-weight: 500; display: inline-flex; align-items: center; min-height: 44px; }
.site-footer a:hover { color: var(--text); }
.site-footer .foot-logo { flex-basis: 100%; color: var(--text); text-decoration: none; }
.foot-logo svg { height: 22px; width: auto; aspect-ratio: 5150 / 722; }

/* ---------- Guide ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0 0; margin: 0; list-style: none; font-size: var(--fs-sub); color: var(--text-muted); }
.crumbs li { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.crumbs a { color: var(--text-muted); display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 16px; height: 16px; }

.g-hero { padding: 12px 0 8px; }
.g-hero h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; margin: 16px 0; }
.g-hero .lead { font-size: var(--fs-body); color: var(--text-muted); margin-bottom: 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px; box-shadow: var(--shadow); }
.stat b { display: block; font: 700 var(--fs-title)/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; color: var(--accent-text); }
@media (max-width: 480px) { .stat b { font-size: 17px; } }
.stat span { display: block; font-size: var(--fs-foot); color: var(--text-muted); line-height: 1.4; margin-top: 4px; }
.verified { font-size: var(--fs-sub); color: var(--text-muted); margin: 8px 0 0; }

.facts { display: grid; grid-template-columns: 1fr; gap: 0; padding: 8px 20px; margin: 24px 0 0; }
.facts div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sub); }
.facts div:last-child { border-bottom: 0; }
.facts dt { font: 500 var(--fs-label)/1.6 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.facts dd { margin: 0; }
@media (min-width: 720px) { .facts { grid-template-columns: 1fr 1fr; column-gap: 28px; padding: 8px 24px; } .facts div:nth-last-child(2):nth-child(odd) { border-bottom: 0; } }

.toc { display: flex; gap: 8px; overflow-x: auto; margin: 20px -16px 0; padding: 4px 16px 8px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-muted); text-decoration: none; font-size: var(--fs-sub); font-weight: 500; transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out); }
.toc a:hover { border-color: var(--line-strong); color: var(--text); }
@media (min-width: 760px) { .toc { flex-wrap: wrap; margin: 20px 0 0; padding: 4px 0 8px; } }

.section { padding-top: 48px; scroll-margin-top: 88px; }
.section > .kicker { margin-bottom: 12px; display: block; }
.section > .intro { color: var(--text-muted); margin-bottom: 16px; }

.uses { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .uses { grid-template-columns: 1fr 1fr; } }
.use { display: flex; gap: 16px; align-items: flex-start; padding: 16px; }
.use .ico { flex: none; width: 44px; height: 44px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-muted); }
.use .ico svg { width: 22px; height: 22px; }
.use p { margin: 0; color: var(--text-muted); font-size: var(--fs-sub); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 24px 52px; margin: 0; counter-increment: step; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-strong); color: var(--accent-text);
  font: 700 var(--fs-body)/1 var(--mono);
}
.steps > li::after { content: ""; position: absolute; left: 17.5px; top: 42px; bottom: 6px; width: 1px; background: var(--line); }
.steps > li:last-child { padding-bottom: 4px; }
.steps > li:last-child::after { display: none; }
.steps h3 { font-size: var(--fs-body); margin: 8px 0 8px; }
.steps p { margin: 0 0 12px; }
.steps .note { font-size: var(--fs-sub); color: var(--text-muted); }

code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.cmd { position: relative; display: flex; flex-direction: column; background: var(--code-bg); border-radius: var(--radius-sm); margin: 12px 0 12px; border: 1px solid var(--line-strong); overflow: hidden; }
.cmd pre { flex: 1 1 auto; min-width: 0; margin: 0; padding: 16px 16px; overflow-x: auto; color: var(--code-text); font: 400 var(--fs-sub)/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
.cmd pre::before { content: "> "; color: var(--accent); font-weight: 700; }
/* Terminal header bar: mono label left, compact copy button right, hairline below. Stays dark in both themes. */
.cmd-bar, .cmd-foot { display: flex; align-items: center; gap: 12px; padding: 4px 8px 4px 16px; background: #231f1d; }
.cmd-bar { justify-content: space-between; border-bottom: 1px solid #2e2826; }
.cmd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 var(--fs-label)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #a8a09b; }
/* Second copy button at the bottom of long blocks, so nobody scrolls back up. */
.cmd-foot { display: none; justify-content: flex-end; padding-left: 8px; border-top: 1px solid #2e2826; }
.cmd.long .cmd-foot { display: flex; }
.copy {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-width: 88px; min-height: 32px; justify-content: center;
  padding: 0 10px; border-radius: 8px; border: 1px solid #3d3532;
  background: #1a1716; color: #f6f2f0; font: 600 13px/1 var(--font); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.copy::after { content: ""; position: absolute; inset: -6px -4px; } /* 44px tap target around the compact button */
.copy:hover { background: #2e2826; }
.copy:focus-visible { outline-offset: 1px; } /* .cmd clips overflow: keep the ring inside */
.copy svg { width: 14px; height: 14px; }
.copy.done { background: #13251a; border-color: #4ade80; color: #4ade80; }

.req { padding: 4px 20px; margin: 16px 0; }
.req div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sub); }
.req div:last-child { border-bottom: 0; }
.req dt { font-weight: 600; }
.req dd { margin: 0; color: var(--text-muted); }
@media (min-width: 720px) { .req { padding: 8px 24px; } .req div { grid-template-columns: 130px 1fr; } }

.tips { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tips { grid-template-columns: 1fr 1fr; } }
.tip { padding: 16px; }
.tip h3 { display: flex; align-items: center; gap: 12px; font-size: var(--fs-body); }
.tip h3 svg { width: 20px; height: 20px; color: var(--text-muted); flex: none; }
.tip p { margin: 0; color: var(--text-muted); font-size: var(--fs-sub); }
.tip.wide { grid-column: 1 / -1; }

/* "Before you use it" warnings: warning verdict colors */
.before { background: var(--warning-soft); border: 1px solid var(--warning-line); border-radius: var(--radius); padding: 16px 12px 12px; }
.before > .head, .before > .sub { padding: 0 8px; }
@media (min-width: 720px) { .before { padding: 24px; } .before > .head, .before > .sub { padding: 0; } }
.before > .head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.before > .head svg { width: 26px; height: 26px; color: var(--warning); flex: none; }
.before > .head h2 { margin: 0; }
.before > .sub { color: var(--text-muted); margin-bottom: 16px; }
.note-item { background: var(--surface); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; border: 1px solid var(--line); }
.note-item h3 { display: flex; align-items: baseline; gap: 12px; }
.note-item h3 .n { flex: none; font: 700 var(--fs-label)/1 var(--mono); color: var(--warning); }
.note-item p:last-child { margin-bottom: 0; }
.note-item .fix { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 12px 12px; border-radius: var(--radius-sm); background: var(--success-soft); color: var(--text); font-size: var(--fs-sub); }
.note-item .fix svg { width: 18px; height: 18px; color: var(--success); flex: none; margin-top: 4px; }
.big-num { font-weight: 700; color: var(--warning); }
.muted { color: var(--text-muted); font-size: var(--fs-sub); }
.h-sm { font-size: var(--fs-title); }

.resp { display: flex; gap: 16px; align-items: flex-start; }
.resp svg { width: 26px; height: 26px; color: var(--text-muted); flex: none; margin-top: 4px; }
.resp p { margin: 0; }

.cta-box { text-align: center; padding: 28px 20px; }
.cta-box h2 { margin-bottom: 8px; }
.cta-box p { color: var(--text-muted); margin-bottom: 16px; }
.cta-box .btn-row { justify-content: center; }

.signoff { margin-top: 40px; display: flex; gap: 16px; align-items: flex-start; }
.signoff img { width: 52px; height: 52px; border-radius: 12px; flex: none; outline: 1px solid var(--line-strong); outline-offset: -1px; }
.signoff p { margin: 0 0 8px; }
.signoff .sig { font: 500 var(--fs-body)/1.4 var(--mono); margin-top: 4px; }

/* ---------- Plain text pages ---------- */
.prose { padding-top: 8px; }
.prose h1 { font-size: var(--fs-h1); font-weight: 700; letter-spacing: -.025em; margin: 16px 0 8px; }
.prose h2 { font-size: var(--fs-title); margin: 32px 0 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose .card { margin-top: 24px; }

/* ---------- Motion (DESIGN.md section 7) ----------
   html.m = motion allowed (set by the inline head script). Hidden "from" states only exist under .m,
   so no-JS and reduced-motion visitors always get the final layout. transform / opacity / filter only. */
:root { --ease-brake: cubic-bezier(0.34, 1.32, 0.64, 1); --dur-hero: 700ms; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes rv-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes bw-in { to { opacity: 1; filter: none; transform: none; } }
@keyframes show { to { visibility: visible; } }
@keyframes sd-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes grow { to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

/* Reading progress bar (guides). Scroll-driven where supported, stepped by JS elsewhere. */
.progress { display: none; }

@media (prefers-reduced-motion: no-preference) {
  /* Hero: blur-fade word reveal (words split by JS), then lead and trust items rise in. */
  .m .hero h1 { visibility: hidden; animation: show 0s 1.5s forwards; }
  .m .hero h1.bw-ready { visibility: visible; animation: none; }
  .m .bw {
    display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(.28em);
    animation: bw-in var(--dur-hero) var(--ease-out) forwards; animation-delay: calc(120ms + var(--i, 0) * 70ms);
  }
  .m .hero .cursor { visibility: hidden; animation: blink var(--cursor-blink) steps(1) .95s infinite, show 0s .95s forwards; }
  .m .hero .eyebrow, .m .crumbs { animation: rise 600ms var(--ease-out) backwards; }
  .m .hero .lead { animation: rise 600ms var(--ease-out) 480ms backwards; }
  .m .hero .trust li { animation: rise 600ms var(--ease-out) 600ms backwards; }
  .m .hero .trust li:nth-child(2) { animation-delay: 670ms; }
  .m .hero .trust li:nth-child(3) { animation-delay: 740ms; }
  .m .g-hero > :not(h1) { animation: rise 600ms var(--ease-out) 100ms backwards; }
  .m .g-hero > :nth-child(3) { animation-delay: 180ms; }
  .m .g-hero > :nth-child(n+4) { animation-delay: 260ms; }

  /* Stagger-in (hub cards; guide blocks when scroll timelines are unavailable). */
  .m .rv:not(.in) { opacity: 0; transform: translateY(12px); }
  .m .rv.in { animation: rv-in 500ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 50ms); }

  /* Hub cards: pointer-following spotlight (coral, low alpha) under the content. */
  .res { overflow: hidden; isolation: isolate; }
  .res::before {
    content: ""; position: absolute; inset: 0 auto auto 0; width: 360px; height: 360px; border-radius: 50%;
    pointer-events: none; z-index: -1; opacity: 0;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 14%, transparent), transparent);
    transform: translate3d(calc(var(--x, 50%) - 180px), calc(var(--y, 0px) - 180px), 0);
    transition: opacity var(--dur-slow) var(--ease-out);
  }
  @media (hover: hover) { .res:hover::before { opacity: 1; } }

  /* Chips and copy buttons: press feedback. */
  .chip { transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
  .chip:active { transform: scale(.97); }
  .copy { transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
  .copy:active { transform: scale(.96); }
  .copy.done svg { animation: pop 360ms var(--ease-brake) both; }
  .copy.done span { animation: rise 240ms var(--ease-out) backwards; }

  /* Magnetic primary CTA: the padded wrapper is the hit zone, only the button moves. */
  .mag { display: inline-flex; padding: 10px; margin: -10px; }
  .mag > .btn { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0); transition: transform 250ms var(--ease-out), background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
  .mag > .btn:active { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0) scale(.98); }

  /* Terminal block: the "> command" line types on once; coral cursor leads (monospace: 1ch = 1 char). */
  .m .cmd.tp pre { position: relative; clip-path: inset(0 calc(100% - 16px - 2ch) 0 0); }
  .m .cmd.tp.go pre { animation: type-on calc(var(--n) * 45ms) steps(var(--n), end) forwards; }
  .m .cmd.tp.go pre::after {
    content: ""; position: absolute; left: calc(16px + 2ch); top: 18px; width: .6ch; height: 1.15em;
    background: var(--accent); animation: type-cursor calc(var(--n) * 45ms) steps(var(--n), end) forwards;
  }
  @keyframes type-on { to { clip-path: inset(0 calc(100% - 16px - (var(--n) + 2) * 1ch - .8ch) 0 0); } }
  @keyframes type-cursor { to { transform: translateX(calc(var(--n) * 1ch)); } }
  @media (max-width: 480px) { .m .cmd.tp pre { clip-path: none; } .m .cmd.tp.go pre, .m .cmd.tp.go pre::after { animation: none; } }

  /* Page transitions. Cross-document: same-origin navigations crossfade, the brand mark stays put and
     the clicked card title (named in JS on pageswap) travels into the guide H1. Filtering the hub uses the
     same-document API from motion.js. Unsupported browsers navigate normally. */
  @view-transition { navigation: auto; }
  .brand img { view-transition-name: brand-mark; }
  .g-hero h1 { view-transition-name: guide-title; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-in-out); }
  ::view-transition-group(*) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease-in-out); }
  ::view-transition-group(guide-title), ::view-transition-group(brand-mark) { animation-duration: 480ms; animation-timing-function: var(--ease-out); }
}

/* Scroll-driven reveal and reading progress; declared after the shorthand so the timeline sticks. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .sd { animation: sd-in linear both; animation-timeline: view(); animation-range: entry 0% cover 22%; }
    .progress {
      display: block; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 25; pointer-events: none;
      background: var(--accent); transform-origin: 0 50%; transform: scaleX(0);
      animation: grow linear both; animation-timeline: scroll(root block);
    }
  }
}
@supports not (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress {
      display: block; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 25; pointer-events: none;
      background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
      transition: transform var(--dur-slow) var(--ease-out);
    }
  }
}

/* ---------- Audit fixes ---------- */
html { scroll-padding-top: 76px; } /* sticky top bar must not cover a focused or targeted element */
h1, h2 { text-wrap: balance; }
h3 { text-wrap: pretty; }
a, button, input, .chip { touch-action: manipulation; }
@media print {
  .sd { animation: none !important; opacity: 1 !important; transform: none !important; }
  .progress { display: none !important; }
}
