/* Art direction: a saint's halo rendered by a CRT. Navy field (#072D59), pink signal (#FD6E88), glyph portrait, grid horizon. */
:root {
  --bg: #072d59; --bg-deep: #041d3c; --panel: #0a3566; --panel-2: #0d3f78;
  --ink: #f4f8ff; --muted: #b9cbe6; --line: rgba(170, 205, 255, .17); --line-2: rgba(170, 205, 255, .34);
  --accent: #fd6e88; --accent-rgb: 253, 110, 136;
  --ok: #7fe0b0;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 104px;
  --r: 10px; --nav-h: 60px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); overflow-x: hidden;
  background-image: radial-gradient(1100px 700px at 50% 260px, #0f4788 0%, rgba(15, 71, 136, 0) 70%), linear-gradient(var(--bg), var(--bg-deep)); background-repeat: no-repeat; background-attachment: scroll; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration-color: rgba(var(--accent-rgb), .6); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
kbd { font: 500 12px var(--mono); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: 5px; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #111; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; height: var(--nav-h); display: flex; align-items: center; gap: var(--s4); padding: 0 var(--s4);
  border-bottom: 1px solid transparent; transition: background .25s, border-color .25s; }
.nav.scrolled { background: rgba(6, 38, 76, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font: 500 18px var(--serif); text-decoration: none; white-space: nowrap; }
.brand-ring { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), .6); }
.nav nav { display: flex; gap: var(--s4); margin-left: auto; }
.nav nav a { font-size: 15px; color: var(--muted); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav nav a:hover, .nav nav a.here { color: var(--ink); border-bottom-color: var(--accent); }
.nav-tools { display: flex; align-items: center; gap: var(--s3); }
.switch { position: relative; font-size: 14px; color: var(--muted); padding: 8px 4px 8px 40px; white-space: nowrap; }
.switch::before { content: ''; position: absolute; left: 2px; top: 50%; margin-top: -9px; width: 30px; height: 18px; border-radius: 9px; border: 1px solid var(--line-2); transition: background .2s, border-color .2s; }
.switch-knob { position: absolute; left: 6px; top: 50%; margin-top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch[aria-checked="true"] { color: var(--ink); }
.switch[aria-checked="true"]::before { background: rgba(var(--accent-rgb), .3); border-color: var(--accent); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(12px); background: var(--accent); }
.kbd-btn { display: flex; gap: 4px; padding: 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 8px; font-weight: 500; font-size: 15px; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, .02); transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--accent); color: var(--ink); background: rgba(var(--accent-rgb), .08); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04162e; }
.btn.primary:hover { background: #ffd9e0; border-color: #ffd9e0; color: #04162e; }
.link-btn { color: var(--accent); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(var(--accent-rgb), .5); padding: 4px 2px; }
.link-btn:hover { text-decoration-color: var(--accent); }

/* ---------- hero ---------- */
main { overflow-x: clip; }
.hero { position: relative; z-index: 0; }
.backdrop { position: absolute; left: 50%; bottom: 0; width: 100vw; height: 100%; transform: translateX(-50%); z-index: -1; pointer-events: none; overflow: hidden; }
.backdrop::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .2) 3px 4px); opacity: .55; }
.floor { position: absolute; left: -50%; right: -50%; bottom: 0; height: 210px; transform: perspective(380px) rotateX(64deg); transform-origin: 50% 100%;
  background-image: linear-gradient(rgba(var(--accent-rgb), .42) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(var(--accent-rgb), .42) 1.5px, transparent 1.5px); background-size: 64px 64px; animation: floor 2.4s linear infinite;
  -webkit-mask-image: linear-gradient(transparent 0%, #000 55%); mask-image: linear-gradient(transparent 0%, #000 55%); }
.horizon { position: absolute; left: 0; right: 0; bottom: 104px; height: 90px; background: linear-gradient(transparent, rgba(var(--accent-rgb), .16)); border-bottom: 1px solid rgba(var(--accent-rgb), .45); }
@keyframes floor { to { background-position: 0 64px, 0 0; } }
.hero { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(440px, 500px) minmax(340px, 1fr); gap: var(--s5); align-items: center;
  max-width: 1400px; margin: 0 auto; padding: var(--s4) var(--s4) var(--s6); min-height: calc(100vh - var(--nav-h) - 120px); }
.hero-copy { justify-self: end; max-width: 380px; }
.status { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ok); border: 1px solid rgba(127, 224, 176, .35); border-radius: 99px; padding: 5px 12px 5px 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(127, 224, 176, .7); animation: ping 2.4s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(127, 224, 176, 0); } 100% { box-shadow: 0 0 0 0 rgba(127, 224, 176, 0); } }
h1 { font: 400 clamp(46px, 5.1vw, 76px)/.96 var(--serif); font-variation-settings: 'opsz' 144; letter-spacing: -.02em; margin: var(--s4) 0 var(--s3); }
.lede { font-size: 18px; line-height: 1.55; color: var(--muted); max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--s4); }
.links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: var(--s4); font-size: 14.5px; color: var(--muted); }

