:root {
  --gold: #f5c542;
  --bg: #0c0b09;
  --surface: #151310;
  --surface-2: #1c1915;
  --border: #322c23;
  --text: #ece5d8;
  --text-bright: #f6efe2;
  --text-dim: #948a78;
  --accent: #ff6a1a;
  --accent-2: #ff9240;
  --accent-dim: #7a3814;
  --atext: #ff6a1a;
  --warn: #e0b84e;
  --danger: #e2503a;
  --ok: #8fbf6a;
  --cyan: #38bdf8;
  --nav-bg: rgba(12, 11, 9, .85);
  --win-bg: rgba(21, 19, 16, .9);
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'Inter', system-ui, sans-serif;
  --binary: 'Share Tech Mono', 'VT323', ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --cine: cubic-bezier(.65, 0, .35, 1);
  --hero-type-y: 0px;
  --hero-type-scale: 1;
  --hero-type-alpha: 1;
  --hero-meta-alpha: 1;
  --hero-pitch-alpha: 0;
  --hero-pitch-x: 70px;
  --about-alpha: 0;
  --pager-p: 0;
  --about-wipe: 0%;
  --about-scale: 1;
  --about-facts: 0;
  --rail-x: 0px;
  --rail-p: 0;
  --packet-alpha: 0;
  --packet-enter: 38px;
  --packet-scale: .78;
  --packet-cut: 0;
  --packet-meter: 0;
  --packet-copy-x: 0px;
}
html[data-theme="light"] {
  --gold: #b07d12;
  --bg: #f4efe4;
  --surface: #fbf8f1;
  --surface-2: #ece4d4;
  --border: #d9cdb6;
  --text: #2a241c;
  --text-bright: #140f09;
  --text-dim: #6f6453;
  --accent: #cf540d;
  --accent-2: #b2470a;
  --accent-dim: #e7b991;
  --atext: #b2470a;
  --warn: #8f5f10;
  --danger: #b0301f;
  --ok: #3f7330;
  --cyan: #0b6fa0;
  --nav-bg: rgba(244, 239, 228, .88);
  --win-bg: rgba(251, 248, 241, .92);
}
* { box-sizing: border-box; }
html { scrollbar-width: thin; scrollbar-color: var(--accent-dim) var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, ul, dl, dd { margin: 0; padding: 0; }
a { color: var(--atext); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dim { color: var(--text-dim); }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.display { font-family: var(--mono); font-weight: 600; text-transform: uppercase; line-height: .9; letter-spacing: -.04em; }

.bg-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: block; }
.root { position: relative; z-index: 1; color: var(--text); overflow-x: clip; }

/* reveal atoms */
[data-rev] { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease) var(--d, 0ms), transform .6s var(--ease) var(--d, 0ms); }
[data-rev][data-in] { opacity: 1; transform: none; }
.split { display: flex; flex-wrap: wrap; column-gap: .26em; row-gap: .05em; }
.split.nowrap { flex-wrap: nowrap; white-space: nowrap; }
.split.body { row-gap: 0; column-gap: .28em; }
.w { display: inline-block; opacity: 0; transform: translateY(.42em); transition: opacity .8s var(--ease) calc(var(--i, 0) * 38ms), transform .8s var(--ease) calc(var(--i, 0) * 38ms); }
.split[data-in] .w { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(143, 191, 106, .6); } 100% { box-shadow: 0 0 0 9px rgba(143, 191, 106, 0); } }

/* nav + pager */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 56px; display: flex; justify-content: center; pointer-events: none; }
/* hero: spread across the screen (prompt far left, links dead centre, theme far right);
   once past the hero it folds into a centred bar and its line shrinks to match */
.nav-inner { pointer-events: auto; width: 100%; height: 100%; padding: 0 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; background: var(--nav-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; transition: width .8s var(--cine), padding .8s var(--cine), border-color .4s, background .4s; }
.nav[data-compact] .nav-inner { width: min(900px, 94vw); padding: 0 16px; }
.nav-prompt { justify-self: start; }
.theme-toggle { justify-self: end; }
.nav-prompt { display: inline-flex; align-items: center; gap: 8px; color: var(--text-bright); font-weight: 600; white-space: nowrap; min-height: 44px; }
.nav-prompt:hover { text-decoration: none; }
.nav-prompt .sep { color: var(--atext); }
.nav-prompt .cursor { color: var(--atext); animation: blink 1.1s steps(1) infinite; }
.nav-logo { width: 26px; height: 26px; display: block; }
.nav-links { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 9px; color: var(--text-dim); border-bottom: 2px solid transparent; font-weight: 500; transition: color .2s, border-color .2s; }
.nav-links a:hover { color: var(--atext); text-decoration: none; }
.nav-links a[aria-current] { color: var(--atext); border-bottom-color: var(--accent); }
.theme-toggle { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: none; border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; transition: color .16s, border-color .16s; }
.theme-toggle:hover { color: var(--atext); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.ic-sun { display: none; }
html[data-theme="light"] .ic-sun { display: block; }
html[data-theme="light"] .ic-moon { display: none; }
.pager { position: fixed; right: 26px; top: 50%; transform: translateY(-50%); z-index: 55; height: 56vh; width: 14px; }
.pager::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; margin-left: -.5px; background: var(--border); }
.pager::after { content: ""; position: absolute; left: 50%; top: 0; width: 2px; margin-left: -1px; height: calc(var(--pager-p) * 100%); background: linear-gradient(to bottom, transparent, var(--accent-2) 70%, var(--accent)); box-shadow: 0 0 8px var(--accent), 0 0 18px var(--accent); border-radius: 2px; pointer-events: none; }
.pager a { position: absolute; left: 0; width: 14px; height: 14px; margin-top: -7px; display: flex; align-items: center; justify-content: center; z-index: 1; }
.pager a i { display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--bg); border: 1px solid var(--text-dim); transition: all .25s var(--ease); }
.pager a:hover i { border-color: var(--accent); }
.pager a[aria-current] i { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 10px var(--accent); transform: scale(1.5); }

/* stages */
.stage { position: relative; }
.pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.s-hero { height: 500vh; height: 500svh; }
.s-packet { height: 420vh; height: 420svh; }
.anchor { position: absolute; left: 0; top: 45%; width: 1px; height: 1px; pointer-events: none; }
.anchor-end { top: calc(100% - 100vh); top: calc(100% - 100svh); } /* nav jumps to the finished About frame */
main > section + section { margin-top: 22vh; margin-top: 22svh; }
main > section#skills { margin-top: 6vh; margin-top: 6svh; }

/* 1 hero */
.hero-pin { display: flex; align-items: center; justify-content: center; }
.lockup { position: absolute; inset: 0; justify-content: center; display: flex; flex-direction: column; align-items: center; gap: 1vw; width: 100%; padding: 0 4vw; text-align: center; transform: translateY(var(--hero-type-y)) scale(var(--hero-type-scale)); opacity: var(--hero-type-alpha); will-change: transform, opacity; }
.hero-sm { justify-content: center; font-family: var(--mono); font-weight: 500; font-size: min(clamp(16px, 2.4vw, 36px), calc(92vw / (12 * .62))); letter-spacing: -.02em; color: var(--text-dim); }
.greet { display: inline-block; color: var(--text-bright); transition: opacity .3s, transform .3s var(--ease); }
.greet.greet-out { opacity: 0; transform: translateY(-.2em); }
.hero-brand { justify-content: center; font-size: min(clamp(36px, 8.6vw, 150px), calc(92vw / (15 * .62))); color: var(--atext); }
.hero-role { font-family: var(--sans); font-weight: 500; font-size: clamp(11px, 1.05vw, 14px); letter-spacing: .32em; text-transform: uppercase; color: var(--text-bright); margin-top: 1.6vw; }
.hero-role b { color: var(--atext); font-weight: 500; }
.scroll-cue { position: absolute; left: 0; right: 0; bottom: 40px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--text-dim); opacity: var(--hero-meta-alpha); pointer-events: none; }
.scroll-cue svg { animation: cuebob 1.6s ease-in-out infinite; color: var(--atext); }
@keyframes cuebob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.about-layer { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .5fr); justify-items: start; gap: 5vw; align-items: center; padding: 76px 7vw 56px; opacity: var(--about-alpha); pointer-events: none; }
.about-layer > * { pointer-events: auto; }
.hero-pitch { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; opacity: var(--hero-pitch-alpha); transform: translateX(var(--hero-pitch-x)); visibility: hidden; }
.pitch-label { margin: 0; font-family: var(--mono); font-weight: 500; font-size: clamp(18px, 1.7vw, 26px); line-height: 1.25; color: var(--text-bright); max-width: 14ch; }
.btn.big { min-height: 68px; padding: 0 40px; font-size: 18px; }
.hero-pin[data-pitch] .hero-pitch { visibility: visible; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px; border: 1px solid var(--border); background: var(--surface); font-family: var(--mono); font-size: 12px; color: var(--text); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: pulse 1.8s infinite; }
.pitch-text { font-size: clamp(14px, 1.3vw, 18px); line-height: 1.6; color: var(--text); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--accent); color: var(--atext); background: transparent; font-family: var(--mono); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
.btn:hover { background: var(--accent); color: var(--bg); text-decoration: none; }
.btn.solid { background: var(--accent); color: var(--bg); }
.btn.solid:hover { background: var(--accent-2); border-color: var(--accent-2); }
.links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--mono); font-size: 12px; }
.links a { display: inline-flex; align-items: center; min-height: 36px; }

