/* Billy Armstrong — Home v3 "stacked stage"
   Linear document by default (works with zero JS); script.js upgrades it into the
   fixed-viewport stage under html.stage. Tokens are the Billy Armstrong Design System. */

/* ── Self-hosted fonts (latin subset, edge-served) ─────────────────────────── */
@font-face { font-family:"Newsreader"; font-style:normal; font-weight:300; font-display:swap;
  src:url("/fonts/newsreader-300.woff2") format("woff2"); }
@font-face { font-family:"Newsreader"; font-style:normal; font-weight:400; font-display:swap;
  src:url("/fonts/newsreader-400.woff2") format("woff2"); }
@font-face { font-family:"Newsreader"; font-style:italic; font-weight:400; font-display:swap;
  src:url("/fonts/newsreader-italic-400.woff2") format("woff2"); }
@font-face { font-family:"Hanken Grotesk"; font-style:normal; font-weight:400; font-display:swap;
  src:url("/fonts/hanken-400.woff2") format("woff2"); }
@font-face { font-family:"Hanken Grotesk"; font-style:normal; font-weight:500; font-display:swap;
  src:url("/fonts/hanken-500.woff2") format("woff2"); }
@font-face { font-family:"Geist Mono"; font-style:normal; font-weight:400; font-display:swap;
  src:url("/fonts/geist-mono-400.woff2") format("woff2"); }

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  /* Limestone — warm neutrals */
  --limestone-25:#FBFAF7; --limestone-50:#F6F4EE; --limestone-100:#EEEAE1;
  --limestone-200:#E2DCCF; --limestone-300:#CFC6B4;
  /* Steel — structural greys */
  --steel-200:#CDD1D5; --steel-300:#AEB4BA; --steel-400:#868E96; --steel-500:#5F6770;
  --steel-600:#444B53; --steel-700:#2E3338; --steel-800:#1F2327; --steel-900:#15181B;
  /* Saddle — the one warm accent */
  --saddle-100:#F1E4D3; --saddle-200:#DFC5A3; --saddle-400:#B0824F; --saddle-500:#925F36; --saddle-600:#734927;
  /* Glass */
  --glass-white-40:rgba(255,255,255,.40); --glass-white-70:rgba(255,255,255,.70);
  --glass-black-60:rgba(21,24,27,.60); --glass-blur:14px;

  /* Semantic aliases */
  --bg-page:var(--limestone-50); --bg-sunken:var(--limestone-100); --bg-inverse:var(--steel-900);
  --text-primary:var(--steel-900); --text-secondary:var(--steel-600); --text-tertiary:var(--steel-500);
  --text-inverse:var(--limestone-50); --text-link:var(--steel-900);
  /* meta/hints are tiny mono caps — use the stronger steel-600 for AA on small type */
  --text-meta:var(--steel-600);
  --border-hairline:var(--steel-200); --border-subtle:var(--limestone-200);
  --border-strong:var(--steel-900); --border-focus:var(--saddle-400);
  --accent:var(--saddle-500); --accent-hover:var(--saddle-600);
  --action-primary:var(--steel-900); --action-primary-hover:var(--steel-700); --action-primary-text:var(--limestone-50);

  /* Type */
  --font-display:"Newsreader","Iowan Old Style",Georgia,serif;
  --font-body:"Hanken Grotesk","Helvetica Neue",Arial,sans-serif;
  --font-mono:"Geist Mono","SF Mono",Menlo,ui-monospace,monospace;
  --type-display:300 var(--fs-display,64px)/1 var(--font-display);
  --type-headline:400 clamp(22px,2.2vw,30px)/1.2 var(--font-display);
  --type-title:400 20px/1.2 var(--font-display);
  --type-body:400 16px/1.65 var(--font-body);
  --type-body-sm:400 14px/1.5 var(--font-body);
  --type-label:500 14px/1 var(--font-body);
  --type-meta:400 12px/1.4 var(--font-mono);
  --tracking-tight:-0.03em; --tracking-caps:0.14em;

  /* Space + motion */
  --page-width:1200px;
  --gutter:clamp(20px,3.2vw,40px);
  --bar:57px;
  --nav-h:64px;
  --ease-out:cubic-bezier(.2,.7,.2,1);
  --dur-fast:120ms; --dur-base:180ms; --dur-slow:320ms;
  --focus-ring:0 0 0 2px var(--bg-page),0 0 0 4px var(--border-focus);

  /* Nav geometry (JS overrides these in stage mode) */
  --nav-pad:max(var(--gutter), calc((100% - var(--page-width)) / 2));
  --wm-left:max(var(--gutter), calc((100% - var(--page-width)) / 2));
  --wm-tx:0; --links-w:340px; --links-op:1; --links-vis:visible;
  --char-dur:0ms;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-page); color: var(--text-primary); font: var(--type-body);
}
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; }
img { max-width: 100%; }

