/* styles.css - tacoroumen.nl 2.0
   Colours: cool slate canvas + electric blue accent (carried over from v1).
   Shape rule: buttons + chips 9px, cards 14px, avatars/icon buttons round. */

/* self-hosted fonts (SIL OFL 1.1, see fonts/OFL-*.txt), latin subset only */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }


:root {
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --accent: #54b8ff;
  --r-sm: 9px;
  --r-md: 14px;
  --maxw: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --band: clamp(72px, 10vw, 112px);
  --nav-h: 64px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: oklch(0.165 0.012 256);
  --canvas-soft: oklch(0.215 0.015 256);
  --canvas-deep: oklch(0.145 0.012 256);
  --hairline: oklch(0.27 0.015 256);
  --hairline-strong: oklch(0.34 0.016 256);
  --ink: oklch(0.97 0.004 256);
  --body-strong: oklch(0.86 0.008 256);
  --body: oklch(0.76 0.012 256);
  --mute: oklch(0.64 0.012 256);
  --accent-text: var(--accent);
  --accent-ink: #06121c;
  --accent-glow: color-mix(in oklab, var(--accent), transparent 84%);
  --primary: var(--accent);
  --on-primary: var(--accent-ink);
  --live: #5fd08a;
  --focus: var(--accent);
  --grid-line: color-mix(in oklab, var(--ink), transparent 94%);
}
:root[data-theme="light"] {
  color-scheme: light;
  --canvas: oklch(0.985 0.004 256);
  --canvas-soft: oklch(1 0 0);
  --canvas-deep: oklch(0.965 0.005 256);
  --hairline: oklch(0.9 0.006 256);
  --hairline-strong: oklch(0.84 0.008 256);
  --ink: oklch(0.24 0.014 256);
  --body-strong: oklch(0.34 0.014 256);
  --body: oklch(0.44 0.014 256);
  --mute: oklch(0.52 0.012 256);
  --accent-text: color-mix(in oklab, var(--accent), #0a2540 45%);
  --accent-ink: #06121c;
  --accent-glow: color-mix(in oklab, var(--accent), transparent 88%);
  --primary: var(--accent);
  --on-primary: var(--accent-ink);
  --live: #1f8a4c;
  --focus: color-mix(in oklab, var(--accent), #0a2540 45%);
  --grid-line: color-mix(in oklab, var(--ink), transparent 95%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-glow); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 50;
  background: var(--primary); color: var(--on-primary);
  padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
}
.skip:focus { top: 12px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--canvas), transparent 8%);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.brand img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--body);
  padding: 6px 10px; border-radius: var(--r-sm);
  transition: color .15s, background-color .15s;
}
.nav-link:hover, .nav-link.is-active { color: var(--ink); background: var(--canvas-soft); }
.icon-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--hairline);
  background: transparent; cursor: pointer; color: var(--body-strong);
  transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--hairline-strong); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border-radius: var(--r-sm); border: 1px solid transparent; background: transparent;
  font-size: 14px; font-weight: 500; line-height: 20px; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary), var(--canvas) 12%); }
.btn-ghost { border-color: var(--hairline-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--canvas-soft); }

/* ---------- HERO ---------- */
.hero { padding: clamp(48px, 8vw, 88px) 0 var(--band); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: center; }
.hero h1 {
  font-size: clamp(40px, 5.2vw, 60px); line-height: 1.1; letter-spacing: -0.025em;
  font-weight: 400; margin: 0 0 20px;
}
.hero-lead { font-size: 18px; line-height: 28px; color: var(--body); max-width: 40ch; margin: 0 0 32px; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-photo { border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; background: var(--canvas-soft); aspect-ratio: 1 / 1; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--hairline); margin-top: clamp(48px, 7vw, 72px);
}
.fact { padding: 20px 20px 0 0; }
.fact + .fact { padding-left: 20px; border-left: 1px solid var(--hairline); }
.fact-num { display: block; font-size: 32px; line-height: 40px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fact-label { display: block; font-size: 13px; color: var(--mute); margin-top: 2px; }
.fact-live .fact-label::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--live); margin-right: 7px; vertical-align: 1px;
}

