/* ==========================================================================
   Brendan Meyer — Portfolio v2
   Plain CSS. No framework, no build step.
   Sections: 1 tokens · 2 base · 3 layout · 4 components · 5 sections
             6 dialogs · 7 motion · 8 responsive
   ========================================================================== */

/* 1 · TOKENS ---------------------------------------------------------------- */
:root {
  --bg: #08080b;
  --bg-2: #0c0c11;
  --surface: #111118;
  --surface-2: #171720;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --ink: #ecebf0;
  --ink-2: #c0bec9;
  --muted: #8f8d9a;
  --ok: #3ddc84;
  --warn: #ffb648;

  --accent-rgb: 255, 59, 79;
  --accent: rgb(var(--accent-rgb));
  --accent-ink: #0b0b0e;
  --accent-soft: rgba(var(--accent-rgb), 0.1);
  --accent-line: rgba(var(--accent-rgb), 0.45);

  --font-sans: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 64px;
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-snap: cubic-bezier(0.7, 0, 0.2, 1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}


/* 2 · BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
strong { font-weight: 650; color: var(--ink); }
em { font-style: normal; }
code, kbd { font-family: var(--font-mono); }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ic {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-lg { width: 26px; height: 26px; }
.ic-xl { width: 34px; height: 34px; stroke-width: 1.5; }
.ic-flip { transform: scaleX(-1); }
.ic-up { transform: rotate(-90deg); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
}

.skip {
  position: fixed; left: 16px; top: 12px; z-index: 200;
  padding: 10px 16px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; border-radius: var(--r);
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip:focus { transform: translateY(0); outline-color: var(--ink); }

/* 3 · LAYOUT ---------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: clamp(88px, 11vw, 144px);
}
.section-alt {
  background: var(--bg-2);
  border-block: 1px solid var(--line);
}

.sec-head { margin-bottom: clamp(40px, 5vw, 64px); }
.sec-head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px 64px; flex-wrap: wrap;
}
.sec-tag {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em;
  color: var(--accent);
  text-transform: uppercase;
}
.sec-tag span {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 24px; padding: 0 6px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  font-size: 12px;
}
.sec-head h2 {
  font-size: clamp(38px, 5.6vw, 72px);
  font-weight: 760;
  font-stretch: 112%;
  line-height: 0.98;
  letter-spacing: -0.025em;
  max-width: 16ch;
  text-wrap: balance;
}
.sec-head h2 em { color: var(--accent); }
.sec-head-row > div { flex: 1 1 520px; min-width: 0; }
.sec-head-row > .sec-lead { flex: 0 1 420px; }
.sec-lead {
  max-width: 44ch;
  color: var(--ink-2);
  font-size: 17px;
}

.big { font-size: clamp(19px, 1.8vw, 23px); line-height: 1.5; color: var(--ink); }

/* 4 · COMPONENTS ------------------------------------------------------------ */

/* Buttons */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font-size: 15px; font-weight: 650; letter-spacing: 0.01em;
  border-radius: var(--r);
  border: 1px solid transparent;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
              border-color 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 0.06s; }
.btn .ic { transition: transform 0.2s var(--ease); }
.btn:hover .ic { transform: translateX(3px); }
.btn:hover .ic-flip { transform: scaleX(-1) translateX(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, white); }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: rgba(255, 255, 255, 0.02); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .meta { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.btn-ghost:hover .meta { color: inherit; }

.text-link, .linkish {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.25s var(--ease);
}
.text-link:hover, .linkish:hover { background-size: 100% 1px; }
.text-link .ic { width: 15px; height: 15px; }
.cred-actions .text-link, #rescan { min-height: 44px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--r);
  color: var(--ink-2);
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Panels */
.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.panel-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.panel-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -24px -24px 20px; padding: 6px 20px; min-height: 54px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2);
}
.panel-bar > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.panel-bar .ic { color: var(--accent); width: 16px; height: 16px; }

.dot-live {
  position: relative;
  display: inline-block; width: 8px; height: 8px; flex: none;
  border-radius: 50%;
  background: var(--ok);
}
.dot-live::after {
  content: ""; position: absolute; inset: -4px;
  border: 1px solid var(--ok); border-radius: 50%;
  opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}

/* Corner brackets (shared signature detail) */
.corner {
  position: absolute; width: 18px; height: 18px;
  border: 0 solid var(--accent);
  pointer-events: none;
}
.corner.tl { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: 10px; left: 10px; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 3px 9px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

/* Progress bar */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 120; pointer-events: none; }
.progress span {
  display: block; height: 100%;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
/* Blur lives on a pseudo-element: backdrop-filter on the header itself would make it the
   containing block for the fixed mobile menu and trap the menu inside the 64px bar. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(8, 8, 11, 0.8);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { height: 100%; display: flex; align-items: center; gap: 24px; }

.logo {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 19px; letter-spacing: 0.04em;
  min-height: 44px;
}
.logo-b { color: var(--accent); }
.logo-cursor {
  width: 9px; height: 18px; margin-left: 6px;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
.logo-sm { font-size: 16px; min-height: 0; }

.nav { margin-left: auto; }
.nav-list { display: flex; gap: 2px; }
.nav-list a {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 12px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.03em;
  color: var(--ink-2);
  border-radius: var(--r-sm);
  transition: color 0.15s;
}
.nav-idx { font-size: 10px; color: var(--muted); transition: color 0.15s; }
.nav-list a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 8px; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-list a:hover, .nav-list a.is-active { color: var(--ink); }
.nav-list a:hover::after, .nav-list a.is-active::after { transform: scaleX(1); }
.nav-list a.is-active .nav-idx { color: var(--accent); }
.nav-mobile-extra { display: none; }

.header-tools { display: flex; align-items: center; gap: 10px; }

.kbd-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 8px 0 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.kbd-btn:hover { border-color: var(--line-2); color: var(--ink); }
.kbd-btn .ic { width: 16px; height: 16px; }
.menu-btn {
  display: none;
  width: 44px; height: 44px; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r);
}

/* 5 · SECTIONS -------------------------------------------------------------- */

/* Hero */
.hero {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(24px, 4.5vh, 56px) 28px;
  overflow: hidden;
  isolation: isolate;
}
.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero-copy { container-type: inline-size; min-width: 0; }
.status-line {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  margin-bottom: clamp(16px, 2.6vh, 28px);
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
  background: rgba(8, 8, 11, 0.6);
}
.status-line .sep { color: var(--muted); }

.hero-title {
  font-size: clamp(48px, 16.6cqi, 150px);
  font-weight: 820;
  font-stretch: 122%;
  line-height: 0.84;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  margin-bottom: clamp(18px, 3vh, 28px);
}
.ht-line { display: block; white-space: nowrap; }
.ht-accent { color: var(--accent); }

.hero-role {
  display: flex; align-items: center; gap: 4px;
  min-height: 1.6em;
  margin-bottom: 18px;
  font-family: var(--font-mono); font-size: clamp(16px, 1.6vw, 20px);
  color: var(--ink);
}
.prompt { color: var(--accent); margin-right: 6px; }
.caret {
  display: inline-block; width: 0.55em; height: 1.1em; margin-left: 4px;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
.hero-lead {
  max-width: 58ch;
  margin-bottom: clamp(20px, 3.2vh, 32px);
  color: var(--ink-2);
  font-size: clamp(16px, 1.35vw, 18px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 6px 24px; font-size: 14px; }
.hero-links a, .hero-links button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px;
  color: var(--ink-2);
  transition: color 0.15s;
}
.hero-links a:hover, .hero-links button:hover { color: var(--accent); }
.hero-links .ic { width: 16px; height: 16px; }
.hero-links kbd { margin-left: 2px; }

/* Operator badge */
.hero-badge { justify-self: end; width: 100%; max-width: 380px; }
.badge-frame {
  background: rgba(17, 17, 24, 0.82);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  padding: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.badge-head {
  display: flex; justify-content: space-between;
  padding: 4px 6px 12px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  color: var(--muted);
}
.badge-id { color: var(--accent); }
.badge-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
}
.badge-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.9) contrast(1.04);
  transition: transform 0.6s var(--ease), filter 0.4s;
}
.hero-badge:hover .badge-photo img { transform: scale(1.025); filter: saturate(1) contrast(1.04); }
.scan {
  position: absolute; left: 0; right: 0; top: 0; height: 30%;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.13) 85%, rgba(var(--accent-rgb), 0.5) 100%);
  transform: translateY(-100%);
  animation: scan 3.6s var(--ease-snap) 0.4s infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}
.badge-data { padding: 14px 6px 4px; display: grid; gap: 8px; }
.badge-data div { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.badge-data dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.badge-data dd { text-align: right; color: var(--ink); }
.badge-data .ok { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); }