.stage-wrap { text-align: center; min-width: 0; }
#stage { position: relative; width: 100%; padding-top: 19%; --tok: 48px; }
#halo-fx { position: absolute; left: -110px; top: -110px; width: calc(100% + 220px); height: calc(100% + 220px); pointer-events: none; }
#halo-ring { position: absolute; inset: 0; }
#portrait, #portrait-glyph { display: block; width: 86%; height: auto; margin: 0 auto; position: relative; pointer-events: none; will-change: transform;
  -webkit-mask-image: linear-gradient(#000 78%, transparent 99%), linear-gradient(90deg, transparent 1%, #000 14%, #000 86%, transparent 99%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(#000 78%, transparent 99%), linear-gradient(90deg, transparent 1%, #000 14%, #000 86%, transparent 99%); mask-composite: intersect; }
#portrait { opacity: 0; transition: opacity .9s ease .1s, filter .5s ease; filter: brightness(.24) saturate(.55) drop-shadow(0 0 26px rgba(var(--accent-rgb), .3)); }
#stage.revealed #portrait { opacity: 1; }
#stage.as-photo #portrait { filter: brightness(1) saturate(1) drop-shadow(0 0 26px rgba(var(--accent-rgb), .3)); }
#portrait-glyph { position: absolute; left: 7%; bottom: 0; opacity: 0; transition: opacity .9s ease .25s; filter: drop-shadow(0 0 5px rgba(var(--accent-rgb), .55)); }
#stage.revealed #portrait-glyph { opacity: 1; }
#stage.as-photo #portrait-glyph { opacity: 0; transition: opacity .4s ease; }
.tok { position: absolute; left: 0; top: 0; width: var(--tok); height: var(--tok); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #10488c, #052247 70%); border: 1px solid color-mix(in srgb, var(--tc) 55%, transparent);
  color: var(--tc); font: 600 calc(var(--tok) * .34)/1 var(--mono); letter-spacing: -.02em; will-change: transform;
  box-shadow: 0 0 14px -2px color-mix(in srgb, var(--tc) 55%, transparent), inset 0 0 10px rgba(0, 0, 0, .5); transition: box-shadow .2s, background .2s, border-color .2s; }
.tok.mine { border-width: 2px; border-color: var(--tc); }
.tok.hot, .tok:focus-visible { background: var(--tc); color: #052247; box-shadow: 0 0 26px 2px var(--tc); z-index: 2; outline-offset: 4px; }
.tok.has-logo { background: #f4f8ff; border-color: #f4f8ff; }
.tok img { width: 62%; height: 62%; object-fit: contain; }
#halo-readout { min-height: 3.1em; max-width: 44ch; margin: var(--s3) auto 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
#halo-readout b { color: var(--accent); font-weight: 600; margin-right: 4px; }

/* ---------- terminal ---------- */
.term { display: flex; flex-direction: column; height: min(540px, 70vh); min-height: 420px; max-width: 520px; width: 100%; background: rgba(3, 20, 43, .88);
  border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(var(--accent-rgb), .05), 0 0 60px -30px rgba(var(--accent-rgb), .5); overflow: hidden; }
.term-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 500 13px var(--mono); }
.term-title { color: var(--accent); }
.term-status { color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.term-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.term-status[data-mode="live"]::before { background: var(--ok); }
#term-log { flex: 1; overflow-y: auto; padding: 14px; font: 400 14px/1.6 var(--mono); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; overscroll-behavior: contain; }
#term-log:focus-visible { outline-offset: -3px; }
.tl { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 10px; }
.tl.pre { margin-bottom: 0; min-height: 1.6em; }
.tl.pre:last-child, .tl.pre + .tl:not(.pre) { margin-top: 10px; }
.tl.in { color: var(--accent); }
.tl.in::before { content: '> '; opacity: .7; }
.tl.out { color: #e6eefa; }
.tl.dim, .tl.wait { color: var(--muted); }
.tl.ask { color: var(--ok); }
.tl.typing::after { content: '▍'; color: var(--accent); margin-left: 1px; }
.tl a { color: var(--accent); }
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.chip { flex: 0 1 auto; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 400 12.5px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 6px 11px; white-space: nowrap; transition: color .15s, border-color .15s; }
.chip:hover { color: var(--ink); border-color: var(--accent); }
#term-form { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.prompt { font: 600 15px var(--mono); color: var(--accent); }
#term-input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font: 400 15px var(--mono); padding: 10px 0; caret-color: var(--accent); }
#term-input::placeholder { color: #8fa9cc; }
#term-form:focus-within { box-shadow: inset 0 1px 0 var(--accent); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: #ff8f7a; }
.send { font: 500 13px var(--mono); padding: 0 14px; height: 40px; border-radius: 7px; background: rgba(var(--accent-rgb), .14); color: var(--accent); border: 1px solid rgba(var(--accent-rgb), .4); }
.send:hover { background: var(--accent); color: #04162e; }

/* ---------- numbers strip ---------- */
.strip { border-block: 1px solid var(--line); }
#stats { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1160px; margin: 0 auto; }
#stats > div { display: flex; flex-direction: column-reverse; padding: var(--s4); border-left: 1px solid var(--line); }
#stats > div:first-child { border-left: 0; }
#stats dd { font: 400 44px/1 var(--serif); font-variation-settings: 'opsz' 144; color: var(--accent); margin-bottom: 8px; }
#stats dt { font-size: 15px; color: var(--muted); line-height: 1.4; max-width: 22ch; }

/* ---------- sections ---------- */
.sec { max-width: 1160px; margin: 0 auto; padding: var(--s7) var(--s4) 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5); align-items: end; margin-bottom: var(--s5); }
h2 { font: 400 clamp(36px, 4vw, 54px)/1 var(--serif); font-variation-settings: 'opsz' 144; letter-spacing: -.015em; }
.sec-head p { color: var(--muted); max-width: 52ch; font-size: 18px; }
h3 { font: 500 22px/1.25 var(--serif); }
h4 { font: 600 14px/1.3 var(--sans); color: var(--accent); margin-bottom: 6px; }
.sub { margin: var(--s6) 0 var(--s4); }

/* now */
.now { display: grid; grid-template-columns: 190px 1fr; gap: var(--s4); padding: var(--s4); margin-bottom: var(--s5); border: 1px solid rgba(var(--accent-rgb), .45); border-radius: var(--r); background: rgba(var(--accent-rgb), .07); }
.now-label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--accent); align-self: start; padding-top: 4px; }
.now-label .status-dot { background: var(--accent); animation: none; box-shadow: 0 0 10px var(--accent); }
.now ul { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.now h3 { font-size: 24px; margin-bottom: 4px; }
.now li p { color: #dbe6f5; font-size: 16px; max-width: 46ch; }
.tldr-cols li b { color: var(--ink); margin-right: 4px; }

/* case studies */
.case { border-top: 1px solid var(--line); }
.case:last-child { border-bottom: 1px solid var(--line); }
.case-head { display: grid; grid-template-columns: 190px 1fr auto 20px; gap: var(--s4); align-items: center; width: 100%; text-align: left; padding: 22px 4px; }
.case-name { font: 400 30px/1 var(--serif); font-variation-settings: 'opsz' 144; transition: color .15s; }
.case-head:hover .case-name, .case.open .case-name { color: var(--accent); }
.case-title { font: 400 17px/1.4 var(--sans); color: var(--muted); }
.tag { font: 500 13px var(--sans); padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.tag-shipped { color: var(--ok); border-color: rgba(127, 224, 176, .4); }
.tag-design { border-style: dashed; }
.chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; justify-self: center; margin-top: -4px; }
.case.open .chev { transform: rotate(-135deg); margin-top: 4px; }
.case-body { padding: 0 4px var(--s5); animation: open .35s ease; }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }
.case-sum { font-size: 19px; line-height: 1.5; max-width: 68ch; margin-bottom: var(--s4); }
.pa, .res { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); }
.pa p, .res p { color: #dbe6f5; max-width: 56ch; }
.res ul:not(.stack) { margin-top: 10px; }
.res ul:not(.stack) li { position: relative; padding-left: 18px; color: var(--muted); margin-bottom: 6px; font-size: 16px; }
.res ul:not(.stack) li::before { content: ''; position: absolute; left: 0; top: .62em; width: 8px; height: 1.5px; background: var(--accent); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack li { font: 400 13px var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; color: #dbe6f5; }
.case-links { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 14px; }
.flow-wrap { margin: var(--s4) 0; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r); background: rgba(4, 24, 50, .55); }
.flow-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s3); }
.flow-top h4 { margin: 0; }
.flow { display: flex; align-items: stretch; counter-reset: n; }
.flow li { flex: 1 1 0; display: flex; align-items: center; min-width: 0; }
.flow li + li::before { content: ''; flex: 0 0 22px; height: 1.5px; background: linear-gradient(90deg, var(--line-2) 50%, transparent 0) 0 0 / 8px 100%; }
.flow li:has(.done) + li::before, .flow li:has(.on) + li::before { background-image: linear-gradient(90deg, var(--accent) 50%, transparent 0); animation: march .6s linear infinite; }
@keyframes march { to { background-position: 8px 0; } }
.node { flex: 1; min-width: 0; height: 100%; min-height: 76px; display: flex; flex-direction: column; gap: 6px; justify-content: center; text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px;
  font-size: 14.5px; line-height: 1.25; background: var(--panel); transition: border-color .25s, background .25s, box-shadow .25s; }
.node-n { font: 500 12px var(--mono); color: var(--muted); }
.node:hover { border-color: var(--accent); }
.node.done { border-color: rgba(var(--accent-rgb), .5); }
.node.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .13); box-shadow: 0 0 22px -6px rgba(var(--accent-rgb), .8); }
.node.on .node-n { color: var(--accent); }
.flow-detail { margin-top: var(--s3); min-height: 3.2em; color: #dbe6f5; max-width: 70ch; font-size: 16px; }

/* approach */
.approach { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5); align-items: start; }
.layers { display: flex; flex-direction: column; gap: 10px; position: relative; padding-left: 26px; }
.layers::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 96px; width: 1.5px; background: linear-gradient(0deg, var(--accent), rgba(var(--accent-rgb), .15)); }
.layers::after { content: ''; position: absolute; left: 1.5px; top: 2px; border: 5px solid transparent; border-bottom: 8px solid rgba(var(--accent-rgb), .5); border-top: 0; }
.layer { text-align: left; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); display: grid; gap: 4px; transition: border-color .2s, background .2s, transform .2s; }
.layer:hover { border-color: var(--accent); }
.layer.on { border-color: var(--accent); background: rgba(var(--accent-rgb), .12); transform: translateX(6px); }
.layer-name { font: 500 21px var(--serif); }
.layer-items { font: 400 13px var(--mono); color: var(--muted); }
.layer-note { min-height: 4.6em; margin-top: 8px; color: #dbe6f5; font-size: 16px; }
.layer-axis { position: absolute; left: -4px; top: 50%; font: 400 12px var(--mono); color: var(--muted); writing-mode: vertical-rl; transform: translate(-100%, -80%) rotate(180deg); white-space: nowrap; }
.approach-copy h3 { margin-bottom: 8px; }
.approach-copy p { color: #dbe6f5; max-width: 62ch; margin-bottom: var(--s4); }
.approach-copy .aside { color: var(--muted); font-size: 15px; border-left: 2px solid var(--accent); padding-left: 14px; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); }
.story p { font: 400 19px/1.65 var(--serif); font-variation-settings: 'opsz' 14; color: #e6eefa; max-width: 62ch; margin-bottom: 1.1em; }
.story p:first-child::first-letter { font-size: 3.3em; float: left; line-height: .9; padding: 6px 10px 0 0; color: var(--accent); }
.about-side h3 { margin-bottom: var(--s3); }
.timeline { border-left: 1.5px solid var(--line-2); }
.timeline li { position: relative; padding: 0 0 var(--s4) 22px; display: grid; gap: 2px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.timeline .where { color: var(--muted); font-size: 14px; }
.timeline small { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 4px; }
.offscreen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); }
.offscreen li { padding: var(--s4) var(--s4) 0 0; }
.offscreen li + li { padding-left: var(--s4); border-left: 1px solid var(--line); }
.offscreen h4 { font: 500 19px var(--serif); color: var(--ink); }
.offscreen p { color: var(--muted); font-size: 15.5px; }

/* resume */
.resume-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3); align-items: center; margin-bottom: var(--s3); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border: 1px solid var(--line-2); border-radius: 10px; padding: 4px; }
.tabs button { padding: 9px 14px; border-radius: 7px; font-size: 15px; color: var(--muted); min-height: 40px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #04162e; font-weight: 500; }
.resume-actions { display: flex; gap: 10px; }
.sheet { background: #f6f0df; color: #1b1a20; border-radius: 6px; padding: clamp(24px, 4vw, 52px); box-shadow: 0 30px 80px -40px #000; }
.sheet :focus-visible, .sheet:focus-visible { outline-color: #1b1a20; }
.sheet-head { display: flex; justify-content: space-between; gap: var(--s4); border-bottom: 1.5px solid #1b1a20; padding-bottom: var(--s3); margin-bottom: var(--s3); }
.sheet-head h3 { font: 500 30px/1.1 var(--serif); }
.sheet-head p { color: #46434f; margin-top: 4px; }
.sheet address { font: 400 13px/1.6 var(--mono); text-align: right; color: #46434f; font-style: normal; }
.sheet h4 { color: #8a5a00; margin: var(--s4) 0 8px; font-size: 14px; }
.sheet p, .sheet dd { color: #2a2831; font-size: 16px; }
.skills div { display: grid; grid-template-columns: 220px 1fr; gap: var(--s3); padding: 7px 0; border-top: 1px solid rgba(27, 26, 32, .14); }
.skills dt { font-weight: 600; font-size: 15px; }
.xp li { padding: 7px 0; border-top: 1px solid rgba(27, 26, 32, .14); }
.xp-top { display: flex; justify-content: space-between; gap: var(--s3); }
.xp-top span { font: 400 13px var(--mono); color: #46434f; white-space: nowrap; }

/* contact */
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); align-items: start; }
.contact-list div { display: grid; grid-template-columns: 130px 1fr; gap: var(--s3); padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.contact-list div:last-child { border-bottom: 1px solid var(--line); }
.contact-list dt { color: var(--muted); font-size: 15px; }
.contact-list dd { font: 400 clamp(17px, 1.9vw, 22px) var(--serif); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
.note { display: grid; gap: var(--s3); padding: var(--s4); border: 1px solid var(--line-2); border-radius: var(--r); background: var(--panel); }
.note label { display: grid; gap: 6px; font-size: 14.5px; color: var(--muted); }
.note input, .note textarea { background: var(--bg-deep); border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 12px; color: var(--ink); font-size: 16px; resize: vertical; }
.note input:focus, .note textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.note-result { font-size: 14.5px; color: var(--muted); }
.note-result:empty { display: none; }
.foot { max-width: 1160px; margin: var(--s7) auto 0; padding: var(--s4); border-top: 1px solid var(--line); color: var(--muted); font-size: 14.5px; }

/* ---------- quick summary ---------- */
#tldr { max-width: 980px; margin: 0 auto; padding: var(--s5) var(--s4) 0; }
.tldr-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: clamp(20px, 4vw, 44px); }
.tldr-id { display: flex; gap: var(--s4); align-items: center; }
.tldr-id img { width: 96px; height: 96px; object-fit: cover; object-position: 50% 12%; border-radius: 50%; background: #0d3f78; border: 2px solid var(--accent); }
.tldr-name { font-size: clamp(32px, 4.4vw, 46px); margin: 0 0 4px; }
.tldr-id p { color: var(--muted); }
.tldr-id .status { margin-top: 10px; color: var(--ok); }
.tldr-line { font: 400 21px/1.5 var(--serif); margin: var(--s4) 0; max-width: 60ch; }
.tldr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); border-block: 1px solid var(--line); padding: var(--s3) 0; }
.tldr-stats div { display: flex; flex-direction: column-reverse; }
.tldr-stats dd { font: 400 30px/1.1 var(--serif); color: var(--accent); }
.tldr-stats dt { font-size: 14px; color: var(--muted); line-height: 1.35; }
.tldr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5); margin-top: var(--s4); }
.tldr-cols h2 { font: 600 14px var(--sans); color: var(--accent); margin: var(--s3) 0 6px; letter-spacing: 0; }
.tldr-cols li, .tldr-cols p { color: #dbe6f5; font-size: 16px; margin-bottom: 6px; }
.tldr-cols li a { font-weight: 600; color: var(--ink); margin-right: 4px; }
body.recruiter .hero, body.recruiter .strip { display: none; }
body.recruiter { background-image: linear-gradient(var(--bg), var(--bg-deep)); }
body.recruiter *, body.recruiter *::before, body.recruiter *::after { animation: none !important; transition: none !important; }

/* ---------- palette, toast, boot ---------- */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(2, 14, 32, .72); backdrop-filter: blur(4px); display: grid; place-items: start center; padding: 14vh var(--s3) 0; }
.palette[hidden] { display: none; }
.palette-box { width: min(600px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: 0 40px 100px -20px #000; }
#palette-input { width: 100%; padding: 16px 18px; background: none; border: 0; border-bottom: 1px solid var(--line); outline: 0; font-size: 17px; }
#palette-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
#palette-list li { padding: 10px 12px; border-radius: 7px; cursor: pointer; font-size: 15.5px; color: #dbe6f5; }
#palette-list li[aria-selected="true"] { background: rgba(var(--accent-rgb), .16); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 70; max-width: min(92vw, 520px); background: var(--ink); color: #04162e; padding: 10px 16px; border-radius: 8px; font-size: 15px; transition: opacity .2s, transform .2s; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#boot { position: fixed; inset: 0; z-index: 90; background: var(--bg-deep); display: grid; place-content: center; gap: var(--s4); transition: opacity .45s; padding: var(--s4); }
#boot.gone { opacity: 0; pointer-events: none; }
#boot-log { font: 400 15px/1.9 var(--mono); color: var(--accent); min-height: 7.6em; min-width: min(80vw, 30em); white-space: pre-wrap; }
#boot-skip { justify-self: start; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: var(--s4); padding-top: var(--s3); }
  .hero-copy { justify-self: center; max-width: 560px; display: flex; flex-direction: column; align-items: center; }
  .lede { max-width: 44ch; }
  .cta, .links { justify-content: center; }
  .stage-wrap { width: min(500px, 100%); }
  .term { max-width: 720px; text-align: left; height: 460px; }
}
@media (max-width: 900px) {
  .nav nav { display: none; }
  .nav-tools { margin-left: auto; }
  .sec-head, .approach, .about, .contact, .pa, .res, .tldr-cols, .now, .now ul { grid-template-columns: 1fr; gap: var(--s4); }
  .sec { padding-top: var(--s6); }
  #stats, .offscreen, .tldr-stats { grid-template-columns: 1fr 1fr; }
  #stats > div:nth-child(3) { border-left: 0; }
  #stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .offscreen li { padding: var(--s3) var(--s3) var(--s3) 0; border-bottom: 1px solid var(--line); }
  .offscreen li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .flow { flex-direction: column; gap: 0; }
  .flow li { flex-direction: column; align-items: stretch; }
  .flow li + li::before { flex: 0 0 16px; width: 1.5px; height: 16px; margin-left: 22px; background: linear-gradient(0deg, var(--line-2) 50%, transparent 0) 0 0 / 100% 8px; }
  .flow li:has(.done) + li::before, .flow li:has(.on) + li::before { background-image: linear-gradient(0deg, var(--accent) 50%, transparent 0); animation: none; }
  .node { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 12px; }
  .case-head { grid-template-columns: 1fr auto 20px; gap: 6px var(--s3); }
  .case-title { grid-column: 1 / -1; grid-row: 2; font-size: 15.5px; }
  .skills div { grid-template-columns: 1fr; gap: 2px; }
  .sheet-head, .xp-top { flex-direction: column; gap: 4px; }
  .sheet address { text-align: left; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { padding: 0 var(--s3); gap: var(--s2); }
  .brand { font-size: 16px; }
  .kbd-btn { display: none; }
  .switch { font-size: 13px; }
  .hero { padding: var(--s2) var(--s3) var(--s5); }
  h1 { font-size: 43px; margin-top: var(--s3); }
  h1 br { display: none; }
  #stage { padding-top: 17%; }
  #portrait, #portrait-glyph { width: 78%; }
  #portrait-glyph { left: 11%; }
  .term { height: 430px; min-height: 0; }
  .sec, .foot, #tldr { padding-left: var(--s3); padding-right: var(--s3); }
  #stats dd { font-size: 36px; }
  #stats > div { padding: var(--s3); }
  .case-name { font-size: 26px; }
  .flow-wrap { padding: var(--s3); }
  .contact-list div { grid-template-columns: 1fr; gap: 2px; }
  .resume-actions { width: 100%; } .resume-actions .btn { flex: 1; }
  .tldr-id { flex-direction: column; align-items: flex-start; }
  .cta .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; } .nav, .hero, .strip, #work, #approach, #about, #contact, .foot, .resume-tools, .sec-head, #boot, #tldr { display: none !important; }
  .sec { padding: 0; max-width: none; } .sheet { box-shadow: none; padding: 0; background: #fff; }
}
