/* Fonts are self-hosted (latin subset) so they load from the same server as the page */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Layout: one 1160px column. Each section reads like a database table — a mono rail
   (table name · row count) on the left, the records on the right — and stacks on phones. */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --line: #dde2eb;
  --line-strong: #c4ccda;
  --ink: #0e1525;
  --ink-2: #39445b;
  --muted: #5f6a81;
  --accent: #2448d8;
  --accent-ink: #ffffff;
  --accent-soft: #e5eafc;
  --signal: #b35400;
  --signal-soft: #fcefe2;
  --signal-ink: #9a4700;
  --ok: #157a4c;
  --ok-soft: #e3f4ea;
  --logo-tile: #ffffff;
  --syn-kw: #2448d8;
  --syn-com: #5f6a81;
  --inv-bg: #ffffff;
  --inv-fg: #0e1525;
  --inv-muted: #5f6a81;
  --inv-line: #dde2eb;
  --inv-accent: #2448d8;
  --grid-dot: #cfd6e2;
  --scroll-thumb: #bcc5d4;
  --scroll-thumb-hover: #8b96ab;
  --shadow: 0 1px 2px rgb(14 21 37 / 0.05), 0 12px 32px -16px rgb(14 21 37 / 0.22);

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Geist", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1160px;
  --nav-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);       /* phone notch / status bar */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e16;
    --surface: #101624;
    --surface-2: #161e2f;
    --line: #222b3e;
    --line-strong: #34405a;
    --ink: #e9edf5;
    --ink-2: #bec6d6;
    --muted: #8b96ad;
    --accent: #8fa9ff;
    --accent-ink: #0a0e16;
    --accent-soft: #19234a;
    --signal: #ffa552;
    --signal-soft: #2d2013;
    --signal-ink: #ffa552;
    --ok: #5ad48f;
    --ok-soft: #10281c;
    --logo-tile: #ffffff;
    --syn-kw: #8fa9ff;
    --syn-com: #8b96ad;
    --inv-bg: #121a2b;
    --inv-fg: #e9edf5;
    --inv-muted: #95a0b6;
    --inv-line: #2a3550;
    --inv-accent: #8fa9ff;
    --grid-dot: #1d2638;
    --scroll-thumb: #2f3a52;
    --scroll-thumb-hover: #4a5877;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 16px 40px -18px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0e16;
  --surface: #101624;
  --surface-2: #161e2f;
  --line: #222b3e;
  --line-strong: #34405a;
  --ink: #e9edf5;
  --ink-2: #bec6d6;
  --muted: #8b96ad;
  --accent: #8fa9ff;
  --accent-ink: #0a0e16;
  --accent-soft: #19234a;
  --signal: #ffa552;
  --signal-soft: #2d2013;
  --signal-ink: #ffa552;
  --ok: #5ad48f;
  --ok-soft: #10281c;
  --logo-tile: #ffffff;
  --syn-kw: #8fa9ff;
  --syn-com: #8b96ad;
  --inv-bg: #121a2b;
  --inv-fg: #e9edf5;
  --inv-muted: #95a0b6;
  --inv-line: #2a3550;
  --inv-accent: #8fa9ff;
  --grid-dot: #1d2638;
  --scroll-thumb: #2f3a52;
  --scroll-thumb-hover: #4a5877;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.35), 0 16px 40px -18px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + var(--safe-top)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
svg { flex: none; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
/* Scrollbars follow the site theme (Chrome, Edge, Firefox use scrollbar-color; Safari uses the ::-webkit rules) */
html { scrollbar-color: var(--scroll-thumb) var(--bg); }
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 3px solid var(--bg); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none;
  transform: translateY(-160%); transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(var(--safe-top)); }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 500; font-size: 15px; text-decoration: none;
}
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.text-link svg:last-child { transition: transform 0.2s; }
.text-link:hover svg:last-child { transform: translate(2px, -2px); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: var(--safe-top);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s, border-color 0.25s;
}
.nav.is-scrolled, .nav.is-open {
  background: var(--bg);
  border-bottom-color: var(--line);
}
.nav-inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark {
  position: relative; flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; padding-bottom: 3px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-display); font-weight: 800; font-size: 12.5px; letter-spacing: -0.02em;
}
.brand-mark::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 7px;
  height: 2px; border-radius: 2px; background: var(--signal);
}

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  position: relative; display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500; text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px;
  height: 2px; border-radius: 2px; background: var(--accent);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; transition: border-color 0.2s, background-color 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn > svg { grid-area: 1 / 1; }

