/* =============================================================================
   agenticow ExplainerSite — BRANCH-GRAPH / GREEN-INK
   Aesthetic lock [Constraint K — distinct per repo]:
     • Substrate: deep cool GREEN-INK near-black (#08120e), NOT photonlayer's
       optical blue-black, NOT metaharness's warm charcoal/amber.
     • Accents: a semantic VERSION-CONTROL palette, never a rainbow —
         mint-emerald  #34e8a0  = branches / additions / new growth
         violet-indigo #9b8cff  = the shared base / parent / lineage
         coral-rose    #ff6b8a  = tombstones / deletes / discarded
       (+ a muted gold #ffcf5e used only for "override" highlights).
     • Motifs: git commit-graph (glowing nodes + smooth curved branch lines),
       copy-on-write overlay sheets, lineage chains.
   Type: "Space Grotesk" display + "Inter" body + "JetBrains Mono" code,
   loaded from Google Fonts with a system fallback so the page renders offline.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;450;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- Design tokens -------------------------------------------------------- */
:root {
  /* Green-ink substrate — deep, calm, version-control terminal feel */
  --bg:        #08120e;   /* deepest — page floor */
  --bg-2:      #0a160f;   /* raised plane */
  --panel:     #0e1d16;   /* card body */
  --panel-2:   #122619;   /* card header / inset */
  --panel-3:   #173123;   /* hover / nested */
  --ridge:     #1f3a2a;   /* hairline edges */

  /* Semantic version-control palette */
  --mint:      #34e8a0;   /* branch / add / new */
  --mint-2:    #5cf2b6;
  --base:      #9b8cff;   /* base / parent / lineage (violet-indigo) */
  --base-2:    #b3a6ff;
  --rose:      #ff6b8a;   /* tombstone / delete / discarded */
  --gold:      #ffcf5e;   /* override (used sparingly) */
  --teal:      #2fd6c6;   /* secondary line accent */

  --branch-grad: linear-gradient(100deg, var(--base) 0%, var(--teal) 42%, var(--mint) 100%);
  --branch-soft: linear-gradient(100deg, rgba(155,140,255,.9), rgba(52,232,160,.9));

  /* Ink — cool off-white with the faintest green cast */
  --ink:       #eaf3ee;   /* primary text */
  --ink-2:     #c2d3c8;   /* secondary text */
  --muted:     #8aa394;   /* captions, meta */
  --faint:     #5d7567;   /* hairline labels */
  --on-accent: #06120c;   /* text ON a bright fill */

  /* Lines / fills */
  --line:        rgba(120,210,160,.12);
  --line-strong: rgba(120,210,160,.26);
  --glass:       rgba(14,29,22,.55);

  /* Depth — cool shadows + mint glow */
  --shadow:      0 22px 50px -28px rgba(0,0,0,.85);
  --shadow-deep: 0 40px 100px -44px rgba(0,0,0,.92);
  --glow-mint:   0 0 0 1px rgba(52,232,160,.22), 0 16px 44px -18px rgba(52,232,160,.28);
  --glow-branch: 0 14px 50px -20px rgba(120,180,255,.30);

  /* Type */
  --display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Rhythm */
  --maxw:    1160px;
  --gutter:  clamp(18px, 5vw, 52px);
  --radius:  16px;
  --radius-s: 10px;
  --ease:    cubic-bezier(.22,.61,.36,1);
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Branch-graph backdrop: faint mint/violet glints + a deep-forest gradient.
     Green/violet only — NEVER warm amber (that's the foundry site). */
  background-image:
    radial-gradient(900px 540px at 84% -6%, rgba(52,232,160,.10), transparent 60%),
    radial-gradient(820px 600px at -8% 6%, rgba(155,140,255,.09), transparent 58%),
    radial-gradient(700px 520px at 50% 112%, rgba(255,107,138,.05), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--mint); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--base-2); }

a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
  border-radius: 4px;
}

code, pre, kbd { font-family: var(--mono); }