/* ---------- BANDS ---------- */
.band { padding: var(--band) 0; border-top: 1px solid var(--hairline); }
.band h2 { font-size: clamp(32px, 4.4vw, 48px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 400; margin: 0 0 16px; }
.band-lead { font-size: 18px; line-height: 28px; color: var(--body); max-width: 62ch; margin: 0 0 40px; text-wrap: pretty; }
.band-head { margin-bottom: 40px; }
.band-head .band-lead { margin-bottom: 0; }

/* ---------- ABOUT + NOW (split) ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.prose p { font-size: 18px; line-height: 28px; color: var(--body); margin: 0 0 18px; max-width: 58ch; text-wrap: pretty; }
.prose p:first-of-type { color: var(--ink); }

.term { background: var(--canvas-deep); border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; }
.term-bar {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 12px; color: var(--mute);
}
.term-body { padding: 18px 16px 20px; font-family: var(--font-mono); font-size: 13.5px; line-height: 22px; }
.term-cmd { color: var(--mute); margin: 0 0 12px; }
.term-cmd b { color: var(--ink); font-weight: 400; }
.term-rows { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.term-rows dt { color: var(--mute); }
.term-rows dd { margin: 0; color: var(--body-strong); }

/* ---------- PROJECTS ---------- */
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.project {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 24px; transition: border-color .15s, transform .15s;
}
.project:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.project.is-lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.project-repo { font-family: var(--font-mono); font-size: 13px; color: var(--mute); display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.project-repo svg { width: 15px; height: 15px; flex-shrink: 0; transition: transform .15s, color .15s; }
.project:hover .project-repo svg { transform: translate(2px, -2px); color: var(--ink); }
.project h3 { font-size: 24px; line-height: 32px; letter-spacing: -0.015em; font-weight: 500; margin: 0 0 10px; }
.project.is-lead h3 { font-size: 32px; line-height: 40px; letter-spacing: -0.025em; }
.project p { font-size: 15px; line-height: 23px; color: var(--body); margin: 0 0 20px; flex: 1; text-wrap: pretty; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.tag { font-family: var(--font-mono); font-size: 12px; color: var(--body-strong); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); padding: 2px 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--mute); padding-top: 14px; border-top: 1px solid var(--hairline); margin-top: auto; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item svg { width: 13px; height: 13px; }
.lang-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.badge { border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); padding: 0 6px; text-transform: lowercase; }
.lead-side { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.lead-points { margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 23px; color: var(--body); }
.lead-points li { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.lead-points li:first-child { padding-top: 0; }

.subhead { font-size: 13px; color: var(--mute); margin: 48px 0 8px; }
.rows { border-top: 1px solid var(--hairline); }
.row {
  display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr) auto; gap: 24px; align-items: baseline;
  padding: 16px 0; border-bottom: 1px solid var(--hairline); transition: background-color .15s;
}
.row:hover { background: color-mix(in oklab, var(--canvas-soft), transparent 50%); }
.row-name { font-family: var(--font-mono); font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.row-text { font-size: 15px; line-height: 23px; color: var(--body); }
.row-aside { font-family: var(--font-mono); font-size: 12px; color: var(--mute); white-space: nowrap; }
.all-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 28px; font-size: 14px; font-weight: 500; color: var(--body-strong); }
.all-link:hover { color: var(--ink); }
.all-link svg { width: 15px; height: 15px; }

/* ---------- HOMELAB ---------- */
.lab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 48px; }
.lab-stat { background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 20px 20px 18px; }
.lab-stat-num { display: block; font-size: 32px; line-height: 40px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lab-stat-label { display: block; font-size: 13px; color: var(--mute); }
.lab-stat.is-live .lab-stat-label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--live); margin-right: 7px; vertical-align: 1px; }
.stack { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hairline); }
.stack-group { padding: 20px 20px 0 0; }
.stack-group + .stack-group { padding-left: 20px; border-left: 1px solid var(--hairline); }
.stack-group h3 { font-size: 14px; font-weight: 500; margin: 0 0 12px; color: var(--ink); }
.stack-group ul { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 26px; color: var(--body); }