/* 2 about */
.about-pin { display: flex; flex-direction: column; justify-content: center; padding: 68px 7vw 40px; }
.stage-label { margin-bottom: 26px; color: var(--text-dim); }
.mwrap { position: relative; font-family: var(--mono); font-weight: 600; text-transform: uppercase; line-height: .95; letter-spacing: -.04em; font-size: clamp(30px, 5.2vw, 76px); max-width: 16ch; transform: scale(var(--about-scale)); transform-origin: left center; will-change: transform; }
.mline { margin: 0; font: inherit; letter-spacing: inherit; }
.mline.base { color: color-mix(in srgb, var(--text) 30%, transparent); }
.mline.dup { position: absolute; inset: 0; color: var(--text-bright); clip-path: inset(calc(100% - var(--about-wipe)) 0 0); }
.about-desc { margin-top: 26px; max-width: 58ch; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.65; color: var(--text); opacity: var(--about-facts); }

/* 3 stack: not pinned, four groups pop in, scattered off-centre to the left */
.stack { position: relative; min-height: 100vh; min-height: 100svh; padding: 9vh 5vw 7vh; display: flex; align-items: center; justify-content: center; }
.stack-inner { perspective: 1300px; width: min(1000px, 86vw); margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.stack-inner h2 { font-size: clamp(40px, 7vw, 104px); margin-left: 3vw; }
.chaps { transform-style: preserve-3d; transform: rotateX(var(--sx, 0deg)) rotateY(var(--sy, 0deg)); transition: transform .35s ease-out; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 22px; margin-top: 84px; }
.chap { min-width: 0; transform-style: preserve-3d; translate: var(--jx, 0px) var(--jy, 0px); }
.chap:nth-child(1) { grid-column: 1 / span 5; }
.chap:nth-child(2) { grid-column: 7 / span 6; margin-top: 84px; }
.chap:nth-child(3) { grid-column: 2 / span 4; margin-top: 36px; }
.chap:nth-child(4) { grid-column: 7 / span 5; margin-top: 56px; }
.chap-in { display: flex; flex-direction: column; gap: 10px; }
.chap-title { font-size: clamp(18px, 1.9vw, 28px); }
.chap[data-rev] { transform: translateY(34px) scale(.86); transform-origin: left top; transition: opacity .45s var(--ease) var(--d, 0ms), transform .8s cubic-bezier(.34, 1.56, .64, 1) var(--d, 0ms); }
.chap[data-rev][data-in] { transform: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.tag-list li { padding: 2px 8px; border: 1px solid var(--border); font-family: var(--mono); font-size: 11px; color: var(--text); background: var(--win-bg); }
.stack::before, .stack::after { content: ""; position: absolute; pointer-events: none; border: 1px solid var(--accent-dim); }
.stack::before { width: 170px; height: 170px; right: 7vw; top: 20vh; border-radius: 50%; opacity: .5; }
.stack::after { width: 90px; height: 90px; left: 5vw; bottom: 14vh; transform: rotate(22deg); opacity: .4; }

/* footer: signal traces, drawn only while on screen */
.waves { position: relative; height: 46vh; height: 46svh; overflow: hidden; -webkit-mask: linear-gradient(to bottom, transparent, #000 45%); mask: linear-gradient(to bottom, transparent, #000 45%); }
.waves canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* 4 projects rail */
.rail-pin { display: flex; align-items: center; padding-top: 118px; padding-bottom: 56px; }
.rail-head { position: absolute; top: 76px; left: 5vw; right: 5vw; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; z-index: 2; }
.rail-head h2 { font-size: clamp(32px, 5.4vw, 80px); }
.rail-head .mono { color: var(--text-dim); padding-bottom: 6px; text-align: right; }
.track { display: flex; flex-wrap: nowrap; gap: 18px; width: max-content; min-width: 100%; padding: 0 5vw; transform: translate3d(var(--rail-x), 0, 0); transition: transform .55s cubic-bezier(.4, 0, .2, 1); will-change: transform; }
/* five whole tiles on screen; each scroll moves the row by exactly one tile */
.card { flex: 0 0 calc((100vw - 10vw - 4 * 18px) / 5); position: relative; z-index: 0; perspective: 1100px; cursor: pointer; outline: none; }
.card:hover, .card:focus-visible { z-index: 5; }
.ptilt { height: 100%; transform-style: preserve-3d; transform: rotateX(calc(var(--ty, 0) * -9deg)) rotateY(calc(var(--tx, 0) * 11deg)) scale(var(--ts, 1)); transition: transform .2s ease-out; }
.card:hover .ptilt, .card:focus-visible .ptilt { --ts: 1.045; }
.pflip { height: 100%; display: grid; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.2, .8, .2, 1); }
.card.is-flipped .pflip { transform: rotateY(180deg); }
.pface { grid-area: 1 / 1; position: relative; overflow: hidden; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: border-color .2s, box-shadow .3s; }
.card:hover .pface, .card:focus-visible .pface { border-color: var(--accent); box-shadow: 0 34px 50px -28px rgba(0, 0, 0, .8); }
.pface.front::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, .15), transparent 55%); opacity: var(--gl, 0); transition: opacity .25s; }
.pface.back { transform: rotateY(180deg); padding: 16px; gap: 12px; }
.card-long { font-size: 12.5px; line-height: 1.55; color: var(--text); }
.card-points { margin: 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.card-points li::marker { color: var(--accent); }
.pface .flip-hint { margin-top: auto; padding-top: 6px; }
.plate { position: relative; aspect-ratio: 3 / 4; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.plate canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.plate img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: left top; }
.card-body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title { font-family: var(--mono); font-size: 15px; font-weight: 600; line-height: 1.25; color: var(--text-bright); }
.card-tag { font-family: var(--mono); font-size: 11px; color: var(--atext); white-space: nowrap; }
.card-desc { font-size: 12.5px; line-height: 1.5; color: var(--text); }
.card-links { display: flex; flex-wrap: wrap; gap: 0 14px; font-family: var(--mono); font-size: 12px; }
.card-links a { display: inline-flex; align-items: center; min-height: 30px; }
.meter { position: absolute; left: 5vw; right: 5vw; bottom: 28px; height: 1px; background: var(--border); }
.meter i { display: block; height: 3px; margin-top: -1px; background: var(--accent); transform-origin: left center; transform: scaleX(var(--rail-p)); transition: transform .55s cubic-bezier(.4, 0, .2, 1); }
.meter-ends { position: absolute; left: 5vw; right: 5vw; bottom: 38px; display: flex; justify-content: space-between; color: var(--text-dim); }
/* desktop: cap the cards to the room between the heading and the meter, so short
   or wide windows (laptops, Safari with its tab bar) never push them over either.
   The plate gives up height first; a long card back scrolls inside the card. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .rail-pin { padding-top: 152px; padding-bottom: 76px; }
  .card { --card-w: calc((100vw - 10vw - 4 * 18px) / 5); height: min(calc(100vh - 236px), calc(var(--card-w) * 4 / 3 + 340px)); height: min(calc(100svh - 236px), calc(var(--card-w) * 4 / 3 + 340px)); }
  .pflip { grid-template-rows: minmax(0, 1fr); }
  .plate { aspect-ratio: auto; flex: 0 1 calc(var(--card-w) * 4 / 3); min-height: 72px; }
  .card-body { flex: none; }
  .pface.back { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (min-width: 901px) and (max-height: 700px) and (prefers-reduced-motion: no-preference) {
  .pface.front .tag-list { display: none; } /* very short windows: keep the description, drop the chips */
}