.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }

.menu-btn { display: none; }
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }
.menu-btn[aria-expanded="true"] .i-open { display: none; }

.mobile-menu { border-top: 1px solid var(--line); }
.mobile-menu ul { display: grid; padding-block: 8px 16px; }
.mobile-menu a {
  display: flex; align-items: center; gap: 6px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 17px; font-weight: 500; text-decoration: none;
}
.mobile-menu li:last-child a { border-bottom: 0; color: var(--accent); }

@media (max-width: 1000px) {
  .nav-links, .nav-resume { display: none; }
  .menu-btn { display: inline-grid; }
}
@media (min-width: 1001px) {
  .mobile-menu { display: none !important; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: calc(var(--nav-h) + clamp(48px, 8vw, 112px)) clamp(48px, 7vw, 88px);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 85% 30%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 70% at 85% 30%, #000 10%, transparent 75%);
}
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(36px, 5vw, 72px); align-items: center;
}
.hero-copy { min-width: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }

.hero-title {
  margin-top: 24px;
  font-family: var(--font-display); font-weight: 760;
  font-size: clamp(2.9rem, 7.2vw, 5.9rem); line-height: 0.93; letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}
.hero-title .line { display: block; }
.caret {
  display: inline-block; width: 0.075em; height: 0.78em; margin-left: 0.08em;
  background: var(--signal); border-radius: 2px; vertical-align: -0.02em;
}

.hero-role { margin-top: 30px; font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 500; color: var(--ink); text-wrap: balance; }
.hero-role strong { font-weight: 600; }
.hero-lead { margin-top: 12px; max-width: 60ch; color: var(--ink-2); font-size: 1.05rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-social { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 26px; }
.hero-social a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 14.5px; font-weight: 500; text-decoration: none;
  transition: color 0.2s;
}
.hero-social a:hover { color: var(--ink); }

/* At-a-glance card */
.glance {
  min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.glance-head { padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.glance-list li + li { border-top: 1px solid var(--line); }
.glance-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 18px; text-decoration: none; transition: background-color 0.2s;
}
.glance-row:hover { background: var(--surface-2); }
.glance-text { display: grid; gap: 1px; min-width: 0; }
.glance-k {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.glance-k.is-now { color: var(--signal-ink); }
.glance-k.is-now > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor;}
.glance-v { font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--ink); }
.glance-s { font-size: 13.5px; color: var(--muted); }
.glance-go { color: var(--muted); transition: transform 0.2s, color 0.2s; }
.glance-row:hover .glance-go { color: var(--accent); transform: translateX(2px); }
.icon-tile { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; }
.icon-tile.is-paper { color: var(--accent); background: var(--accent-soft); }
.icon-tile.is-award { color: var(--signal); background: var(--signal-soft); }
.glance-foot { display: grid; gap: 10px; padding: 14px 18px 18px; border-top: 1px solid var(--line); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .glance { max-width: 560px; }
}

/* Facts ledger */
.ledger {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  margin-top: clamp(56px, 8vw, 96px);
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.ledger > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; padding: 20px 22px; background: var(--surface); }
.ledger dt { font-size: 13.5px; color: var(--muted); }
.ledger dd {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.9rem, 3.4vw, 2.5rem);
  line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .eyebrow { font-size: 11px; letter-spacing: 0.05em; gap: 8px; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger > div { padding: 16px 18px; }
  .hero-actions .btn { flex: 1 1 auto; }
}