::selection { background: rgba(52,232,160,.28); color: var(--ink); }

/* ---- Layout shell --------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

/* Branch-line hairline used as a recurring motif */
.spec-line { height: 2px; width: 100%; background: var(--branch-grad); border: 0; border-radius: 2px; opacity: .9; }

/* ---- Top bar -------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(8,18,14,.92), rgba(8,18,14,.72));
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--display); font-weight: 600; letter-spacing: .2px; color: var(--ink); }
.brand .logo { width: 26px; height: 26px; flex: none; }
.brand b { font-weight: 700; }
.brand .tag { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 2px 7px; border: 1px solid var(--line); border-radius: 20px; }
.topbar nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.topbar nav a { color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 7px 11px; border-radius: 8px; }
.topbar nav a:hover { color: var(--ink); background: var(--panel-2); }
.topbar .ghub { border: 1px solid var(--line-strong); }
@media (max-width: 720px) { .topbar nav a.hide-sm { display: none; } }

/* ---- Hero ----------------------------------------------------------------- */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero .wrap { position: relative; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.06fr .94fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-2); padding: 6px 13px; border-radius: 30px;
  border: 1px solid var(--line-strong);
  background: var(--glass);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--branch-grad); box-shadow: 0 0 10px rgba(52,232,160,.6); }

.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(34px, 5.6vw, 60px); line-height: 1.04; letter-spacing: -.02em;
  margin: 20px 0 0;
}
.hero h1 .spec-text {
  background: var(--branch-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede { font-size: clamp(17px, 2.2vw, 21px); color: var(--ink-2); margin: 20px 0 0; max-width: 40ch; }
.hero .sub { font-size: 15.5px; color: var(--muted); margin: 14px 0 0; max-width: 48ch; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 12px 20px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
  transition: transform .14s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn-primary { color: var(--on-accent); background: var(--branch-grad); box-shadow: var(--glow-branch); }
.btn-primary:hover { transform: translateY(-2px); color: var(--on-accent); }
.btn-ghost { color: var(--ink); background: var(--panel); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); background: var(--panel-2); transform: translateY(-2px); }

.hero-figure { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-deep); }
.hero-figure img { width: 100%; }
.hero-figure::after { content:""; position:absolute; inset:0; border-radius: var(--radius); box-shadow: inset 0 0 0 1px rgba(52,232,160,.18); pointer-events:none; }
.hero-figcap { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-top: 10px; text-align: center; }

/* Provenance strip */
.prov {
  margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
  padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass);
}
.prov .who { color: var(--ink-2); }
.prov code { color: var(--mint); }
.prov a { color: var(--ink-2); border-bottom: 1px dotted var(--line-strong); }
.prov a:hover { color: var(--base-2); }
.prov .pill { padding: 2px 9px; border-radius: 20px; border: 1px solid var(--line-strong); }

/* ---- Stat band ------------------------------------------------------------ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2,1fr); } }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); position: relative; overflow: hidden; }
.stat::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--branch-grad); }
.stat .n { font-family: var(--display); font-weight: 700; font-size: clamp(22px, 3vw, 30px); color: var(--ink); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---- Main two-column (rail + content) ------------------------------------ */
.shell { display: grid; grid-template-columns: 224px 1fr; gap: clamp(24px, 4vw, 52px); padding: clamp(40px,6vw,72px) 0; align-items: start; }
@media (max-width: 980px) { .shell { grid-template-columns: 1fr; } }

.rail { position: sticky; top: 84px; align-self: start; }
@media (max-width: 980px) { .rail { display: none; } }
.rail .rail-h { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px 12px; }
.rail a { display: block; color: var(--muted); font-size: 14px; padding: 7px 12px; border-radius: 8px; border-left: 2px solid transparent; line-height: 1.3; }
.rail a:hover { color: var(--ink); background: var(--panel); }
.rail a.active { color: var(--ink); border-left-color: var(--mint); background: var(--panel); }
.rail a .num { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-right: 7px; }
.rail .expand-btn { margin-top: 16px; width: 100%; font-size: 12.5px; color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); padding: 9px; border-radius: 9px; cursor: pointer; font-family: var(--sans); }
.rail .expand-btn:hover { background: var(--panel-2); color: var(--ink); }