/* 5 writeups: the report */
.pk-pin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6vw; align-items: center; padding: 56px 6vw 0; }
.pk-copy { display: flex; flex-direction: column; gap: 18px; max-width: 560px; transform: translateX(var(--packet-copy-x)); will-change: transform; }
.pk-copy h2 { font-size: clamp(32px, 5vw, 72px); }
.pk-lede { font-size: 15px; line-height: 1.6; color: var(--text); max-width: 52ch; }
.cues { display: flex; flex-direction: column; gap: 8px; }
.cue { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); background: var(--win-bg); color: var(--text-dim); transition: border-color .5s var(--cine), color .5s var(--cine); }
.cue.is-lit { color: var(--text-bright); border-color: var(--accent-dim); }
.cue.is-active { border-color: var(--accent); }
.status-line { display: flex; align-items: center; gap: 12px; color: var(--text-bright); min-height: 20px; }
.status-line b { width: 8px; height: 8px; background: var(--accent); flex: none; }
.pk-meter { height: 1px; background: var(--border); }
.pk-meter i { display: block; height: 3px; margin-top: -1px; background: var(--accent); transform-origin: left center; transform: scaleX(var(--packet-meter)); }
.packet-slot { display: flex; justify-content: center; align-items: center; }
.deck { position: relative; height: min(74vh, 640px); height: min(74svh, 640px); aspect-ratio: 3 / 4; }
.deck-float { position: absolute; inset: 0; perspective: 1100px; animation: deckfloat 7s ease-in-out infinite alternate; }
@keyframes deckfloat { from { transform: translateY(0) rotateZ(-.6deg); } to { transform: translateY(-12px) rotateZ(.6deg); } }
.fcard { position: absolute; inset: 0; transform-style: preserve-3d; will-change: transform, opacity; pointer-events: none; }
.fcard.is-front { pointer-events: auto; cursor: pointer; }
.tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(calc(var(--ty, 0) * -13deg)) rotateY(calc(var(--tx, 0) * 15deg + var(--spin, 0deg))) scale(calc(var(--ts, 1) * var(--enter, 1))); transition: transform .2s ease-out; }
.fcard.is-spinning .tilt { transition: none; }
.fcard.is-front:hover .tilt { --ts: 1.04; }
.knock { position: absolute; inset: 0; transform-style: preserve-3d; }
.fcard, .shatter { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fcard .flip-hint { margin-top: auto; }
.pk-back-mark { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(56px, 9vw, 120px); color: var(--atext); text-shadow: 0 0 30px rgba(0, 0, 0, .8); pointer-events: none; }
.packet.back .pk-plate { flex: 1 1 auto; }
.cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.crack { fill: none; stroke: var(--text-bright); stroke-width: 1.6; stroke-linejoin: bevel; stroke-linecap: round; filter: drop-shadow(0 0 2px rgba(255, 106, 26, .9)); }
.crack.thin { stroke-width: 1; opacity: .8; }
.hit-fx { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: visible; }
.hit-fx > i { position: absolute; display: block; pointer-events: none; }
.hitmarker { width: 34px; height: 34px; }
.hitmarker b { position: absolute; left: 50%; top: 50%; width: 11px; height: 2.5px; margin: -1.25px 0 0 -5.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .55); }
.hitmarker b:nth-child(1) { transform: rotate(45deg) translateX(-9px); }
.hitmarker b:nth-child(2) { transform: rotate(135deg) translateX(-9px); }
.hitmarker b:nth-child(3) { transform: rotate(225deg) translateX(-9px); }
.hitmarker b:nth-child(4) { transform: rotate(315deg) translateX(-9px); }
.spark { height: 2px; margin-top: -1px; transform-origin: 0 50%; background: #fff; border-radius: 2px; }
.spark.hot { background: var(--accent-2); }
.hit-ring { width: 40px; height: 40px; border: 2px solid var(--accent); border-radius: 50%; }
.hit-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; mix-blend-mode: overlay; }
.hit-label { font-size: 15px; font-weight: 700; letter-spacing: .08em; color: #fff; white-space: nowrap; text-shadow: 0 0 10px var(--accent), 0 2px 0 rgba(0, 0, 0, .7); }
.shatter { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.shatter-half { position: absolute; inset: 0; }
.shard { position: absolute; display: block; background: linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(236, 229, 216, .25)); }
.shard.hot { background: var(--accent); }
.shatter-flash { position: absolute; inset: -20%; opacity: 0; }
.deck-flag { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.deck-flag[hidden] { display: none; }
.key-art { width: 150px; height: 75px; overflow: visible; filter: drop-shadow(0 0 18px rgba(255, 106, 26, .55)); animation: keyfloat 2.4s ease-in-out infinite alternate; }
@keyframes keyfloat { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-8px) rotate(-3deg); } }
.key-metal { fill: var(--accent); }
.key-hole { fill: var(--bg); }
.key-row { display: flex; align-items: stretch; max-width: 100%; }
.flag-code { font-family: var(--mono); font-size: clamp(14px, 1.6vw, 20px); font-weight: 600; color: var(--text-bright); padding: 10px 14px; border: 1px dashed var(--accent); border-right: 0; background: var(--surface); word-break: break-all; }
.key-copy { flex: none; min-width: 64px; padding: 0 14px; border: 1px solid var(--accent); background: var(--accent); color: var(--bg); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: background .2s; }
.key-copy:hover { background: var(--accent-2); }
.key-copy:focus-visible { outline: 2px solid var(--text-bright); outline-offset: 2px; }
.hint-bubble { position: fixed; z-index: 200; max-width: 280px; padding: 10px 14px; border: 1px solid var(--accent); background: var(--surface); color: var(--text-bright); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; text-align: left; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8), 0 0 24px rgba(255, 106, 26, .25); pointer-events: none; }
.hint-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; margin-left: -5px; background: var(--surface); border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); transform: rotate(45deg); }
.hint-bubble b { color: var(--atext); font-weight: 600; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .85s cubic-bezier(.2, .8, .2, 1); }
.fcard.is-flipped .flip { transform: rotateY(180deg); }
.packet { position: absolute; inset: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); color: var(--text); border: 1px solid var(--accent); backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 106, 26, .08); }
.packet.back { transform: rotateY(180deg); justify-content: space-between; }
.packet.front::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 30%), rgba(255, 255, 255, .16), transparent 55%); opacity: var(--gl, 0); transition: opacity .25s; }
.flip-hint { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); text-align: right; }
.outline { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; font-size: 13px; color: var(--text-bright); }
.outline li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.outline li span { color: var(--atext); }
.packet.back .btn { align-self: flex-start; }
.pk-head { display: flex; flex-direction: column; gap: 6px; }
.pk-name { font-size: clamp(32px, min(5vw, 8vh), 72px); color: var(--atext); }
.pk-plate { position: relative; flex: 1 1 0; min-height: 0; border: 1px solid var(--border); background: var(--surface-2); }
.pk-plate canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pk-plate { overflow: hidden; }
.pk-shot { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; object-position: left top; pointer-events: none; user-select: none; }
.pk-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pk-title .pk-name { min-width: 0; font-size: clamp(26px, min(3.6vw, 6.4vh), 58px); }
.pk-ava { flex: none; width: clamp(40px, min(5vw, 7vh), 64px); height: clamp(40px, min(5vw, 7vh), 64px); border-radius: 50%; }
.pk-rows { display: flex; flex-direction: column; }
.pk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.pk-row .val { color: var(--atext); text-align: right; }