/* ---------- SKILLS ---------- */
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 72px; }
.skill h3 { font-size: 14px; font-weight: 500; color: var(--mute); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { font-size: 15px; color: var(--ink); background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 5px 12px; }

/* ---------- CONTACT ---------- */
.contact-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 40px; }
.contact-email { font-size: clamp(26px, 4vw, 40px); line-height: 1.2; letter-spacing: -0.02em; overflow-wrap: anywhere; border-bottom: 1px solid var(--hairline-strong); transition: border-color .15s; }
.contact-email:hover { border-color: var(--ink); }
.contact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hairline); }
.contact-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--hairline); min-width: 0; }
.contact-item:nth-child(3n+2), .contact-item:nth-child(3n) { padding-left: 20px; border-left: 1px solid var(--hairline); }
.contact-label { display: block; font-size: 13px; color: var(--mute); }
.contact-value { display: block; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.contact-item svg { width: 15px; height: 15px; color: var(--mute); flex-shrink: 0; transition: transform .15s, color .15s; }
.contact-item:hover svg { color: var(--ink); transform: translate(2px, -2px); }
.copy-btn { min-height: 40px; }
.copy-btn[data-copied="true"] { border-color: var(--live); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--hairline); padding: 32px 0 48px; font-size: 14px; color: var(--mute); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.footer a { color: var(--body-strong); }
.footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-links { display: flex; gap: 20px; }

/* ---------- SECURITY PAGE ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: clamp(40px, 7vw, 72px) var(--gutter) 0; }
.doc h1 { font-size: clamp(40px, 6vw, 56px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 400; margin: 0 0 16px; }
.doc h2 { font-size: 24px; line-height: 32px; letter-spacing: -0.015em; font-weight: 500; margin: 48px 0 16px; }
.doc p { font-size: 17px; line-height: 27px; color: var(--body); margin: 0 0 16px; }
.doc strong { color: var(--ink); font-weight: 500; }
.doc a.inline { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline-strong); }
.doc a.inline:hover { text-decoration-color: var(--ink); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: var(--font-mono); font-size: 13px; color: var(--mute); margin: 24px 0 0; padding: 16px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.rules { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.rules li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--hairline); font-size: 16px; line-height: 25px; color: var(--body); }
.rules .mark { font-family: var(--font-mono); color: var(--ink); }
.callout { margin: 56px 0 0; background: var(--canvas-soft); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 28px; }
.callout h2 { margin-top: 0; }
.callout .hero-actions { margin-top: 20px; }
.doc + .footer { margin-top: 72px; }

/* ---------- V1 CHARACTER: type, accent, glow ---------- */
.hero h1, .band h2, .project h3, .doc h1, .doc h2, .fact-num, .lab-stat-num, .contact-email, .brand span {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em;
}
.hero h1 { font-size: clamp(40px, 4.9vw, 58px); line-height: 1.04; }
.hero h1 .accent { color: var(--accent-text); }
.band h2 { letter-spacing: -0.025em; }
.project h3 { letter-spacing: -0.015em; }
.fact-num, .lab-stat-num { color: var(--ink); }
.lab-stat-num { color: var(--accent-text); }

.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 35%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 30% 35%, #000 20%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 620px; height: 620px; right: -120px; top: -160px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent);
  transform: translate3d(0, var(--glow-y, 0px), 0);
}
.hero-photo { border-radius: 18px; box-shadow: 0 30px 60px -40px rgba(0,0,0,.8); }
.hero-photo img { transform: scale(var(--photo-scale, 1.06)) translate3d(0, var(--photo-y, 0px), 0); transition: transform .1s linear; }

.kicker { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-mono); font-size: 13px; color: var(--mute); margin: 0 0 14px; }
.kicker b { color: var(--accent-text); font-weight: 500; }
.prose p.kicker { font-size: 13px; line-height: 1.5; color: var(--mute); margin: 0 0 14px; max-width: none; }