a { color: var(--text-link); text-decoration: underline; text-decoration-color: var(--steel-300);
    text-underline-offset: 3px; transition: text-decoration-color var(--dur-fast) var(--ease-out); }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 1px; }
::selection { background: var(--saddle-200); color: var(--steel-900); }

.skip-link { position: absolute; top: -200px; left: var(--gutter); z-index: 100;
  padding: 10px 16px; background: var(--steel-900); color: var(--limestone-50); text-decoration: none; }
.skip-link:focus { top: 12px; }

.mono-caps { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); }
.measure { max-width: var(--page-width); margin-inline: auto; padding-inline: var(--gutter); }

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 50; flex: 0 0 auto;
  background: var(--glass-white-70); backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur)); border-bottom: 1px solid var(--border-subtle);
}
.nav-inner { position: relative; height: 64px; display: flex; align-items: center; justify-content: flex-end;
  gap: 24px; padding: 0 var(--nav-pad); transition: padding 640ms var(--ease-out); }
.wordmark { position: absolute; top: 50%; left: var(--wm-left); transform: translate(var(--wm-tx), -50%);
  font: 400 22px/1 var(--font-display); letter-spacing: var(--tracking-tight); text-decoration: none;
  color: var(--text-primary); white-space: nowrap; transition: left 640ms var(--ease-out), transform 640ms var(--ease-out); }
.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 28px; max-width: var(--links-w); opacity: var(--links-op);
  visibility: var(--links-vis); overflow: hidden; white-space: nowrap;
  transition: max-width 640ms var(--ease-out), opacity 320ms var(--ease-out); }
.nav-links a { font: var(--type-label); text-decoration: none; color: var(--text-secondary);
  padding-bottom: 4px; border-bottom: 1px solid transparent; }
.nav-links a:hover { color: var(--text-primary); border-bottom-color: var(--border-strong); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 8px; font: var(--type-label); text-decoration: none;
  padding: 0 16px; height: 40px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--action-primary); color: var(--action-primary-text); border-color: var(--action-primary); }
.btn--primary:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); }
.btn--secondary { background: transparent; color: var(--text-primary); border-color: var(--border-hairline); height: 32px; }
.btn--secondary:hover { border-color: var(--border-strong); background: var(--bg-sunken); }
.btn--accent { background: var(--accent); color: var(--limestone-50); border-color: var(--accent); height: 48px; padding: 0 22px; font-size: 15px; }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--link { background: transparent; color: var(--text-primary); padding: 0; height: auto; border: none;
  text-decoration: underline; text-decoration-color: var(--steel-300); text-underline-offset: 3px; }
.btn--link:hover { text-decoration-color: var(--accent); }

/* ── Stage / sections (linear defaults) ─────────────────────────────────────── */
main { flex: 1 1 auto; }
.section { border-top: 1px solid var(--border-hairline); min-width: 0; }
.section--inverse { background: var(--bg-inverse); color: var(--text-inverse); border-top-color: var(--border-strong); }

.banner { display: block; min-width: 0; }
.banner-inner { display: flex; align-items: center; gap: 20px; height: 56px; min-width: 0; overflow: hidden;
  max-width: var(--page-width); margin-inline: auto; padding-inline: var(--gutter); }