/* Stat strip */
.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(28px, 4.5vh, 56px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(12, 12, 17, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.stat-strip li {
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-strip li + li { border-left: 1px solid var(--line); }
.stat-strip strong {
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 760; font-stretch: 115%;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-strip li:first-child strong { color: var(--accent); }
.stat-strip span { font-size: 14px; color: var(--muted); line-height: 1.4; }

/* About */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.about-story { display: grid; gap: 20px; color: var(--ink-2); max-width: 62ch; }
.about-story em.film { font-style: italic; color: var(--ink); }

/* Full story: a terminal-style "cat" that expands in place */
.story-more {
  margin-top: 8px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  transition: border-color 0.2s;
}
.story-more[open] { border-style: solid; border-color: var(--line-2); background: rgba(255, 255, 255, 0.015); }
.story-more summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 18px;
  font-family: var(--font-mono); font-size: 14px; color: var(--ink);
  cursor: pointer; list-style: none;
  border-radius: var(--r);
  transition: color 0.15s;
}
.story-more summary::-webkit-details-marker { display: none; }
.story-more summary .prompt { margin-right: 0; }
.story-more summary .ic { margin-left: auto; color: var(--accent); transition: transform 0.25s var(--ease); }
.story-more[open] summary .ic { transform: rotate(180deg); }
.story-more summary:hover { color: var(--accent); }
.story-more summary:hover .story-more-label { text-decoration: underline; text-underline-offset: 4px; }
.story-full {
  display: grid; gap: 18px;
  padding: 6px 18px 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.story-full p { color: var(--ink-2); }
.story-quote {
  margin: 4px 0;
  padding: 18px 20px 18px 48px;
  position: relative;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r);
}
.story-quote::before {
  content: "\201C";
  position: absolute; left: 16px; top: 6px;
  font-size: 44px; font-weight: 800; line-height: 1;
  color: var(--accent);
}
.story-quote p { color: var(--ink) !important; font-style: italic; font-weight: 600; line-height: 1.55; }
.story-quote-final p { font-size: 17px; }
.focus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.focus-card {
  position: relative;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.focus-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.focus-card .ic { color: var(--accent); margin-bottom: 18px; }
.focus-card h3 { font-size: 18px; font-weight: 680; font-stretch: 105%; margin-bottom: 8px; line-height: 1.25; }
.focus-card p { font-size: 15px; color: var(--muted); line-height: 1.55; }

/* Toolkit */
.tk-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.tk-tab {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 16px;
  font-size: 15px; font-weight: 600;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s, transform 0.15s var(--ease);
}
.tk-tab:hover { color: var(--ink); border-color: var(--line-2); transform: translateY(-1px); }
.tk-tab[aria-selected="true"] { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.tk-tab .ic { width: 17px; height: 17px; }
.tk-tab[aria-selected="true"] .ic { color: var(--accent); }
.tk-count {
  font-family: var(--font-mono); font-size: 11px;
  padding: 1px 6px; border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.06); color: var(--muted);
}

.tk-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: 20px;
  min-height: 460px;
}
.tk-map {
  position: relative;
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.07), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.tk-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tk-map .edge { stroke: var(--line-2); stroke-width: 1; fill: none; }
.tk-map .pulse {
  stroke: var(--accent); stroke-width: 2; fill: none;
  stroke-linecap: round;
  stroke-dasharray: 4 100;
  stroke-dashoffset: 0;
  animation: pulse-run 3.2s linear infinite;
  animation-delay: var(--d, 0s);
}
.tk-map .ring { fill: none; stroke: var(--line); stroke-dasharray: 2 6; }
.tk-hub, .tk-node {
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.tk-hub {
  display: grid; place-items: center; text-align: center;
  width: 132px; height: 132px; border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent-line);
}
.tk-hub small { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--muted); }
.tk-hub strong { display: block; font-size: 17px; font-weight: 720; font-stretch: 110%; }
.tk-node {
  padding: 7px 13px;
  font-family: var(--font-mono); font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink);
  opacity: 0;
  animation: node-in 0.45s var(--ease) forwards;
  animation-delay: var(--d, 0s);
  transition: border-color 0.15s, color 0.15s;
}
.tk-node:hover { border-color: var(--accent); color: var(--accent); }
.tk-map.is-static .tk-node { animation: none; opacity: 1; }

.tk-panel {
  height: 100%;
  display: flex; flex-direction: column; gap: 18px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.tk-panel > p { color: var(--ink-2); font-size: 16px; }
.tk-list { display: grid; grid-template-columns: 1fr; gap: 0; }
.tk-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  font-family: var(--font-mono); font-size: 14px;
  border-bottom: 1px dashed var(--line);
}
.tk-list li::before { content: ""; width: 6px; height: 6px; background: var(--accent); border-radius: 1px; flex: none; }
.tk-list li:last-child { border-bottom: 0; }

/* Case files */
.filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 24px;
}
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px;
  font-family: var(--font-mono); font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.chip-btn span { color: var(--muted); font-size: 11px; }
.chip-btn:hover { border-color: var(--line-2); color: var(--ink); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-btn[aria-pressed="true"] span { color: inherit; opacity: 0.7; }
.filter-status { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.case-card {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px;
  min-height: 330px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.2s, transform 0.2s var(--ease), background-color 0.2s;
}
.case-card::before, .case-card::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border: 0 solid var(--accent);
  opacity: 0; transition: opacity 0.2s, transform 0.25s var(--ease);
}
.case-card::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: var(--r-lg); transform: translate(4px, 4px); }
.case-card::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: var(--r-lg); transform: translate(-4px, -4px); }
.case-card:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--surface-2); }
.case-card:hover::before, .case-card:hover::after { opacity: 1; transform: none; }
.case-card[hidden] { display: none; }
.case-top { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); font-size: 12px; }
.case-no { color: var(--accent); letter-spacing: 0.08em; }
.case-cat { color: var(--muted); text-align: right; }
.case-card h3 { font-size: 22px; font-weight: 700; font-stretch: 108%; line-height: 1.15; letter-spacing: -0.01em; }
.case-card > p { color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.case-open {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  min-height: 44px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em;
  color: var(--accent);
}
.case-open::before { content: ""; position: absolute; inset: 0; border-radius: var(--r-lg); }
.case-open .ic { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.case-card:hover .case-open .ic { transform: translateX(4px); }

/* Resume */
.resume-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.85fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: start;
}
.timeline { position: relative; display: grid; gap: 20px; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px;
  background: linear-gradient(var(--accent-line), var(--line) 30%, var(--line));
}
.tl-item {
  position: relative;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 30px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--line-2);
}
.tl-main::before { border-color: var(--accent); background: var(--accent); }
.tl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; font-family: var(--font-mono); font-size: 12px; }
.tl-date { color: var(--ink); }
.tl-badge { padding: 2px 8px; border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--muted); }
.tl-main .tl-badge { border-color: var(--accent-line); color: var(--accent); }
.tl-item h3 { font-size: 21px; font-weight: 700; font-stretch: 106%; line-height: 1.25; margin-bottom: 10px; }
.tl-item h3 .at { color: var(--muted); font-weight: 500; }
.tl-item > p { color: var(--ink-2); font-size: 15px; }
.duty-groups { display: grid; gap: 22px; margin-top: 18px; }
.duty h4 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--ink);
}
.duty h4 .ic { width: 16px; height: 16px; color: var(--accent); }
.duty ul { display: grid; gap: 8px; }
.duty li {
  position: relative; padding-left: 20px;
  font-size: 15px; color: var(--ink-2); line-height: 1.55;
}
.duty li::before { content: "›"; position: absolute; left: 4px; top: -1px; color: var(--accent); font-family: var(--font-mono); }

.resume-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 24px); }
.skill-list { display: grid; gap: 14px; }
.skill-list dt { font-weight: 650; font-size: 15px; }
.skill-list dd { font-size: 14px; color: var(--muted); line-height: 1.5; }
.facts { display: grid; gap: 12px; margin-bottom: 20px; }
.facts li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-2); }
.facts .ic { color: var(--accent); width: 17px; height: 17px; }

/* Credentials */
.cred-feature { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: clamp(48px, 6vw, 72px); }
.cred-hero {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), transparent 45%),
    var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cred-hero > .ic { color: var(--accent); margin-bottom: 6px; }
.cred-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.cred-hero h3 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 720; font-stretch: 108%; line-height: 1.15; max-width: 22ch; }
.cred-facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 6px 0; }
.cred-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cred-facts dd { font-size: 22px; font-weight: 700; font-stretch: 112%; font-variant-numeric: tabular-nums; }
.cred-hero > .muted { font-size: 14px; margin-top: auto; }
.cred-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: auto; }

.sub-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
  font-size: 22px; font-weight: 700; font-stretch: 108%;
}
.sub-head span {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-sm);
  color: var(--accent); border: 1px solid var(--accent-line);
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface);
}
.cred-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cred-table th, .cred-table td { padding: 12px 18px; text-align: left; vertical-align: middle; }
.cred-table thead th {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.cred-table tbody tr { border-bottom: 1px solid var(--line); transition: background-color 0.15s; }
.cred-table tbody tr:last-child { border-bottom: 0; }
.cred-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.cred-table tbody th { font-weight: 600; color: var(--ink); }
.cred-table td { color: var(--ink-2); white-space: nowrap; }
.cred-table td:nth-child(3) { font-family: var(--font-mono); font-size: 13px; }

.copy-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 0 10px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--ink-2);
  border: 1px dashed var(--line-2); border-radius: var(--r-sm);
  transition: border-color 0.15s, color 0.15s;
}
.copy-btn .ic { width: 14px; height: 14px; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent); border-style: solid; }
.copy-btn.is-copied { color: var(--ok); border-color: var(--ok); }
.verify {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 12px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  transition: background-color 0.15s, color 0.15s;
}
.verify .ic { width: 14px; height: 14px; }
.verify:hover { background: var(--accent); color: var(--accent-ink); }