.nav-link.is-active { color: var(--ink); background: var(--canvas-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.brand img { box-shadow: 0 0 0 1px var(--hairline-strong); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent), white 14%); }
.btn-ghost:hover { border-color: var(--accent); background: transparent; }

.project { position: relative; overflow: hidden; transition: transform .35s var(--ease-out), border-color .2s; }
.project::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px 220px at var(--mx, 100%) var(--my, 0%), var(--accent-glow), transparent 70%);
}
.project:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--accent), var(--hairline) 50%); }
.project:hover::after { opacity: 1; }
.project-repo span { color: var(--accent-text); }
.project:hover .project-repo svg { color: var(--accent-text); }
.tag { background: var(--canvas-deep); border-color: var(--hairline); }
.row-name { color: var(--accent-text); }
.row:hover { background: var(--canvas-soft); }
.chip { border-radius: 999px; transition: border-color .2s, color .2s, transform .2s var(--ease-out); }
.chip:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }
.term { box-shadow: 0 24px 50px -36px rgba(0,0,0,.9); }
.term-bar::before { content: ""; width: 44px; height: 10px; flex-shrink: 0; background:
  radial-gradient(circle at 5px 5px, #ff5f57 4px, transparent 4.5px),
  radial-gradient(circle at 22px 5px, #febc2e 4px, transparent 4.5px),
  radial-gradient(circle at 39px 5px, #28c840 4px, transparent 4.5px); }
.term-cmd b { color: var(--accent-text); }
.caret { display: inline-block; width: 8px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.contact-email:hover { border-color: var(--accent); color: var(--accent-text); }
.contact-item:hover svg { color: var(--accent-text); }
.lab-stat, .project, .term { will-change: auto; }

/* ---------- SCROLL PROGRESS ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 40; pointer-events: none;
  background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }

/* ---------- REVEAL ANIMATIONS (only when JS runs) ---------- */
.js .reveal { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .8s var(--ease-out), transform .9s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .reveal.from-left { transform: translate3d(-36px, 0, 0); }
.js .reveal.from-right { transform: translate3d(36px, 0, 0); }
.js .reveal.zoom { transform: scale(.96); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .term-rows > * { opacity: 0; transform: translate3d(-8px, 0, 0); transition: opacity .4s, transform .5s var(--ease-out); transition-delay: var(--d, 0ms); }
.js .term.is-typed .term-rows > * { opacity: 1; transform: none; }


/* ---------- ANIME.JS LAYER ---------- */
.circuit { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.circuit { --trace: color-mix(in oklab, var(--accent), transparent 35%); --trace-dim: color-mix(in oklab, var(--accent), transparent 84%); --trace-glow: drop-shadow(0 0 3px color-mix(in oklab, var(--accent), transparent 60%)); }
.circuit .trace { stroke: var(--trace); stroke-width: 1.5; filter: var(--trace-glow); }
.circuit .pads circle { fill: var(--canvas); stroke: var(--trace); stroke-width: 1.5; }
.circuit .pulse { fill: var(--accent); opacity: 0; filter: drop-shadow(0 0 4px var(--accent)); }
.hero-title [data-word] { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .08em; margin-bottom: -.08em; }
.hero-title [data-char] { display: inline-block; will-change: transform; }
.motion-on .hero-title { visibility: hidden; animation: show-late 0s 1.6s forwards; }
@keyframes show-late { to { visibility: visible; } }
.motion-on .hero-title.is-split { visibility: visible; }
.projects { perspective: 1400px; }
.motion-on .project { transform-style: preserve-3d; transition: border-color .2s; }
.motion-on .project:hover { transform: none; }
.kicker-text { white-space: pre; }
@media (max-width: 860px) { .circuit { opacity: .55; } }


/* ---------- PROJECTS (v1 layout) ---------- */
.project-repo { justify-content: flex-start; align-items: center; }
.project-repo > span:first-child { color: var(--accent-text); overflow-wrap: anywhere; }
.repo-owner { color: var(--mute); }
.project-repo svg { margin-left: auto; }
.project-rank[hidden] { display: none; }
.project-rank { margin-left: auto; margin-right: 12px; font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-text); border: 1px solid color-mix(in oklab, var(--accent), var(--hairline) 40%); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.project-rank:not([hidden]) + svg { margin-left: 0; }

.contrib { margin-top: 40px; padding-top: 32px; border-top: 1px dashed var(--hairline-strong); }
.contrib-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.contrib-label { font-family: var(--font-mono); font-size: 13px; color: var(--accent-text); }
.contrib-count { font-size: 14px; color: var(--body); }
.contrib-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.contrib-list { perspective: 1400px; }
.contrib-item h3 { font-size: 20px; line-height: 28px; }
.contrib-item .project-repo > span:first-child { font-size: 12.5px; }
.contrib-role { margin-left: auto; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-text); border: 1px solid color-mix(in oklab, var(--accent), var(--hairline) 45%); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
@media (max-width: 1023px) { .contrib-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 767px) { .contrib-list { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .repo-owner { display: none; } }


/* ---------- PAGE-WIDE BACKGROUND: dot field, cursor light, scroll trace ---------- */
body { position: relative; isolation: isolate; }
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -2;
  background-size: 26px 26px; background-position: 13px 13px;
  background-image: radial-gradient(color-mix(in oklab, var(--ink), transparent 91%) 1px, transparent 1.4px);
}
.page-circuit { z-index: -1; }
.page-circuit .bus-base { fill: none; stroke: var(--trace-dim); stroke-width: 1.5; }
.page-circuit .bus-lit { fill: none; stroke: var(--trace); stroke-width: 1.5; filter: var(--trace-glow); }
.page-circuit .branch { fill: none; stroke: var(--trace); stroke-width: 1.5; filter: var(--trace-glow); transition: stroke-dashoffset .8s var(--ease-out); }
.page-circuit .via { fill: var(--canvas); stroke: var(--trace-dim); stroke-width: 1.5; transition: fill .3s, stroke .3s; }
.page-circuit .via.is-lit { fill: var(--trace); stroke: var(--trace); }
.page-circuit .pad { fill: var(--canvas); stroke: var(--trace); stroke-width: 1.5; opacity: 0; transition: opacity .4s .5s; }
.page-circuit .pad.is-lit { opacity: 1; }
.page-circuit .pads circle { transform-box: fill-box; transform-origin: center; }
.circuit .pads circle { transform-box: fill-box; transform-origin: center; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1023px) {
  .stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stack-group:nth-child(4) { padding-left: 0; border-left: 0; }
  .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-item:nth-child(3n+2), .contact-item:nth-child(3n) { padding-left: 0; border-left: 0; }
  .contact-item:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--hairline); }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .brand { margin-right: auto; }
  .hero-grid, .split, .project.is-lead { grid-template-columns: 1fr; }
  .hero-photo { order: -1; max-width: 220px; }
  .lab-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact + .fact { padding-left: 14px; }
  .fact { padding-right: 10px; }
  .projects, .skills { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row-aside { white-space: normal; }
}
@media (max-width: 767px) {
  .stack { grid-template-columns: 1fr 1fr; }
  .stack-group, .stack-group + .stack-group { padding: 20px 0 0; border-left: 0; }
  .stack-group:nth-child(2n) { padding-left: 20px; border-left: 1px solid var(--hairline); }
  .contact-list { grid-template-columns: 1fr; }
  .contact-item:nth-child(n) { padding-left: 0; border-left: 0; }
  .btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .term-rows { grid-template-columns: 1fr; gap: 0; }
  .term-rows dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .term-rows > * { opacity: 1 !important; transform: none !important; }
  .hero-photo img { transform: none !important; }
  .caret { display: none; }
  .circuit .pulse { display: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- v2.1 colour and layout pass (approved from /demo) ----------
   Primary blue (--accent): clickable things and stat numbers.
   Darker blue (--circuit): the circuit, progress bar and active menu line. */

/* 1. Circuit in a darker blue so it sits behind the content */
:root, :root[data-theme="dark"] { --circuit: #2f6fb3; }
:root[data-theme="light"] { --circuit: #4a82bd; }
.circuit {
  --trace: color-mix(in oklab, var(--circuit), transparent 15%);
  --trace-dim: color-mix(in oklab, var(--circuit), transparent 78%);
  --trace-glow: drop-shadow(0 0 2px color-mix(in oklab, var(--circuit), transparent 55%));
}
.circuit .pulse { fill: color-mix(in oklab, var(--circuit), #9fd4ff 55%); filter: drop-shadow(0 0 3px var(--circuit)); }
.page-circuit .via.is-lit { fill: var(--circuit); stroke: var(--circuit); }
.hero::after { background: radial-gradient(closest-side, color-mix(in oklab, var(--circuit), transparent 82%), transparent); }

/* 2. One background texture: the dot field stays, the hero's extra line grid goes */
.hero::before { display: none; }

/* 3. Less blue everywhere else, so blue means "clickable" or "number" */
.project-repo > span:first-child, .row-name { color: var(--body-strong); transition: color .2s; }
.project:hover .project-repo > span:first-child { color: var(--accent-text); }
.repo-owner { color: var(--mute); }
.progress { height: 2px; background: var(--circuit); }
.nav-link.is-active { box-shadow: inset 0 -2px 0 var(--circuit); }

/* 4. Slightly brighter body copy on cards for readability */
.project p, .contrib-blurb { color: var(--body-strong); }

/* 5. Homelab stats in the same open style as the hero facts (no boxes) */
.lab-stats { gap: 0; border-top: 1px solid var(--hairline); margin-bottom: 40px; }
.lab-stat { background: none; border: 0; border-radius: 0; padding: 20px 20px 0 0; }
.lab-stat + .lab-stat { padding-left: 20px; border-left: 1px solid var(--hairline); }
.lab-stat-num { font-size: 40px; line-height: 48px; }

/* 5b. Hero stat numbers blue too, same as the homelab ones */
/* stat numbers in the darker circuit blue */
.fact-num, .lab-stat-num { color: var(--circuit); }

/* 6. Lighter skill chips: outline only, fill on hover */
.chip { background: transparent; border-color: var(--hairline-strong); }
.chip:hover { background: var(--canvas-soft); }

/* 7. Phones: section links in a scrollable row under the name instead of hidden */
@media (max-width: 860px) {
  .nav-inner { height: auto; flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
  .brand { margin-right: auto; }
  .nav-links {
    display: flex; order: 3; flex-basis: 100%; margin: 6px -4px 0; padding-bottom: 8px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; }
  .lab-stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .lab-stat:nth-child(n+3) { border-top: 1px solid var(--hairline); margin-top: 20px; }
}
html { scroll-padding-top: 110px; }

/* ---------- circuit v2: hierarchy, chips, CPU, phone line (approved from /demo) ---------- */

/* 3. Hierarchy: thicker main trace, thinner branches */
.page-circuit .bus-base { stroke-width: 2.2; }
.page-circuit .bus-lit { stroke-width: 2.2; }
.page-circuit .branch { stroke-width: 1.2; }

/* 2. Chips on the crossovers */
.page-circuit .chip rect { fill: var(--canvas); stroke: var(--trace-dim); stroke-width: 1.4; transition: stroke .4s, fill .4s; }
.page-circuit .chip line { stroke: var(--trace-dim); stroke-width: 1.4; transition: stroke .4s; }
.page-circuit .chip .chip-dot { fill: var(--trace-dim); transition: fill .4s; }
.page-circuit .chip.is-lit rect { stroke: var(--trace); fill: color-mix(in oklab, var(--circuit), var(--canvas) 88%); }
.page-circuit .chip.is-lit line { stroke: var(--trace); }
.page-circuit .chip.is-lit .chip-dot { fill: var(--accent); }
.page-circuit .chip.is-flash rect { fill: color-mix(in oklab, var(--circuit), var(--canvas) 55%); filter: drop-shadow(0 0 6px var(--circuit)); }

/* 5. Phones: the thin left-edge line is quieter */
@media (max-width: 860px) {
  .page-circuit .bus-base, .page-circuit .bus-lit { stroke-width: 1.4; }
}

/* no grey divider between sections; the circuit already separates them */
.band { border-top: 0; }
