/* A dark room in warm lamplight. Pulling the plug takes it to nearly black. */

/* Fonts are served from here rather than Google, so the first paint waits on no other server.
   Both are variable: one file covers every weight. Latin-ext only downloads if the page needs it. */
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(fonts/fraunces-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Fraunces"; font-style: normal; font-weight: 600 700; font-display: swap;
  src: url(fonts/fraunces-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/figtree-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #1a1b1e;
  --nav: rgba(16, 17, 19, .96);
  --ink: #f4ece1;
  --bright: #fff7ec;
  --dim: #aaa59d;
  --unlit: #64625e;
  --accent: #ffb347;  /* anything you can interact with */
  --brand: #e8804a;   /* brand moments */
  --tint: rgba(255, 250, 240, .07);
  --line: rgba(255, 250, 240, .1);
  --line-strong: rgba(255, 250, 240, .22);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 56px;
}
html.off {
  --bg: #08090a;
  --panel: #121315;
  --nav: rgba(8, 9, 10, .97);
  --ink: #ddd6cc;
  --bright: #e9e2d8;
  --dim: #918d86;
  --unlit: #55534f;
  --accent: #d99a45;
  --brand: #c8744a;
  --tint: rgba(255, 250, 240, .05);
  --line: rgba(255, 250, 240, .07);
  --line-strong: rgba(255, 250, 240, .16);
}
html.switching, html.switching *, html.switching *::before { transition: background-color .35s, color .35s, border-color .35s, fill .35s, stroke .35s, opacity .35s, filter .35s !important; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
code { font: inherit; }
main { position: relative; }
svg { display: block; }
::selection { background: var(--brand); color: var(--bg); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 30;
  padding: 8px 14px; background: var(--ink); color: var(--bg);
  font: 700 14px var(--sans);
}
.skip:focus { top: 12px; }

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--nav);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: 8px; font: 600 18px var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.nav ul { display: flex; gap: clamp(10px, 2.6vw, 28px); }
.nav li a { display: block; padding-block: 13px; font: 500 14px/18px var(--sans); color: var(--dim); text-decoration: none; transition: color .15s; }
.nav li a:hover, .nav li a.on { color: var(--accent); }
.nav .wrap > ul { margin-left: auto; }
.lang {
  flex: none; display: grid; place-items: center; min-width: 34px; height: 28px; padding: 0 8px;
  font: 600 12px/1 var(--sans); letter-spacing: .06em; color: var(--dim); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 999px; transition: color .15s, border-color .15s;
}
.lang:hover { color: var(--accent); border-color: var(--accent); }

/* the room lights up as the plug goes in */
.dusk { position: fixed; inset: 0; z-index: 40; background: #050506; opacity: 0; pointer-events: none; animation: dusk .55s linear; }
@keyframes dusk {
  0%, 26% { opacity: .7; }
  30%, 40% { opacity: .2; }
  44%, 56% { opacity: .55; }
  64% { opacity: .12; }
  100% { opacity: 0; }
}

/* backlit sign: the letters are there from the first frame, then the light behind them strikes */
.tube { --glow: 0 0 22px rgba(255, 165, 70, .18), 0 0 56px rgba(255, 150, 60, .08); }
.tube-ink { --sign: var(--bright); }
.tube-fire { --sign: var(--accent); }
.sign .ch {
  color: var(--sign); text-shadow: var(--glow);
  animation: strike .36s linear calc(var(--start, 0s) + var(--d, 0s)) backwards;
}
h1.sign { --start: .14s; }
#closing-sign { --start: .8s; }
.sign.wait .ch, html.off .sign .ch { animation: none; color: var(--unlit); text-shadow: none; }

/* the name runs hot: a white core inside the glow, current surging through it,
   one loose tube that buzzes, and letters that crackle under the pointer */
h1.sign .tube { --glow: 0 0 1px rgba(255, 250, 240, .9), 0 0 8px rgba(255, 190, 100, .45), 0 0 24px rgba(255, 165, 70, .28), 0 0 64px rgba(255, 150, 60, .14); }
h1.sign .ch {
  --strike: strike .36s linear calc(var(--start) + var(--d) * .6) backwards;
  --surge: surge 6.5s ease-out calc(var(--start) + 1.4s + var(--i) * 55ms) infinite;
  --buzz: buzz 4.7s linear calc(var(--start) + 2.3s) infinite;
  --zap: zap .38s steps(1);
  display: inline-block;
  animation: var(--strike), var(--surge);
}
h1.sign .ch.loose { animation: var(--strike), var(--surge), var(--buzz); }
/* same names keep running; only the zap is new */
h1.sign .ch:hover { animation: var(--strike), var(--surge), var(--zap); }
h1.sign .ch.loose:hover { animation: var(--strike), var(--surge), var(--buzz), var(--zap); }
html.off h1.sign .ch, h1.sign.wait .ch { animation: none; filter: none; transform: none; }
@keyframes surge {
  0%, 8%, 100% { filter: brightness(1) drop-shadow(0 0 0 rgba(255, 214, 140, 0)); }
  3% { filter: brightness(1.35) drop-shadow(0 0 10px rgba(255, 214, 140, .75)); }
}
@keyframes buzz {
  0%, 61%, 63.5%, 66%, 68%, 100% { color: var(--sign); text-shadow: var(--glow); }
  62%, 62.8%, 67% { color: var(--unlit); text-shadow: none; }
}
@keyframes zap {
  0% { transform: translate(1px, -1px) skewX(-4deg); }
  20% { transform: translate(-1.5px, .5px) skewX(3deg); color: #fff; }
  40% { transform: translate(.5px, 1px); color: var(--unlit); text-shadow: none; }
  60% { transform: translate(-.5px, -1px) skewX(-2deg); color: #fff; }
  80%, 100% { transform: none; }
}

/* the Italian three-pin plug, cartoon style: Spina is the name, and the sign needs power.
   Ink outlines, flat colours, zap lines at the socket. Pull it and it falls asleep. */
.plug { display: block; flex: none; margin-left: .06em; cursor: pointer; }
.plug:disabled { cursor: default; }
.plug .pl { width: 1.44em; height: .9em; }
.sign-line { display: flex !important; align-items: flex-end; }
.pl { --ol: #24170a; display: block; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pl-cable { transform-origin: -4px 78px; transition: transform .2s ease-out; }
.pl-cable-o { stroke: var(--ol); stroke-width: 10; }
.pl-cable-i { stroke: var(--accent); stroke-width: 5; transition: stroke .2s; }
.pl-move { transform-origin: 100px 62px; transition: transform .2s ease-out; }
.pl-ink { stroke: var(--ol); stroke-width: 4.5; }
.pl-body { fill: var(--accent); transition: fill .2s; }
.pl-pin { fill: #efe8de; transition: fill .2s; }
.pl-shine { stroke: #fff4d8; stroke-width: 4; transition: opacity .2s; }
.pl-face { fill: var(--ol); }
.pl-smile { stroke: var(--ol); stroke-width: 3; }
.pl-sleep { opacity: 0; stroke: var(--ol); stroke-width: 3; }
.pl-plate { fill: #f4ece1; transition: fill .2s; }
.pl-shade { stroke: #dccfbd; stroke-width: 5; transition: opacity .2s; }
.pl-screw { fill: none; stroke: #b3a897; stroke-width: 2; }
.pl-zap { stroke: #ffd98f; stroke-width: 3.5; transition: opacity .2s; }
h1.sign .pl-move { animation: plug-in .14s ease-in backwards; }
h1.sign .pl-cable { animation: cable-in .14s ease-in backwards; }
h1.sign .pl-zap { animation: bulb-on .35s linear .14s backwards; }
@keyframes plug-in { from { transform: translateX(-26px); } }
@keyframes cable-in { from { transform: scaleX(.7); } }
/* the wiggle only while plugged in, or a hovered pull would leave the body behind its cable */
html:not(.off) .plug:not(:disabled):hover .pl-move { transform: translateX(-3px) rotate(-3deg); }
html.off h1.sign .pl-move { animation: none; transform: translateX(-26px); }
html.off h1.sign .pl-cable { animation: none; transform: scaleX(.7); }
html.off h1.sign .pl-cable-i { stroke: var(--unlit); }
html.off h1.sign .pl-body { fill: var(--unlit); }
html.off h1.sign .pl-pin { fill: #8c8880; }
html.off h1.sign .pl-plate { fill: #7d7972; }
html.off h1.sign .pl-shine, html.off h1.sign .pl-shade, html.off h1.sign .pl-eyes { opacity: 0; }
html.off h1.sign .pl-sleep { opacity: 1; }
html.off h1.sign .pl-zap { animation: none; opacity: 0; }
.brand .icon { width: 22px; height: 22px; }

/* the cable ends in a bulb: a lit bulb means an idea */
.bulb-row { display: flex; justify-content: center; margin-bottom: 18px; }
.bulb { display: block; width: 96px; height: 120px; overflow: visible; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s .25s; }
.bulb-cap { fill: var(--panel); stroke: var(--ink); }
.bulb-thread { stroke: var(--ink); stroke-width: 2; }
.bulb-glass { stroke: var(--ink); }
.bulb-glow { fill: #ffd98f; stroke: none; filter: drop-shadow(0 0 10px rgba(255, 190, 100, .35)) drop-shadow(0 0 32px rgba(255, 170, 70, .16)); animation: bulb-on .35s linear .25s backwards; }
.bulb-fil { stroke: var(--brand); stroke-width: 2.5; }
@keyframes bulb-on {
  0%, 30% { opacity: 0; }
  34%, 48% { opacity: 1; }
  52%, 66% { opacity: .1; }
  70%, 100% { opacity: 1; }
}
.contact.waiting .bulb, .contact.waiting .bulb-cap, .contact.waiting .bulb-thread, .contact.waiting .bulb-glass, .contact.waiting .bulb-fil,
html.off .bulb, html.off .bulb-cap, html.off .bulb-thread, html.off .bulb-glass, html.off .bulb-fil { stroke: var(--unlit); }
.contact.waiting .bulb-glow, html.off .bulb-glow { animation: none; opacity: 0; }

/* one wire carries the sign's power: out of the S, down the margin past every section,
   round a corner and into the bulb. Lit behind the reader, with festival bulbs on the way. */
.cable { display: none; position: absolute; z-index: 1; left: 0; top: 0; overflow: visible; pointer-events: none; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; will-change: transform; }
main.wired .cable { display: block; }
.cable-dark { stroke: #3a3c41; }
.cable-lit { stroke: #e8a23f; }
.cb-halo { fill: #ffc861; opacity: 0; }
.cb.on .cb-halo { opacity: .19; }
.cb-glass { fill: #292a2e; stroke: #3a3c41; }
.cb.on .cb-glass { fill: #ffd98f; stroke: #e8a23f; stroke-width: 1.5; }
html.off .cable-lit, html.off .cb.on .cb-halo { opacity: 0; }
html.off .cb.on .cb-glass { fill: #292a2e; stroke: #3a3c41; stroke-width: 2; }
.spark { position: absolute; z-index: 2; left: 0; top: 0; width: 180px; height: 180px; pointer-events: none; will-change: transform; }
@keyframes strike {
  0%, 24% { color: var(--unlit); text-shadow: none; }
  26%, 40% { color: var(--sign); text-shadow: var(--glow); }
  42%, 58% { color: var(--unlit); text-shadow: none; }
  60%, 100% { color: var(--sign); text-shadow: var(--glow); }
}

/* hero */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; z-index: -2; inset: 0;
  background: radial-gradient(closest-side at 28% 50%, rgba(255, 165, 85, .08), rgba(255, 165, 85, .03) 60%, transparent);
  transition: opacity .25s;
}
html.off .hero::before { opacity: 0; }
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: center; gap: clamp(32px, 5vw, 64px);
  padding-block: clamp(56px, 8vw, 104px);
}
.kicker { font: 500 17px var(--sans); color: var(--dim); }
.kicker b { font-weight: 600; color: var(--ink); }

/* the portrait sits in a soft pool of lamplight */
.portrait { position: relative; justify-self: center; width: min(100%, 340px); }
.portrait::before {
  content: ""; position: absolute; z-index: -1; inset: -80px -90px -60px;
  background: radial-gradient(closest-side, rgba(255, 180, 95, .17), transparent);
  transition: opacity .25s;
}
html.off .portrait::before { opacity: 0; }
.print { border-radius: 50%; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); }
.print picture { display: block; }
.print img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; transition: filter .25s; }
html.off .print img { filter: brightness(.38) saturate(.7); }
h1 {
  margin-top: 16px;
  font: 700 clamp(3.4rem, 10vw, 7rem)/.98 var(--serif);
  letter-spacing: -.02em;
}
h1 > span { display: block; }
.gloss { margin-top: 14px; font-size: .88rem; color: var(--dim); }
.gloss b { font-weight: 500; color: var(--ink); }
.lede { margin-top: 22px; max-width: 24em; font-size: clamp(1.2rem, 2vw, 1.4rem); line-height: 1.45; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 30px; }
.btn {
  display: inline-block; padding: 12px 20px;
  font: 700 14px/20px var(--sans); text-decoration: none; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 999px;
  transition: background .15s, color .15s, box-shadow .15s;
  overflow-wrap: anywhere;
}
.btn[hidden] { display: none; }
.btn:hover { box-shadow: 0 0 14px rgba(255, 179, 71, .12); }
.btn.solid { background: var(--accent); color: var(--bg); }
.link { padding: 12px 6px; font: 500 14px/20px var(--sans); color: var(--dim); text-underline-offset: 4px; transition: color .15s; }
.link:hover { color: var(--accent); }

/* proof strip */
.proof { border-block: 1px solid var(--line); }
.proof dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 32px; padding-block: clamp(22px, 3vw, 32px); }
.proof div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.proof dd { font: 600 clamp(1.25rem, 2.5vw, 1.75rem)/1.2 var(--serif); color: var(--bright); }
.proof dt { margin-top: 4px; font: 400 13.5px/1.4 var(--sans); color: var(--dim); }

/* sections */
section { padding-block: clamp(56px, 8vw, 96px); scroll-margin-top: var(--nav-h); }
section + section { border-top: 1px solid var(--line); }
h2 {
  font: 600 clamp(2rem, 4.4vw, 3rem)/1.15 var(--serif);
  letter-spacing: -.01em;
  margin-bottom: clamp(28px, 4vw, 44px);
  color: var(--bright);
}
.intro { margin: calc(clamp(28px, 4vw, 44px) * -1 + 10px) 0 clamp(28px, 4vw, 44px); max-width: 36em; font-size: 1.12rem; color: var(--dim); }

/* experience */
.job + .job { margin-top: clamp(64px, 9vw, 112px); }
.job-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 20px; }
h3 { font: 600 1.5rem/1.3 var(--serif); }
h3 .at { color: var(--brand); }
h3 a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.when { font: 500 14px var(--sans); color: var(--dim); }
.job-lead { margin-top: 8px; color: var(--dim); max-width: 46em; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tags li { padding: 3px 12px; font: 500 14px/1.6 var(--sans); color: var(--dim); background: var(--tint); border-radius: 999px; }

/* Moveax story: names stay pinned, each lights up with its chapter */
.story { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); margin-top: 40px; }
.rail { position: sticky; top: calc(var(--nav-h) + 40px); align-self: start; }
.rail a {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  color: var(--dim); text-decoration: none; font-weight: 500; line-height: 1.3;
  transition: color .25s;
}
.rail a:hover { color: var(--accent); }
.rail a.on { color: var(--bright); }
.rail .icon { transition: color .25s, filter .25s; }
.rail a.on .icon { color: var(--accent); }
/* one client, three projects: a labelled group with a thread down its side */
.rail-group > span { display: flex; align-items: center; gap: 12px; padding: 11px 0 4px; font: 600 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.rail-group > span .icon { width: 18px; height: 18px; margin-inline: 3px; }
.rail-group ol { margin: 0 0 6px 11px; padding-left: 16px; border-left: 1px solid var(--line-strong); }
.rail-group a { padding: 8px 0; }
.rail-group a .icon { width: 20px; height: 20px; }

.chapter { position: relative; min-height: min(50vh, 460px); padding-bottom: 48px; scroll-margin-top: calc(var(--nav-h) + 32px); transition: opacity .3s; }
/* a pool of lamplight follows whatever you're reading */
.chapter::before {
  content: ""; position: absolute; z-index: -1; inset: -56px -72px -8px;
  background: radial-gradient(closest-side at 46% 44%, rgba(255, 175, 90, .07), rgba(255, 175, 90, .025) 60%, transparent);
  opacity: 0; transition: opacity .4s;
}
.story.live .chapter.on::before { opacity: 1; }
html.off .chapter::before { opacity: 0 !important; }
.chapter:last-child { min-height: 0; padding-bottom: 0; }
.story.live .chapter:not(.on) { opacity: .42; }
.chapter-head { display: flex; align-items: center; gap: 14px; }
.chapter-head .icon { width: 32px; height: 32px; color: var(--brand); }
h4 { font: 600 1.5rem/1.25 var(--serif); color: var(--bright); }
.chapter p { margin-top: 14px; max-width: 40em; }
.chapter p strong { color: var(--bright); font-weight: 700; }
.chapter .group-tag { margin: 0 0 8px; font: 600 12px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.did { display: grid; gap: 8px; max-width: 40em; margin-top: 14px; }
.did li { position: relative; padding-left: 20px; }
.did li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.did strong { color: var(--bright); font-weight: 600; }
/* dashboard card: one flight's altitude, split into maneuvers; the line draws in with its chapter */
.dash { padding: 14px 16px 16px; background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: 16px; font: 500 13px/1.4 var(--sans); }
.dash-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.dash-top b { margin-right: auto; font-weight: 600; color: var(--bright); }
.dash-top b small { display: block; font: 400 12px/1.3 var(--sans); color: var(--dim); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 12px; color: var(--dim); border: 1px solid var(--line-strong); border-radius: 999px; }
.pill .icon { width: 14px; height: 14px; color: var(--accent); }
.dash-plot { display: block; width: 100%; height: 130px; overflow: visible; }
.dash-plot path { fill: none; vector-effect: non-scaling-stroke; }
.dash-plot .grid { stroke: var(--line); }
.dash-plot .sep { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.dash-plot .area { fill: rgba(255, 179, 71, .1); stroke: none; }
.dash-plot .line { stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.dash-plot .draw { clip-path: inset(0 0 0 0); transition: clip-path 1.4s ease-out .15s; }
.story.live .chapter:not(.on) .dash-plot .draw { clip-path: inset(0 100% 0 0); transition-duration: .2s; transition-delay: 0s; }
.dash-band { display: flex; gap: 3px; margin-top: 6px; }
.dash-band li { flex: var(--w) 1 0; min-width: 0; padding: 4px 0; overflow: hidden; font-size: 12px; text-align: center; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); background: rgba(255, 179, 71, .16); border-radius: 6px; }
.dash-band li:nth-child(2) { background: rgba(255, 179, 71, .08); }
.dash-band li:nth-child(3) { background: rgba(255, 179, 71, .26); }
.story.live .chapter:not(.on) .dash-band li { background: var(--tint); }

/* gate: a query passes the policy check and comes back with a locked column */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) 40px auto 40px minmax(0, 1.5fr); align-items: center; row-gap: 14px; font: 500 13px/1.4 var(--sans); }
.gate small { display: block; font: 400 12px/1.35 var(--sans); color: var(--dim); }
.gate-q { padding: 12px 14px; background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: 12px; }
.gate code { display: block; margin-top: 6px; font: 500 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--bright); }
.gate-ln { position: relative; height: 2px; margin: 0 6px; background: var(--accent); transition: opacity .3s .15s; }
.gate-ln::after { content: ""; position: absolute; right: -1px; top: -4px; border-block: 5px solid transparent; border-left: 7px solid var(--accent); }
.gate-check { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ring {
  display: grid; place-items: center; width: 48px; height: 48px; color: var(--accent);
  background: var(--panel); border: 1.5px solid var(--accent); border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 179, 71, .13), 0 0 22px rgba(255, 179, 71, .14);
  transition: border-color .35s, box-shadow .35s;
}
.ring .icon { width: 26px; height: 26px; }
.gate-t { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 4px; padding: 10px; background: var(--panel); border: 1.5px solid var(--line-strong); border-radius: 12px; }
.gate-t > span { display: flex; align-items: center; justify-content: center; gap: 3px; padding-bottom: 3px; font-size: 12px; color: var(--dim); }
.gate-t > span.no { color: var(--unlit); }
.gate-t > span .icon { width: 12px; height: 12px; }
.gate-t i { height: 12px; background: rgba(255, 179, 71, .24); border-radius: 4px; transition: background-color .35s; }
.gate-t i.no { background: repeating-linear-gradient(135deg, var(--line-strong) 0 2px, transparent 2px 6px); }
.gate-log { grid-column: 1 / -1; display: flex; align-items: center; gap: 9px; padding: 8px 12px; font: 500 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim); background: var(--tint); border-radius: 8px; }
.gate-log i { flex: none; width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }
.story.live .chapter:not(.on) .gate-ln { opacity: 0; transition-delay: 0s; }
.story.live .chapter:not(.on) .ring { border-color: var(--line-strong); box-shadow: none; }
.story.live .chapter:not(.on) .gate-t i:not(.no) { background: var(--tint); }

/* domain tree: one person's branch lights up, the rest stays out of sight */
.tree { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, 48px); row-gap: 28px; font: 500 13px/1.25 var(--sans); }
.tree-ln { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tree-ln path { fill: none; stroke: var(--line-strong); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.tree-ln .seen { stroke: var(--accent); stroke-width: 2; transition: stroke .35s; }
.node {
  position: relative; z-index: 1; justify-self: center; display: flex; flex-direction: column; justify-content: center;
  width: calc(100% - 10px); max-width: 160px; padding: 0 6px; text-align: center; color: var(--unlit);
  background: var(--panel); border: 1.5px dashed var(--line-strong); border-radius: 12px;
  transition: border-color .35s, box-shadow .35s;
}
.node small { display: block; margin-top: 2px; font: 400 11px/1.3 var(--sans); white-space: nowrap; }
.node.seen { color: var(--bright); border: 1.5px solid var(--accent); }
.node.seen small { color: var(--dim); }
.node.you { box-shadow: 0 0 0 5px rgba(255, 179, 71, .13), 0 0 22px rgba(255, 179, 71, .14); }
.node.you::after { content: "you"; position: absolute; top: -9px; right: -6px; padding: 0 7px; font: 700 10.5px/1.6 var(--sans); color: #24170a; background: var(--accent); border-radius: 999px; }
:lang(it) .node.you::after { content: "tu"; }
.story.live .chapter:not(.on) .tree-ln .seen { stroke: var(--line-strong); }
.story.live .chapter:not(.on) .node.seen { border-color: var(--line-strong); }
.story.live .chapter:not(.on) .node.you { box-shadow: none; }

/* diagrams: real text, connectors light up with the chapter */
.flow-fig { margin-top: 26px; }
.flow { display: flex; }
.flow li {
  position: relative; flex: 1 1 0; min-width: 0; padding: 12px 10px;
  font: 500 13px/1.4 var(--sans); text-align: center;
  background: var(--panel); border: 1.5px solid var(--accent); border-radius: 16px;
  transition: border-color .35s var(--t, 0s);
}
.flow small { display: block; margin-top: 3px; font: 400 12.5px/1.35 var(--sans); color: var(--dim); }
.flow li:nth-child(2) { --t: .18s; }
.flow li:nth-child(3) { --t: .36s; }
.flow li:nth-child(4) { --t: .54s; }
.flow.chain li + li { margin-left: 30px; }
.flow.chain li + li::before {
  content: ""; position: absolute; left: -31px; top: 50%; width: 30px; height: 2px; margin-top: -1px;
  background: var(--accent);
  transform-origin: 0 50%; transition: transform .3s var(--t, 0s);
}
.flow.chain li + li::after {
  content: ""; position: absolute; left: -8px; top: 50%; margin-top: -5px;
  border-block: 5px solid transparent; border-left: 7px solid var(--accent);
  transition: opacity .2s var(--t, 0s);
}
/* loop: people are round chips, systems are boxes, the ledger is the hub */
.loop {
  display: grid; align-items: center;
  grid-template-columns: auto 76px minmax(0, 1fr) 76px minmax(0, 1fr);
  grid-template-rows: auto 52px auto;
  grid-template-areas: "prov c1 back c2 chain" ". . . . cv" "cons c4 c4 c4 synth";
  font: 500 13px/1.4 var(--sans);
}
.loop small { display: block; margin-top: 3px; font: 400 12.5px/1.35 var(--sans); color: var(--dim); }
.loop .box {
  padding: 12px 10px; text-align: center;
  background: var(--panel); border: 1.5px solid var(--accent); border-radius: 16px;
  transition: border-color .35s, box-shadow .35s;
}
.loop .hub { box-shadow: 0 0 0 5px rgba(255, 179, 71, .13), 0 0 22px rgba(255, 179, 71, .14); }
.loop .who { display: flex; align-items: center; gap: 10px; }
.loop .av {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px;
  border: 1.5px solid var(--accent); border-radius: 50%; background: var(--panel); color: var(--accent);
  transition: border-color .35s;
}
.loop .av .icon { width: 26px; height: 26px; }
.loop .ln { position: relative; height: 2px; margin: 0 8px; background: var(--accent); transition: opacity .3s var(--t, 0s); }
.loop .ln::after {
  content: ""; position: absolute; right: -1px; top: -4px;
  border-block: 5px solid transparent; border-left: 7px solid var(--accent);
}
.loop .ln.back::after { right: auto; left: -1px; border-left: 0; border-right: 7px solid var(--accent); }
.loop .ln.down { justify-self: center; align-self: stretch; width: 2px; height: auto; margin: 8px 0; }
.loop .ln.down::after { right: auto; left: -4px; top: auto; bottom: -1px; border-inline: 5px solid transparent; border-block: 7px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
.loop .ln > span {
  position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%);
  font: 500 11.5px/1 var(--sans); letter-spacing: .02em; color: var(--dim); white-space: nowrap;
}
.loop .ln.down > span { left: auto; right: 12px; bottom: 50%; transform: translateY(50%); }
.loop .g-prov { grid-area: prov; } .loop .g-c1 { grid-area: c1; --t: .1s; }
.loop .g-back { grid-area: back; } .loop .g-c2 { grid-area: c2; --t: .25s; }
.loop .g-chain { grid-area: chain; } .loop .g-cv { grid-area: cv; --t: .4s; }
.loop .g-synth { grid-area: synth; } .loop .g-c4 { grid-area: c4; --t: .55s; }
.loop .g-cons { grid-area: cons; }
/* runs: one schedule fans out into a floor × resource matrix of parallel runs */
.loop.runs {
  grid-template-columns: minmax(0, 1fr) 72px auto 72px minmax(0, 1fr);
  grid-template-rows: auto; grid-template-areas: "sched r1 mat r2 db";
}
.loop .g-sched { grid-area: sched; } .loop .g-r1 { grid-area: r1; --t: .1s; }
.loop .g-mat { grid-area: mat; } .loop .g-r2 { grid-area: r2; --t: .9s; }
.loop .g-db { grid-area: db; }
.mat { text-align: center; }
.mat-head, .mat .cells { display: grid; grid-template-columns: repeat(3, 32px); gap: 6px; justify-content: center; }
.mat-head { margin-bottom: 6px; font: 500 10.5px/1 var(--sans); letter-spacing: .04em; color: var(--dim); }
.mat .cells i {
  height: 16px; border: 1.5px solid var(--accent); border-radius: 5px;
  background: rgba(255, 179, 71, .32);
  transition: background-color .3s calc(.25s + var(--i) * 45ms), border-color .3s;
}
.mat small { margin-top: 8px; }
.story.live .chapter:not(.on) .mat .cells i { background: transparent; border-color: var(--line-strong); transition-delay: 0s; }
.story.live .chapter:not(.on) .loop .box,
.story.live .chapter:not(.on) .loop .av { border-color: var(--line-strong); box-shadow: none; }
.story.live .chapter:not(.on) .loop .ln { opacity: 0; }
/* stack: layers top to bottom, requests run down the spine on the left */
.stack { font: 500 13px/1.4 var(--sans); }
.stack small { display: block; margin-top: 2px; font: 400 12px/1.35 var(--sans); color: var(--dim); }
.tier {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 12px 14px; background: var(--panel); border: 1.5px solid var(--accent); border-radius: 16px;
  transition: border-color .35s var(--t, 0s);
}
.tier:nth-child(3) { --t: .15s; } .tier:nth-child(5) { --t: .3s; } .tier:nth-child(7) { --t: .45s; }
.tier-name { font-weight: 600; color: var(--bright); }
.tier ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tier li { padding: 7px 8px; text-align: center; border: 1px solid var(--line-strong); border-radius: 10px; }
.hop { position: relative; height: 36px; }
.hop::before {
  content: ""; position: absolute; left: 70px; top: 3px; bottom: 3px; width: 2px; margin-left: -1px;
  background: var(--accent); transform-origin: 50% 0; transition: transform .3s var(--t, 0s);
}
.hop::after {
  content: ""; position: absolute; left: 70px; bottom: 2px; margin-left: -5px;
  border-inline: 5px solid transparent; border-top: 7px solid var(--accent);
  transition: opacity .2s var(--t, 0s);
}
.hop span {
  position: absolute; left: 84px; top: 50%; transform: translateY(-50%);
  font: 500 11.5px/1 var(--sans); letter-spacing: .02em; color: var(--dim); white-space: nowrap;
}
.story.live .chapter:not(.on) .tier { border-color: var(--line-strong); }
.story.live .chapter:not(.on) .hop::before { transform: scaleY(0); }
.story.live .chapter:not(.on) .hop::after { opacity: 0; }
.story.live .chapter:not(.on) .flow li { border-color: var(--line-strong); }
.story.live .chapter:not(.on) .chain li::before { transform: scaleX(0); }
.story.live .chapter:not(.on) .chain li::after { opacity: 0; }
/* bond life: a track with coupon ticks, then the subscribe swap up close */
.life { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); font: 500 13px/1.4 var(--sans); text-align: center; }
.life::before {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 6px; height: 2px;
  background: var(--accent); transform-origin: 0 50%; transition: transform .6s;
}
.life li { position: relative; padding: 24px 6px 0; }
.life li::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 14px; height: 14px; margin-left: -7px;
  background: var(--panel); border: 2px solid var(--accent); border-radius: 50%;
  transition: border-color .35s var(--t, 0s), box-shadow .35s var(--t, 0s);
}
.life li:nth-child(2) { --t: .15s; } .life li:nth-child(3) { --t: .3s; } .life li:nth-child(4) { --t: .45s; }
.life .now::before { background: var(--accent); box-shadow: 0 0 0 5px rgba(255, 179, 71, .16), 0 0 16px rgba(255, 179, 71, .4); }
.life .cpn::before {
  top: 2px; width: 46px; height: 10px; margin-left: -23px; border: 0; border-radius: 0;
  background: radial-gradient(circle, var(--accent) 3.5px, transparent 4px) 0 0 / 11.5px 10px repeat-x;
}
.life b { display: block; font-weight: 600; color: var(--bright); }
.life small, .swap small { display: block; margin-top: 2px; font: 400 12.5px/1.35 var(--sans); color: var(--dim); }
.swap-box { margin-top: 22px; padding: 14px clamp(14px, 3vw, 26px) 18px; border: 1px solid var(--line); border-radius: 18px; }
.swap-box > b { display: block; font: 600 11.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.swap-note { margin-top: 6px; text-align: center; font: 400 12.5px/1.35 var(--sans); color: var(--dim); }
.swap {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 44px minmax(0, 1fr) auto minmax(0, 1fr) 44px;
  grid-template-areas: "inv . esc . iss";
  margin: 26px 0 30px; font: 500 13px/1.4 var(--sans);
}
.swap .who, .swap .esc { position: relative; z-index: 1; }
.swap .inv { grid-area: inv; } .swap .iss { grid-area: iss; }
.swap .av {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1.5px solid var(--accent); border-radius: 50%; background: var(--panel); color: var(--accent);
  transition: border-color .35s;
}
.swap .av .icon { width: 24px; height: 24px; }
.swap .nm { position: absolute; top: 100%; left: 0; margin-top: 6px; white-space: nowrap; }
.swap .iss .nm { left: auto; right: 0; }
.swap .esc {
  grid-area: esc; display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  background: var(--panel); border: 1.5px solid var(--accent); border-radius: 16px;
  box-shadow: 0 0 0 5px rgba(255, 179, 71, .13), 0 0 22px rgba(255, 179, 71, .14);
  transition: border-color .35s, box-shadow .35s;
}
.swap .esc .icon { width: 26px; height: 26px; color: var(--accent); }
.swap .leg { position: absolute; left: 22px; right: 22px; height: 2px; background: var(--accent); transition: transform .5s var(--t, 0s); }
.swap .cash { top: calc(50% - 8px); transform-origin: 0 50%; }
.swap .asset { top: calc(50% + 6px); transform-origin: 100% 50%; --t: .15s; }
.swap .leg::after { content: ""; position: absolute; top: -4px; border-block: 5px solid transparent; }
.swap .cash::after { right: 21px; border-left: 7px solid var(--accent); }
.swap .asset::after { left: 21px; border-right: 7px solid var(--accent); }
.swap .leg > span {
  position: absolute; left: 24%; bottom: 8px; transform: translateX(-50%);
  font: 500 11.5px/1 var(--sans); letter-spacing: .02em; color: var(--dim); white-space: nowrap;
}
.swap .asset > span { left: 76%; top: 8px; bottom: auto; }
/* a coin and a token meet in the escrow, the lock opens, both cross over */
.swap .pulse {
  position: absolute; top: -4px; left: 0; width: 10px; height: 10px; margin-left: -5px; opacity: 0;
  background: var(--bright); border-radius: 50%; box-shadow: 0 0 10px 2px rgba(255, 179, 71, .7);
}
.swap .asset .pulse { left: 100%; border-radius: 2px; transform: rotate(45deg); }
.swap .shackle { transition: transform .3s; }
.chapter.on .swap .cash .pulse { animation: swap-a 4.4s ease-in-out infinite; }
.chapter.on .swap .asset .pulse { animation: swap-b 4.4s ease-in-out infinite; }
.chapter.on .swap .esc { animation: swap-hub 4.4s ease-in-out infinite; }
.chapter.on .swap .shackle { animation: swap-open 4.4s ease-in-out infinite; }
@keyframes swap-a {
  0% { left: 4%; opacity: 0; } 8% { opacity: 1; } 36% { left: 42%; opacity: 1; }
  40%, 60% { left: 50%; opacity: 0; }
  64% { left: 58%; opacity: 1; } 90% { left: 96%; opacity: 1; } 100% { left: 96%; opacity: 0; }
}
@keyframes swap-b {
  0% { left: 96%; opacity: 0; } 8% { opacity: 1; } 36% { left: 58%; opacity: 1; }
  40%, 60% { left: 50%; opacity: 0; }
  64% { left: 42%; opacity: 1; } 90% { left: 4%; opacity: 1; } 100% { left: 4%; opacity: 0; }
}
@keyframes swap-a-v {
  0% { top: 4%; opacity: 0; } 8% { opacity: 1; } 36% { top: 42%; opacity: 1; }
  40%, 60% { top: 50%; opacity: 0; }
  64% { top: 58%; opacity: 1; } 90% { top: 96%; opacity: 1; } 100% { top: 96%; opacity: 0; }
}
@keyframes swap-b-v {
  0% { top: 96%; opacity: 0; } 8% { opacity: 1; } 36% { top: 58%; opacity: 1; }
  40%, 60% { top: 50%; opacity: 0; }
  64% { top: 42%; opacity: 1; } 90% { top: 4%; opacity: 1; } 100% { top: 4%; opacity: 0; }
}
@keyframes swap-hub {
  0%, 34%, 72%, 100% { box-shadow: 0 0 0 5px rgba(255, 179, 71, .13), 0 0 22px rgba(255, 179, 71, .14); }
  46%, 58% { box-shadow: 0 0 0 8px rgba(255, 179, 71, .22), 0 0 34px rgba(255, 179, 71, .4); }
}
@keyframes swap-open { 0%, 56%, 84%, 100% { transform: none; } 61%, 78% { transform: translateY(-2.5px); } }
html.off .swap .pulse { animation: none !important; opacity: 0; }
html.off .swap .esc, html.off .swap .shackle { animation: none !important; }
.story.live .chapter:not(.on) .life::before { transform: scaleX(0); }
.story.live .chapter:not(.on) .life li::before,
.story.live .chapter:not(.on) .swap .esc,
.story.live .chapter:not(.on) .swap .av { border-color: var(--line-strong); box-shadow: none; }
.story.live .chapter:not(.on) .swap .leg { transform: scaleX(0); }


/* CineDev: a camera viewfinder pulls focus to the chapter you're reading */
.shots { position: relative; }
.vf {
  --c: var(--accent); --l: 22px; --w: 2px;
  position: absolute; z-index: 1; top: 0; left: -18px; right: -18px; height: 0;
  pointer-events: none; opacity: 0;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) 0 0 / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--w) var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) var(--w),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--w) var(--l);
  background-repeat: no-repeat;
  transition: transform .5s cubic-bezier(.3, .7, .2, 1), height .5s cubic-bezier(.3, .7, .2, 1), opacity .3s;
}
.vf.on { opacity: 1; }
.vf.hunt { animation: vf-hunt .55s .3s; }
@keyframes vf-hunt { 0%, 40%, 80% { opacity: 1; } 20%, 60% { opacity: .25; } }
.vf span {
  position: absolute; bottom: 100%; margin-bottom: 6px;
  font: 600 11px/1 var(--sans); letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--dim);
}
.vf-rec { left: 0; display: flex; align-items: center; gap: 6px; }
.vf-rec::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: rec 1.2s steps(2, jump-none) infinite; }
.vf-rec::after { content: "REC"; }
.vf-tc { right: 0; }
@keyframes rec { to { opacity: .15; } }
html.off .vf { --c: var(--unlit); }
html.off .vf-rec::before { background: var(--unlit); animation: none; }
html.off .vf-rec::after { content: "STBY"; }

/* research tool: the config shown as the sheet it produces */
.sheet { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--panel); }
.sheet th, .sheet td { padding: 10px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sheet th { font: 600 14px/1.3 var(--sans); color: var(--bright); border-bottom: 1.5px solid var(--accent); }
.sheet td { font: 400 12.5px/1.4 var(--sans); color: var(--dim); }
.sheet-note { margin-top: 10px; font: 400 12.5px/1.45 var(--sans); color: var(--dim); }

/* skills: the languages are lit; picking a project lights its stack */
.skills-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.skills-grid.live { grid-template-columns: minmax(0, 1fr) 290px; gap: clamp(32px, 5vw, 64px); }
.core { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 108px; padding: 14px 8px 12px;
  font: 700 1.02rem/1.2 var(--sans); color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  transition: color .2s, border-color .2s, box-shadow .2s, background-color .2s;
}
.tile svg { width: 28px; height: 28px; margin-bottom: 4px; flex: none; fill: currentColor; }
.tile .go { width: 67px; height: 28px; }
.tile small { font: 500 12.5px/1.3 var(--sans); color: var(--dim); transition: color .2s; }
.skill-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 24px; padding-block: 20px; border-bottom: 1px solid var(--line); }
.skill-row:last-child { border-bottom: 0; padding-bottom: 0; }
.skill-row h3 { font: 600 1rem/1.35 var(--sans); color: var(--bright); padding-top: 5px; transition: color .2s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 5px 14px; font: 500 14px/1.5 var(--sans); color: var(--ink); background: var(--tint); border: 1px solid transparent; border-radius: 999px; transition: color .2s, border-color .2s, box-shadow .2s, background-color .2s; }
.tile { color: var(--bright); border-color: rgba(255, 179, 71, .28); box-shadow: 0 0 16px rgba(255, 165, 70, .13), inset 0 0 10px rgba(255, 165, 70, .07); }
.tile svg { color: var(--accent); }
button.chip:hover, button.tile:hover, .chip[aria-pressed="true"], .tile[aria-pressed="true"],
button.chip.peek, button.tile.peek { color: var(--accent); border-color: var(--accent); }
/* a project is picked: its stack stays lit, the rest of the room goes dark */
.skills-grid.focus .chip:not(.hit), .skills-grid.focus .tile:not(.hit) { color: var(--unlit); background-color: transparent; border-color: var(--line); box-shadow: none; }
.skills-grid.focus .tile:not(.hit) svg, .skills-grid.focus .tile:not(.hit) small { color: var(--unlit); }
.skills-grid.focus .hit { color: var(--bright); border-color: var(--accent); box-shadow: 0 0 18px rgba(255, 165, 70, .2); }
.skills-grid.focus .skill-row:not(:has(.hit)) h3 { color: var(--unlit); }
html.off .tile, html.off .skills-grid.focus .hit { box-shadow: none; }

.used[hidden] { display: none; }
.used { position: sticky; top: calc(var(--nav-h) + 32px); align-self: start; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; }
.used h3 { font: 500 13px/1.4 var(--sans); color: var(--dim); }
.used-read { min-height: 3em; margin-top: 8px; font-weight: 500; line-height: 1.5; }
.used ul { margin-top: 10px; }
.proj { display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); margin-inline: -8px; padding: 6px 8px; border-radius: 10px; font-size: .92rem; line-height: 1.3; text-align: left; color: var(--dim); transition: color .15s, background-color .15s; }
.proj .icon { width: 20px; height: 20px; }
.used li.lit .proj { color: var(--bright); }
.used li.lit .icon, .proj:hover, .proj.peek, .proj[aria-pressed="true"] { color: var(--accent); }
.proj[aria-pressed="true"] { background: var(--tint); }
.used-more[hidden] { display: none; }
.used-more { display: inline-block; margin-top: 12px; font: 600 14px/24px var(--sans); color: var(--accent); text-underline-offset: 4px; }
.used-more::after { content: " \2192"; }

/* papers */
.paper {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 24px; align-items: baseline;
  padding: 32px 0; border-top: 1px solid var(--line);
}
#publications .intro { max-width: none; }
.paper:last-child { border-bottom: 1px solid var(--line); }
.paper > b { font: 600 clamp(1.8rem, 4vw, 2.4rem)/1.1 var(--serif); color: var(--bright); }
.paper h3 { font: 500 1.15rem/1.35 var(--sans); }
.paper h3 a { color: var(--bright); text-decoration: none; transition: color .15s; }
.paper h3 a:hover { color: var(--accent); text-decoration: underline; }
.paper-meta { display: block; margin-top: 4px; font: 500 14px var(--sans); color: var(--dim); }
.paper p { margin-top: 12px; max-width: 46em; color: var(--dim); }
.paper p strong { color: var(--bright); font-weight: 600; }
.paper-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 14px; }
.paper-links a { font: 600 14px/24px var(--sans); color: var(--accent); text-underline-offset: 4px; }

/* about: the story on the left, the record beside it */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-text p { max-width: 36em; font-size: 1.12rem; color: var(--dim); }
.about-text p + p { margin-top: 1em; }
.facts { padding-left: clamp(20px, 3vw, 32px); border-left: 1px solid var(--line); }
.facts > div + div { margin-top: 28px; }
.facts dt { font: 500 13px var(--sans); color: var(--dim); margin-bottom: 10px; }
.facts dd + dd { margin-top: 14px; }
.facts strong { display: block; font-weight: 500; }
.facts small { display: block; font: 400 13.5px/1.6 var(--sans); color: var(--dim); }
@media (max-width: 760px) {
  .about { grid-template-columns: minmax(0, 1fr); }
  .facts { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* contact: the bulb lights the room */
.contact { position: relative; overflow: hidden; isolation: isolate; text-align: center; }
.contact::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(closest-side at 50% 40%, rgba(255, 175, 85, .13), rgba(255, 175, 85, .045) 55%, transparent);
  transition: opacity .5s .55s;
}
.contact.waiting::before, html.off .contact::before { opacity: 0; }
.contact h2 { margin-bottom: 20px; font-size: clamp(3rem, 10.5vw, 6.5rem); font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.contact p { max-width: 34em; margin-inline: auto; }
.aside { margin-top: clamp(28px, 4vw, 40px); max-width: 40em; color: var(--dim); }
.aside b { font-weight: 500; color: var(--ink); }
.contact p { color: var(--ink); }
.contact .actions { justify-content: center; }
footer { padding: 22px 0 30px; border-top: 1px solid var(--line); text-align: center; font: 400 13px var(--sans); color: var(--dim); }

@media (max-width: 1080px) {
  .core { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile { grid-column: span 2; }
  .tile:nth-child(n+4) { grid-column: span 3; }
}
@media (max-width: 900px) {
  /* phones: the portrait becomes a badge beside the name, so it costs no row of its own
     and name, pitch and proof share the first screen */
  .hero .wrap { grid-template-columns: minmax(0, 1fr) auto; gap: 0 14px; padding-block: 24px 36px; }
  .hero .wrap > div { display: contents; }
  .hero .wrap > div > * { grid-column: 1 / -1; }
  .hero .wrap > div > .kicker { grid-area: 1 / 1; align-self: end; }
  .hero .wrap > div > h1 { grid-area: 2 / 1; }
  .portrait { grid-area: 1 / 2 / 3 / 3; align-self: center; width: clamp(76px, 22vw, 150px); }
  .portrait::before { inset: -40px; }
  .print { box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
  .story { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .chapter { min-height: 0; }
  .chapter::before { inset: -32px -16px 0; }
  .story.live .chapter:not(.on) { opacity: 1; }
  .story .chapter + .chapter { padding-top: 36px; border-top: 1px solid var(--line); }
  .vf { left: 0; right: 0; --l: 12px; }  /* the cable owns the left gutter */
  .skills-grid.live { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  /* a floating card inside the content column: the cable runs down the gutter beside it, never under it */
  .used {
    position: sticky; top: auto; bottom: 12px; z-index: 10;
    padding: 10px 10px 6px;
    background: var(--panel); border: 1px solid var(--line-strong); border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .3);
  }
  .used h3 { display: none; }
  .used-read { min-height: 1.4em; margin: 0 4px; font-size: .85rem; line-height: 1.4; }
  .used ul { display: flex; justify-content: space-between; margin-top: 4px; }
  .proj { width: auto; margin: 0; padding: 5px; }
  .proj .sr-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .proj .icon { width: 24px; height: 24px; }
  .used-more { display: none; }
}
@media (max-width: 640px) {
  /* desktop-sized breathing room reads as empty screens on a phone */
  section { padding-block: 44px; }
  h2 { margin-bottom: 22px; }
  .intro { margin: -12px 0 22px; }
  .tile { min-height: 84px; padding: 10px 6px; }
  .tile svg { width: 24px; height: 24px; margin-bottom: 2px; }
  .proof dl { gap: 12px; padding-block: 18px; }
  .proof dd { font-size: 1.15rem; }
  .proof dt { font-size: 12px; }
  .flow.chain { flex-direction: column; }
  .flow.chain li + li { margin: 26px 0 0; }
  .flow.chain li + li::before { left: 50%; top: -27px; width: 2px; height: 26px; margin: 0 0 0 -1px; transform-origin: 50% 0; }
  .flow.chain li + li::after { left: 50%; top: -8px; margin: 0 0 0 -5px; border-inline: 5px solid transparent; border-block: 7px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
  .story.live .chapter:not(.on) .chain li::before { transform: scaleY(0); }
  .loop {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none; grid-auto-rows: auto;
    grid-template-areas: "prov" "c1" "back" "c2" "chain" "cv" "synth" "c4" "cons";
  }
  .loop .who { justify-content: center; }
  .loop .ln, .loop .ln.down { justify-self: center; width: 2px; height: 34px; margin: 6px 0; }
  .loop .ln::after, .loop .ln.back::after, .loop .ln.down::after {
    right: auto; left: -4px; top: auto; bottom: -1px;
    border-inline: 5px solid transparent; border-block: 7px solid transparent; border-top-color: var(--accent); border-bottom: 0;
  }
  .loop .ln > span, .loop .ln.down > span { left: 14px; right: auto; bottom: 50%; transform: translateY(50%); }
  .loop.runs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "sched" "r1" "mat" "r2" "db"; }
  .life { grid-template-columns: minmax(0, 1fr); gap: 14px; text-align: left; }
  .life::before { left: 6px; right: auto; top: 7px; bottom: 7px; width: 2px; height: auto; transform-origin: 50% 0; }
  .life li { padding: 0 0 0 30px; }
  .life li::before { left: 0; top: 2px; margin-left: 0; }
  .life .cpn::before { left: 2px; top: 0; width: 10px; height: 44px; margin-left: 0; background: radial-gradient(circle, var(--accent) 3.5px, transparent 4px) 0 0 / 10px 11px repeat-y; }
  .story.live .chapter:not(.on) .life::before { transform: scaleY(0); }
  .swap { grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px auto 44px; row-gap: 64px; grid-template-areas: "inv" "esc" "iss"; justify-items: center; margin: 20px 0 8px; }
  .swap .nm, .swap .iss .nm { top: 50%; left: 100%; right: auto; margin: 0 0 0 10px; transform: translateY(-50%); }
  .swap .leg { left: auto; right: auto; top: 22px; bottom: 22px; width: 2px; height: auto; }
  .swap .cash { left: calc(50% - 8px); transform-origin: 50% 0; }
  .swap .asset { left: calc(50% + 6px); transform-origin: 50% 100%; }
  .swap .leg::after { top: auto; border-block: 0; border-inline: 5px solid transparent; left: -4px; right: auto; }
  .swap .cash::after { bottom: 21px; border-top: 7px solid var(--accent); }
  .swap .asset::after { top: 21px; border-bottom: 7px solid var(--accent); }
  .swap .leg > span { left: auto; right: 12px; bottom: auto; top: 24%; width: 84px; transform: translateY(-50%); white-space: normal; line-height: 1.3; text-align: right; }
  .swap .asset > span { left: 12px; right: auto; top: 76%; text-align: left; }
  .swap .pulse { top: 0; left: -4px; margin: -5px 0 0; }
  .swap .asset .pulse { top: 100%; left: -4px; }
  .chapter.on .swap .cash .pulse { animation-name: swap-a-v; }
  .chapter.on .swap .asset .pulse { animation-name: swap-b-v; }
  .story.live .chapter:not(.on) .swap .leg { transform: scaleY(0); }
  .gate { grid-template-columns: minmax(0, 1fr); }
  .gate-ln { justify-self: center; width: 2px; height: 26px; margin: 0; }
  .gate-ln::after { right: auto; left: -4px; top: auto; bottom: -1px; border-inline: 5px solid transparent; border-block: 7px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
  .gate-check { flex-direction: row; justify-content: center; gap: 12px; text-align: left; }
  .tier { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tier-name small { display: inline; margin-left: 6px; }
  .hop::before, .hop::after { left: 30px; }
  .hop span { left: 44px; }
  .skill-row { grid-template-columns: minmax(0, 1fr); }
  .skill-row h3 { padding-top: 0; }
  .paper { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .brand { display: none; }
  .nav .wrap { gap: 10px; }
  .nav .wrap > ul { margin-left: 0; gap: clamp(6px, 2.8vw, 14px); }
  .nav li a { font-size: 13px; white-space: nowrap; }
  .lang { min-width: 30px; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