.modules {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.modules summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; padding: 0 20px;
  font-weight: 650; cursor: pointer; list-style: none;
}
.modules summary::-webkit-details-marker { display: none; }
.modules summary .muted { font-weight: 400; }
.modules summary .ic { transition: transform 0.25s var(--ease); color: var(--accent); }
.modules[open] summary .ic { transform: rotate(180deg); }
.modules summary:hover { color: var(--accent); }
.modules > p { padding: 0 20px 16px; }
.module-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1px; background: var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}
.module-list div { padding: 16px 20px; background: var(--surface); }
.module-list dt { font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 4px; }
.module-list dt small { color: var(--muted); font-size: 12px; }
.module-list dd { font-size: 14px; color: var(--muted); line-height: 1.5; }


/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.contact-side { display: grid; gap: 28px; }
.contact-list { display: grid; gap: 10px; }
.contact-list a {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s var(--ease);
}
.contact-list a:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-list .ic { color: var(--accent); width: 20px; height: 20px; }
.contact-list span { display: flex; flex-direction: column; font-size: 16px; overflow-wrap: anywhere; }
.contact-list small { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

.contact-form { display: grid; gap: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px; padding: 12px 14px;
  font-size: 16px;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  transition: border-color 0.15s, background-color 0.15s;
}
.field textarea { resize: vertical; min-height: 150px; line-height: 1.55; }
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
  padding-right: 40px;
}
.field select option { background: var(--surface); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: rgba(255, 255, 255, 0.28); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--bg-2); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--warn); }
.field-hint { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-align: right; }
.field-error { font-size: 14px; color: var(--warn); }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-status { font-size: 14px; color: var(--muted); flex: 1 1 220px; }
.form-status.is-error { color: var(--warn); }
.form-status.is-success { color: var(--ok); }
.btn[disabled] { opacity: 0.55; cursor: progress; transform: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 28px; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-copy { color: var(--muted); font-size: 14px; }
.footer-keys { display: flex; align-items: center; gap: 8px; margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.footer-keys kbd:not(:first-child) { margin-left: 8px; }
.footer-links { display: flex; gap: 4px; }
.footer-links a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: var(--r); color: var(--ink-2);
  transition: color 0.15s, background-color 0.15s;
}
.footer-links a:hover { color: var(--accent); background: var(--surface); }

/* Launcher */
.launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px 0 14px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--ink);
  background: rgba(17, 17, 24, 0.9);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s var(--ease), border-color 0.2s, opacity 0.3s;
}
.launcher .ic { color: var(--accent); }
.launcher:hover { transform: translateY(-2px); border-color: var(--accent); }
.launcher:active { transform: scale(0.97); }
.launcher.is-hidden { opacity: 0; pointer-events: none; transform: translateY(12px); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  transform: translateX(-50%);
  padding: 12px 18px;
  font-family: var(--font-mono); font-size: 13px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid rgba(61, 220, 132, 0.45);
  border-radius: var(--r);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
  animation: toast-in 0.25s var(--ease);
}

/* 6 · DIALOGS --------------------------------------------------------------- */
dialog {
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  max-height: calc(100dvh - 32px);
  width: min(100% - 32px, 820px);
  overflow: hidden;
}
dialog[open] { display: flex; flex-direction: column; animation: dlg-in 0.28s var(--ease); }
dialog::backdrop {
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dlg-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 6px 6px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  flex: none;
}
.dlg-path { font-family: var(--font-mono); font-size: 13px; color: var(--muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-dots { display: flex; gap: 6px; }
.dlg-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.dlg-dots i:first-child { background: var(--accent); }

/* Case dialog */
.dlg-body { overflow-y: auto; padding: clamp(24px, 4vw, 40px); overscroll-behavior: contain; }
.dlg-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  flex: none;
}
.cf-head { margin-bottom: 28px; }
.cf-head .cf-stamp {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 5px 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: var(--r-sm);
}
.cf-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 780; font-stretch: 112%; line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 14px; }
.cf-head p { color: var(--ink-2); font-size: 17px; max-width: 60ch; }
.cf-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  margin-bottom: 28px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.cf-meta div { padding: 12px 14px; background: var(--bg-2); }
.cf-meta dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.cf-meta dd { font-size: 14px; }
.cf-section { margin-bottom: 26px; }
.cf-section h3 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.cf-section h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cf-steps { counter-reset: step; display: grid; gap: 10px; }
.cf-steps li {
  counter-increment: step;
  position: relative; padding-left: 40px; min-height: 26px;
  color: var(--ink-2); font-size: 16px; line-height: 1.55;
}
.cf-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent);
  padding: 1px 5px; border: 1px solid var(--accent-line); border-radius: var(--r-sm);
}
.cf-section > p { color: var(--ink-2); }

/* Redaction reveal — words start blacked out and "declassify" on open */
.rd { position: relative; color: var(--ink); }
.rd::after {
  content: ""; position: absolute; inset: 0 -3px;
  background: var(--ink);
  transform-origin: right center;
  transition: transform 0.45s var(--ease-snap);
  transition-delay: calc(var(--i, 0) * 80ms + 220ms);
}
.case-dialog.is-declassified .rd::after { transform: scaleX(0); }