/* ---- Section (collapsible) ------------------------------------------------ */
section { scroll-margin-top: 84px; }
.sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 20px; overflow: hidden; box-shadow: var(--shadow); }
.sec[open] { box-shadow: var(--shadow), var(--glow-mint); border-color: var(--line-strong); }
.sec > summary {
  list-style: none; cursor: pointer; display: flex; align-items: flex-start; gap: 16px;
  padding: 22px clamp(18px,3vw,30px); user-select: none;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary:hover { background: var(--panel-2); }
.sec .s-num { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--on-accent); background: var(--branch-grad); border-radius: 9px; padding: 6px 10px; flex: none; line-height: 1; margin-top: 3px; }
.sec .s-head { flex: 1; min-width: 0; }
.sec .s-q { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); }
.sec .s-title { font-family: var(--display); font-weight: 600; font-size: clamp(19px, 2.6vw, 25px); line-height: 1.18; margin: 5px 0 0; color: var(--ink); }
.sec .s-sub { font-size: 14.5px; color: var(--muted); margin: 7px 0 0; }
.sec .chev { flex: none; width: 22px; height: 22px; color: var(--muted); transition: transform .22s var(--ease); margin-top: 6px; }
.sec[open] .chev { transform: rotate(180deg); color: var(--mint); }
.sec .s-body { padding: 4px clamp(18px,3vw,30px) clamp(24px,3vw,32px); }
.sec .s-body > :first-child { margin-top: 0; }

.sec p { color: var(--ink-2); }
.sec h4 { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--ink); margin: 26px 0 8px; }
.sec ul, .sec ol { color: var(--ink-2); padding-left: 20px; }
.sec li { margin: 7px 0; }
.sec strong { color: var(--ink); font-weight: 600; }
.sec em { color: var(--ink); font-style: italic; }

.lead-in { font-size: 17px; color: var(--ink) !important; }

/* Callouts */
.note { border-left: 3px solid var(--mint); background: rgba(52,232,160,.06); padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 18px 0; font-size: 14.5px; color: var(--ink-2); }
.note.warn { border-left-color: var(--rose); background: rgba(255,107,138,.07); }
.note.honest { border-left-color: var(--base); background: rgba(155,140,255,.08); }
.note .lab { font-family: var(--mono); font-size: 11px; letter-spacing:.08em; text-transform: uppercase; color: var(--mint); display:block; margin-bottom: 4px; }
.note.warn .lab { color: var(--rose); }
.note.honest .lab { color: var(--base-2); }

/* Dual-visual block: a friendly raster on-ramp + a technical SVG diagram */
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
@media (max-width: 760px) { .dual { grid-template-columns: 1fr; } }
.vfig { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); overflow: hidden; display: flex; flex-direction: column; }
.vfig .vlabel { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--muted); display:flex; align-items:center; gap:8px; }
.vfig .vlabel .ic { width: 14px; height: 14px; }
.vfig .vlabel.simple { color: var(--mint); }
.vfig .vlabel.tech { color: var(--base-2); }
.vfig .vbody { padding: 0; }
.vfig img { width: 100%; display: block; }
.vfig .svgwrap { padding: 16px; }
.vfig .vcap { font-size: 13px; color: var(--muted); padding: 11px 14px 14px; border-top: 1px solid var(--line); }
.vfig svg { width: 100%; height: auto; display: block; }