.banner-num { font: var(--type-meta); letter-spacing: var(--tracking-caps); color: var(--text-meta); }
.banner-title { font: var(--type-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.banner-hint { flex: 1; text-align: right; white-space: nowrap; font: var(--type-meta);
  text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); }
.section--inverse .banner-num, .section--inverse .banner-hint { color: var(--steel-300); }

.pane { position: relative; min-width: 0; }
.pane-inner { display: flex; flex-direction: column; }
.content { max-width: var(--page-width); width: 100%; margin-inline: auto; padding: 16px var(--gutter) 48px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,360px),1fr)); gap: 32px 64px; align-items: center; }
.grid-2--start { align-items: start; }
.grid-2--tight { grid-template-columns: repeat(auto-fit, minmax(min(100%,320px),1fr)); gap: 32px 48px; }

/* Media placeholders (real assets land later) */
.media { width: 100%; background: var(--limestone-100); border: 1px solid var(--border-subtle);
  display: flex; align-items: flex-end; justify-self: end; }
.media span { font: var(--type-meta); color: var(--text-tertiary); padding: 12px 14px; }
.media--portrait { aspect-ratio: 4/5; max-width: 100%; }
.media--wide { aspect-ratio: 16/10; }
.media--photo { aspect-ratio: 4/3; }
.media--square { aspect-ratio: 1/1; }
/* Real assets fill the box (cover-crop); placeholders keep their caption span. */
.media { position: relative; overflow: hidden; }
.media > img, .media > video, .media > picture { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.media > picture > img { width: 100%; height: 100%; display: block; object-fit: cover; }

/* Notes media carousel — native scroll-snap (works with no JS); arrows/keyboard layered on by script.js. */
.carousel-track { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none;
  display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scroll-behavior: smooth; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-track::-webkit-scrollbar { width: 0; height: 0; display: none; }
.carousel-slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; }
.carousel-slide > img, .carousel-slide > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-slide .media-placeholder { position: absolute; inset: auto 0 0 0; font: var(--type-meta); color: var(--text-tertiary); padding: 12px 14px; }
.carousel-nav { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 4px; padding: 4px;
  background: var(--glass-white-70); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-subtle); border-radius: 999px; }
.carousel-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: none; border-radius: 999px; background: transparent; color: var(--text-primary); cursor: pointer;
  transition: background .15s var(--ease-out); }
.carousel-btn:hover { background: var(--bg-sunken); }
.carousel-btn:disabled { opacity: .35; cursor: default; }
.carousel-btn svg { width: 18px; height: 18px; }
.carousel-count { font: var(--type-meta); color: var(--text-secondary); min-width: 34px; text-align: center; }

/* Recent Projects — square clip carousel + "how it's made" disclosure */
.projects-carousel { max-width: 460px; justify-self: end; }
.reveal { margin-top: 24px; border-top: 1px solid var(--border-subtle); }
.reveal > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 14px 0;
  font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); }
.reveal > summary::-webkit-details-marker { display: none; }
.reveal-chev { width: 15px; height: 15px; flex: none; transition: transform .2s var(--ease-out); }
.reveal[open] .reveal-chev { transform: rotate(90deg); }
.reveal-steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
.reveal-steps li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: baseline; }
.reveal-step-h { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--accent); }
.reveal-step-d { font: var(--type-body-sm); font-size: 14px; color: var(--text-secondary); }
.feature { display: flex; flex-direction: column; gap: 12px; margin: 0; width: 100%; max-width: 480px; justify-self: end; }
.feature-cap { font: var(--type-meta); color: var(--text-tertiary); margin: 0; line-height: 1.5; }
.project-clips { margin-top: 44px; }
.clips-label { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); margin: 0; }
.clips-desc { font: var(--type-body-sm); font-size: 14px; color: var(--text-secondary); margin: 10px 0 0; max-width: 42ch; }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero-h1 { font: var(--type-display); --fs-display: clamp(32px,3.6vw,46px); letter-spacing: var(--tracking-tight);
  text-wrap: balance; max-width: 18ch; }