/* Terminal */
.term-dialog { width: min(100% - 32px, 880px); height: min(640px, calc(100dvh - 32px)); background: #0a0a0e; }
.term-out {
  flex: 1; overflow-y: auto;
  padding: 18px 20px 8px;
  font-family: var(--font-mono); font-size: 14px; line-height: 1.65;
  color: var(--ink-2);
  overscroll-behavior: contain;
}
.term-out p { white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out .t-cmd { color: var(--ink); }
.term-out .t-cmd b { color: var(--accent); font-weight: 500; }
.term-out .t-ok { color: var(--ok); }
.term-out .t-acc { color: var(--accent); }
.term-out .t-dim { color: var(--muted); }
.term-out .t-err { color: var(--warn); }
.term-out a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.term-out .t-ascii { color: var(--accent); line-height: 1.15; font-size: 12px; }
.term-in {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 14px;
  flex: none;
}
.term-in label { color: var(--muted); white-space: nowrap; }
.t-user { color: var(--ok); }
.t-sym { color: var(--accent); }
.term-in input {
  flex: 1; min-width: 0; min-height: 36px;
  background: transparent; border: 0; outline: 0;
  font-family: var(--font-mono); font-size: 15px;
  color: var(--ink); caret-color: var(--accent);
}
.term-hints {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 0 20px 14px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  flex: none;
}
.term-hints button {
  min-height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.term-hints button:hover { border-color: var(--accent); color: var(--accent); }

/* Palette */
.palette { width: min(100% - 32px, 620px); margin-top: 14vh; }
.pal-search {
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.pal-search .ic { color: var(--muted); }
.pal-search input { flex: 1; min-height: 58px; background: transparent; border: 0; outline: 0; font-size: 17px; }
.pal-search input::placeholder { color: var(--muted); }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.pal-list li {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 12px;
  border-radius: var(--r);
  cursor: pointer;
  color: var(--ink-2);
}
.pal-list li .ic { color: var(--muted); width: 16px; height: 16px; }
.pal-list li small { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.pal-list li[aria-selected="true"] { background: var(--accent-soft); color: var(--ink); }
.pal-list li[aria-selected="true"] .ic { color: var(--accent); }
.pal-empty { padding: 20px 12px; color: var(--muted); font-size: 15px; }
.pal-foot {
  display: flex; gap: 18px; padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
  background: var(--bg-2);
}
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* 7 · MOTION ---------------------------------------------------------------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes ping { 0% { opacity: 0.8; transform: scale(0.6); } 80%, 100% { opacity: 0; transform: scale(1.8); } }
@keyframes scan { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(340%); } }
@keyframes pulse-run { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -104; } }
@keyframes node-in { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes dlg-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Hero entrance — pure CSS, plays once on load; never depends on JS, so nothing stays hidden. */
.hero [data-enter] { animation: enter 0.7s var(--ease) both; }
.hero [data-enter="2"] { animation-delay: 0.08s; }
.hero [data-enter="3"] { animation-delay: 0.16s; }
.hero [data-enter="4"] { animation-delay: 0.24s; }
.hero [data-enter="5"] { animation-delay: 0.32s; }
.hero [data-enter="6"] { animation-delay: 0.45s; }
html:has(dialog[open]) { overflow: hidden; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .scan, .tk-map .pulse { display: none; }
  .rd::after { display: none; }
}

/* 8 · RESPONSIVE ------------------------------------------------------------ */
@media (max-width: 1180px) {
  .nav-idx { display: none; }
  .nav-list a { padding: 0 10px; }
  .header-cv { display: none; }
}

@media (max-width: 1020px) {
  .menu-btn { display: inline-grid; }
  .header-tools { margin-left: auto; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    margin: 0; padding: 24px var(--gutter) 40px;
    background: var(--bg);
    display: flex; flex-direction: column; gap: 32px;
    overflow-y: auto;
    visibility: hidden; opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.25s var(--ease), visibility 0s 0.25s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a {
    width: 100%; height: 60px; padding: 0 4px;
    font-family: var(--font-sans); font-size: 26px; font-weight: 700; font-stretch: 110%;
    letter-spacing: -0.01em;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }
  .nav-list a::after { display: none; }
  .nav-idx { display: inline; font-family: var(--font-mono); font-size: 12px; font-weight: 400; min-width: 28px; }
  .nav-mobile-extra { display: grid; gap: 20px; }
  body.menu-open { overflow: hidden; }

  .hero-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.6fr); }
  .about-layout, .resume-layout, .contact-layout { grid-template-columns: 1fr; }
  .resume-side { position: static; grid-template-columns: 1fr 1fr; }
  .tk-stage { grid-template-columns: 1fr; }
  .tk-map { min-height: 400px; }
}

@media (max-width: 820px) {
  .hero { min-height: auto; padding-top: 28px; }
  .hero-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-net { mask-image: none; -webkit-mask-image: none; opacity: 0.45; }
  .hero-badge { justify-self: start; max-width: 420px; order: -1; }
  .badge-frame { display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto 1fr; gap: 0 14px; }
  .badge-head { grid-column: 1 / -1; }
  .badge-photo { aspect-ratio: 4 / 5; }
  .badge-data { padding: 0; align-content: center; gap: 6px; }
  .badge-data div { flex-direction: column; gap: 0; }
  .badge-data dd { text-align: left; font-size: 14px; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip li:nth-child(3) { border-left: 0; }
  .stat-strip li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .focus-grid, .cred-feature, .hood-grid, .resume-side { grid-template-columns: 1fr; }
  .tk-map { display: none; }
  .tk-list { grid-template-columns: 1fr 1fr; column-gap: 20px; }
  .filter-status { width: 100%; margin-left: 0; }

  .table-wrap { border: 0; background: none; overflow: visible; }
  .cred-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cred-table, .cred-table tbody, .cred-table tr, .cred-table th, .cred-table td { display: block; }
  .cred-table tbody { display: grid; gap: 10px; }
  .cred-table tbody tr {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
    padding: 16px;
    border: 1px solid var(--line); border-radius: var(--r-lg);
    background: var(--surface);
  }
  .cred-table tbody tr:last-child { border-bottom: 1px solid var(--line); }
  .cred-table th, .cred-table td { padding: 0; white-space: normal; }
  .cred-table tbody th { grid-column: 1 / -1; font-size: 16px; }
  .cred-table td:nth-child(2) { grid-column: 1; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
  .cred-table td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; color: var(--muted); }
  .cred-table td:nth-child(4) { grid-column: 1; }
  .cred-table td:nth-child(5) { grid-column: 2; grid-row: 3; justify-self: end; }
  .cf-meta { grid-template-columns: 1fr; }
  .footer-keys { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .status-line { font-size: 12px; padding: 6px 12px 6px 10px; }
  .hero-actions .btn { width: 100%; }
  .field-row { grid-template-columns: 1fr; }
  .launcher { right: 16px; bottom: 16px; padding: 0; width: 48px; height: 48px; justify-content: center; }
  .launcher-label { display: none; }
  .kbd-btn kbd { display: none; }
  .kbd-btn { padding: 0; width: 44px; justify-content: center; }
  .stat-strip li { padding: 16px; }
  .sec-tag { margin-bottom: 14px; }
  .dlg-foot .btn { padding: 0 10px; }
  .term-hints { display: none; }
  .term-in label .t-host { display: none; }
  .tk-list { grid-template-columns: 1fr; }
  .tk-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .tk-tab { justify-content: flex-start; padding: 0 12px; font-size: 14px; gap: 8px; text-align: left; line-height: 1.2; }
  .tk-tab .tk-count { display: none; }
  .timeline { padding-left: 20px; }
  .tl-item { padding: 18px; }
  .tl-item::before { left: -20px; }
  .badge-head { display: none; }
  .badge-frame { grid-template-columns: 104px 1fr; }
  .badge-data div:nth-child(3) { display: none; }
  .status-line .status-loc { display: none; }
  .status-line { white-space: nowrap; }
}

@media (min-width: 1500px) {
  :root { --wrap: 1280px; }
}

/* ==========================================================================
   v3 — multi-page layer: backgrounds, page wipe, reveals, explore, dossiers
   ========================================================================== */
body { background: transparent; }
html { background: var(--bg); }
main, .site-footer { position: relative; z-index: 1; }
.section-alt { background: rgba(12, 12, 17, 0.55); }

/* Animated page background (canvas) */
.bg-fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vw, 4vh) scale(1.12); }
  100% { transform: translate(-4vw, 8vh) scale(0.95); }
}

/* Page transition — two shutters close on a red seam, a short "connect"
   sequence runs, then the shutters split open on the new page. */
.page-wipe { position: fixed; inset: 0; z-index: 500; pointer-events: none; visibility: hidden; overflow: hidden; }
.pw-panel { position: absolute; left: 0; right: 0; height: 50.5%; background: #050507; will-change: transform; }
.pw-panel::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 140% at 50% 100%, rgba(var(--accent-rgb), 0.1), transparent 55%);
}
.pw-top { top: 0; transform: translateY(-101%); border-bottom: 1px solid var(--accent); }
.pw-bot { bottom: 0; transform: translateY(101%); border-top: 1px solid var(--accent); }
.pw-bot::after { background: radial-gradient(120% 140% at 50% 0%, rgba(var(--accent-rgb), 0.1), transparent 55%); }
.pw-seam { position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--accent); transform: scaleX(0); }
.pw-stage { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: clamp(18px, 3vh, 30px); padding: 24px; opacity: 0; }
.pw-big {
  position: relative;
  font-size: clamp(52px, 12vw, 190px); font-weight: 880; font-stretch: 125%;
  text-transform: uppercase; letter-spacing: -0.035em; line-height: 0.86; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.2);
}
.pw-big::before, .pw-big::after { content: attr(data-text); content: attr(data-text) / ""; position: absolute; inset: 0; -webkit-text-stroke: 0; }
.pw-big::before { color: var(--ink); clip-path: inset(-10% 100% -10% 0); }
.pw-big::after { color: var(--accent); opacity: 0; }
.pw-term { width: min(460px, 86vw); display: grid; gap: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.pw-line { display: flex; align-items: center; gap: 4px; color: var(--ink); font-size: 14px; }
.pw-prompt { color: var(--accent); margin-right: 6px; }
.pw-log { display: grid; gap: 2px; min-height: 4.6em; }
.pw-log li { animation: line-in 0.16s ease-out both; }
.pw-log b { color: var(--accent); font-weight: 500; }
.pw-meter { display: flex; align-items: center; gap: 12px; }
.pw-bar { flex: 1; height: 2px; background: var(--line-2); overflow: hidden; }
.pw-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.pw-pct { min-width: 4ch; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.pw-hex { position: absolute; right: clamp(16px, 4vw, 48px); bottom: clamp(16px, 4vw, 44px); margin: 0; font-family: var(--font-mono); font-size: 11px; line-height: 1.55; color: rgba(var(--accent-rgb), 0.5); white-space: pre; text-align: right; opacity: 0; }
.pw-tag { position: absolute; left: clamp(16px, 4vw, 48px); top: clamp(16px, 4vw, 40px); margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); opacity: 0; }
.pw-tag b { color: var(--accent); font-weight: 700; }

/* Leaving: shutters close, seam draws, the next page's name decrypts in. */
.page-wipe.is-in { visibility: visible; pointer-events: auto; }
.page-wipe.is-in .pw-top, .page-wipe.is-in .pw-bot { transform: none; transition: transform 0.34s var(--ease-snap); }
.page-wipe.is-in .pw-seam { animation: pw-seam 0.3s var(--ease-snap) 0.24s both; }
.page-wipe.is-in .pw-stage, .page-wipe.is-in .pw-hex, .page-wipe.is-in .pw-tag { opacity: 1; transition: opacity 0.18s 0.22s; }
.page-wipe.is-in .pw-big::before { animation: pw-fill 0.42s var(--ease-out) 0.3s both; }
.page-wipe.is-in .pw-big::after { animation: pw-glitch 0.4s steps(1) 0.28s both; }

/* Arriving: shown closed from the first paint, then opens. */
html.arriving .page-wipe { visibility: visible; animation: wipe-safety 0s 2.5s forwards; }
html.arriving .pw-top, html.arriving .pw-bot { transform: none; }
html.arriving .pw-seam { transform: scaleX(1); }
html.arriving .pw-stage, html.arriving .pw-hex, html.arriving .pw-tag { opacity: 1; }
html.arriving .pw-big::before { clip-path: inset(-10% 0 -10% 0); }
.page-wipe.is-out { visibility: visible; }
.page-wipe.is-out .pw-big::before { clip-path: inset(-10% 0 -10% 0); }
.page-wipe.is-out .pw-stage, .page-wipe.is-out .pw-hex, .page-wipe.is-out .pw-tag { opacity: 0; transform: scale(0.98); transition: opacity 0.16s, transform 0.3s var(--ease); }
.page-wipe.is-out .pw-seam { animation: pw-seam-out 0.4s var(--ease) both; }
.page-wipe.is-out .pw-top { transform: translateY(-101%); transition: transform 0.6s var(--ease-snap) 0.1s; }
.page-wipe.is-out .pw-bot { transform: translateY(101%); transition: transform 0.6s var(--ease-snap) 0.1s; }

@keyframes pw-seam { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pw-seam-out { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(1); opacity: 0; } }
@keyframes pw-fill { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% 0 -10% 0); } }
@keyframes pw-glitch {
  0% { opacity: 1; clip-path: inset(18% 0 64% 0); transform: translateX(-10px); }
  25% { clip-path: inset(56% 0 24% 0); transform: translateX(8px); }
  50% { clip-path: inset(6% 0 82% 0); transform: translateX(-5px); }
  75% { clip-path: inset(72% 0 10% 0); transform: translateX(10px); }
  100% { opacity: 0; }
}
@keyframes wipe-safety { to { visibility: hidden; } }
@media (max-width: 560px) { .pw-hex { display: none; } }

/* Scroll reveals (only when JS runs; a CSS fallback shows everything after 3s) */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); transition-delay: var(--rd, 0s); animation: reveal-fallback 0s 3s forwards; }
.js [data-reveal].in { opacity: 1; transform: none; animation: none; }
@keyframes reveal-fallback { to { opacity: 1; transform: none; } }

