/* ─────────────────────────── Tokens ─────────────────────────── */
:root {
  --bg: #f6f7f9;
  --bg-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e2e5eb;
  --border-strong: #cdd2db;
  --text: #0d1117;
  --muted: #5a6372;
  --faint: #8a92a0;
  --accent: #059669;
  --accent-2: #3b5bdb;
  --accent-ink: #ffffff;
  --glow: rgba(5, 150, 105, .18);
  --grad: linear-gradient(100deg, #059669 0%, #0ea5a4 45%, #3b5bdb 100%);
  --shadow: 0 1px 2px rgba(13, 17, 23, .04), 0 12px 32px -12px rgba(13, 17, 23, .12);
  --radius: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c10;
    --bg-2: #0d1015;
    --surface: #11151c;
    --surface-2: #0e1218;
    --border: #1e2430;
    --border-strong: #2b3342;
    --text: #e8ebf0;
    --muted: #8f98a8;
    --faint: #5f6878;
    --accent: #6ee7b7;
    --accent-2: #7aa2ff;
    --accent-ink: #04241a;
    --glow: rgba(110, 231, 183, .16);
    --grad: linear-gradient(100deg, #6ee7b7 0%, #5eead4 40%, #7aa2ff 100%);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0c10;
  --bg-2: #0d1015;
  --surface: #11151c;
  --surface-2: #0e1218;
  --border: #1e2430;
  --border-strong: #2b3342;
  --text: #e8ebf0;
  --muted: #8f98a8;
  --faint: #5f6878;
  --accent: #6ee7b7;
  --accent-2: #7aa2ff;
  --accent-ink: #04241a;
  --glow: rgba(110, 231, 183, .16);
  --grad: linear-gradient(100deg, #6ee7b7 0%, #5eead4 40%, #7aa2ff 100%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 20px 40px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ─────────────────────────── Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
b, strong { font-weight: 600; color: var(--text); }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { padding: 1px 6px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); }
kbd {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 6px; font-size: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
::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: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }

.muted { color: var(--muted); }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--accent); color: var(--accent-ink); border-radius: 8px; }
.skip:focus { left: 8px; }

/* Scroll reveal (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ─────────────────────────── Nav ─────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; height: 64px; gap: 24px; }
.logo { font: 700 22px/1 var(--mono); letter-spacing: -.04em; }
.logo b { color: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 6px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg-2); }
.nav-actions { display: flex; gap: 8px; }
.kbd-btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: inherit; transition: color .2s, border-color .2s;
}
.kbd-btn { padding: 0 8px 0 10px; }
.icon-btn { width: 36px; }
.kbd-btn:hover, .icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.kbd-btn kbd { border: 0; background: var(--bg-2); }

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

/* ─────────────────────────── Hero ─────────────────────────── */
.hero { position: relative; padding: 72px 0 40px; isolation: isolate; }
@media (min-width: 900px) { .hero { padding-top: 112px; } }
.hero-bg {
  position: absolute; inset: -64px 0 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
  opacity: .55;
}
.hero-bg::after {
  content: ""; position: absolute; left: 50%; top: 10%; width: 720px; height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent);
  filter: blur(20px);
}

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 13px; margin: 0 0 28px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-size: 14.5px; color: var(--muted);
}
.status b { color: var(--text); }
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.025em; line-height: 1.1; }
h1 {
  font-size: clamp(38px, 6.6vw, 76px); font-weight: 600;
  margin: 0 0 24px; max-width: 16ch;
}
h1 .grad { display: block; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 62ch; margin: 0 0 32px; }

.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.cta.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 500 15px/1 var(--font); cursor: pointer;
  transition: transform .15s, border-color .2s, background .2s, box-shadow .2s;
}
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 8px 24px -8px var(--accent); }
.btn.primary svg { transition: transform .2s; }
.btn.primary:hover svg { transform: translateX(3px); }
.btn.ghost { background: transparent; }
.btn.big { height: 52px; padding: 0 24px; font-size: 16px; }

