/* ==========================================================================
   Chris Cross — Portfolio
   One scrolling page. Light grey/white bands; contents + contact in black.
   ========================================================================== */

:root {
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --gutter: clamp(20px, 6vw, 96px);
  /* the papers keep their original faces: Times New Roman / Arial, with metric-compatible Tinos / Arimo as fallbacks */
  --doc-serif: 'Times New Roman', Tinos, Times, 'Liberation Serif', serif;
  --doc-sans: Arial, Arimo, 'Liberation Sans', Helvetica, sans-serif;
  --paper: #ffffff;
}
[data-theme="dark"] { --paper: #ecece8; }

/* Theme tokens. Each band is .light or .dark; in dark mode the light bands turn charcoal
   and the black bands (contents, skills, contact) stay pure black. */
.light {
  --bg: #efefec; --bg-2: #f7f7f5;
  --ink: #0a0a0a; --ink-2: #262626; --muted: #5c5c56; --faint: #9a9a94;
  --line: rgba(0, 0, 0, 0.13); --line-2: rgba(0, 0, 0, 0.32);
  --glass: rgba(255, 255, 255, 0.55); --glass-2: rgba(247, 247, 245, 0.88); --glass-hi: rgba(255, 255, 255, 0.85);
}
.light.alt { --bg: #f7f7f5; --bg-2: #efefec; }
.dark, [data-theme="dark"] .light {
  --bg: #000000; --bg-2: #0b0b0b;
  --ink: #f4f4f2; --ink-2: #cfcfca; --muted: #93938d; --faint: #4f4f4b;
  --line: rgba(255, 255, 255, 0.14); --line-2: rgba(255, 255, 255, 0.34);
  --glass: rgba(24, 24, 24, 0.55); --glass-2: rgba(16, 16, 16, 0.85); --glass-hi: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .light { --bg: #0d0d0d; --bg-2: #141414; }
[data-theme="dark"] .light.alt { --bg: #121212; --bg-2: #0d0d0d; }
[data-theme="dark"] .light .pcb-side { filter: invert(1); }
[data-theme="dark"] .pdf { border-color: rgba(255, 255, 255, .2); }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #efefec; color-scheme: light; -webkit-text-size-adjust: 100%; }
html[data-theme="dark"] { background: #0d0d0d; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img, svg { max-width: 100%; }
::selection { background: #0a0a0a; color: #f2f2f2; }
.dark ::selection, [data-theme="dark"] ::selection { background: #f2f2f2; color: #0a0a0a; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
code { font-family: var(--mono); font-size: .88em; }

/* ---------- Bands ---------- */
.band {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  padding: clamp(110px, 17vh, 190px) 0 clamp(90px, 14vh, 160px);
}
.band.tight { padding-top: clamp(70px, 10vh, 110px); }
.wrap { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }

.title {
  margin: 0 0 clamp(36px, 6vh, 70px);
  font-weight: 250;
  font-size: clamp(3rem, 9vw, 8.5rem);
  line-height: .92;
  letter-spacing: -0.05em;
}
.lede { margin: 0 0 clamp(40px, 6vh, 70px); max-width: 60ch; color: var(--ink-2); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; }
.lede strong { color: var(--ink); font-weight: 500; }
.lede:has(+ .lede) { margin-bottom: 1em; }
.tagline { margin: 0 0 26px; max-width: 46ch; color: var(--ink-2); font-weight: 300; font-size: clamp(1.15rem, 1.8vw, 1.5rem); line-height: 1.3; letter-spacing: -0.01em; }

.sub {
  margin: 0 0 14px;
  font-weight: 300;
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.sub-sm { margin: 0 0 22px; font-weight: 400; font-size: clamp(1.4rem, 2.2vw, 1.9rem); letter-spacing: -0.02em; }
.part + .part { margin-top: clamp(70px, 11vh, 130px); }

/* ---------- Small pieces ---------- */
.label { font: 400 11.5px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tbd { display: inline-block; font: 400 12px/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tbd::before { content: ''; display: inline-block; width: 18px; height: 1px; margin: 0 10px 0 0; vertical-align: middle; background: currentColor; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: clamp(30px, 5vh, 50px); }
.chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px;
  border: 1px solid var(--line-2); font: 400 11px/1 var(--mono); letter-spacing: .05em; color: var(--ink-2);
}
.prose { max-width: 68ch; color: var(--ink-2); }
.prose p { margin: 0 0 1.1em; }
.prose strong { color: var(--ink); font-weight: 500; }

.todo {
  display: block; margin: 0 0 1em; padding: 14px 16px;
  border: 1px dashed var(--line-2);
  font: 400 13px/1.6 var(--mono); color: var(--ink-2);
}
.todo::before { content: 'TODO · '; color: var(--ink); font-weight: 500; letter-spacing: .1em; }
.todo.inline { display: inline; padding: 1px 6px; margin: 0; font-size: 12px; }
.todo.inline::before { content: 'TODO: '; }

.link {
  display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 20px;
  border: 1px solid var(--line-2);
  font: 400 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  transition: background .25s, color .25s, border-color .25s;
}
button.link { background: none; color: inherit; cursor: pointer; }
.link:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.links { display: flex; flex-wrap: wrap; gap: 10px; }

/* Grid of bordered cells (facts, contact, index) */
.cells { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); border: 1px solid var(--line); }
.cells > * { display: block; padding: 22px 22px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; text-decoration: none; min-width: 0; }
.cells a { transition: background .25s; }
.cells a:hover { background: var(--line); }
.cells .label { display: block; margin-bottom: 10px; }
.cells b { display: block; font-weight: 300; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 4px; overflow-wrap: anywhere; }
.cells p { margin: 0; color: var(--ink-2); font-size: 15px; }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); border: 1px solid var(--line); margin-top: 30px; }
.spec { padding: 18px 18px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.spec b { display: block; font: 200 clamp(28px, 3vw, 40px)/1 var(--sans); letter-spacing: -0.03em; color: var(--ink); }
.spec span { display: block; margin-top: 10px; font: 400 10px/1.5 var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

/* Two-column: text + figure */
.split { display: grid; gap: clamp(30px, 4vw, 70px); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .split { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); } }
.split > .fig { align-self: start; }
@media (min-width: 1000px) { .fig.sticky { position: sticky; top: 100px; } }

/* Field list for the rubric items */
.fields { margin: 0; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0 22px; border-top: 1px solid var(--line); }
.field:first-child { padding-top: 0; border-top: 0; }
@media (min-width: 700px) { .field { grid-template-columns: 170px minmax(0, 1fr); gap: 0; } }
.field dt { font: 500 12px/1.9 var(--mono); letter-spacing: .14em; color: var(--ink); text-transform: uppercase; }
.field dd { margin: 0; color: var(--ink-2); }
.field dd p { margin: 0 0 .8em; }
.field dd p:last-child { margin: 0; }
.field ul { margin: 0; padding: 0; list-style: none; }
.field li { position: relative; padding-left: 20px; margin: 0 0 .5em; }
.field li::before { content: ''; position: absolute; left: 0; top: .8em; width: 10px; height: 1px; background: var(--ink-2); }
.soft { margin: .6em 0 0; color: var(--muted); font-size: 15px; }
.soft b { font: 400 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-right: 8px; }

/* Figures */
.fig { margin: 0; border: 1px solid var(--line); background: var(--bg-2); }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { padding: 10px 14px; border-top: 1px solid var(--line); font: 400 10px/1.5 var(--mono); letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }

.sch { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.sch .thin { stroke-width: .7; stroke: var(--ink-2); }
.sch .dim { stroke: var(--muted); stroke-width: .6; }
.sch .dash { stroke-dasharray: 4 4; }
.sch .fill { fill: var(--ink); stroke: none; }
.sch text { fill: var(--ink); stroke: none; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.sch text.small { font-size: 9px; fill: var(--muted); }
.sch text.big { font-family: var(--sans); font-weight: 300; font-size: 20px; letter-spacing: 0; }

/* ---------- Papers (reflections, ethics) ----------
   A .doc is page 1 on a small stack of sheets; js/papers.js opens the whole paper in the reader.
   Pages are sized in cqw against an 816 px (8.5 in) page: 1 in margins, 12 pt = 1.9608cqw. The sheet is therefore
   an exact miniature of the page in the reader, which is what lets the sheet grow into it. */
.doc { position: relative; isolation: isolate; width: 100%; max-width: 460px; align-self: start; }
@media (min-width: 1000px) { .doc { justify-self: end; } }
.doc::before, .doc::after {
  content: ''; position: absolute; inset: 0; z-index: -1; background: var(--paper);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 10px 24px -14px rgba(0, 0, 0, .35);
  transition: transform .7s var(--ease);
}
.doc::before { transform: translate(-7px, 7px) rotate(-2.4deg); }
.doc::after { transform: translate(6px, 4px) rotate(1.6deg); }
.doc:hover::before, .doc:has(:focus-visible)::before { transform: translate(-16px, 10px) rotate(-4.6deg); }
.doc:hover::after, .doc:has(:focus-visible)::after { transform: translate(14px, 6px) rotate(3.2deg); }
.sheet {
  position: relative; aspect-ratio: 8.5 / 11; background: var(--paper);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .04), 0 22px 44px -20px rgba(0, 0, 0, .4);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.doc:hover .sheet, .doc:has(:focus-visible) .sheet {
  transform: translateY(-8px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .04), 0 36px 60px -24px rgba(0, 0, 0, .5);
}
.sheet.lifted { visibility: hidden; }
.sheet-pg { position: absolute; inset: 0; overflow: hidden; container-type: inline-size; pointer-events: none; user-select: none; }
.sheet-pg .pg { height: 100%; }
.sheet-open { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.sheet-open:focus-visible { outline: 1px solid var(--ink); outline-offset: 8px; }
.sheet-open span {
  position: absolute; right: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 12px;
  background: #0a0a0a; color: #fff; font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase;
  opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s var(--ease);
}
.sheet-open i { font-style: normal; }
.doc:hover .sheet-open span, .sheet-open:focus-visible span { opacity: 1; transform: none; }
@media (hover: none) { .sheet-open span { opacity: 1; transform: none; } }

.pg {
  --m: 11.765cqw;                                   /* 1 in */
  position: relative; min-width: 0; padding: var(--m);
  font-size: 16px; font-size: 1.9608cqw;            /* 12 pt */
  color: #000; background: var(--paper); text-align: left; overflow-wrap: break-word;
}
.pg p, .pg h4 { margin: 0; }
.pg-hd { position: absolute; top: calc(var(--m) / 2); right: var(--m); font: 400 .9167em/1.3227 var(--doc-sans); text-align: right; }
.pg.mla { font-family: var(--doc-serif); line-height: 2.3; }  /* Google Docs "double" in Times */
.pg.mla p { text-indent: 3em; }
.pg.mla p.c, .pg.mla .mla-hd, .pg.mla .wc { text-indent: 0; }
.pg.mla .pg-t { font-size: 1em; font-weight: 400; text-align: center; }
.pg.mla .wc { margin-bottom: 1em; }
.pg.mla a { color: #1155cc; }
.pg.std { font-family: var(--doc-sans); }
.pg.std p, .pg.std .pg-t { font-size: .9167em; line-height: 1.3227; margin-bottom: 1.0909em; }  /* 11 pt, 1.15 spacing, 12 pt after */
.pg.std .pg-t { margin-top: 1.82em; font-weight: 700; text-align: center; }

/* Reader: a modal <dialog> over a dimmed page; the bar stays on top while the pages scroll */
.reader {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: #fff; overflow: hidden;
}
.reader::backdrop { background: transparent; }
.reader::before {
  content: ''; position: absolute; inset: 0;
  background: rgba(8, 8, 8, .66); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .5s var(--ease);
}
.reader.on::before { opacity: 1; }
.rd-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 90px; }
.rd-bar {
  position: sticky; top: 14px; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  width: min(1000px, 100%); height: 60px; margin: 0 auto 30px; padding: 0 9px 0 20px;
  background: rgba(24, 24, 24, .62); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 34px -16px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(-10px); transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.reader.on .rd-bar { opacity: 1; transform: none; }
.rd-id { flex: 1; min-width: 0; }
.rd-id span, .rd-id b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-id span { font: 400 10px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.rd-id b { margin-top: 3px; font: 500 15px/1.25 var(--sans); letter-spacing: -0.01em; }
.rd-count { margin-right: 10px; font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rd-dl {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 11px;
  background: #fff; color: #000; font: 500 14px/1 var(--sans); text-decoration: none; white-space: nowrap; transition: background .2s;
}
.rd-dl:hover { background: #dcdcd8; }
.rd-x {
  display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 11px;
  background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background .2s;
}
.rd-x:hover { background: rgba(255, 255, 255, .2); }
.rd-x:focus:not(:focus-visible) { outline: none; }
.rd-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rd-pages { display: grid; gap: 24px; width: min(816px, 100%); margin: 0 auto; container-type: inline-size; }
.rd-pages .pg {
  --m: max(22px, 11.765cqw);
  aspect-ratio: 8.5 / 11;                           /* a minimum: a page grows if the text reflows on a phone */
  font-size: clamp(13.5px, 1.9608cqw, 16px);
  transform-origin: 0 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08), 0 30px 70px -24px rgba(0, 0, 0, .75);
}
@media (max-width: 640px) {
  .rd-scroll { padding: 10px 10px 70px; }
  .rd-bar { top: 10px; height: 56px; padding-left: 14px; margin-bottom: 18px; }
  .rd-count, .rd-dl .w { display: none; }
  .rd-dl { padding: 0 13px; }
  .rd-pages { gap: 14px; }
  .rd-pages .pg { --m: 26px; padding-top: 16px; }
  .rd-pages .pg-hd { position: static; margin-bottom: 14px; }   /* margins too thin to hold the running header */
}

/* ---------- Motion ---------- */
@keyframes drawOn { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.rv { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.rv.in { opacity: 1; transform: none; }
.rv-draw .draw-sc { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rv-draw.in .draw-sc { animation: drawOn 2.2s cubic-bezier(.55, 0, .2, 1) forwards; }

/* ---------- Fixed chrome (inverts over light and black bands) ---------- */
.frame {
  position: fixed; inset: 12px; z-index: 60; pointer-events: none;
  border: 1px solid #fff; mix-blend-mode: difference; opacity: .3;
}
@media (min-width: 720px) { .frame { inset: 18px; } }

.nav {
  /* light glass over light bands; .on-dark (set by js/common.js) swaps to dark glass over black ones */
  --n-bg: rgba(255, 255, 255, .5); --n-ink: #0a0a0a; --n-ink-2: rgba(10, 10, 10, .78);
  --n-line: rgba(0, 0, 0, .1); --n-hi: rgba(255, 255, 255, .9); --n-pill: rgba(0, 0, 0, .07); --n-shadow: rgba(0, 0, 0, .18);
  position: fixed; z-index: 70; top: 26px; left: 50%; transform: translateX(-50%);
  width: min(1280px, calc(100% - 52px)); height: 58px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 8px 0 22px;
  color: var(--n-ink);
  background: var(--n-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--n-line); border-radius: 16px;
  box-shadow: inset 0 1px 0 var(--n-hi), 0 14px 34px -16px var(--n-shadow);
  transition: background .45s ease, color .45s ease, border-color .45s ease, box-shadow .45s ease;
}
.nav.on-dark {
  --n-bg: rgba(18, 18, 18, .5); --n-ink: #fff; --n-ink-2: rgba(255, 255, 255, .84);
  --n-line: rgba(255, 255, 255, .14); --n-hi: rgba(255, 255, 255, .1); --n-pill: rgba(255, 255, 255, .14); --n-shadow: rgba(0, 0, 0, .6);
}
.nav a { text-decoration: none; }
.nav .brand { font: 600 16px/1 var(--sans); letter-spacing: -0.02em; white-space: nowrap; color: var(--n-ink); }
.nav ul { position: relative; display: flex; align-items: center; gap: 2px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.nav ul a {
  position: relative; z-index: 1; display: block; padding: 10px 12px; border-radius: 10px;
  font: 500 14.5px/1 var(--sans); letter-spacing: -0.01em; color: var(--n-ink-2);
  transition: color .25s;
}
.nav ul a:hover, .nav ul a.cur { color: var(--n-ink); }
.nav .pill {
  position: absolute; left: 0; top: 50%; height: 36px; margin-top: -18px; width: 0; z-index: 0;
  border-radius: 10px; background: var(--n-pill); box-shadow: inset 0 0 0 1px var(--n-line);
  opacity: 0; transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s, background .45s;
}
.nav .pill.on { opacity: 1; }
.nav-end { display: flex; align-items: center; gap: 6px; }
.theme-btn {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 11px;
  background: transparent; color: var(--n-ink); cursor: pointer; transition: background .2s;
}
.theme-btn:hover { background: var(--n-pill); }
.theme-btn:focus:not(:focus-visible) { outline: none; }
.theme-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-btn .sun, [data-theme="dark"] .theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: block; }
.nav-menu { display: none; }
@media (max-width: 1180px) {
  .nav { padding-right: 6px; }
  .nav-menu {
    display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border: 0; border-radius: 11px;
    background: var(--n-pill); color: var(--n-ink); font: 500 14.5px/1 var(--sans); cursor: pointer;
  }
  .nav-menu i, .nav-menu i::before { display: block; width: 14px; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
  .nav-menu i { position: relative; transform: translateY(-3px); }
  .nav-menu i::before { content: ''; position: absolute; top: 6px; }
  .nav.open .nav-menu i { transform: translateY(0) rotate(45deg); }
  .nav.open .nav-menu i::before { transform: translateY(-6px) rotate(-90deg); }
  .nav ul {
    position: absolute; top: calc(100% + 8px); right: 0; width: min(300px, calc(100vw - 52px));
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px;
    background: var(--n-bg); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--n-line); border-radius: 16px; box-shadow: inset 0 1px 0 var(--n-hi), 0 20px 40px -16px var(--n-shadow);
    opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav.open ul { opacity: 1; visibility: visible; transform: none; }
  .nav ul a { padding: 14px 14px; font-size: 16px; }
  .nav ul a.cur { background: var(--n-pill); }
  .nav .pill { display: none; }
}
@media (max-width: 720px) { .nav { top: 14px; width: calc(100% - 28px); height: 54px; padding-left: 18px; } }

/* ---------- Faint PCB traces on the left of each band ---------- */
.pcb-side {
  position: absolute; left: 0; top: 0; z-index: 0;
  width: min(460px, 38vw); height: min(100%, 100vh);
  pointer-events: none; opacity: .09;
  -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 30%, transparent 100%);
}
@media (max-width: 760px) { .pcb-side { opacity: .06; width: 70vw; } }
.pcb-root .cap, .pcb-root .mark, .pcb-root .deco, .pcb-root .chipbody { transform-box: fill-box; transform-origin: center; }

/* ---------- Skills (black, spotlit) ---------- */
.skills { isolation: isolate; }
.skills-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.skills-bg::before, .skills-bg::after { content: ''; position: absolute; inset: 0; }
.skills-bg::before {
  background: radial-gradient(ellipse 40% 55% at 62% -8%, rgba(255, 255, 255, .2), rgba(255, 255, 255, .04) 55%, transparent 75%), #000;
}
.skills-bg::after {
  background:
    linear-gradient(90deg, #000 0%, rgba(0, 0, 0, .9) 30%, rgba(0, 0, 0, .55) 62%, rgba(0, 0, 0, .35) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, transparent 25%, transparent 70%, #000 100%);
}
.skills-bg .dust { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; mix-blend-mode: screen; }
.skills .lede { color: var(--ink-2); }
.sk-table { border-top: 1px solid rgba(255, 255, 255, .22); }
.sk-row { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid rgba(255, 255, 255, .22); }
@media (min-width: 900px) { .sk-row { grid-template-columns: 250px minmax(0, 1fr); } }
.sk-h { display: flex; gap: 14px; margin: 0; padding: 24px 0 18px; font: 500 12px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #fff; }
.sk-h span { color: #77776f; }
@media (min-width: 900px) { .sk-h { padding: 30px 24px 0 0; border-right: 1px solid rgba(255, 255, 255, .22); } }
.sk-cells { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 -1px; padding: 0; list-style: none; }
/* fixed column counts; the last cell stretches so no row ends in an empty gap */
@media (min-width: 440px) {
  .sk-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sk-cells li:last-child:nth-child(2n+1) { grid-column: span 2; }
}
@media (min-width: 700px) {
  .sk-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sk-cells li:last-child:nth-child(2n+1) { grid-column: auto; }
  .sk-cells li:last-child:nth-child(3n+1) { grid-column: span 3; }
  .sk-cells li:last-child:nth-child(3n+2) { grid-column: span 2; }
}
@media (min-width: 1240px) {
  .sk-cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sk-cells li:last-child:nth-child(3n+1), .sk-cells li:last-child:nth-child(3n+2) { grid-column: auto; }
  .sk-cells li:last-child:nth-child(4n+1) { grid-column: span 4; }
  .sk-cells li:last-child:nth-child(4n+2) { grid-column: span 3; }
  .sk-cells li:last-child:nth-child(4n+3) { grid-column: span 2; }
}
.sk-cells li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 18px; align-items: center;
  min-height: 104px; padding: 22px 20px 26px; margin: 0 -1px 0 0;
  border-right: 1px solid rgba(255, 255, 255, .12); border-bottom: 1px solid rgba(255, 255, 255, .12);
  perspective: 560px;
  transition: background .3s;
}
.sk-cells li:hover { background: rgba(255, 255, 255, .05); }
.sk-cells .fav { grid-row: 1 / span 2; }
.sk-cells b { align-self: end; font: 500 16px/1.25 var(--sans); letter-spacing: -0.01em; color: #fff; }
.sk-cells small { align-self: start; margin-top: 3px; font: 400 11px/1.4 var(--mono); letter-spacing: .06em; color: #93938d; }

/* 3D favicons: a key-cap with a lit top edge, stacked side walls for thickness and a cast shadow.
   js/skills.js tilts each one toward the pointer (--rx / --ry) and slides the sheen (--mx / --my). */
.fav {
  --rx: 0deg; --ry: 0deg; --lift: 0px; --mx: 32%; --my: 12%;
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
  color: #fff; font: 700 15px/1 var(--sans); letter-spacing: -0.04em;
  background:
    radial-gradient(130% 100% at var(--mx) var(--my), rgba(255, 255, 255, .2), transparent 55%),
    linear-gradient(160deg, #2b2b2b 0%, #151515 55%, #0a0a0a 100%);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .6),
    0 1px 0 #3a3a3a, 0 2px 0 #303030, 0 3px 0 #272727, 0 4px 0 #1f1f1f, 0 5px 0 #171717, 0 6px 0 #101010,
    0 16px 20px -6px rgba(0, 0, 0, .95);
  transform: translateY(calc(var(--lift) * -1)) rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.fav::after {   /* gloss on the upper half */
  content: ''; position: absolute; inset: 1px 1px 52% 1px; border-radius: 9px 9px 40% 40% / 9px 9px 8px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.fav svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transform: translateZ(12px); filter: drop-shadow(0 1px 0 #000); }
/* real logos: a white key-cap, logo forced to greyscale so the grid stays black and white */
.fav.logo {
  padding: 7px; border-color: #fff;
  background:
    radial-gradient(130% 100% at var(--mx) var(--my), #fff, transparent 60%),
    linear-gradient(160deg, #ffffff 0%, #e4e4e0 55%, #c9c9c4 100%);
  box-shadow:
    inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .2),
    0 1px 0 #b9b9b4, 0 2px 0 #a2a29d, 0 3px 0 #8b8b86, 0 4px 0 #74746f, 0 5px 0 #5d5d59, 0 6px 0 #464643,
    0 16px 20px -6px rgba(0, 0, 0, .95), 0 0 24px -8px rgba(255, 255, 255, .35);
}
.fav.logo::after { background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); }
.fav.logo.wide { width: 72px; padding: 5px 7px; }
.fav.logo img { display: block; width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) contrast(1.15); transform: translateZ(12px); }
.sk-cells li:hover .fav { --lift: 6px; box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(0, 0, 0, .6),
    0 1px 0 #3a3a3a, 0 2px 0 #303030, 0 3px 0 #272727, 0 4px 0 #1f1f1f, 0 5px 0 #171717, 0 6px 0 #101010,
    0 26px 26px -8px rgba(0, 0, 0, .95); }
.sk-cells li:hover .fav.logo { box-shadow:
    inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .2),
    0 1px 0 #b9b9b4, 0 2px 0 #a2a29d, 0 3px 0 #8b8b86, 0 4px 0 #74746f, 0 5px 0 #5d5d59, 0 6px 0 #464643,
    0 26px 26px -8px rgba(0, 0, 0, .95), 0 0 30px -6px rgba(255, 255, 255, .45); }
@media (prefers-reduced-motion: reduce) { .fav { transform: none !important; } }

/* ---------- Contact (black and white) ---------- */
.contact { isolation: isolate; padding-top: clamp(120px, 20vh, 220px); }
.contact-ascii { position: absolute; z-index: 0; top: 0; right: 0; left: clamp(460px, 50%, 760px); height: 100%; pointer-events: none; }
.contact-ascii canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 980px) { .contact-ascii { left: 0; height: 640px; opacity: .45; } }
.contact .wrap > * { max-width: min(640px, 100%); }
@media (min-width: 981px) { .contact .wrap > * { max-width: min(640px, 46vw); } }
.contact .wrap > .foot { max-width: none; }
.kicker { margin: 0 0 28px; font: 400 12px/1 var(--mono); letter-spacing: .24em; text-transform: uppercase; color: #8a8a86; }
.contact-h { margin: 0; max-width: 14ch; font-weight: 300; font-size: clamp(2.6rem, 7vw, 6.8rem); line-height: .98; letter-spacing: -0.045em; color: #fff; }
.contact-sub { margin: 28px 0 clamp(56px, 9vh, 96px); max-width: 46ch; font-size: clamp(17px, 1.4vw, 20px); color: #b8b8b4; }
.ct-cells { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid rgba(255, 255, 255, .22); }
.ct-cells a {
  position: relative; display: block; padding: 26px 56px 30px 0; min-width: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .22); text-decoration: none; color: #fff;
  background: rgba(0, 0, 0, .78);
  transition: background .35s var(--ease), color .35s var(--ease), padding .35s var(--ease);
}
.ct-cells .label { display: block; margin-bottom: 14px; color: #8a8a86; }
.ct-cells b {
  display: block; font-weight: 300; font-size: clamp(20px, 2.3vw, 34px); line-height: 1.15; letter-spacing: -0.025em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-cells i { position: absolute; right: 18px; top: 26px; font: 400 18px/1 var(--sans); font-style: normal; color: #8a8a86; transition: transform .35s var(--ease), color .35s; }
.ct-cells a:hover, .ct-cells a:focus-visible { background: #fff; color: #000; padding-left: 22px; }
.ct-cells a:hover .label, .ct-cells a:focus-visible .label { color: #555; }
.ct-cells a:hover i, .ct-cells a:focus-visible i { color: #000; transform: translate(3px, -3px); }
@media (max-width: 420px) { .ct-cells b { font-size: clamp(17px, 5.6vw, 22px); } }
.ct-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.btn-solid, .btn-line {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 26px;
  font: 500 15px/1 var(--sans); letter-spacing: -0.01em; text-decoration: none;
  transition: background .25s, color .25s, border-color .25s;
}
.btn-solid { background: #fff; color: #000; border: 1px solid #fff; }
.btn-solid:hover { background: transparent; color: #fff; }
.btn-line { border: 1px solid rgba(255, 255, 255, .35); color: #fff; }
.btn-line:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-solid span, .btn-line span { transition: transform .3s var(--ease); }
.btn-solid:hover span { transform: translateY(2px); }
.btn-line:hover span { transform: translateX(3px); }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-top: clamp(80px, 12vh, 140px); padding-top: 22px; border-top: 1px solid var(--line);
  font: 400 11px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .rv { opacity: 1; transform: none; }
  .rv-draw .draw-sc { stroke-dasharray: none; stroke-dashoffset: 0; }
}