/* Split headings: each word rises out of a mask */
.split-w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.split-w > span { display: inline-block; transform: translateY(105%); transition: transform 0.85s var(--ease); transition-delay: calc(var(--wi, 0) * 60ms + 80ms); }
.in .split-w > span, .split-w.in > span { transform: none; }

/* Hero photo scan: once on load, again only on hover */
.scan { animation: scan 1.8s var(--ease-snap) 0.5s 1 both; }
.badge-photo.rescan .scan { animation: scan 1.4s var(--ease-snap) 0s 1 both; }
@keyframes scan { 0% { transform: translateY(-100%); opacity: 1; } 99% { opacity: 1; } 100% { transform: translateY(340%); opacity: 0; } }

/* Subpage top spacing */
.page-first { padding-top: clamp(56px, 8vw, 104px); border-top: 0; }

/* Explore cards (home) */
.explore-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.explore-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 300px; padding: 26px;
  background: rgba(17, 17, 24, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform 0.3s var(--ease), border-color 0.3s, background-color 0.3s;
  isolation: isolate;
}
.explore-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 40%, rgba(var(--accent-rgb), 0.16));
  transform: translateY(100%); transition: transform 0.5s var(--ease);
}
.explore-card:hover { transform: translateY(-6px); border-color: var(--accent-line); }
.explore-card:hover::before { transform: none; }
.ex-no { font-size: 64px; font-weight: 820; font-stretch: 120%; line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--line-2); transition: -webkit-text-stroke-color 0.3s, color 0.3s; }
.explore-card:hover .ex-no { -webkit-text-stroke-color: var(--accent); }
.ex-path { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.explore-card h3 { font-size: 22px; font-weight: 720; font-stretch: 108%; line-height: 1.15; }
.explore-card p { color: var(--muted); font-size: 15px; line-height: 1.5; }
.ex-go { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.ex-go .ic { width: 16px; height: 16px; color: var(--accent); transition: transform 0.25s var(--ease); }
.explore-card:hover .ex-go .ic { transform: translateX(6px); }

.cta-band { text-align: left; }
.cta-inner { padding: clamp(32px, 5vw, 64px); border: 1px solid var(--line-2); border-radius: var(--r-lg); background: linear-gradient(120deg, rgba(var(--accent-rgb), 0.12), rgba(17, 17, 24, 0.7) 55%); }
.cta-inner h2 { font-size: clamp(34px, 5vw, 64px); font-weight: 780; font-stretch: 112%; line-height: 1; letter-spacing: -0.02em; margin-bottom: 28px; max-width: 18ch; }
.cta-inner h2 em { color: var(--accent); }

/* Primary button shine */
.btn-primary { overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
}
.btn-primary:hover::after { animation: shine 0.7s var(--ease); }
@keyframes shine { to { left: 130%; } }

/* ── Case files as dossiers ── */
.case-card {
  margin-top: 18px;
  border-top-left-radius: 0;
  background: linear-gradient(180deg, rgba(23, 23, 32, 0.92), rgba(15, 15, 21, 0.92));
  overflow: visible;
}
.case-card .case-top { position: relative; }
.case-card .case-no {
  position: absolute; left: -25px; top: -43px;
  padding: 4px 14px 4px 12px;
  background: rgba(23, 23, 32, 0.95);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0;
  clip-path: polygon(0 0, 86% 0, 100% 100%, 0 100%);
  padding-right: 22px;
  transition: border-color 0.2s, color 0.2s;
}
.case-card:hover .case-no { border-color: var(--line-2); }
.case-card .case-cat { margin-left: auto; }
.case-stamp {
  position: absolute; right: 18px; top: 46px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 3px;
  padding: 3px 7px;
  transform: rotate(-9deg);
  opacity: 0.85;
  pointer-events: none;
}
.js .case-card[data-reveal] .case-stamp { opacity: 0; transform: rotate(-9deg) scale(1.8); }
.js .case-card[data-reveal].in .case-stamp { animation: stamp 0.45s cubic-bezier(.3,1.6,.5,1) forwards; animation-delay: calc(var(--rd, 0s) + 0.45s); }
@keyframes stamp { 0% { opacity: 0; transform: rotate(-9deg) scale(1.8); } 100% { opacity: 0.85; transform: rotate(-9deg) scale(1); } }
.case-card h3 { padding-right: 70px; min-height: 2.3em; }
.case-card::before, .case-card::after { display: none; }
.case-sheet {
  position: absolute; inset: 8px 8px -7px 8px; z-index: -1;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: rgba(17, 17, 24, 0.7);
  transition: transform 0.35s var(--ease);
}
.case-card:hover .case-sheet { transform: translate(6px, 6px) rotate(1.2deg); }
.case-redact { display: flex; gap: 6px; flex-wrap: wrap; }
.case-redact i { height: 10px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); transition: background-color 0.3s, transform 0.4s var(--ease); transform-origin: left; }
.case-card:hover .case-redact i { background: rgba(var(--accent-rgb), 0.45); transform: scaleX(0.15); }
.case-card:hover h3 { color: var(--ink); }
.case-card .case-scanline { position: absolute; inset: 0; border-radius: var(--r-lg); overflow: hidden; pointer-events: none; }
.case-card .case-scanline::after {
  content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.08));
}
.case-card:hover .case-scanline::after { animation: card-scan 0.9s var(--ease) 1; }
@keyframes card-scan { to { top: 100%; } }