.hero-lede { font: var(--type-body); font-size: 17px; color: var(--text-secondary); max-width: 46ch; margin: 20px 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.eyebrow { margin-bottom: 20px; }

/* Timeline strip (undated progression — no fabricated dates) */
.timeline { max-width: var(--page-width); width: 100%; margin-inline: auto; padding: 0 var(--gutter) 32px; order: 2; }
.timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.timeline-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%,180px),1fr)); border-top: 1px solid var(--border-strong); }
.timeline-stop { position: relative; padding: 16px 16px 0 0; }
.timeline-stop::before { content: ""; position: absolute; top: -1px; left: 0; width: 1px; height: 10px; background: var(--border-strong); }
.timeline-stop .step { font: var(--type-meta); letter-spacing: var(--tracking-caps); color: var(--text-meta); margin-bottom: 6px; }
.timeline-stop .t { font: var(--type-title); font-size: 17px; margin-bottom: 2px; }
.timeline-stop .n { font: var(--type-body-sm); font-size: 13px; color: var(--text-secondary); }

/* ── Rule lists (work + repos) ─────────────────────────────────────────────── */
.intro { font: var(--type-body); font-size: 16px; color: var(--text-secondary); max-width: 52ch; margin: 0 0 20px; }
.rule-list { border-top: 1px solid var(--border-strong); }
.row-link { display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 16px; padding: 14px 0;
  border-bottom: 1px solid var(--border-hairline); text-decoration: none; color: inherit;
  transition: background var(--dur-fast) var(--ease-out); }
.row-link:hover { background: var(--bg-sunken); }
.row-index { font: var(--type-meta); letter-spacing: var(--tracking-caps); color: var(--text-meta); padding-top: 6px; }
.row-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.row-title { font: var(--type-title); font-size: 22px; }
.row-meta { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); white-space: nowrap; }
.row-desc { display: block; font: var(--type-body-sm); font-size: 14px; color: var(--text-secondary); margin-top: 4px; max-width: 56ch; }

.github-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.repo-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 24px; align-items: baseline; padding: 14px 0;
  border-bottom: 1px solid var(--border-hairline); text-decoration: none; color: inherit; transition: background var(--dur-fast) var(--ease-out); }
.repo-row:hover { background: var(--bg-sunken); }
.repo-name { font: var(--type-title); font-size: 20px; overflow-wrap: anywhere; }
.repo-meta { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); text-align: right; white-space: nowrap; }
.repo-desc { grid-column: 1 / -1; font: var(--type-body-sm); font-size: 14px; color: var(--text-secondary); }
.status-note { font: var(--type-body-sm); font-size: 14px; color: var(--text-secondary); padding: 14px 0; border-top: 1px solid var(--border-strong); margin: 0; }

/* ── About ─────────────────────────────────────────────────────────────────── */
.about-headline { font: var(--type-headline); margin: 0 0 20px; text-wrap: balance; max-width: 24ch; }
.about-headline em { font-style: italic; color: var(--text-secondary); }
.about-copy { font: var(--type-body); font-size: 16px; margin: 0 0 24px; color: var(--text-secondary); max-width: 52ch; }
.deflist { margin: 0; border-top: 1px solid var(--border-hairline); max-width: 520px; }
.deflist > div { display: grid; grid-template-columns: 96px minmax(0,1fr); gap: 20px; padding: 12px 0; border-bottom: 1px solid var(--border-hairline); }
.deflist dt { font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); padding-top: 4px; }
.deflist dd { margin: 0; font: var(--type-body); font-size: 15px; }

/* ── Notes cards ───────────────────────────────────────────────────────────── */
.card-list { display: grid; gap: 0; }
.card { display: block; text-decoration: none; color: inherit; padding: 16px 0;
  border-top: 1px solid var(--border-hairline); transition: background var(--dur-fast) var(--ease-out); }