/* Window chrome shared by pipeline + terminal */
.win-bar {
  display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; gap: 12px; align-items: center;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font: 12px var(--mono); color: var(--faint);
}
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.win-title { text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { justify-self: end; display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.live .pulse { width: 6px; height: 6px; }

/* Pipeline */
.pipeline {
  margin: 0; border: 1px solid var(--border); border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow); overflow: hidden;
}
.pipe { display: flex; align-items: center; padding: 32px 28px 24px; }
.node {
  flex: none; width: 128px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
}
.node .ico {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 8px;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface-2);
  font: 600 14px var(--mono); color: var(--text);
  animation: node-pulse 5s ease-in-out infinite;
}
.node:nth-of-type(1) .ico { animation-delay: 0s; }
.node:nth-of-type(2) .ico { animation-delay: 1s; }
.node:nth-of-type(3) .ico { animation-delay: 2s; }
.node:nth-of-type(4) .ico { animation-delay: 3s; }
.node:nth-of-type(5) .ico { animation-delay: 4s; }
@keyframes node-pulse {
  0%, 30%, 100% { border-color: var(--border-strong); box-shadow: none; color: var(--text); }
  10% { border-color: var(--accent); box-shadow: 0 0 0 5px var(--glow), 0 0 24px var(--glow); color: var(--accent); }
}
.node .nm { font-weight: 600; font-size: 14px; }
.node .sub { font: 11.5px var(--mono); color: var(--faint); }