/* Case dialog extras */
.cf-head .cf-access { font-family: var(--font-mono); font-size: 12px; color: var(--ok); margin-bottom: 10px; min-height: 1.4em; letter-spacing: 0.08em; }
.case-dialog .cf-steps li { opacity: 0; transform: translateX(-10px); }
.case-dialog.is-declassified .cf-steps li { animation: step-in 0.4s var(--ease) forwards; animation-delay: calc(var(--si, 0) * 110ms + 450ms); }
@keyframes step-in { to { opacity: 1; transform: none; } }
.case-dialog .cf-stamp { animation: none; }
.case-dialog.is-declassified .cf-stamp { animation: stamp-slam 0.5s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stamp-slam { from { opacity: 0; transform: scale(1.6) rotate(-4deg); } to { opacity: 1; transform: none; } }

/* Toolkit motion */
.tk-map { background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb), 0.1), transparent 60%), rgba(17, 17, 24, 0.75); }
.tk-map .edge { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: edge-draw 0.9s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes edge-draw { to { stroke-dashoffset: 0; } }
.tk-map .ring { transform-origin: center; transform-box: fill-box; animation: ring-spin 60s linear infinite; }
@keyframes ring-spin { to { transform: rotate(360deg); } }
.tk-hub { animation: hub-pop 0.6s cubic-bezier(.3,1.5,.5,1) both; }
.tk-hub::before, .tk-hub::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--accent); opacity: 0;
  animation: hub-ping 3s var(--ease) infinite;
}
.tk-hub::after { animation-delay: 1.5s; }
@keyframes hub-pop { from { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes hub-ping { 0% { opacity: 0.6; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.tk-node { animation: node-burst 0.6s cubic-bezier(.3,1.4,.5,1) forwards; animation-delay: var(--d, 0s); }
@keyframes node-burst { from { opacity: 0; transform: translate(calc(-50% + var(--fx, 0px)), calc(-50% + var(--fy, 0px))) scale(0.3); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.tk-node.is-hot { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
.tk-map.is-leaving .tk-node, .tk-map.is-leaving .tk-hub { animation: none; transition: transform 0.28s var(--ease-snap), opacity 0.28s; opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
.tk-map.is-leaving svg { opacity: 0; transition: opacity 0.25s; }
.tk-panel:not([hidden]) > p, .tk-panel:not([hidden]) .tk-list li { animation: list-in 0.45s var(--ease) both; }
.tk-panel:not([hidden]) .tk-list li { animation-delay: calc(var(--li, 0) * 50ms + 120ms); }
@keyframes list-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.tk-list li { transition: color 0.15s, padding-left 0.2s var(--ease); }
.tk-list li:hover, .tk-list li.is-hot { color: var(--accent); padding-left: 6px; }

/* Timeline draws as you scroll */
.js .timeline::before { transform: scaleY(var(--tl, 0)); transform-origin: top; transition: transform 0.2s linear; }
.js .tl-item[data-reveal]::before { transform: scale(0); transition: transform 0.5s cubic-bezier(.3,1.6,.5,1) 0.3s; }
.js .tl-item[data-reveal].in::before { transform: none; }

/* Credentials table rows */
.js .cred-table tbody tr[data-reveal] { transform: translateX(-16px); }
.js .cred-table tbody tr[data-reveal].in { transform: none; }

.sec-tag .tag-text { display: inline; min-width: 0; height: auto; padding: 0; border: 0; font-size: inherit; }
/* Section tags type themselves */
.sec-tag .typed-cur { display: inline-block; width: 7px; height: 13px; background: var(--accent); margin-left: 4px; animation: blink 1s steps(1) infinite; }

/* Focus card icons */
.focus-card .ic { transition: transform 0.4s cubic-bezier(.3,1.6,.5,1); }
.focus-card:hover .ic { transform: scale(1.18) rotate(-6deg); }
.stat-strip li { transition: background-color 0.3s; }
.stat-strip li:hover { background: rgba(var(--accent-rgb), 0.06); }

@media (max-width: 1020px) { .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .explore-grid { grid-template-columns: 1fr; }
  .explore-card { min-height: 0; }
  .ex-no { font-size: 44px; }
  .case-card h3 { padding-right: 0; min-height: 0; }
  .case-stamp { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
  .split-w > span { transform: none; }
  .page-wipe { display: none; }
  .case-dialog .cf-steps li { opacity: 1; transform: none; }
  .js .timeline::before { transform: none; }
}

/* 404 page */
.nf { min-height: 100svh; display: grid; align-items: center; padding-block: 48px; }
.nf-inner { display: grid; gap: 28px; justify-items: start; }
.nf-title { font-size: clamp(40px, 7vw, 88px); font-weight: 800; font-stretch: 115%; line-height: 0.95; letter-spacing: -0.03em; max-width: 14ch; }
.nf-title em { color: var(--accent); }
.nf-term { width: min(100%, 620px); font-family: var(--font-mono); font-size: 14px; display: grid; gap: 6px; }
.nf-term .t-err { color: var(--warn); }
.nf-term .muted { font-family: var(--font-sans); font-size: 15px; margin-top: 6px; }

@media print {
  .site-header, .launcher, #bg-fx, .progress, dialog { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ==========================================================================
   v3.1 — identity layer: sharp corners, red-only status, film grain,
   terminal section labels, highlighted headings, page titles, marquees
   ========================================================================== */
:root { --r-sm: 0px; --r: 0px; --r-lg: 0px; --ok: var(--accent); --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }
.section { padding-block: clamp(64px, 8vw, 112px); }
.page-first { padding-top: clamp(28px, 4vw, 56px); }

/* Film grain over everything (very faint), so the black never looks flat. */
body::after {
  content: ""; position: fixed; inset: -80px; z-index: 2; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.055;
  animation: grain 0.9s steps(5) infinite;
}
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-22px, 14px); } 40% { transform: translate(16px, -24px); } 60% { transform: translate(-12px, -10px); } 80% { transform: translate(24px, 18px); } }

/* Status line: a terminal readout, not a pill. */
.status-line { border: 0; background: none; padding: 0; border-radius: 0; gap: 12px; font-size: 13px; color: var(--ink); }
.status-line .sl-key { color: var(--muted); }
.blip { position: relative; display: inline-block; width: 8px; height: 8px; flex: none; background: var(--accent); }
.blip::after { content: ""; position: absolute; inset: -4px; border: 1px solid var(--accent); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
.dot-live { border-radius: 0; }
.dot-live::after { border-radius: 0; }

/* Section labels read like commands. */
.sec-tag { gap: 10px; text-transform: none; letter-spacing: 0.01em; color: var(--ink-2); font-size: 13px; }
.sec-tag .st-prompt { min-width: 0; height: auto; padding: 0; border: 0; color: var(--accent); font-size: 13px; }
.sec-tag .tag-text { color: var(--ink-2); }
.sec-tag::after { content: ""; width: 7px; height: 14px; background: var(--accent); animation: blink 1.1s steps(1) infinite; }

/* Headings: the key phrase is "selected", like highlighted terminal text.
   Default state is highlighted, so it reads correctly without the script. */
.sec-head h2 em, .cta-inner h2 em, .nf-title em {
  color: var(--accent-ink);
  background: linear-gradient(var(--accent), var(--accent)) no-repeat 0 0 / 100% 100%;
  padding: 0.04em 0.14em 0.02em;
  margin: 0 0.02em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 0.75s var(--ease-out) 0.45s, color 0.3s 0.6s;
}
.sec-head h2, .cta-inner h2, .nf-title { line-height: 1.14; }
.js [data-reveal]:not(.in) h2 em, .js h2[data-reveal]:not(.in) em { background-size: 0% 100%; color: var(--accent); }

/* Page titles: a giant outlined word that fills in once, left to right. */
.pt { position: relative; container-type: inline-size; margin-bottom: clamp(18px, 2.4vw, 30px); --len: 8; }
.pt[data-len="7"] { --len: 7; }
.pt[data-len="10"] { --len: 10; }
.pt[data-len="11"] { --len: 11; }
.pt h1, .pt::before {
  display: block;
  font-size: min(calc(100cqi / var(--len) * 1.08), 176px);
  font-weight: 880; font-stretch: 125%;
  line-height: 0.84; letter-spacing: -0.035em;
  text-transform: uppercase; white-space: nowrap;
}
.pt::before {
  content: attr(data-text);
  content: attr(data-text) / "";
  position: absolute; inset: 0;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.24);
  pointer-events: none;
}
.pt h1 { position: relative; color: var(--ink); animation: fill-sweep 1.25s var(--ease-out) 0.25s both; }
.pt::after {
  content: ""; position: absolute; top: -6%; bottom: -6%; left: 0; width: 5px;
  background: var(--accent);
  animation: sweep-bar 1.25s var(--ease-out) 0.25s both;
  pointer-events: none;
}
html.arriving .pt h1, html.arriving .pt::after { animation-delay: 0.85s; }
@keyframes fill-sweep { from { clip-path: inset(-10% 100% -10% 0); } to { clip-path: inset(-10% 0 -10% 0); } }
@keyframes sweep-bar { 0% { left: 0; opacity: 1; } 88% { opacity: 1; } 100% { left: 100%; opacity: 0; } }

/* Sharp, notched buttons. Focus ring sits inside the shape so it never gets clipped. */
.btn { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
.btn-ghost { border: 0; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost::after {
  content: ""; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px;
  background: linear-gradient(to bottom right, transparent calc(50% - 0.75px), var(--line-2) calc(50% - 0.75px), var(--line-2) calc(50% + 0.75px), transparent calc(50% + 0.75px));
  transition: background 0.2s;
}
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.btn-ghost:hover::after { background: linear-gradient(to bottom right, transparent calc(50% - 0.75px), var(--accent) calc(50% - 0.75px), var(--accent) calc(50% + 0.75px), transparent calc(50% + 0.75px)); }
.chip-btn, .launcher, .kbd-btn, .tk-node, .tk-count, .copy-btn, .verify, .tags li, kbd { border-radius: 0; }
.launcher { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }

/* Corner ticks on cards when hovered (cards stay square). */
.focus-card, .explore-card, .cred-hero, .tl-item, .contact-list a, .tk-panel, .stat-strip { --tick: transparent; }
.explore-card:hover, .focus-card:hover, .cred-hero:hover, .contact-list a:hover { --tick: var(--accent); }
.focus-card, .cred-hero, .contact-list a {
  background-image:
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick)),
    linear-gradient(var(--tick), var(--tick)), linear-gradient(var(--tick), var(--tick));
  background-repeat: no-repeat;
  background-size: 14px 2px, 2px 14px, 14px 2px, 2px 14px;
  background-position: 0 0, 0 0, 100% 100%, 100% 100%;
  transition: border-color 0.25s, transform 0.25s var(--ease), --tick 0.25s;
}
@property --tick { syntax: "<color>"; inherits: true; initial-value: transparent; }

@media (max-width: 560px) {
  .status-line .status-loc { display: none; }
  .form-bar > span:last-child, .panel-bar > span.small:last-child { display: none; }
  .pt::before { -webkit-text-stroke-width: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .pt::after { display: none; }
  .pt h1 { animation: none; }
  .sec-head h2 em, .cta-inner h2 em { transition: none; }
}

/* ==========================================================================
   v3.3 — less template: log readout, directory listing, spec list, next links
   ========================================================================== */

/* Results as a log excerpt instead of a four-number stat bar */
.logbox { margin-top: clamp(18px, 3vh, 40px); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line); background: rgba(6, 6, 8, 0.6); padding: 12px 0 4px; }
.logbox-head { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding: 0 4px 8px; }
.logbox-rows { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 56px); }
.logbox-rows > div { display: flex; align-items: baseline; gap: 12px; padding: 8px 4px; border-top: 1px dashed var(--line); transition: background-color 0.25s; }
.logbox-rows > div:hover { background: rgba(var(--accent-rgb), 0.05); }
.logbox-rows dt { flex: none; display: flex; gap: 10px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.lg-ts { color: var(--accent); }
.logbox-rows dd { flex: 1; display: flex; align-items: baseline; justify-content: flex-end; gap: 10px; min-width: 0; }
.logbox-rows dd::before { content: ""; flex: 1; min-width: 12px; border-bottom: 1px dotted var(--line-2); transform: translateY(-5px); }
.logbox-rows strong { font-size: 26px; font-weight: 780; font-stretch: 115%; line-height: 1; font-variant-numeric: tabular-nums; }
.logbox-rows > div:first-child strong { color: var(--accent); }
.logbox-rows dd span { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Home: the pages as a directory listing */
.dir-total { padding: 0 20px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.dir-row {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 116px minmax(180px, 0.7fr) minmax(0, 1.6fr) auto;
  align-items: center; gap: 24px;
  min-height: 86px; padding: 0 20px;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.35s var(--ease);
}
.dir-row::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.02) 70%);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}
.dir-row:hover::before, .dir-row:focus-visible::before { transform: scaleX(1); }
.dir-row:hover { padding-left: 30px; }
.dir-row:focus-visible { outline-offset: -2px; }
.dir-perm { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.dir-name { font-size: clamp(20px, 2.2vw, 28px); font-weight: 760; font-stretch: 115%; letter-spacing: -0.01em; white-space: nowrap; }
.dir-name .slash { color: var(--accent); }
.dir-desc { color: var(--ink-2); font-size: 15px; }
.dir-arrow { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-2); color: var(--ink-2); transition: transform 0.3s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s; }
.dir-row:hover .dir-arrow { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateX(4px); }

/* Profile: focus areas as a spec sheet, not a card grid */
.spec-list { border-top: 1px solid var(--line-2); }
.spec-row { display: grid; gap: 6px; padding: 20px 4px 20px 0; border-bottom: 1px solid var(--line); transition: padding-left 0.3s var(--ease); }
.spec-row:hover { padding-left: 10px; }
.spec-row dt { display: flex; align-items: baseline; gap: 14px; font-size: 20px; font-weight: 720; font-stretch: 110%; line-height: 1.25; }
.spec-no { min-width: 22px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent); }
.spec-row dd { padding-left: 36px; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* Bottom of each page: one big link to the next page */
.next-section { padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 100px); }
.next-link { display: block; padding-top: 22px; border-top: 1px solid var(--line-2); container-type: inline-size; }
.next-label { display: block; margin-bottom: 14px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.next-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.next-word {
  position: relative; display: inline-block;
  font-size: clamp(28px, calc((100cqi - 130px) / 10.8), 148px); font-weight: 880; font-stretch: 125%;
  text-transform: uppercase; letter-spacing: -0.035em; line-height: 0.86; white-space: nowrap;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.4);
}
.next-word::after {
  content: attr(data-text); content: attr(data-text) / "";
  position: absolute; inset: 0;
  color: var(--accent); -webkit-text-stroke: 0;
  clip-path: inset(-10% 100% -10% 0);
  transition: clip-path 0.65s var(--ease-out);
}
.next-link:hover .next-word::after, .next-link:focus-visible .next-word::after { clip-path: inset(-10% 0 -10% 0); }
.next-arrow { flex: none; display: grid; place-items: center; width: clamp(52px, 6vw, 84px); aspect-ratio: 1; border: 1px solid var(--line-2); transition: transform 0.35s var(--ease), background-color 0.2s, border-color 0.2s, color 0.2s; }
.next-arrow .ic { width: 28px; height: 28px; }
.next-link:hover .next-arrow { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateX(6px); }

@media (max-width: 820px) {
  .logbox-rows { grid-template-columns: minmax(0, 1fr); }
  .dir-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 16px; min-height: 0; }
  .dir-row:hover { padding-left: 16px; }
  .dir-perm { display: none; }
  .dir-name { grid-column: 1; }
  .dir-desc { grid-column: 1; grid-row: 2; font-size: 14px; }
  .dir-arrow { grid-column: 2; grid-row: 1 / span 2; }
}
@media (max-width: 560px) {
  .logbox-rows dt { font-size: 12px; }
  .logbox-rows strong { font-size: 22px; }
  .logbox-rows dd span { display: none; }
  .spec-row dd { padding-left: 0; }
  .next-word { -webkit-text-stroke-width: 1px; }
  .next-row { flex-wrap: wrap; gap: 16px; }
  .next-arrow { width: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .next-word::after { transition: none; }
  .dir-row, .spec-row { transition: none; }
}

/* ==========================================================================
   v3.5 — calmer labels, prev/next page nav, career track, credential tiers,
   case-file filter landing, full-screen code field in the page transition
   ========================================================================== */

/* Section labels: a plain label, no command syntax */
.sec-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); gap: 12px; }
.sec-tag::after { display: none; }
.sec-tag::before { content: ""; width: 8px; height: 8px; background: var(--accent); flex: none; }
.sec-tag .st-prompt { display: none; }

/* Stats: the clean four-up strip, with sharp edges and smooth hover */
.stat-strip { border: 1px solid var(--line); background: rgba(10, 10, 13, 0.72); }
.stat-strip li { transition: background-color 0.4s var(--ease); }
.stat-strip li strong { transition: color 0.4s var(--ease); }
.stat-strip li:hover strong { color: var(--accent); }

/* Smooth hover everywhere a card already animates */
.focus-card, .explore-card, .cred-hero, .tl-item, .contact-list a, .panel, .case-card, .chip-btn, .tk-tab, .copy-btn, .verify, .btn {
  transition-duration: 0.35s;
  transition-timing-function: var(--ease);
}

/* ── Bottom of each page: previous / next ─────────────────────────────── */
.page-nav-section { padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 96px); }
.page-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pn {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; gap: 8px; align-content: start;
  min-height: 150px; padding: 24px 26px;
  border: 1px solid var(--line);
  background: rgba(12, 12, 16, 0.78);
  transition: border-color 0.45s var(--ease), transform 0.45s var(--ease);
}
.pn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.02) 60%);
  opacity: 0; transform: translateX(-12%);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease-out);
}
.pn:hover, .pn:focus-visible { border-color: var(--accent-line); transform: translateY(-3px); }
.pn:hover::before, .pn:focus-visible::before { opacity: 1; transform: none; }
.pn-kicker { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pn-kicker .ic { width: 16px; height: 16px; color: var(--accent); transition: transform 0.45s var(--ease); }
.pn-title { font-size: clamp(26px, 3vw, 40px); font-weight: 800; font-stretch: 118%; line-height: 1.02; letter-spacing: -0.02em; transition: color 0.45s var(--ease), transform 0.45s var(--ease); }
.pn-desc { color: var(--ink-2); font-size: 15px; max-width: 40ch; }
.pn:hover .pn-title { color: var(--accent); }
.pn-next { text-align: right; justify-items: end; }
.pn-next:hover .pn-kicker .ic { transform: translateX(5px); }
.pn-prev:hover .pn-kicker .ic { transform: scaleX(-1) translateX(5px); }
.pn-prev .pn-kicker .ic { transform: scaleX(-1); }
.pn-solo { grid-column: 2; }

/* ── Experience: career track ─────────────────────────────────────────── */
.track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 4px 0 clamp(36px, 5vw, 56px); padding-top: 22px; }
.track::before, .track::after { content: ""; position: absolute; left: 0; right: 0; top: 27px; height: 2px; }
.track::before { background: var(--line-2); }
.track::after { background: linear-gradient(90deg, var(--accent) 75%, rgba(var(--accent-rgb), 0.2)); transform-origin: left; transition: transform 1.6s var(--ease-out) 0.2s; }
.js .track[data-reveal]:not(.in)::after { transform: scaleX(0); }
.track li { position: relative; padding-right: 16px; }
.track li::before {
  content: ""; position: absolute; left: 0; top: -1px; z-index: 1;
  width: 12px; height: 12px; transform: rotate(45deg);
  background: var(--bg); border: 2px solid var(--accent);
  transition: background-color 0.4s var(--ease) calc(0.35s + var(--ti, 0) * 0.35s), transform 0.5s cubic-bezier(.3,1.6,.5,1) calc(0.35s + var(--ti, 0) * 0.35s);
}
.track li:nth-child(1) { --ti: 0; } .track li:nth-child(2) { --ti: 1; } .track li:nth-child(3) { --ti: 2; } .track li:nth-child(4) { --ti: 3; }
.track li.now::before { background: var(--accent); }
.js .track[data-reveal]:not(.in) li::before { transform: rotate(45deg) scale(0); }
.track time { display: block; margin-top: 22px; font-family: var(--font-mono); font-size: 12px; color: var(--accent); }
.track strong { display: block; margin-top: 4px; font-size: 16px; font-weight: 700; font-stretch: 106%; line-height: 1.25; }
.track span { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

.tl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 18px 0 4px; background: var(--line); border: 1px solid var(--line); }
.tl-stats div { padding: 14px 16px; background: rgba(10, 10, 13, 0.9); transition: background-color 0.4s var(--ease); }
.tl-stats div:hover { background: rgba(var(--accent-rgb), 0.08); }
.tl-stats strong { display: block; font-size: 26px; font-weight: 800; font-stretch: 115%; line-height: 1; font-variant-numeric: tabular-nums; }
.tl-stats div:first-child strong { color: var(--accent); }
.tl-stats span { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.35; }
.tl-sub { margin: 20px 0 10px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 5px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.02); transition: border-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease); }
.chips li:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-2px); }
.tl-item .tl-link { margin-top: 12px; }