/* bands as terminal windows */
.screen { position: relative; height: 100vh; height: 100svh; padding: 68px 5vw 34px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; min-height: 0; max-height: 100%; display: flex; flex-direction: column; gap: 14px; transform: translateY(calc(var(--p, 0) * 36px)) scale(calc(1 - var(--a, 0) * .05)); opacity: calc(1 - var(--a, 0) * .6); will-change: transform, opacity; }
.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.sec-head h2 { font-family: var(--mono); font-weight: 600; font-size: clamp(26px, 3.4vw, 42px); line-height: 1.1; color: var(--text-bright); }
.sec-head h2 b { color: var(--atext); font-weight: 600; margin-right: .35em; }
.sec-lede { font-size: 15px; color: var(--text-dim); max-width: 74ch; }
.win { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); background: var(--win-bg); }
.win-bar { flex: none; display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.r { background: var(--danger); }
.dot.y { background: var(--warn); }
.dot.g { background: var(--ok); }
.win-title { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px; scrollbar-width: thin; scrollbar-color: var(--accent-dim) transparent; }

.wu-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid var(--border); background: transparent; font-family: var(--mono); font-size: 12px; color: var(--text-dim); cursor: pointer; transition: all .2s; }
.chip:hover { border-color: var(--accent); color: var(--atext); }
.chip.on { border-color: var(--accent); color: var(--bg); background: var(--accent); }
.wu-count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.wt-row { display: grid; grid-template-columns: 1.5fr .8fr .8fr 1fr 1fr; gap: 12px; align-items: center; height: 42px; box-sizing: border-box; padding: 0 8px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; animation: rise .4s var(--ease) both; }
.wt-row:nth-child(2) { animation-delay: 20ms; }
.wt-row:nth-child(3) { animation-delay: 40ms; }
.wt-row:nth-child(4) { animation-delay: 60ms; }
.wt-row:nth-child(5) { animation-delay: 80ms; }
.wt-row:nth-child(6) { animation-delay: 100ms; }
.wt-row:nth-child(7) { animation-delay: 120ms; }
.wt-row:nth-child(8) { animation-delay: 140ms; }
.wt-row:hover:not(.wt-head) { background: var(--surface-2); }
.wt-head { color: var(--text-dim); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; position: sticky; top: 0; background: var(--surface-2); z-index: 2; animation: none; }
.wt-name { color: var(--text-bright); font-weight: 600; display: flex; align-items: center; gap: 10px; min-width: 0; }
.wt-ava { flex: none; width: 28px; height: 28px; border-radius: 50%; }
.ava-blank { display: inline-grid; place-items: center; background: var(--surface-2); border: 2px solid var(--border); color: var(--text-dim); font-family: var(--mono); font-size: .75rem; font-weight: 600; text-transform: uppercase; }
.pk-ava.ava-blank { font-size: 1.2rem; }
.os-tag, .diff-tag { display: inline-block; padding: 1px 8px; border: 1px solid currentColor; font-size: 11px; }
.os-linux, .diff-easy { color: var(--ok); }
.os-windows { color: var(--cyan); }
.diff-medium, .st-locked { color: var(--warn); }
.diff-hard { color: var(--danger); }
.st-missing { color: var(--text-dim); }

.ach-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; }
.ach-grid h3 { font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--atext); margin-bottom: 12px; }
.cert { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 10px; }
.cert b { font-family: var(--mono); font-size: 14px; color: var(--text-bright); font-weight: 600; }
.cert span { font-size: 13px; color: var(--text-dim); }
.cert a { font-family: var(--mono); font-size: 12px; display: inline-flex; align-items: center; min-height: 32px; }
.log { padding: 14px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 14px; }
.log .id { font-family: var(--binary); font-size: 14px; color: var(--atext); }
.log h4 { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text-bright); }
.log p { grid-column: 2; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.res-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 56px); min-height: 0; }
.res-card { position: relative; height: min(calc(100svh - 230px), 720px); aspect-ratio: 1100 / 1424; perspective: 1100px; cursor: pointer; }
.res-card:hover .tilt { --ts: 1.03; }
.res-card.is-flipped .flip { transform: rotateY(180deg); }
.res-face { padding: 0; gap: 0; background: #fff; }
.res-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.res-info { display: flex; flex-direction: column; gap: 14px; max-width: 52ch; }
.res-info .fmt { font-family: var(--binary); font-size: 13px; color: var(--atext); letter-spacing: .1em; }
.res-info h3 { font-family: var(--mono); font-size: clamp(24px, 3vw, 36px); font-weight: 600; line-height: 1.15; color: var(--text-bright); }
.res-info p { font-size: 15px; line-height: 1.6; color: var(--text-dim); }
.res-info .btns { margin-top: 8px; }
.contact-hero { display: block; font-family: var(--mono); font-weight: 600; font-size: clamp(18px, 3.2vw, 38px); line-height: 1.2; color: var(--text-bright); word-break: break-all; margin-bottom: 16px; }
.contact-hero:hover { color: var(--atext); text-decoration: none; }
.clinks { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.clinks a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 14px; color: var(--text); }
.clinks a b { color: var(--atext); font-weight: 500; }
.clinks a:hover { background: var(--surface-2); text-decoration: none; }
.foot { margin-top: 16px; font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

@media (max-width: 900px) {
  .nav-inner { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0 12px; gap: 8px; }
  .nav-links { justify-self: stretch; min-width: 0; }
  .nav-prompt .sep, .nav-prompt .cursor { display: none; }
  .track { transform: none !important; width: auto; overflow-x: auto; scroll-snap-type: x mandatory; transition: none; }
  .card { flex: 0 0 78vw; scroll-snap-align: center; perspective: none; }
  .ptilt { transform: none !important; }
  .nav-prompt .host { display: none; }
  .pager { display: none; }
  .pk-pin { grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: center; padding-top: 64px; }
  .pk-copy { gap: 10px; }
  .pk-lede { display: none; }
  .cues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .cue { padding: 0 8px; gap: 8px; font-size: 9px; }
  .deck { height: min(40vh, 420px); height: min(40svh, 420px); }
  .about-layer { grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: center; padding: 70px 6vw 24px; }
  .about-desc { margin-top: 12px; font-size: 14px; }
  .mwrap { font-size: clamp(24px, 8vw, 40px); }
  .hero-pitch { gap: 10px; }
  .btn.big { min-height: 56px; padding: 0 28px; font-size: 16px; }
  .chaps { display: flex; flex-direction: column; gap: 22px; }
  .chap:nth-child(n) { margin-top: 0; translate: none; }
  .stack-inner { width: 100%; }
  .stack-inner h2 { margin-left: 0; }
  .stack::before, .stack::after { display: none; }
  .ach-grid { grid-template-columns: minmax(0, 1fr); }
  .res-panel { grid-template-columns: minmax(0, 1fr); }
  .res-card { justify-self: center; height: min(calc(100svh - 380px), 560px); }
  .screen { padding-left: 14px; padding-right: 14px; }
  .wt-row { grid-template-columns: 1.4fr .8fr .8fr 1fr; }
  .wt-row > :nth-child(4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .stage { height: auto !important; }
  .pin { position: relative; height: auto; min-height: 100vh; min-height: 100svh; overflow: visible; }
  .track { transform: none !important; flex-wrap: wrap; justify-content: center; width: auto; }
  .rail-head { position: static; padding: 0 0 28px; }
  .rail-pin { flex-direction: column; align-items: stretch; padding: 130px 0 80px; }
  .meter, .meter-ends { display: none; }
  .hero-pin { display: flex; flex-direction: column; gap: 40px; padding: 100px 0 60px; }
  .lockup { position: static; }
  .about-layer { position: static; display: flex; flex-direction: column; opacity: 1; padding: 0 7vw; }
  .hero-pitch { visibility: visible; opacity: 1; transform: none; }
  main > section + section { margin-top: 0; }
  .scroll-cue { position: static; }
  [data-rev], .w { opacity: 1; transform: none; transition: none; }
  .wrap { transform: none; opacity: 1; }
  .wt-row { animation: none; }
}

/* ===========================================================
   Module-driven UI: certifications table + PDF viewer (certs.js),
   (music card removed; music.js is unused)
   =========================================================== */
:root { --hard-shadow: color-mix(in srgb, var(--text-dim) 45%, transparent); --pixel: 'Silkscreen', var(--binary); }
html[data-theme="light"] { --hard-shadow: var(--text-bright); }

.cert-table { display: grid; }
.cert-row { display: grid; grid-template-columns: 1.6fr 1.2fr auto; gap: 4px 14px; align-items: baseline; text-align: left; width: 100%; padding: 12px 0; background: none; border: 0; border-bottom: 1px solid var(--border); color: var(--text); font: inherit; cursor: pointer; }
.cert-row:last-child { border-bottom: 0; }
.cert-row.static { cursor: default; }
.cert-row.static .cert-view { color: var(--text-dim); }
.cert-row:not(.static):hover .cert-view { text-decoration: underline; }
.cert-name { grid-column: 1 / -1; color: var(--text-bright); font-weight: 600; }
.cert-issuer, .cert-date { font-family: var(--mono); font-size: .8rem; color: var(--text-dim); }
.cert-view { font-family: var(--mono); font-size: .8rem; color: var(--atext); white-space: nowrap; justify-self: end; }
.cert-empty { font-family: var(--mono); font-size: .84rem; color: var(--text-dim); }

.cert-viewer { position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; padding: 24px; }
.cert-viewer:not([hidden]) { display: flex; }
.cert-viewer[hidden] { display: none; }
.cert-viewer-backdrop { position: absolute; inset: 0; background: rgba(12, 11, 9, .82); backdrop-filter: blur(4px); }
.cert-viewer-box { position: relative; width: min(900px, 100%); height: min(85vh, 1100px); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); }
.cert-viewer-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-family: var(--mono); }
.cert-viewer-title { flex: 1; font-size: .82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cert-viewer-download { font-size: .76rem; color: var(--text-dim); border: 1px solid var(--border); padding: 4px 9px; }
.cert-viewer-download:hover { color: var(--atext); border-color: var(--accent); text-decoration: none; }
.cert-viewer-close { background: none; border: 1px solid var(--border); color: var(--text-dim); width: 26px; height: 26px; cursor: pointer; line-height: 1; }
.cert-viewer-close:hover { color: var(--atext); border-color: var(--accent); }
.cert-viewer-frame { flex: 1; border: 0; background: #fff; }

}

/* ===========================================================
   Section transitions: titles type in, windows unroll, items slide
   =========================================================== */
.sec-head h2[data-rev] { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); transition: clip-path .9s steps(16) var(--d, 0ms); }
.sec-head h2[data-rev][data-in] { clip-path: inset(0 0 0 0); }
.sec-head h2[data-rev]::after { content: "_"; margin-left: .1em; color: var(--accent); opacity: 0; }
.sec-head h2[data-rev][data-in]::after { animation: caret 1.1s steps(2) 3 .9s; }
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.win[data-rev] { opacity: 0; transform: translateY(46px) scale(.965); clip-path: inset(0 0 100% 0); transition: clip-path 1s var(--cine) .15s, transform 1s var(--ease) .15s, opacity .4s linear .15s; }
.win[data-rev][data-in] { opacity: 1; transform: none; clip-path: inset(0 0 0 0); }
.win[data-rev] .win-bar { box-shadow: 0 1px 0 var(--accent); }
.log[data-rev], .cert-row, .wt-row { transition-property: opacity, transform; }
.log[data-rev], .clinks a[data-rev] { transform: translateX(-26px); }
.res-card[data-rev] { transform: translateX(-30px) scale(.96); }
.res-info[data-rev] { transform: translateX(30px); --d: 150ms; }
.log[data-rev][data-in], .clinks a[data-rev][data-in], .res-card[data-rev][data-in], .res-info[data-rev][data-in] { transform: none; }
.contact-hero[data-rev] { transform: none; clip-path: inset(0 100% 0 0); letter-spacing: .12em; transition: clip-path 1.1s var(--cine) .5s, letter-spacing 1.4s var(--ease) .5s, opacity .3s linear .5s; }
.contact-hero[data-rev][data-in] { clip-path: inset(0 0 0 0); letter-spacing: 0; }
@media (prefers-reduced-motion: reduce) {
  .sec-head h2[data-rev], .win[data-rev], .contact-hero[data-rev] { clip-path: none; letter-spacing: 0; }
}

/* ===========================================================
   Stack: floating panels with a slight perspective warp
   =========================================================== */
.chap-in { --z: 30px; --rx: 4deg; --ry: -10deg; --bt: 6s; padding: 16px 18px 18px; background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--border); box-shadow: 0 34px 46px -26px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .05); backdrop-filter: blur(4px); transform-style: preserve-3d; transform: translateZ(var(--z)) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz, 0deg)); animation: panelbob var(--bt) ease-in-out infinite alternate; }
@keyframes panelbob { from { transform: translateZ(var(--z)) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz, 0deg)) translateY(0); } to { transform: translateZ(calc(var(--z) + 18px)) rotateX(calc(var(--rx) * .6)) rotateY(calc(var(--ry) * .7)) rotateZ(calc(var(--rz, 0deg) * .5)) translateY(-14px); } }
.chap-title { text-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .stack-inner { perspective: none; }
  .chaps { transform: none; }
  .chap-in { animation: none; transform: none; }
}