.link {
  position: relative; flex: 1; min-width: 20px; height: 2px; margin-bottom: 52px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px);
}
.link i {
  position: absolute; top: 50%; left: 0; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px 2px var(--glow);
  animation: flow-x 2.4s linear infinite;
}
.link i:nth-child(2) { animation-delay: -1.2s; }
@keyframes flow-x {
  0% { left: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { left: calc(100% - 7px); opacity: 0; }
}
@keyframes flow-y {
  0% { top: 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { top: calc(100% - 7px); opacity: 0; }
}

.log {
  list-style: none; margin: 0 20px; padding: 14px 16px; min-height: 118px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--bg-2);
  font: 12.5px/1.75 var(--mono); color: var(--muted); overflow: hidden;
}
.log li { display: flex; gap: 12px; white-space: nowrap; animation: log-in .4s ease; }
.log li > span { flex: none; }
.log li > span:last-child { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.log .t { color: var(--faint); }
.log .src { color: var(--accent-2); min-width: 92px; }
.log .ok { color: var(--accent); }
@keyframes log-in { from { opacity: 0; transform: translateY(6px); } }
.pipeline figcaption { padding: 14px 20px 18px; font-size: 13px; color: var(--faint); }

@media (max-width: 760px) {
  .pipe { flex-direction: column; align-items: stretch; padding: 24px 20px 16px; }
  .node { width: auto; flex-direction: row; text-align: left; gap: 12px; }
  .node .ico { width: 44px; height: 44px; margin: 0; font-size: 12.5px; }
  .node .sub { margin-left: auto; }
  .link {
    flex: none; width: 2px; height: 26px; min-width: 0; margin: 4px 0 4px 21px;
    background: repeating-linear-gradient(180deg, var(--border-strong) 0 5px, transparent 5px 9px);
  }
  .link i { left: 50%; top: 0; margin: 0 0 0 -3.5px; animation-name: flow-y; }
  .log { margin: 0 12px; font-size: 11.5px; }
  .log .src { min-width: 0; }
  .log .t { display: none; }
  .pipeline .win-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
}

/* ─────────────────────────── Focus areas ─────────────────────────── */
.focus { padding: 48px 0 8px; }
.focus-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.area { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.area-ico {
  display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 14px;
  border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border);
  font: 600 15px var(--mono); color: var(--accent);
}
.area h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.area p { margin: 0; font-size: 14.5px; color: var(--muted); }
@media (max-width: 760px) { .focus-grid { grid-template-columns: 1fr; } }

/* ─────────────────────────── Sections ─────────────────────────── */
.section { padding: 96px 0 24px; }
.sec-head { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: baseline; margin-bottom: 40px; }
.sec-num { font: 500 13px var(--mono); color: var(--accent); }
.sec-head h2 { margin: 0; font-size: clamp(30px, 4vw, 44px); font-weight: 600; }
.sec-head p { grid-column: 2; margin: 8px 0 0; color: var(--muted); }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 3px 10px; border-radius: 999px; font: 500 12px/1.6 var(--mono);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}

/* Roles */
.role { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 40px 0; border-top: 1px solid var(--border); }
.role-meta { position: sticky; top: 96px; align-self: start; }
.role-meta .co { font: 500 13px var(--mono); color: var(--accent); margin-bottom: 8px; }
.role-meta h3 { margin: 0 0 6px; font-size: 24px; font-weight: 600; }
.role-meta .team { color: var(--muted); font-size: 15px; }
.role-meta .when { margin-top: 14px; font: 12.5px var(--mono); color: var(--faint); }
.role-meta .also { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

.wins { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.win {
  position: relative; display: flex; flex-direction: column;
  padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  transition: border-color .25s, transform .25s;
}
.win:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.win::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), var(--glow), transparent 45%);
  transition: opacity .3s;
}
.win:hover::before { opacity: 1; }
.kind { font: 500 11.5px var(--mono); color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.win h4 { margin: 0 0 10px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.win p { margin: 0 0 18px; font-size: 14.5px; color: var(--muted); }
.win .chips { margin-top: auto; }

@media (max-width: 900px) {
  .role { grid-template-columns: 1fr; gap: 24px; }
  .role-meta { position: static; }
}
@media (max-width: 600px) { .wins { grid-template-columns: 1fr; } }

/* Projects */
.project {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px;
  padding: 36px; margin-bottom: 20px; border-radius: 22px;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
}
.tag { display: inline-block; font: 500 12px var(--mono); color: var(--accent); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .06em; }
.project h3 { margin: 0 0 12px; font-size: clamp(22px, 2.6vw, 28px); font-weight: 600; }
.project-body > p { margin: 0 0 24px; color: var(--muted); }
.how { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.how li { position: relative; padding-left: 20px; font-size: 15px; color: var(--muted); }
.how li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 7px; height: 7px; border-radius: 2px; background: var(--accent); }

.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-self: center; }
.flow li {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 14px; font-weight: 500;
}
.flow li + li { margin-top: 18px; }
.flow li + li::before {
  content: ""; position: absolute; left: 26px; top: -19px; width: 2px; height: 18px;
  background: linear-gradient(var(--border-strong), var(--accent));
}
.flow li span { font: 500 11px var(--mono); color: var(--faint); }
.flow li.out { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.flow li.out span { color: inherit; }

@media (max-width: 900px) {
  .project { grid-template-columns: 1fr; padding: 24px; gap: 28px; }
}

/* Terminal */
.term {
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border); background: #0b0e13; box-shadow: var(--shadow);
  color: #d6dbe4;
  --t-accent: #6ee7b7; --t-blue: #7aa2ff; --t-faint: #5f6878; --t-border: #1e2430;
}
.term .win-bar { border-bottom-color: var(--t-border); color: var(--t-faint); }
.term .dots i:nth-child(1) { background: #ff5f57; }
.term .dots i:nth-child(2) { background: #febc2e; }
.term .dots i:nth-child(3) { background: #28c840; }
.term-body {
  height: 400px; overflow-y: auto; padding: 18px 20px;
  font: 13.5px/1.7 var(--mono); cursor: text;
  scrollbar-width: thin; scrollbar-color: #2b3342 transparent;
}
#term-out pre { margin: 0 0 10px; font: inherit; white-space: pre-wrap; word-break: break-word; }
.term .p { color: var(--t-accent); }
.term .c { color: var(--t-blue); }
.term .d { color: var(--t-faint); }
.term .h { color: #fff; font-weight: 500; }
.term a { color: var(--t-blue); text-decoration: underline; text-underline-offset: 3px; }
.term-line { display: flex; gap: 10px; align-items: center; }
.prompt { color: var(--t-accent); white-space: nowrap; }
.prompt span { color: #d6dbe4; }
#term-in {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; color: #fff; caret-color: var(--t-accent);
}
.term-hints { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--t-border); }
.term-hints button {
  font: 12px var(--mono); padding: 5px 10px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--t-border); background: #11151c; color: #a3abb9;
  transition: color .2s, border-color .2s;
}
.term-hints button:hover { color: var(--t-accent); border-color: var(--t-accent); }
@media (max-width: 600px) {
  .term-body { height: 360px; padding: 14px; font-size: 12.5px; }
  .prompt { font-size: 0; } .prompt span { font-size: 12.5px; }
}

/* Skills */
.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.layer { padding: 22px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.layer h4 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.layer .chips li { font-size: 12.5px; }
.layer .chips li:hover { color: var(--accent); border-color: var(--accent); }

.edu {
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
  margin-top: 40px; padding: 28px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
}
.edu h3 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.edu p { margin: 0; }
.edu .muted { margin-top: 8px; font-size: 14px; }
.edu-side { text-align: right; flex: none; }
.gpa { font: 600 44px/1 var(--display); letter-spacing: -.03em; }
.gpa small { font-size: 18px; color: var(--muted); }
@media (max-width: 640px) { .edu { flex-direction: column; align-items: flex-start; } .edu-side { text-align: left; } }

/* Baking */
.cakes { columns: 3 240px; column-gap: 14px; }
.cake { position: relative; margin: 0 0 14px; break-inside: avoid; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.cake button { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.cake img { display: block; width: 100%; height: auto; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.cake:hover img { transform: scale(1.04); }
.cake figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 12px 10px; pointer-events: none;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #fff; font-size: 13px; font-weight: 500;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
.cake:hover figcaption, .cake:focus-within figcaption { opacity: 1; transform: none; }
@media (hover: none) { .cake figcaption { opacity: 1; transform: none; } }

.lightbox {
  position: fixed; inset: 0; z-index: 110; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px;
  padding: 24px; background: rgba(5, 7, 10, .92); backdrop-filter: blur(6px); animation: fade .2s ease;
}
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); animation: pop .25s cubic-bezier(.2, .8, .2, 1); }
.lightbox figcaption { margin-top: 14px; color: #e8ebf0; font-size: 15px; }
.lightbox figcaption span { color: #8f98a8; font: 12px var(--mono); margin-left: 10px; }
.lb-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .15); background: rgba(255, 255, 255, .06); color: #fff; font-size: 22px; line-height: 1;
}
.lb-btn:hover { background: rgba(255, 255, 255, .14); }
.lb-close { position: absolute; top: 16px; right: 16px; font-size: 16px; }
@media (max-width: 600px) {
  .lightbox { grid-template-columns: 1fr; padding: 16px; }
  .lb-prev, .lb-next { position: absolute; bottom: 20px; }
  .lb-prev { left: calc(50% - 56px); } .lb-next { right: calc(50% - 56px); }
  .lightbox img { max-height: calc(100vh - 170px); }
}

.term .cake-thumb { display: block; width: 160px; margin: 8px 0 4px; border-radius: 8px; cursor: zoom-in; }

/* Pipeline as the featured piece in Work */
.pipeline.featured { margin-bottom: 8px; }

/* Slim arcade link in the hero */
.arcade-strip {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 28px;
  padding: 6px 14px 6px 8px; border-radius: 999px; font-size: 14px; color: var(--muted);
  border: 1px dashed var(--border-strong); transition: color .2s, border-color .2s;
}
.arcade-strip:hover { color: var(--text); border-color: var(--accent); border-style: solid; }
.as-icons { display: inline-flex; }
.as-icons span {
  display: grid; place-items: center; width: 26px; height: 26px; margin-left: -6px; font-size: 14px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--border);
}
.as-icons span:first-child { margin-left: 0; }
.arcade-strip b { color: var(--text); font-weight: 600; }
.as-arrow { transition: transform .2s; }
.arcade-strip:hover .as-arrow { transform: translateX(3px); }
.arcade-strip:hover .as-icons span { animation: bob .6s ease-in-out; }
.arcade-strip:hover .as-icons span:nth-child(2) { animation-delay: .06s; }
.arcade-strip:hover .as-icons span:nth-child(3) { animation-delay: .12s; }
.arcade-strip:hover .as-icons span:nth-child(4) { animation-delay: .18s; }
.arcade-strip:hover .as-icons span:nth-child(5) { animation-delay: .24s; }
@media (max-width: 480px) { .as-icons span:nth-child(n+4) { display: none; } }

/* Arcade teaser */
.arcade-teaser {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: center;
  padding: 40px; border-radius: 22px; color: inherit;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  transition: border-color .25s, transform .25s;
}
.arcade-teaser:hover { border-color: var(--accent); transform: translateY(-2px); }
.teaser-body h2 { margin: 10px 0 12px; font-size: clamp(30px, 4vw, 44px); font-weight: 600; }
.teaser-body p { margin: 0 0 24px; color: var(--muted); }
.teaser-icons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.teaser-icons span {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 14px; font-size: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border); background: var(--bg-2);
  animation: bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.32s);
}
.arcade-teaser:hover .teaser-icons span { border-color: var(--border-strong); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (max-width: 800px) { .arcade-teaser { grid-template-columns: 1fr; padding: 24px; gap: 28px; } }

/* Contact */
.contact { position: relative; padding: 128px 0 112px; text-align: center; overflow: hidden; }
.contact::before {
  content: ""; position: absolute; left: 50%; bottom: -200px; width: 900px; height: 500px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none;
}
.contact .wrap { position: relative; }
.contact h2 { font-size: clamp(36px, 6vw, 68px); font-weight: 600; margin: 12px auto 20px; max-width: 14ch; }
.contact .lede { margin-left: auto; margin-right: auto; }
.contact .btn.primary.big { word-break: break-all; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 28px; margin-top: 36px; font-size: 15px; color: var(--muted); }
.socials a:hover { color: var(--accent); }

.footer { border-top: 1px solid var(--border); }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 24px; padding-bottom: 28px; font-size: 13.5px; }

/* ─────────────────────────── Command palette ─────────────────────────── */
.palette { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 14vh 16px 16px; }
.palette[hidden] { display: none; }
.palette-backdrop { position: absolute; inset: 0; background: rgba(5, 7, 10, .55); backdrop-filter: blur(4px); animation: fade .15s ease; }
.palette-box {
  position: relative; width: 100%; max-width: 560px; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5);
  animation: pop .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--faint); }
.palette-search input { flex: 1; border: 0; outline: 0; background: transparent; font: 16px var(--font); color: var(--text); }
#palette-list { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow-y: auto; }
#palette-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 14.5px;
}
#palette-list li .grp { font: 11px var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
#palette-list li[aria-selected="true"] { background: var(--bg-2); }
#palette-list li[aria-selected="true"] .label { color: var(--accent); }
#palette-list .empty { color: var(--faint); cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 12px; font-size: 14px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow);
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ─────────────────────────── Responsive nav ─────────────────────────── */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-actions { margin-left: auto; }
}

/* ─────────────────────────── Motion + print ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .link i { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .hero-bg, .pipeline, .arcade-strip, #terminal, #baking, .lightbox, .cta, .contact::before, .footer, .palette, .toast { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  body { background: #fff; color: #000; }
  .win, .project, .layer, .edu { box-shadow: none; break-inside: avoid; }
  .role-meta { position: static; }
}

/* Hover lifts must outrank the finished scroll-reveal state. */
.js .win.reveal.in:hover, .js .arcade-teaser.reveal.in:hover { transform: translateY(-2px); }