.card:first-child { border-top-color: var(--border-strong); }
.card:last-child { border-bottom: 1px solid var(--border-hairline); }
.card:hover { background: var(--bg-sunken); }
.card .kicker { display: block; font: var(--type-meta); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-meta); margin-bottom: 8px; }
.card .h { font: var(--type-title); font-size: 24px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.card .h svg { width: 18px; height: 18px; }
.card p { font: var(--type-body-sm); font-size: 14px; color: var(--text-secondary); margin: 0; }

/* ── Connect ───────────────────────────────────────────────────────────────── */
.connect-headline { font: var(--type-headline); --fs-display: clamp(26px,2.8vw,38px); font-size: var(--fs-display);
  text-wrap: balance; max-width: 20ch; margin-bottom: 16px; }
.connect-copy { font: var(--type-body); font-size: 16px; color: var(--steel-300); max-width: 44ch; margin: 0; }
.connect-actions { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; justify-self: end; }
.connect-lead { display: flex; flex-direction: column; gap: 28px; justify-content: center; }
.connect-media { max-width: 320px; justify-self: start; align-self: center; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.social-links a { display: inline-flex; align-items: center; gap: 8px; font: var(--type-body-sm); color: var(--limestone-50); text-decoration-color: var(--steel-500); }
.social-links a:hover { text-decoration-color: var(--accent); }
.social-links svg { width: 14px; height: 14px; }
.site-footer { max-width: var(--page-width); width: 100%; margin-inline: auto; border-top: 1px solid var(--steel-700);
  padding: 14px var(--gutter); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font: var(--type-meta); color: var(--steel-300); text-transform: uppercase; letter-spacing: var(--tracking-caps); }

/* ── Ask guide (per-section, inline; appears in place, trail types out) ──────── */
.ask-row { display: flex; gap: 14px; align-items: center; }
.ask-row.open { align-items: flex-start; } /* when the line is open, mascot sits beside the input */
.ask-side { flex: 1; min-width: 0; }
/* pixel mascot (self-hosted sprite, crisp pixels); faces toward its trail (right by default) */
.ask-character { flex: 0 0 36px; width: 36px; height: 48px; border: 0; padding: 0; cursor: pointer;
  background: url("/img/ask-right.png") center bottom / contain no-repeat; image-rendering: pixelated;
  transition: transform var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out); }
.ask-character--left { background-image: url("/img/ask-left.png"); } /* used when the trail sits on the left */
.ask-character:hover { transform: translateY(-2px); filter: brightness(1.07); }
/* the mascot pops in place (no sliding), then JS types the trail out */
.ask-character.ask-in { animation: ask-pop 300ms var(--ease-out); }
@keyframes ask-pop { from { transform: translateY(5px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

.ask-trail { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font: var(--type-meta);
  color: var(--text-tertiary); max-width: 52ch; }
.section--inverse .ask-trail { color: var(--steel-300); }
.ask-trail .cursor { display: inline-block; width: 10px; height: 18px; background: var(--accent); vertical-align: middle; }
.ask-row.open .ask-trail { display: none; }

.ask-panel { min-width: 0; max-width: 60ch; }
.ask-panel[hidden] { display: none; }
.ask-input-row { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.ask-input-row .cursor { display: inline-block; width: 8px; height: 15px; background: var(--accent); }
.ask-input-row .chev { font: var(--type-meta); font-size: 13px; color: var(--accent); }
.ask-panel input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 0;
  font: var(--type-meta); font-size: 13px; line-height: 1.4; color: inherit; caret-color: var(--accent); }
.ask-close { background: transparent; border: 0; padding: 4px; cursor: pointer; color: inherit; opacity: .6; display: inline-flex; }
.ask-close:hover { opacity: 1; }
.ask-close svg { width: 14px; height: 14px; }
.ask-answer { margin: 10px 0 0; font: var(--type-body-sm); font-size: 14px; color: inherit; opacity: .9; max-width: 60ch; white-space: pre-wrap; }
.ask-note { font: var(--type-meta); font-size: 12px; line-height: 1.35; opacity: .8; margin-bottom: 6px; max-width: 44ch; }
.blink { animation: ba-blink 1s steps(1) infinite; }
@keyframes ba-blink { 50% { opacity: 0; } }

/* Every section's ask row sits at the foot, pinned to the bottom of the fold in stage mode */
.ask-row--foot { max-width: var(--page-width); width: 100%; margin: 24px auto 0; padding: 8px var(--gutter) 24px; box-sizing: border-box; order: 3; }
html.stage .ask-row--foot { margin-top: auto; position: sticky; bottom: 0; z-index: 30;
  background: var(--bg-page); border-top: 1px solid var(--border-hairline); } /* pin to the fold bottom, on top of scrolling content */
html.stage .section--inverse .ask-row--foot { background: var(--bg-inverse); border-top-color: var(--steel-700); }

/* ── STAGE MODE (JS adds html.stage only when tall + non-reduced-motion) ─────── */
html.stage, html.stage body { height: 100%; min-height: 0; overflow: hidden; }
html.stage .site-nav { position: relative; }
html.stage main { flex: 1 1 0%; min-height: 0; display: grid;
  grid-template-columns: repeat(var(--cols,1), minmax(0,1fr)); grid-template-rows: auto minmax(0,1fr); grid-auto-rows: auto; }
html.stage .section { display: grid; grid-template-rows: auto auto; min-height: 0; min-width: 0; }
html.stage .banner { cursor: pointer; position: relative; z-index: 1; overflow: hidden;
  background: var(--glass-white-70); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--border-hairline); transition: background var(--dur-fast) var(--ease-out); }
html.stage .section:first-child .banner { border-top: 0; }
html.stage .banner:hover { background: var(--glass-white-40); }
html.stage .section--inverse .banner { background: var(--glass-black-60); border-top-color: var(--border-strong); }
html.stage .section--inverse .banner:hover { background: var(--steel-700); }
html.stage .section { border-top: 0; }
html.stage .pane { min-height: 0; overflow: hidden; contain: paint;
  transition: opacity 420ms var(--ease-out); }
html.stage .pane-inner { position: absolute; left: 0; right: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
html.stage .off { pointer-events: none; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .connect-actions { justify-self: start; }
  .media { justify-self: stretch; }
}
@media (max-width: 620px) {
  .banner-inner, .content, .timeline, .site-footer, .ask-row--foot { --gutter: 20px; }
  .row-head { flex-direction: column; gap: 2px; }
  .grid-2, .grid-2--tight { gap: 24px 32px; }
  /* Narrow (always linear here): the stage nav geometry doesn't fit — wordmark back in flow,
     section links hidden (every section is reachable by scrolling), keep Connect. */
  .nav-inner { justify-content: space-between; }
  .wordmark { position: static; transform: none; }
  .nav-links { display: none; }
}

/* ── Mobile (linear document): section title sticks to the top, mascot to the bottom ── */
@media (max-width: 719px) {
  html:not(.stage) .banner { position: sticky; top: var(--nav-h); z-index: 40;
    background: var(--bg-page); border-bottom: 1px solid var(--border-hairline); }
  html:not(.stage) .section--inverse .banner { background: var(--bg-inverse); border-bottom-color: var(--steel-700); }
  html:not(.stage) .ask-row--foot { position: sticky; bottom: 0; z-index: 30; margin-top: 0;
    background: var(--bg-page); border-top: 1px solid var(--border-hairline); padding-top: 10px; padding-bottom: 12px; }
  html:not(.stage) .section--inverse .ask-row--foot { background: var(--bg-inverse); border-top-color: var(--steel-700); }
  /* Mobile stage: collapsed sections show the number only (tabs tile too narrow for titles) */
  html.stage .folded .banner-title { display: none; }
  html.stage .folded .banner-num { font-size: 13px; }
}

/* ── Reduced motion: kill every transition/animation (stays linear via JS gate) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── Print: compact résumé (name, intro, work, about) ──────────────────────── */
@media print {
  @page { margin: 16mm; }
  :root { --gutter: 0px; }
  html.stage, html.stage body { height: auto; overflow: visible; }
  .site-nav, .skip-link, .ask-character, .ask-row, .media, .banner-hint, #projects, #github, #notes, #connect, .site-footer { display: none !important; }
  html.stage main { display: block; }
  html.stage .pane, html.stage .pane-inner { position: static; height: auto !important; overflow: visible; opacity: 1 !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .section { border-top: 1.5pt solid #000; break-inside: avoid; }
  .hero-h1 { --fs-display: 26pt; }
}