/* Command / code blocks */
.cmd { position: relative; display: block; font-family: var(--mono); font-size: 13.5px; background: #05100a; border: 1px solid var(--ridge); border-radius: 10px; padding: 14px 48px 14px 16px; color: var(--mint); margin: 14px 0; overflow-x: auto; white-space: pre; cursor: copy; }
.cmd .copy-hint { position: absolute; right: 12px; top: 12px; font-size: 10.5px; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
.cmd:hover { border-color: var(--line-strong); }
.cmd:hover .copy-hint { color: var(--mint); }
.cmd .prompt { color: var(--faint); user-select: none; }
.cmd .flag { color: var(--base-2); }
pre.block { font-family: var(--mono); font-size: 13px; line-height: 1.6; background: #05100a; border: 1px solid var(--ridge); border-radius: 12px; padding: 16px; color: var(--ink-2); overflow-x: auto; margin: 16px 0; }
pre.block .c { color: var(--faint); }
pre.block .k { color: var(--base-2); }
pre.block .s { color: var(--mint-2); }
code.inl { font-size: .9em; background: var(--panel-3); padding: 1.5px 6px; border-radius: 5px; color: var(--mint); border: 1px solid var(--line); }

/* Tables (before/after, comparison) */
.tbl { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.tbl thead th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.before { color: var(--ink-2); }
.tbl td.after { color: var(--ink); }
.tbl .win { color: var(--mint); font-weight: 600; }
.tbl .num { font-family: var(--mono); }

/* Before → after pair */
.ba { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: stretch; margin: 20px 0; }
@media (max-width: 720px) { .ba { grid-template-columns: 1fr; } .ba .arrow { transform: rotate(90deg); justify-self: center; } }
.ba .card { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: var(--bg-2); }
.ba .card.b { border-top: 3px solid var(--rose); }
.ba .card.a { border-top: 3px solid var(--mint); }
.ba .card h5 { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 10px; }
.ba .card.b h5 { color: var(--rose); }
.ba .card.a h5 { color: var(--mint); }
.ba .card p { font-size: 14px; margin: 0; color: var(--ink-2); }
.ba .arrow { align-self: center; color: var(--base-2); font-size: 26px; }

/* ---- "Ways it bites you" — without/with pain cards ------------------------ */
.pains { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 6px; }
@media (max-width: 760px) { .pains { grid-template-columns: 1fr; } }
.pain { border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); padding: 18px; }
.pain .sit { display: flex; gap: 11px; align-items: flex-start; margin: 0 0 13px; }
.pain .sit .pn { font-family: var(--mono); font-size: 12px; color: var(--on-accent); background: var(--branch-grad); border-radius: 7px; padding: 4px 8px; flex: none; line-height: 1; margin-top: 2px; }
.pain .sit h5 { font-family: var(--display); font-weight: 600; font-size: 16.5px; color: var(--ink); margin: 0; line-height: 1.3; }
.pain .row { display: flex; gap: 10px; font-size: 14px; margin: 10px 0 0; }
.pain .row .tag { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; flex: none; height: fit-content; margin-top: 2px; }
.pain .row.without .tag { color: var(--rose); border: 1px solid rgba(255,107,138,.42); }
.pain .row.with .tag { color: var(--mint); border: 1px solid rgba(52,232,160,.42); }
.pain .row p { margin: 0; color: var(--ink-2); }
.pain .row.with p strong { color: var(--ink); }

/* ---- Use-case gallery ----------------------------------------------------- */
.gallery-intro { margin-bottom: 18px; }
.uc { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 14px; overflow: hidden; }
.uc[open] { border-color: var(--line-strong); box-shadow: var(--glow-mint); }
.uc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.uc > summary::-webkit-details-marker { display: none; }
.uc > summary:hover { background: var(--panel-2); }
.uc .uc-n { font-family: var(--mono); font-size: 12px; color: var(--on-accent); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.uc .uc-n.b1 { background: var(--base); } .uc .uc-n.b2 { background: var(--teal); }
.uc .uc-n.b3 { background: var(--mint); }   .uc .uc-n.b4 { background: var(--mint-2); }
.uc .uc-n.b5 { background: var(--gold); } .uc .uc-n.b6 { background: var(--base-2); }
.uc .uc-n.b7 { background: var(--rose); }    .uc .uc-n.b8 { background: var(--teal); }
.uc .uc-t { font-family: var(--display); font-weight: 600; font-size: 16.5px; color: var(--ink); flex: 1; }
.uc .uc-tag { font-family: var(--mono); font-size: 11px; color: var(--muted); padding: 3px 9px; border: 1px solid var(--line); border-radius: 20px; }
@media (max-width: 600px) { .uc .uc-tag { display: none; } }
.uc .chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); flex: none; }
.uc[open] .chev { transform: rotate(180deg); color: var(--mint); }
.uc .uc-body { padding: 4px 20px 22px; }
.uc .uc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
@media (max-width: 760px) { .uc .uc-grid { grid-template-columns: 1fr; } }
.uc .uc-meta p { margin: 6px 0; font-size: 14.5px; color: var(--ink-2); }
.uc .uc-meta .k { font-family: var(--mono); font-size: 11px; letter-spacing:.06em; text-transform: uppercase; color: var(--mint); display:block; }

/* ---- Drop-in file tree ---------------------------------------------------- */
.tree { font-family: var(--mono); font-size: 13px; line-height: 1.9; background: #05100a; border: 1px solid var(--ridge); border-radius: 14px; padding: 20px; overflow-x: auto; margin: 18px 0; }
.tree .root { color: var(--ink); font-weight: 500; }
.tree .br { color: var(--faint); }
.tree .f { color: var(--mint); }
.tree .d { color: var(--base-2); }
.tree .cmt { color: var(--muted); }
.tree .heart { color: var(--rose); }
.tree .group { color: var(--mint-2); }

/* steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 20px 0; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 56px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; background: var(--bg-2); }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--on-accent); background: var(--branch-grad); }
.steps li strong { color: var(--ink); }

/* ---- Footer --------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 44px 0 60px; margin-top: 30px; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
@media (max-width: 760px) { .footer .cols { grid-template-columns: 1fr; } }
.footer h6 { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.footer a { color: var(--ink-2); display: block; padding: 4px 0; font-size: 14px; }
.footer a:hover { color: var(--mint); }
.footer .credit { font-size: 14px; color: var(--muted); line-height: 1.7; }
.footer .credit b { color: var(--ink); }
.footer .fine { font-family: var(--mono); font-size: 11.5px; color: var(--faint); margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }

/* utility */
.center { text-align: center; }
.muted { color: var(--muted); }
.kbd { font-family: var(--mono); font-size: .85em; background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }

/* ---- Click-to-enlarge: every diagram/illustration is zoomable ------------- */
.svgwrap, .vbody { position: relative; }
.svgwrap svg, .vbody img { cursor: zoom-in; }
.svgwrap::after, .vbody::after {
  content: "⤢ enlarge"; position: absolute; top: 8px; right: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .04em; color: var(--ink);
  background: rgba(8,18,14,.78); border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 3px 8px; opacity: 0; transition: opacity .15s var(--ease); pointer-events: none;
}
.svgwrap:hover::after, .vbody:hover::after { opacity: 1; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 5vh 4vw; background: rgba(5,12,9,.93); backdrop-filter: blur(9px); cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox .lb-stage {
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow-deep); display: flex;
  max-width: 96vw; max-height: 84vh; cursor: default;
}
.lightbox .lb-stage svg { width: min(92vw, 1200px); height: auto; max-height: 78vh; }
.lightbox .lb-stage img { max-width: 92vw; max-height: 78vh; width: auto; height: auto; border-radius: 10px; }
.lightbox .lb-cap { font-family: var(--sans); font-size: 13.5px; color: var(--ink-2); max-width: 760px; text-align: center; margin: 0; cursor: default; }
.lightbox .lb-close {
  position: fixed; top: 18px; right: 22px; width: 42px; height: 42px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  font-size: 23px; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lightbox .lb-close:hover { background: var(--panel-2); color: var(--mint); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