/* ── Credentials: tiers ───────────────────────────────────────────────── */
.tier-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: clamp(44px, 6vw, 72px) 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.tier-label h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 780; font-stretch: 112%; letter-spacing: -0.015em; }
.tier-label span { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cred-summary { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 18px; font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.cred-summary b { color: var(--accent); font-weight: 700; font-size: 15px; margin-right: 6px; }

.q-feature {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(24px, 4vw, 56px);
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid var(--accent-line);
  background: linear-gradient(140deg, rgba(var(--accent-rgb), 0.1), rgba(12, 12, 16, 0.92) 45%);
}
.q-badge { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); }
.q-feature h3 { margin: 16px 0 10px; font-size: clamp(28px, 3.4vw, 46px); font-weight: 820; font-stretch: 116%; line-height: 1.02; letter-spacing: -0.02em; max-width: 18ch; }
.q-meta { color: var(--ink-2); font-size: 15px; }
.q-facts { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 22px; }
.q-facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.q-facts dd { font-size: 26px; font-weight: 800; font-stretch: 115%; font-variant-numeric: tabular-nums; }
.q-side { display: grid; align-content: start; gap: 12px; }
.nqf-label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.nqf-label b { color: var(--ink); font-weight: 500; }
.nqf { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.nqf i { height: 34px; background: var(--line); position: relative; overflow: hidden; }
.nqf i::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform: scaleY(0); transform-origin: bottom; transition: transform 0.5s var(--ease-out) calc(0.3s + var(--n, 0) * 0.12s); }
.nqf i.on::after { transform: none; }
.js [data-reveal]:not(.in) .nqf i.on::after { transform: scaleY(0); }
.nqf i:nth-child(1) { --n: 0; } .nqf i:nth-child(2) { --n: 1; } .nqf i:nth-child(3) { --n: 2; } .nqf i:nth-child(4) { --n: 3; } .nqf i:nth-child(5) { --n: 4; }
.nqf-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.q-modules { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; }
.q-modules summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; list-style: none; font-weight: 650; transition: color 0.35s var(--ease); }
.q-modules summary::-webkit-details-marker { display: none; }
.q-modules summary:hover { color: var(--accent); }
.q-modules summary .ic { color: var(--accent); transition: transform 0.4s var(--ease); }
.q-modules[open] summary .ic { transform: rotate(180deg); }
.q-modules .module-list { margin-top: 14px; border: 1px solid var(--line); }