/* Code window (404 page) */
.query {
  min-width: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  font-family: var(--font-mono); font-size: 12.5px;
}
.query-code {
  margin: 0; padding: 14px 16px 12px; overflow-x: auto;
  font: inherit; line-height: 1.75; color: var(--ink); background: var(--surface);
}
.query-code .ln { display: inline-block; width: 2ch; margin-right: 14px; color: var(--syn-com); text-align: right; user-select: none; }
.tk-k { color: var(--syn-kw); font-weight: 500; }
.tk-c { color: var(--syn-com); font-style: italic; }
.query-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px; background: var(--surface-2);
}
.ok-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---------- Sections ---------- */
.section { padding-block: clamp(64px, 8vw, 104px); border-top: 1px solid var(--line); }
.section-grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); }
.rail { position: sticky; top: calc(var(--nav-h) + var(--safe-top) + 28px); align-self: start; }
.tbl {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2);
}
.tbl svg { color: var(--accent); }
.tbl span { color: var(--muted); }
.rail h2 {
  margin-top: 12px;
  font-family: var(--font-display); font-weight: 720;
  font-size: clamp(2rem, 3.4vw, 2.7rem); line-height: 1.02; letter-spacing: -0.035em;
  text-wrap: balance;
}
.rail-note { margin-top: 14px; max-width: 30ch; color: var(--muted); font-size: 15px; line-height: 1.55; }

@media (max-width: 900px) {
  .section-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .rail-note { max-width: 52ch; }
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1;
  padding: 7px 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}

/* Logo tile — logos keep their own colours, so they always sit on white */
.logo-tile {
  flex: none; width: 52px; height: 52px; padding: 9px;
  display: grid; place-items: center;
  border-radius: 12px; background: var(--logo-tile); border: 1px solid var(--line);
}
.logo-tile img { width: 100%; height: 100%; object-fit: contain; }
.logo-sm { width: 44px; height: 44px; padding: 9px; border-radius: 10px; }
.logo-gh { color: #181717; }

/* ---------- Experience ---------- */
.timeline { display: grid; }
.job { display: grid; grid-template-columns: 148px minmax(0, 1fr); column-gap: 28px; }
.job-when { padding-top: 14px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.job-body { position: relative; min-width: 0; padding: 0 0 56px 32px; border-left: 1px solid var(--line); }
.job:last-child .job-body { padding-bottom: 8px; }
.job-body::before {
  content: ""; position: absolute; left: -7px; top: 19px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong);
}
.job.is-current .job-body::before { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 5px var(--signal-soft); }
.job-head { display: flex; align-items: center; gap: 16px; }
.job-head > div { min-width: 0; }
.job h3 { font-family: var(--font-display); font-weight: 650; font-size: clamp(1.25rem, 2.2vw, 1.5rem); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.org { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; color: var(--ink-2); font-weight: 500; }
.pill-current {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--signal-ink); background: var(--signal-soft);
}
.pill-current > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor;}
.job-desc { margin-top: 18px; max-width: 62ch; color: var(--ink-2); }
.job .chips { margin-top: 18px; }
.job .text-link { margin-top: 18px; }

@media (max-width: 640px) {
  .job { grid-template-columns: minmax(0, 1fr); }
  .job-when { padding: 0 0 12px 32px; border-left: 1px solid var(--line); }
  .job-body::before { top: -24px; }
  .job:first-child .job-when { padding-top: 0; }
  .job-head { align-items: flex-start; }
  .logo-tile { width: 46px; height: 46px; padding: 8px; }
}