/* writeups table: ten rows at a time, the rest scrolls */
#wuTable { max-height: calc(42px * 11); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--accent-dim) transparent; }

/* ===========================================================
   Boot loader (loader.js + terminal.js): runs on every load
   =========================================================== */
body.is-loading { overflow: hidden; }
/* hold the page's reveals while loading, so the hero plays as the screen opens */
body.is-loading [data-rev][data-in], body.is-loading .split[data-in] .w { opacity: 0 !important; transition: none !important; }
.loader { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; }
.loader-half { position: absolute; left: 0; right: 0; height: 50.2%; background: var(--bg); transition: transform .95s cubic-bezier(.77, 0, .18, 1); }
.loader-half.top { top: 0; }
.loader-half.bottom { bottom: 0; }
.loader-half.top::after, .loader-half.bottom::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); box-shadow: 0 0 22px var(--accent); opacity: 0; transition: opacity .2s; }
.loader-half.top::after { bottom: 0; }
.loader-half.bottom::after { top: 0; }
.loader-core { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; width: min(780px, 94vw); transition: opacity .3s; }
.loader .terminal { border: 1px solid var(--accent); background: var(--surface); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7); transform-origin: center; transition: transform .5s cubic-bezier(.7, 0, .84, 0), filter .5s, opacity .2s; }
.loader .terminal-bar { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12px; color: var(--text-dim); }
.loader .terminal-title { flex: 1; margin-left: 6px; }
.term-skip-btn { background: none; border: 1px solid var(--border); color: var(--text-dim); font: inherit; padding: 3px 9px; cursor: pointer; }
.term-skip-btn:hover { color: var(--atext); border-color: var(--accent); }
.loader .terminal-body { height: min(380px, 56vh); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 18px; font-family: var(--binary); font-size: 14px; line-height: 1.55; color: var(--text); }
.terminal-body p { margin: 0; white-space: pre-wrap; word-break: break-word; }
.terminal-input-row { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.dot.r, .dot.y, .dot.g { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.font-binary { color: var(--text-dim); }
.font-binary-accent { color: var(--atext); }
.font-binary-green { color: var(--ok); }
.bin-tag { color: var(--cyan); }
.bin-stream { color: var(--text-dim); letter-spacing: .04em; }
.term-hl { color: var(--atext); }
.ascii-banner { margin: 0 0 8px; color: var(--atext); font-family: var(--binary); font-size: clamp(5px, 1.05vw, 10px); line-height: 1.05; overflow: hidden; }
.type-cursor { display: inline-block; width: 9px; height: 1em; margin-left: 2px; background: var(--accent); vertical-align: text-bottom; animation: caret 1s steps(2) infinite; }
.loader-bar { height: 4px; background: var(--border); overflow: hidden; }
.loader-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 14px var(--accent); transform-origin: left center; transform: scaleX(0); transition: transform .35s var(--ease); }
.loader-meta { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.loader-meta #loaderPct { color: var(--atext); }
/* ready -> collapse -> open */
.loader--ready .loader-bar i { animation: barflash .7s ease-out; }
@keyframes barflash { 50% { filter: brightness(2.2); } }
.loader--collapse .terminal { transform: scaleY(.008) scaleX(1.02); filter: brightness(2.4); }
.loader--collapse .loader-meter { opacity: 0; transition: opacity .25s; }
.loader--open .loader-core { opacity: 0; }
.loader--open .loader-half.top { transform: translateY(-101%); }
.loader--open .loader-half.bottom { transform: translateY(101%); }
.loader--collapse .loader-half::after { opacity: 1; }
.loader--fade { opacity: 0; transition: opacity .4s; }
@media (prefers-reduced-motion: reduce) { .loader-half, .loader .terminal { transition: none; } }

/* ===========================================================
   Phones (<= 900px): a plain, natural-scrolling page. No pinned sequences,
   no scroll hijacking, no background canvas. The class is set in <head>.
   =========================================================== */
.nav-actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.nav-burger { display: none; width: 38px; height: 36px; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: none; border: 1px solid var(--border); cursor: pointer; }
.nav-burger i { display: block; width: 18px; height: 2px; background: var(--text-bright); transition: transform .3s var(--ease), opacity .2s; }
.nav--menu.is-open .nav-burger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--menu.is-open .nav-burger i:nth-child(2) { opacity: 0; }
.nav--menu.is-open .nav-burger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

html.is-mobile body { background: radial-gradient(120% 60% at 90% 0%, color-mix(in srgb, var(--accent) 12%, var(--bg)), var(--bg) 70%); }
html.is-mobile .bg-canvas, html.is-mobile .pager { display: none; }
html.is-mobile .nav-inner { grid-template-columns: auto 1fr auto; padding: 0 12px; gap: 8px; width: 100% !important; }
html.is-mobile .nav-prompt .host, html.is-mobile .nav-prompt .sep, html.is-mobile .nav-prompt .cursor { display: none; }
html.is-mobile .nav-burger { display: flex; }
html.is-mobile .nav--menu .nav-links { position: fixed; top: 56px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px 16px 14px; overflow: visible; background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .6); opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none; transition: opacity .25s, transform .25s var(--ease), visibility .25s; }
html.is-mobile .nav--menu.is-open .nav-links { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
html.is-mobile .nav--menu .nav-links a { min-height: 50px; padding: 0 4px; font-size: 15px; border-bottom: 1px solid var(--border); }
html.is-mobile .nav--menu .nav-links a:last-child { border-bottom: 0; }
html.is-mobile .nav--menu .nav-links a[aria-current] { border-bottom-color: var(--border); }

/* every stage becomes ordinary flowing content */
html.is-mobile .stage { height: auto !important; }
html.is-mobile .pin { position: relative; height: auto; min-height: 0; overflow: visible; }
html.is-mobile main > section + section { margin-top: 0; }
html.is-mobile .anchor { display: none; }

/* hero + about */
html.is-mobile .hero-pin { display: flex; flex-direction: column; justify-content: flex-start; gap: 0; padding: 0; }
html.is-mobile .lockup { position: static; transform: none; opacity: 1; min-height: 100vh; min-height: 100svh; justify-content: center; padding: 70px 16px 40px; }
html.is-mobile .about-layer { position: static; display: flex; flex-direction: column; gap: 22px; padding: 48px 20px 56px; opacity: 1; }
html.is-mobile .stage-label { margin-bottom: 14px; }
html.is-mobile .mwrap { font-size: clamp(27px, 8.6vw, 42px); max-width: none; transform: none; }
html.is-mobile .mline.dup { display: none; }
html.is-mobile .mline.base { color: var(--text-bright); }
html.is-mobile .about-desc { margin-top: 16px; font-size: 15px; opacity: 1; }
html.is-mobile .hero-pitch { visibility: visible; opacity: 1; transform: none; align-items: stretch; gap: 10px; }
html.is-mobile .pitch-label { max-width: none; font-size: 18px; }
html.is-mobile .btn.big { min-height: 56px; font-size: 16px; }
html.is-mobile .scroll-cue { position: absolute; top: calc(100vh - 70px); top: calc(100svh - 70px); bottom: auto; }
.m-only { display: none; }
html.is-mobile .m-only { display: inline; }
html.is-mobile .d-only { display: none; }

/* stack: flat panels */
html.is-mobile .stack { min-height: 0; padding: 56px 20px; display: block; }
html.is-mobile .stack-inner { width: 100%; perspective: none; }
html.is-mobile .stack-inner h2 { margin-left: 0; font-size: clamp(40px, 13vw, 64px); }
html.is-mobile .chaps { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; transform: none; }
html.is-mobile .chap:nth-child(n) { margin-top: 0; translate: none; }
html.is-mobile .chap-in { animation: none; transform: none; }
html.is-mobile .stack::before, html.is-mobile .stack::after { display: none; }

/* projects: a compact vertical list; tap a project to expand it */
html.is-mobile .rail-pin { display: block; padding: 56px 0 24px; }
html.is-mobile .rail-head { position: static; display: block; padding: 0 20px 20px; }
html.is-mobile .rail-head h2 { font-size: clamp(38px, 12vw, 60px); }
html.is-mobile .rail-head .mono { text-align: left; padding: 8px 0 0; }
html.is-mobile .meter, html.is-mobile .meter-ends { display: none; }
html.is-mobile .track { flex-direction: column; gap: 10px; width: auto; min-width: 0; padding: 0 16px; overflow: visible; transform: none !important; transition: none; scroll-snap-type: none; }
html.is-mobile .card { flex: none; width: 100%; perspective: none; }
html.is-mobile .ptilt { transform: none !important; transition: none; }
html.is-mobile .pflip { display: block; transform: none !important; transition: none; }
html.is-mobile .pface { backface-visibility: visible; -webkit-backface-visibility: visible; }
html.is-mobile .pface.front { padding: 0; }
html.is-mobile .plate { display: none; }
html.is-mobile .card-body { padding: 14px 16px; gap: 8px; }
html.is-mobile .card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.is-mobile .card .tag-list li:nth-child(n+4) { display: none; }
html.is-mobile .pface.back { display: none; transform: none; }
html.is-mobile .card.is-flipped .pface.front { display: none; }
html.is-mobile .card.is-flipped .pface.back { display: flex; }
html.is-mobile .pface .flip-hint { padding-top: 0; }

/* writeups: no sequence, just the title, the blurb and the list below */
html.is-mobile .pk-pin { display: block; padding: 56px 20px 8px; }
html.is-mobile .pk-copy { transform: none; max-width: none; gap: 12px; }
html.is-mobile .pk-copy h2 { font-size: clamp(34px, 10.5vw, 56px); }
html.is-mobile .pk-lede { display: flex; font-size: 15px; }
html.is-mobile .cues, html.is-mobile .status-line, html.is-mobile .pk-meter, html.is-mobile .packet-slot { display: none; }

/* table screens: ordinary blocks */
html.is-mobile .screen { height: auto; min-height: 0; display: block; overflow: visible; padding: 56px 16px 16px; }
html.is-mobile .wrap { transform: none; opacity: 1; max-height: none; }
html.is-mobile .sec-head { flex-direction: column; align-items: flex-start; }
html.is-mobile .win-body { overflow: visible; padding: 14px; }
html.is-mobile .wu-tools { gap: 6px; }
html.is-mobile #wuTable { max-height: calc(42px * 11); }
html.is-mobile .wt-row { grid-template-columns: 1.3fr .8fr .8fr 1.1fr; gap: 8px; font-size: 12px; padding: 0 4px; }
html.is-mobile .wt-row > :nth-child(2), html.is-mobile .wt-row > :nth-child(4) { display: none; }
html.is-mobile .wt-row { grid-template-columns: 1.3fr .9fr 1.2fr; }
html.is-mobile .contact-hero { font-size: clamp(15px, 5vw, 22px); }
html.is-mobile .ach-grid, html.is-mobile .res-panel { grid-template-columns: minmax(0, 1fr); }
html.is-mobile .res-card { width: 100%; height: auto; perspective: none; }
html.is-mobile .res-card .tilt, html.is-mobile .res-card .flip { position: relative; transform: none; }
html.is-mobile .res-card .packet { position: relative; aspect-ratio: 1100 / 1424; backface-visibility: visible; -webkit-backface-visibility: visible; transform: none; }
html.is-mobile .res-card .packet.back, html.is-mobile .res-card.is-flipped .packet.front { display: none; }
html.is-mobile .res-card.is-flipped .packet.back { display: flex; }
html.is-mobile .waves { height: 22vh; height: 22svh; }
html.is-mobile .loader .terminal-body { height: 46vh; font-size: 12px; }
html.is-mobile .cert-viewer { padding: 8px; }
html.is-mobile .wu-lock-body { padding: 24px 18px; }

.os-mythic, .diff-mythic { color: var(--gold); }
.wt-classified { background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(245, 197, 66, .045) 10px 20px); }
.wt-classified .redacted { display: inline-block; color: var(--text-dim); letter-spacing: -.05em; filter: blur(.4px); }
.wt-keyform { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.wt-keyinput { flex: 1 1 auto; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text-bright); font-family: var(--mono); font-size: 12px; transition: border-color .2s, box-shadow .2s; }
.wt-keyinput:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 197, 66, .2); }
.wt-keyinput.is-wrong, .lock-pop input.is-wrong { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(226, 80, 58, .25); }
.wt-keybtn { flex: none; height: 30px; padding: 0 12px; border: 1px solid var(--gold); background: transparent; color: var(--gold); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.wt-keybtn:hover:not(:disabled) { background: var(--gold); color: var(--bg); }
.wt-keybtn:disabled { opacity: .6; cursor: progress; }
.wt-classified.just-opened { animation: classified-open 1.2s var(--ease) both; }
@keyframes classified-open { 0% { background-color: rgba(245, 197, 66, .45); } 100% { background-color: transparent; } }
.keyhole { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 4px; padding: 0; vertical-align: middle; border: 0; border-radius: 50%; background: none; color: var(--text-dim); cursor: pointer; transition: transform .2s, filter .3s; }
.keyhole svg { width: 100%; height: 100%; }
.keyhole .kh-plate { fill: var(--surface-2); stroke: var(--border); stroke-width: 1; transition: stroke .2s; }
.keyhole .kh-hole { fill: var(--bg); }
.keyhole:hover, .keyhole:focus-visible, .keyhole[aria-expanded="true"] { transform: scale(1.25); filter: drop-shadow(0 0 6px rgba(245, 197, 66, .7)); }
.keyhole:hover .kh-plate, .keyhole:focus-visible .kh-plate, .keyhole[aria-expanded="true"] .kh-plate { stroke: var(--gold); }
.keyhole:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.keyhole.is-known .kh-plate { stroke: var(--gold); }
.keyhole.is-known { animation: keyhole-glow 2.4s ease-in-out infinite alternate; }
@keyframes keyhole-glow { from { filter: drop-shadow(0 0 0 rgba(245, 197, 66, 0)); } to { filter: drop-shadow(0 0 7px rgba(245, 197, 66, .8)); } }
.keyhole.is-wrong .kh-plate { stroke: var(--danger); }
.lock-pop { position: fixed; z-index: 150; width: min(340px, calc(100vw - 24px)); padding: 16px; border: 1px solid var(--gold); background: var(--surface); box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .85), 0 0 30px rgba(245, 197, 66, .15); }
.lock-pop-title { display: block; color: var(--gold); margin-bottom: 6px; }
.lock-pop p { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.lock-pop-row { display: flex; }
.lock-pop input { flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-right: 0; background: var(--bg); color: var(--text-bright); font-family: var(--mono); font-size: 12px; }
.lock-pop input:focus { outline: none; border-color: var(--gold); }
.lock-pop button { flex: none; height: 38px; padding: 0 16px; border: 1px solid var(--gold); background: var(--gold); color: #0c0b09; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; }
.lock-pop button:disabled { opacity: .7; cursor: progress; }
.vgate { position: fixed; inset: 0; z-index: 300; overflow: hidden; pointer-events: all; background: rgba(0, 0, 0, 0); }
.vgate-door { position: absolute; top: 0; bottom: 0; width: 50%; overflow: hidden; transform: translateX(-100%); background:
  radial-gradient(circle, #4a4136 2.5px, transparent 3.5px) 22px 22px / 64px 64px,
  repeating-linear-gradient(0deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 6px),
  linear-gradient(90deg, #1a1714, #2a251f 60%, #1f1b17); box-shadow: inset 0 0 0 3px #0c0b09, inset 0 0 80px rgba(0, 0, 0, .7); }
.vgate-door.l { left: 0; border-right: 3px solid var(--gold); }
.vgate-door.r { right: 0; transform: translateX(100%); border-left: 3px solid var(--gold); background-position: 42px 22px, 0 0, 0 0; }
.vgate-bolt { position: absolute; width: 120px; height: 26px; background: linear-gradient(180deg, #8a7a5c, #c9b27a 45%, #6f6148); border: 1px solid #0c0b09; box-shadow: 0 4px 10px rgba(0, 0, 0, .6); }
.vgate-door.l .vgate-bolt { right: -50px; }
.vgate-door.r .vgate-bolt { left: -50px; }
.vgate-bolt:nth-child(1) { top: 18%; }
.vgate-bolt:nth-child(2) { top: calc(50% - 13px); }
.vgate-bolt:nth-child(3) { bottom: 18%; }
.vgate-wheel { position: absolute; left: 50%; top: 50%; width: min(42vmin, 320px); aspect-ratio: 1; opacity: 0; transform: translate(-50%, -50%); }
.vgate-wheel > svg:first-child { width: 100%; height: 100%; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .8)); }
.vgate-wheel .w-rim { fill: #24201b; stroke: var(--gold); stroke-width: 4; }
.vgate-wheel .w-ring { fill: none; stroke: #4a4136; stroke-width: 10; stroke-dasharray: 6 10; }
.vgate-wheel .w-spokes rect { fill: #c9b27a; }
.vgate-wheel .w-hub { fill: #1a1714; stroke: #c9b27a; stroke-width: 4; }
.vgate-wheel .w-hole { fill: #0c0b09; }
.vgate-key { position: absolute; left: 50%; top: 50%; width: 46%; opacity: 0; fill: #ff6a1a; filter: drop-shadow(0 0 14px rgba(255, 106, 26, .8)); transform-origin: 0 50%; }
.vgate-key .k-hole { fill: #24201b; }
.vgate-light { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, #fff 0%, #ffd9a8 18%, #ff6a1a 45%, #0c0b09 80%); transform-origin: 50% 50%; }
.vgate-text { position: absolute; left: 0; right: 0; top: calc(50% + min(21vmin, 160px) + 24px); margin: 0; text-align: center; opacity: 0; font-family: var(--mono); font-size: clamp(16px, 2.6vw, 28px); font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 18px rgba(245, 197, 66, .7); }
.vgate.is-calm { background: rgba(0, 0, 0, .9); }
.vgate.is-calm .vgate-door, .vgate.is-calm .vgate-wheel, .vgate.is-calm .vgate-light { display: none; }
.vgate.is-calm .vgate-text { top: 50%; opacity: 1; }
html.is-mobile .wt-classified .wt-keyform { display: flex; }
html.is-mobile .wt-keyform .diff-tag { display: none; }
@media (max-width: 900px) { .wt-keyform .diff-tag { display: none; } }
.lock-pop.is-valid { border-color: var(--gold); box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .85), 0 0 0 2px var(--gold), 0 0 40px color-mix(in srgb, var(--gold) 45%, transparent); }
.lock-pop.is-valid input { border-color: var(--gold); color: var(--gold); }
.lock-pop.is-valid button { animation: turn-pulse 1s ease-in-out infinite alternate; }
@keyframes turn-pulse { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--gold) 60%, transparent); } to { box-shadow: 0 0 18px 4px color-mix(in srgb, var(--gold) 60%, transparent); } }
.shockwave { position: fixed; z-index: 260; width: 40px; height: 40px; border-radius: 50%; pointer-events: none; border: 3px solid var(--gold); box-shadow: 0 0 30px var(--gold), inset 0 0 30px color-mix(in srgb, var(--gold) 50%, transparent); }
.shockwave.echo { border-width: 1.5px; opacity: .7; }
.shock-flash { position: fixed; inset: 0; z-index: 259; pointer-events: none; mix-blend-mode: screen; }
html[data-theme="light"] .shock-flash { mix-blend-mode: multiply; }
.glitch-bubble { position: fixed; z-index: 280; width: min(360px, calc(100vw - 24px)); padding: 18px 18px 16px; border: 1px solid var(--accent); background: var(--surface); color: var(--text-bright); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85), 4px 0 0 rgba(255, 40, 80, .35), -4px 0 0 rgba(40, 220, 255, .35); animation: gb-jitter 2.4s steps(1) infinite; }
.glitch-bubble::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; margin-left: -7px; background: var(--surface); border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); transform: rotate(45deg); }
.gb-cracks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.gb-crack, .pc-crack { fill: none; stroke: var(--text-bright); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: bevel; filter: drop-shadow(0 0 2px var(--accent)); }
.gb-crack.thin, .pc-crack.thin { stroke-width: 1; opacity: .8; }
.gb-text { position: relative; margin: 0 0 14px; font-family: var(--mono); font-size: 16px; font-weight: 600; line-height: 1.45; }
.gb-text::before, .gb-text::after { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: .75; }
.gb-text::before { color: rgba(255, 40, 80, .9); animation: gb-split 1.6s steps(2) infinite; }
.gb-text::after { color: rgba(40, 220, 255, .9); animation: gb-split 1.3s steps(2) infinite reverse; }
.gb-actions { display: flex; gap: 10px; align-items: center; }
.gb-actions.swapped { flex-direction: row-reverse; justify-content: flex-end; }
.gb-btn { height: 36px; padding: 0 18px; border: 1px solid var(--accent); background: transparent; color: var(--atext); font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: transform .25s var(--ease), background .2s; }
.gb-btn:hover, .gb-btn:focus-visible { background: var(--accent); color: var(--bg); outline: none; }
.gb-yes { transform: scale(var(--grow, 1)); transform-origin: left center; }
.gb-no { transform: scale(var(--shrink, 1)); }
.glitch-bubble[data-level="2"], .glitch-bubble[data-level="3"] { animation-duration: 1.2s; }
.glitch-bubble[data-level="4"], .glitch-bubble[data-level="5"] { animation-duration: .6s; border-color: var(--danger); }
.glitch-bubble[data-level="6"] { animation-duration: .25s; border-color: var(--danger); }
.glitch-bubble[data-level="4"] .gb-text::before, .glitch-bubble[data-level="5"] .gb-text::before, .glitch-bubble[data-level="6"] .gb-text::before { animation-duration: .4s; }
@keyframes gb-jitter {
  0%, 86%, 100% { transform: none; clip-path: none; }
  88% { transform: translate(-3px, 1px) skewX(4deg); clip-path: inset(10% 0 55% 0); }
  91% { transform: translate(3px, -1px); clip-path: inset(50% 0 10% 0); }
  94% { transform: translate(-1px, 0) skewX(-3deg); clip-path: none; }
}
@keyframes gb-split { 0% { transform: translate(-2px, 0); clip-path: inset(0 0 60% 0); } 50% { transform: translate(2px, 0); clip-path: inset(40% 0 0 0); } 100% { transform: translate(-1px, 0); clip-path: inset(20% 0 30% 0); } }
.gb-shard { position: fixed; z-index: 281; display: block; pointer-events: none; background: linear-gradient(135deg, var(--text-bright), color-mix(in srgb, var(--accent) 60%, transparent)); }
.page-cracks { position: fixed; inset: 0; z-index: 270; pointer-events: all; background: rgba(0, 0, 0, calc(var(--fracture, 0) * .35)); transition: background .4s; }
html[data-theme="light"] .page-cracks { background: rgba(60, 40, 20, calc(var(--fracture, 0) * .2)); }
html[data-theme="light"] .pc-crack, html[data-theme="light"] .gb-crack { stroke: #2a241c; filter: drop-shadow(0 0 2px rgba(255, 255, 255, .9)); }
.page-cracks svg { width: 100%; height: 100%; }
html[data-theme="light"] .vgate-door { background:
  radial-gradient(circle, #9a8f7c 2.5px, transparent 3.5px) 22px 22px / 64px 64px,
  repeating-linear-gradient(0deg, rgba(255, 255, 255, .25) 0 2px, transparent 2px 6px),
  linear-gradient(90deg, #cfc6b5, #e6dfd1 60%, #d6cdbc); box-shadow: inset 0 0 0 3px #8a7d66, inset 0 0 80px rgba(80, 60, 30, .35); }
html[data-theme="light"] .vgate-door.r { background-position: 42px 22px, 0 0, 0 0; }
html[data-theme="light"] .vgate-wheel .w-rim { fill: #e6dfd1; }
html[data-theme="light"] .vgate-wheel .w-hub { fill: #cfc6b5; }
html[data-theme="light"] .vgate-text { color: #8a5a00; text-shadow: 0 0 18px rgba(255, 255, 255, .9); }
.credits { --cr-bg: #030503; --cr-fg: #7dff8a; --cr-dim: #4a9a55; --cr-accent: #ff6a1a; position: fixed; inset: 0; z-index: 400; overflow: hidden; background: var(--cr-bg); color: var(--cr-fg); font-family: 'VT323', var(--binary); text-align: center; image-rendering: pixelated; }
html[data-theme="light"] .credits { --cr-bg: #efe9dc; --cr-fg: #1d4d23; --cr-dim: #5c7d60; --cr-accent: #c4581b; }
.cr-scan { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(0deg, color-mix(in srgb, var(--cr-fg) 9%, transparent) 0 1px, transparent 1px 3px); animation: cr-flicker 3s steps(2) infinite; }
@keyframes cr-flicker { 50% { opacity: .75; } }
.cr-viewport { position: absolute; inset: 0; overflow: hidden; -webkit-mask: linear-gradient(transparent, #000 14%, #000 86%, transparent); mask: linear-gradient(transparent, #000 14%, #000 86%, transparent); }
.cr-roll { width: min(720px, calc(100vw - 32px)); margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 28px; padding-bottom: 20vh; }
.cr-roll h2 { margin: 0; font-family: 'Silkscreen', var(--binary); font-size: clamp(26px, 4.4vw, 46px); font-weight: 700; line-height: 1.1; color: var(--cr-fg); text-shadow: 3px 3px 0 color-mix(in srgb, var(--cr-fg) 25%, transparent); }
.cr-roll .cr-big { color: var(--cr-accent); font-size: clamp(30px, 5.6vw, 60px); text-shadow: 4px 4px 0 color-mix(in srgb, var(--cr-accent) 30%, transparent); }
.cr-roll p { margin: 0; font-size: clamp(20px, 2.4vw, 28px); line-height: 1.25; }
.cr-sys { color: var(--cr-dim); letter-spacing: .1em; }
.cr-pills { display: flex; gap: 48px; justify-content: center; }
.cr-pill { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 18px; color: var(--cr-dim); }
.cr-pill svg { width: 132px; height: 66px; }
.cr-pill.blue { opacity: .45; filter: grayscale(.4); }
.cr-pill.red svg { filter: drop-shadow(0 0 12px rgba(255, 43, 43, .7)); animation: pill-pulse 1.4s steps(2) infinite; }
.cr-pill.red figcaption { color: var(--cr-fg); }
@keyframes pill-pulse { 50% { transform: translateY(-4px); } }
.cr-cast { margin: 0; display: grid; gap: 14px; }
.cr-cast div { display: grid; gap: 2px; }
.cr-cast dt { font-family: 'Silkscreen', var(--binary); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--cr-dim); }
.cr-cast dd { margin: 0; font-size: 26px; }
.cr-fine { color: var(--cr-dim); font-size: 18px !important; }
.cr-end { color: var(--cr-accent) !important; animation: cr-flicker 1s steps(2) infinite; }
.cr-skip { position: absolute; right: 20px; bottom: 20px; z-index: 3; padding: 8px 14px; border: 2px solid var(--cr-fg); background: var(--cr-bg); color: var(--cr-fg); font-family: 'Silkscreen', var(--binary); font-size: 12px; letter-spacing: .1em; cursor: pointer; box-shadow: 3px 3px 0 var(--cr-dim); }
.cr-skip:hover, .cr-skip:focus-visible { background: var(--cr-fg); color: var(--cr-bg); outline: none; }
.credits.is-static .cr-viewport { position: static; height: 100%; overflow-y: auto; -webkit-mask: none; mask: none; padding: 10vh 0; }
@media (prefers-reduced-motion: reduce) {
  .glitch-bubble, .gb-text::before, .gb-text::after, .cr-scan, .cr-pill.red svg, .cr-end, .lock-pop.is-valid button { animation: none !important; }
}

/* accessibility: skip link, and dark text on orange in light theme (contrast 4.5:1+) */
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 300; padding: 10px 16px; background: var(--accent); color: #0b0a09; font-family: var(--mono); font-size: 13px; font-weight: 600; text-decoration: none; transition: top .2s; }
.skip-link:focus, .skip-link:focus-visible { top: 12px; outline: 2px solid var(--text-bright); outline-offset: 2px; }
#main:focus { outline: none; }
html[data-theme="light"] .btn.solid, html[data-theme="light"] .chip.on { color: #0b0a09; }
.wu-meta-line { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; color: var(--text-dim); }
.wu p a, .wu li a, .footer a, .foot a { text-decoration: underline; text-underline-offset: 3px; }