.cert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cert {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-content: start;
  padding: 26px;
  border: 1px solid var(--line);
  background: rgba(12, 12, 16, 0.85);
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease), background-color 0.5s var(--ease);
}
.cert:hover { border-color: var(--accent-line); transform: translateY(-3px); background: rgba(18, 14, 18, 0.92); }
.cert .seal { grid-row: span 3; width: 64px; height: 64px; }
.cert .seal svg.ring { transition: transform 0.8s var(--ease); }
.cert-kind { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cert h4 { font-size: 21px; font-weight: 760; font-stretch: 110%; line-height: 1.2; }
.cert-dates { font-size: 14px; color: var(--ink-2); }
.cert .cred-actions { grid-column: 1 / -1; margin-top: 12px; }

.course-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.cgroup { border: 1px solid var(--line); background: rgba(12, 12, 16, 0.85); }
.cgroup-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cgroup-head h4 { font-size: 17px; font-weight: 720; font-stretch: 108%; }
.cgroup-head span { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; color: var(--accent); border: 1px solid var(--accent-line); }
.course { display: grid; gap: 6px; padding: 14px 18px; border-bottom: 1px solid var(--line); transition: background-color 0.4s var(--ease); }
.course:last-child { border-bottom: 0; }
.course:hover { background: rgba(var(--accent-rgb), 0.06); }
.course h5 { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.3; }
.course-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.course-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

/* ── Case files: leave and land when filtering ───────────────────────── */
.case-grid { perspective: 1400px; }
.case-card.case-out { animation: case-out 0.24s var(--ease) both; pointer-events: none; }
.case-card.case-land { animation: case-land 0.75s var(--ease-out) both; animation-delay: calc(var(--li, 0) * 70ms); }
.case-card.case-land .case-stamp { animation: stamp 0.45s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(var(--li, 0) * 70ms + 0.45s); }
@keyframes case-out { to { opacity: 0; transform: translateY(14px) scale(0.97); filter: blur(3px); } }
@keyframes case-land {
  0% { opacity: 0; transform: translateY(-34px) rotateX(16deg) scale(0.96); clip-path: inset(-60px -30px 100% -30px); }
  55% { opacity: 1; clip-path: inset(-60px -30px -30px -30px); }
  78% { transform: translateY(4px) rotateX(0) scale(1); }
  100% { opacity: 1; transform: none; clip-path: inset(-60px -30px -30px -30px); }
}

/* ── Page transition: codes fill the whole screen, faintly ────────────── */
.pw-hex {
  inset: 0; right: 0; bottom: 0; left: 0; top: 0;
  margin: 0; padding: 8px 12px;
  font-size: 11px; line-height: 17px; letter-spacing: 0.08em;
  color: rgba(var(--accent-rgb), 0.16); text-align: left; overflow: hidden;
  mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, transparent 25%, #000 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, transparent 25%, #000 75%);
}
.page-wipe .pw-stage { z-index: 1; }
@media (max-width: 560px) { .pw-hex { display: block; } }

@media (max-width: 1020px) {
  .course-groups { grid-template-columns: minmax(0, 1fr); }
  .q-feature { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .page-nav, .cert-grid { grid-template-columns: minmax(0, 1fr); }
  .pn-solo { grid-column: 1; }
  .pn-next { text-align: left; justify-items: start; }
  .track { grid-template-columns: 1fr 1fr; row-gap: 26px; }
  .track::before, .track::after { display: none; }
  .tl-stats { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .case-card.case-out, .case-card.case-land { animation: none; }
  .track::after, .track li::before, .nqf i::after { transition: none; }
}

/* Certificate seal: a slowly turning dashed ring around the issuer mark */
.seal { position: relative; width: 64px; height: 64px; display: grid; place-items: center; color: var(--accent); }
.seal svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; animation: seal-spin 28s linear infinite; }
.seal svg.ring circle { fill: none; stroke: var(--accent-line); stroke-width: 1.4; stroke-dasharray: 3 5; }
.seal > .ic { position: relative; transition: transform 0.6s var(--ease); }
.cert:hover .seal > .ic { transform: scale(1.12); }
.cert .seal svg.ring { transition: transform 0.8s var(--ease); }
.cert:hover .seal svg.ring { transform: scale(1.1); }
@keyframes seal-spin { to { rotate: 360deg; } }

/* ==========================================================================
   v3.6 — calmer scale: smaller titles, stat cards with small visuals
   ========================================================================== */

/* Smaller, quieter headings */
.hero-title { font-size: clamp(42px, 10.5cqi, 104px); margin-bottom: clamp(14px, 2.4vh, 22px); }
.pt h1, .pt::before { font-size: clamp(34px, 5.8vw, 78px); }
.pt { margin-bottom: clamp(12px, 1.8vw, 20px); }
.sec-head h2, .h-sec { font-size: clamp(28px, 3.3vw, 46px); }
.q-feature h3 { font-size: clamp(24px, 2.6vw, 36px); }
.pn-title { font-size: clamp(24px, 2.4vw, 34px); }
.page-first { padding-top: clamp(24px, 3.5vw, 48px); }

/* Experience: company on its own line instead of "@ Company" */
.tl-item h3 .at { display: block; margin-top: 4px; font-size: 16px; font-weight: 500; font-stretch: 100%; color: var(--muted); }

/* Credentials: qualification card without the level meter */
.q-feature { grid-template-columns: minmax(0, 1fr); }

/* Stat cards: number + a small visual that builds itself */
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: clamp(22px, 3.6vh, 44px); }
.sc {
  display: grid; gap: 6px; align-content: start;
  padding: 18px 20px 20px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 13, 0.8);
  transition: border-color 0.45s var(--ease), transform 0.45s var(--ease), background-color 0.45s var(--ease);
}
.sc:hover { border-color: var(--accent-line); transform: translateY(-3px); background: rgba(16, 12, 15, 0.9); }
.sc strong { font-size: clamp(28px, 2.8vw, 38px); font-weight: 800; font-stretch: 115%; line-height: 1; font-variant-numeric: tabular-nums; transition: color 0.45s var(--ease); }
.sc:hover strong { color: var(--accent); }
.sc > span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.sc-vis { height: 30px; margin-bottom: 8px; display: flex; align-items: flex-end; gap: 4px; }
.js .sc-vis[data-reveal] { transform: none; }

/* #1 of 10: ten bars, the first one tall and red */
.sc-rank i { flex: 1; max-width: 12px; height: 9px; background: var(--line-2); }
.sc-rank i:first-child { height: 30px; background: var(--accent); }
.sc-rank.in i { animation: sc-rise 0.5s var(--ease-out) both; animation-delay: calc(0.2s + var(--i, 0) * 0.05s); transform-origin: bottom; }

/* Tickets: rows that get worked off */
.sc-tickets { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 4px; }
.sc-tickets i { height: 3px; background: linear-gradient(90deg, var(--accent) 8px, var(--line-2) 8px); transform-origin: left; }
.sc-tickets i:nth-child(2) { width: 82%; } .sc-tickets i:nth-child(3) { width: 92%; } .sc-tickets i:nth-child(4) { width: 70%; }
.sc-tickets.in i { animation: sc-grow 0.55s var(--ease-out) both; animation-delay: calc(0.2s + var(--i, 0) * 0.1s); }

/* Five stars */
.sc-stars { gap: 3px; align-items: center; }
.sc-stars svg { width: 22px; height: 22px; fill: var(--accent); }
.sc-stars.in svg { animation: sc-pop 0.45s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(0.2s + var(--i, 0) * 0.08s); }

/* Devices: a small block of endpoints switching on */
.sc-devices { display: grid; grid-template-columns: repeat(18, 1fr); grid-auto-rows: 9px; gap: 3px; align-content: end; }
.sc-devices i { height: 9px; background: rgba(var(--accent-rgb), 0.55); }
.sc-devices.in i { animation: sc-on 0.5s ease both; animation-delay: calc(0.2s + var(--i, 0) * 0.022s); }

@keyframes sc-rise { from { transform: scaleY(0.1); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sc-grow { from { transform: scaleX(0); } to { transform: none; } }
@keyframes sc-pop { from { transform: scale(0.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sc-on { 0% { background: var(--line); } 60% { background: var(--accent); } 100% { background: rgba(var(--accent-rgb), 0.55); } }

@media (max-width: 820px) { .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .sc { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { .sc-vis.in i, .sc-vis.in svg { animation: none; } }

/* Contact form: a successful send reads green, not red */
.form-status.is-success { color: #3ddc84; }

/* Story: bold phrases stand out in white */
.about-story strong { color: #fff; font-weight: 700; }