/* ---------- Skills ---------- */
.skills {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.tk { padding: 26px; background: var(--surface); }
.tk h3 {
  margin-bottom: 16px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
@media (max-width: 640px) {
  .skills { grid-template-columns: minmax(0, 1fr); }
  .tk { padding: 22px; }
}

/* ---------- Projects ---------- */
.projects { display: grid; gap: 16px; }
.project {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 36px;
  padding: clamp(22px, 3vw, 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s;
}
.project:hover { border-color: var(--line-strong); }
.project-main { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.project-kind {
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.badge-live {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px;
  color: var(--ok); background: var(--ok-soft); letter-spacing: 0.08em;
}
.badge-live > span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.project h3 {
  margin-top: 10px;
  font-family: var(--font-display); font-weight: 650;
  font-size: clamp(1.3rem, 2.3vw, 1.6rem); line-height: 1.18; letter-spacing: -0.025em; text-wrap: balance;
}
.project .text-link { margin-top: auto; padding-top: 20px; }

.features { display: grid; gap: 11px; align-content: start; }
.features li { display: flex; align-items: flex-start; gap: 11px; color: var(--ink-2); line-height: 1.5; }
.features svg { margin-top: 3px; color: var(--accent); }
.project .features { padding-left: 28px; border-left: 1px dashed var(--line-strong); }

@media (max-width: 720px) {
  .project { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .project-main { display: contents; }
  .project .features { margin-top: 20px; padding: 18px 0 0; border-left: 0; border-top: 1px dashed var(--line-strong); }
  .project .text-link { order: 3; margin-top: 20px; padding-top: 0; }
}

/* ---------- Hackathons & publications ---------- */
.paper, .award {
  min-width: 0; padding: clamp(22px, 3vw, 34px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.paper-journal, .award-kind {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.paper-journal svg { color: var(--accent); }
.paper h3 {
  margin-top: 14px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.08; letter-spacing: -0.03em; text-wrap: balance;
}
.paper-venue { margin-top: 8px; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.paper-abstract { margin-top: 16px; max-width: 64ch; color: var(--ink-2); }
.paper h4 {
  margin-top: 26px; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.features-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }

.meta {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 1px;
  margin-top: 26px; margin-bottom: 22px;
  background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.meta > div { min-width: 0; padding: 12px 14px; background: var(--surface-2); }
.meta dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.meta dd { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 14px; font-weight: 500; color: var(--ink); }
.doi { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }

.copy-btn {
  position: relative; display: inline-grid; place-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  cursor: pointer; transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.copy-btn:not(.copy-btn-text) { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.copy-btn:not(.copy-btn-text) > svg { grid-area: 1 / 1; }
.copy-btn:hover { color: var(--accent); border-color: var(--line-strong); }
.copy-btn .i-done { display: none; }
.copy-btn.is-copied .i-done { display: block; }
.copy-btn.is-copied .i-copy { display: none; }
.copy-btn.is-copied { color: var(--ok); }

.award { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 20px 40px; align-items: start; }
.award-body { min-width: 0; }
.award-icon {
  display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 18px;
  border-radius: 14px; color: var(--signal); background: var(--signal-soft);
}
.award h3 {
  margin-top: 8px;
  font-family: var(--font-display); font-weight: 720;
  font-size: clamp(1.7rem, 3vw, 2.1rem); line-height: 1.05; letter-spacing: -0.03em;
}
.award-project { margin-top: 6px; color: var(--ink); font-weight: 600; }
.award-desc { color: var(--ink-2); max-width: 60ch; }
.award .chips { margin-top: 18px; }
.award .text-link { margin-top: 20px; }

@media (max-width: 720px) {
  .award { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 600px) {
  .features-2 { grid-template-columns: minmax(0, 1fr); }
  .meta { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Certifications ---------- */
.certs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.certs li + li { border-top: 1px solid var(--line); }
.cert {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 16px 22px; text-decoration: none;
  transition: background-color 0.2s;
}
.cert:hover { background: var(--surface-2); }
.cert-text { display: grid; gap: 1px; min-width: 0; }
.cert-name { font-weight: 600; color: var(--ink); line-height: 1.35; }
.cert-issuer { font-size: 14px; color: var(--muted); }
.cert-verify {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--accent);
}
.cert:hover .cert-verify svg { transform: translate(2px, -2px); }
.cert-verify svg { transition: transform 0.2s; }
@media (max-width: 520px) {
  .cert { padding: 14px 16px; gap: 12px; }
  .cert-verify { font-size: 0; gap: 0; }
  .cert-verify svg { width: 16px; height: 16px; }
}

/* ---------- Contact ---------- */
.contact { padding-block: clamp(24px, 4vw, 48px) clamp(64px, 9vw, 112px); }
.contact-card {
  position: relative; overflow: hidden;
  padding: clamp(28px, 6vw, 72px);
  border-radius: 24px; border: 1px solid var(--inv-line); background: var(--inv-bg); color: var(--inv-fg);
}
.contact-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--inv-line) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 55% 80% at 100% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(ellipse 55% 80% at 100% 0%, #000 0%, transparent 70%);
}
.contact-card > * { position: relative; z-index: 1; }
.tbl-inv { color: var(--inv-muted); }
.tbl-inv svg { color: var(--inv-accent); }
.contact-card h2 {
  margin-top: 16px; max-width: 16ch;
  font-family: var(--font-display); font-weight: 740;
  font-size: clamp(2.2rem, 5.6vw, 4.4rem); line-height: 0.98; letter-spacing: -0.04em; text-wrap: balance;
}
.contact-lead { margin-top: 18px; max-width: 50ch; color: var(--inv-muted); font-size: 1.05rem; }

.email-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 36px; padding: 14px 14px 14px 22px;
  border: 1px solid var(--inv-line); border-radius: 16px;
}
.email-addr {
  min-width: 0; overflow-wrap: anywhere; user-select: all;
  font-family: var(--font-mono); font-size: clamp(1rem, 2.2vw, 1.3rem); color: var(--inv-fg);
}
.email-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-inv { background: var(--inv-fg); color: var(--inv-bg); }
.btn-inv:hover { background: var(--inv-accent); color: var(--inv-bg); }
.btn-inv-ghost.copy-btn { display: inline-flex; background: transparent; color: var(--inv-fg); border: 1px solid var(--inv-line); }
.btn-inv-ghost.copy-btn:hover { border-color: var(--inv-muted); color: var(--inv-fg); }

.contact-links { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 28px; }
.contact-links a {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--inv-muted); font-weight: 500; text-decoration: none; transition: color 0.2s;
}
.contact-links a:hover { color: var(--inv-fg); }

@media (max-width: 560px) {
  .email-row { padding: 16px; }
  .email-actions, .email-actions .btn { width: 100%; }
  .email-actions .btn { flex: 1 1 0; }
  .email-actions { flex-wrap: nowrap; }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: 26px; color: var(--muted); font-size: 14px;
}
.footer-domain { font-family: var(--font-mono); font-size: 13px; }
.footer-top { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 500; color: var(--ink-2); }
.footer-top:hover { color: var(--accent); }
@media (max-width: 520px) { .footer-domain { display: none; } }

/* ---------- Touch: finger-sized tap areas (44px) without changing the layout ---------- */
@media (pointer: coarse), (max-width: 1000px) {
  .icon-btn { width: 44px; height: 44px; }
  .brand { min-height: 44px; }
  .copy-btn:not(.copy-btn-text) { width: 40px; height: 40px; }
  .text-link, .hero-social a, .contact-links a, .footer-top { position: relative; }
  .text-link::after, .hero-social a::after, .contact-links a::after, .footer-top::after {
    content: ""; position: absolute; inset: -11px -6px;
  }
  .hero-social { row-gap: 24px; }
  .contact-links { row-gap: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- 404 page ---------- */
.nf { min-height: 100vh; display: grid; place-items: center; padding-block: 48px; }
.nf-card { width: 100%; max-width: 520px; }
.nf h1 { margin-top: 14px; font-family: var(--font-display); font-weight: 760; font-size: clamp(3rem, 12vw, 5rem); line-height: 0.95; letter-spacing: -0.045em; }
.nf .lead { margin-top: 16px; color: var(--ink-2); }
.nf .query { margin-top: 28px; width: 100%; }
.nf .btn { margin-top: 28px; }
.ok-dot.is-miss { background: var(--signal); }
