/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #0b0f14;
  --bg-alt: #0f151c;
  --surface: #121a23;
  --surface-2: #17212c;
  --border: #223040;
  --text: #e6edf3;
  --muted: #8b9bab;
  --accent: #00add8;        /* Go gopher blue */
  --accent-2: #7c5cff;      /* Web3 violet */
  --accent-soft: rgba(0, 173, 216, 0.12);
  --gold: #f5b84a;
  --grid: rgba(255, 255, 255, 0.035);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);

  --tk-k: #ff7b72;
  --tk-t: #79c0ff;
  --tk-s: #a5d6ff;
  --tk-f: #d2a8ff;
  --tk-n: #ffa657;
  --tk-c: #6e7f8f;

  --radius: 14px;
  --container: 1120px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --nav-h: 68px;
}

:root[data-theme="light"] {
  --bg: #f7f9fb;
  --bg-alt: #eef3f7;
  --surface: #ffffff;
  --surface-2: #f2f6f9;
  --border: #dbe3ea;
  --text: #0f1720;
  --muted: #5a6876;
  --accent: #007d9c;
  --accent-2: #5b3fd9;
  --accent-soft: rgba(0, 125, 156, 0.1);
  --gold: #b7791f;
  --grid: rgba(15, 23, 32, 0.045);
  --shadow: 0 20px 40px -24px rgba(15, 23, 32, 0.25);

  --tk-k: #cf222e;
  --tk-t: #0550ae;
  --tk-s: #0a3069;
  --tk-f: #8250df;
  --tk-n: #953800;
  --tk-c: #6e7781;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--text); }
svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.mono { font-family: var(--mono); }
.accent { color: var(--accent); }
.muted { color: var(--muted); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
}
.skip-link:focus { top: 16px; }

/* Background decoration */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed;
  z-index: -1;
  top: -20vh;
  left: 50%;
  width: 900px;
  height: 600px;
  max-width: 140vw;
  transform: translateX(-50%);
  background:
    radial-gradient(closest-side, rgba(0, 173, 216, 0.18), transparent 70%),
    radial-gradient(closest-side at 70% 60%, rgba(124, 92, 255, 0.14), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

/* ==========================================================================
   Buttons, tags, badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 15px/1 var(--font);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px -10px var(--accent);
}
.btn--primary:hover { box-shadow: 0 14px 34px -10px var(--accent); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 11px 14px; font-size: 14px; }
.btn--lg { padding: 16px 26px; font-size: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tags li {
  font: 500 12.5px/1 var(--mono);
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
}
.tags--lg { margin-top: 0; }
.tags--lg li {
  font-size: 13.5px;
  padding: 9px 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: border-color 0.2s, color 0.2s;
}
.tags--lg li:hover { border-color: var(--accent); color: var(--accent); }
.tags--lg li.hot { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); }

.badge {
  display: inline-block;
  font: 600 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge--gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s, backdrop-filter 0.3s;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom-color: var(--border);
}
.nav__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.nav__logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.nav nav { margin-left: auto; }
.nav__links { display: flex; gap: 4px; }
.nav__links a {
  display: block;
  padding: 8px 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}
.nav__links a:hover,
.nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__burger { display: none; }

[data-theme="dark"] .i-sun { display: none; }
[data-theme="light"] .i-moon { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 72px 0 40px; }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(63, 185, 80, 0); }
  100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, 0); }
}
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  font-weight: 800;
  margin: 22px 0 20px;
}
.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead { font-size: 1.1rem; color: var(--muted); max-width: 560px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0; }

.socials { display: flex; gap: 10px; }
.socials a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* Terminal card */
.terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.terminal__bar span { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal__bar span:nth-child(2) { background: #febc2e; }
.terminal__bar span:nth-child(3) { background: #28c840; }
.terminal__bar p { margin: 0 0 0 10px; font-size: 12.5px; color: var(--muted); }
.terminal__body {
  margin: 0;
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text);
}
.tk-k { color: var(--tk-k); }
.tk-t { color: var(--tk-t); }
.tk-s { color: var(--tk-s); }
.tk-f { color: var(--tk-f); }
.tk-n { color: var(--tk-n); }
.tk-c { color: var(--tk-c); }
.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 64px 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.stats div { padding: 22px 24px; border-right: 1px solid var(--border); }
.stats div:last-child { border-right: 0; }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd {
  margin: 4px 0 0;
  font-size: 1.6rem;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 96px 0; }
.section--alt {
  background: linear-gradient(180deg, transparent, var(--bg-alt) 12%, var(--bg-alt) 88%, transparent);
}
.section__head { margin-bottom: 48px; max-width: 720px; }
.section__head h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; }
.section__lead { color: var(--muted); font-size: 1.05rem; }
.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); transform: translateY(-3px); }
.card h3 { font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.card__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

/* About */
.about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.about__text p { color: var(--muted); font-size: 1.04rem; }
.about__looking {
  padding: 16px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  color: var(--text) !important;
}
.about__cards { display: grid; gap: 12px; }
.about__cards .card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 16px;
  padding: 18px 20px;
}
.about__cards .card__icon { grid-row: span 2; margin: 0; }
.about__cards .card h3 { margin-bottom: 2px; }

/* Experience timeline */
.timeline { position: relative; display: grid; gap: 28px; }
.job {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  position: relative;
}
.job__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 26px;
}
.job__date { font-size: 13px; color: var(--muted); }
.job__body {
  position: relative;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s;
}
.job__body:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.job__body::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 32px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.job:not(:last-child) .job__body::after {
  content: "";
  position: absolute;
  left: -17px;
  top: 48px;
  bottom: -40px;
  width: 2px;
  background: linear-gradient(var(--border), transparent);
}
.job h3 { font-size: 1.2rem; margin-bottom: 4px; }
.job h3 a { color: var(--accent); }
.job h3 a:hover { text-decoration: underline; }
.job__sub { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.job__list { display: grid; gap: 10px; }
.job__list li {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.97rem;
}
.job__list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.job__more { display: none; }

/* Highlights: one block per system */
.highlight + .highlight {
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
}
.highlight__head { max-width: 720px; margin-bottom: 28px; }
.highlight__head h3 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 800; }
.highlight__head p { margin: 0; color: var(--muted); font-size: 1.02rem; }

/* Web3 spotlight */
.flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}
.flow__node {
  flex: 1;
  max-width: 260px;
  padding: 20px;
  text-align: center;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.flow__node small {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.flow__node--main {
  border-color: transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent), var(--accent-2)) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 0 40px -12px var(--accent);
}
.flow__arrow {
  align-self: center;
  position: relative;
  width: 56px;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 6px, transparent 6px 12px);
  background-size: 24px 2px;
  animation: dash 1s linear infinite;
}
.flow__arrow::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -4px;
  border: 5px solid transparent;
  border-left-color: var(--accent);
  border-right: 0;
}
@keyframes dash { to { background-position: 24px 0; } }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s, border-color 0.25s;
}
.feature:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent-2) 55%, var(--border)); }
.feature__num { font-size: 12px; color: var(--accent-2); }
.feature h3,
.feature h4 { font-size: 1.05rem; line-height: 1.3; margin: 10px 0 8px; letter-spacing: -0.01em; }
.feature p { margin: 0; font-size: 0.93rem; color: var(--muted); }

.chains {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}
.chains li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.chains li.mono { font-size: 12.5px; color: var(--muted); }
.chains .chains__sep { width: 1px; height: 24px; padding: 0; border: 0; background: var(--border); border-radius: 0; }
.chain-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }

/* Skills */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.skill-group {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.skill-group h3 {
  font-size: 0.85rem;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Projects */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.project {
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.project:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  box-shadow: var(--shadow);
}
.project__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.project__folder { width: 34px; height: 34px; color: var(--accent); stroke-width: 1.5; }
.project--award .project__folder { color: var(--gold); }
.project--featured {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background:
    radial-gradient(circle at 100% 0%, var(--accent-soft), transparent 55%),
    var(--surface);
}
.project--featured h3 { font-size: 1.4rem; }
.project--featured p { flex: none; max-width: 720px; }
.project__note { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.project__tags { margin-top: 12px; }
.badge--accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.job__product { color: var(--accent); }
.job__product:hover { text-decoration: underline; }
.project__actions { display: flex; align-items: center; gap: 4px; }
.project__link {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: -10px -10px -10px 0;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.2s;
}
.project__link:hover { color: var(--accent); }
.project h3 { font-size: 1.12rem; }
.project p { color: var(--muted); font-size: 0.95rem; flex: 1; }
.project .tags { margin-top: 4px; }

.cp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 32px;
  align-items: center;
  margin-top: 24px;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 0% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
}
.cp h3 { font-size: 1.2rem; }
.cp p { margin: 0; color: var(--muted); }
.cp__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cp__stats a {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color 0.2s, transform 0.2s;
}
.cp__stats a:hover { border-color: var(--accent); transform: translateY(-2px); }
.cp__num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.cp__label { font-size: 12.5px; color: var(--muted); }

/* Education */
.edu {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.edu h3 { font-size: 1.2rem; }
.edu p { margin: 0 0 4px; color: var(--muted); }
.extras {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 20px;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Contact */
.contact { text-align: center; }
.contact__inner { max-width: 760px; }
.contact h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
.contact .section__lead { margin: 0 auto 32px; max-width: 560px; }
.contact__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.contact__links { display: flex; justify-content: center; gap: 24px; margin-top: 28px; font-size: 14.5px; }
.contact__links a { display: inline-block; padding-top: 10px; color: var(--muted); border-bottom: 1px dashed var(--border); padding-bottom: 2px; }
.contact__links a:hover { color: var(--accent); border-color: var(--accent); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.footer p { margin: 0; }
.footer a { display: inline-block; padding: 10px 0; }
.footer a:hover { color: var(--accent); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 12px 18px;
  font-size: 14px;
  border-radius: 10px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Pointer effects (enabled by JS as .fx on fine pointers only)
   ========================================================================== */
.tilt { min-width: 0; }
.bg-grid--hl,
.spot__ring,
.spot__fill { display: none; }

/* Grid lines light up around the cursor */
.fx .bg-grid--hl {
  display: block;
  --hl: color-mix(in srgb, var(--accent) 55%, transparent);
  background-image:
    linear-gradient(var(--hl) 1px, transparent 1px),
    linear-gradient(90deg, var(--hl) 1px, transparent 1px);
  mask-image: radial-gradient(220px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 75%);
  -webkit-mask-image: radial-gradient(220px circle at var(--mx, -999px) var(--my, -999px), #000, transparent 75%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.fx-active .bg-grid--hl { opacity: 0.6; }

/* Cursor spotlight on cards: border ring + soft fill */
.fx .spot { position: relative; }
.fx .spot__ring,
.fx .spot__fill {
  display: block;
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.fx .spot__ring {
  padding: 1px;
  background: radial-gradient(280px circle at var(--x, -999px) var(--y, -999px), var(--accent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.fx .spot__fill {
  background: radial-gradient(360px circle at var(--x, -999px) var(--y, -999px), var(--accent-soft), transparent 65%);
}
.fx-active .spot__ring { opacity: 0.9; }
.fx .spot:hover > .spot__fill { opacity: 1; }

/* 3D tilt + glare on the code card */
.fx .tilt { perspective: 1000px; }
.fx .tilt .terminal {
  position: relative;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}
.fx .tilt.is-tilting .terminal { transition-duration: 0.12s; }
.fx .tilt .terminal::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(500px circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.07), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.fx .tilt.is-tilting .terminal::after { opacity: 1; }

/* Magnetic elements: JS sets `translate`, which composes with hover transforms */
.fx [data-magnetic] {
  transition: transform 0.2s ease, translate 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

/* Scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .hero__inner,
  .about,
  .cp { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 48px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .skills,
  .projects { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(2) { border-right: 0; }
  .stats div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 820px) {
  .nav__burger { display: inline-grid; }
  .nav nav { margin-left: auto; }
  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .nav__links.is-open { opacity: 1; transform: none; visibility: visible; }
  .nav__links a { padding: 12px; font-size: 16px; }
  .nav__actions { margin-left: 0; }

  .job { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-left: 22px; }
  .job__meta { flex-direction: row; align-items: center; padding-top: 0; }
  .job__body::before { left: -27px; top: -24px; }
  .job:not(:last-child) .job__body::after { left: -23px; top: -8px; bottom: -36px; }

  .flow { flex-direction: column; align-items: center; }
  .flow__node { width: 100%; max-width: 360px; }
  .flow__arrow { width: 2px; height: 36px; background: repeating-linear-gradient(180deg, var(--accent) 0 6px, transparent 6px 12px); background-size: 2px 24px; animation-name: dash-v; }
  .flow__arrow::after { right: -4px; top: auto; bottom: -2px; border: 5px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
}
@keyframes dash-v { to { background-position: 0 24px; } }

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hide-sm { display: none; }
  .section { padding: 56px 0; }
  .section__head { margin-bottom: 32px; }
  .hero { padding: 32px 0 24px; }
  .stats { margin-top: 40px; }

  .card,
  .feature,
  .skill-group,
  .project,
  .edu,
  .cp { padding: 18px; }

  /* Experience: reclaim width from the timeline indent */
  .job { padding-left: 14px; }
  .job__body { padding: 18px 16px; }
  .job__body::before { left: -19px; }
  .job:not(:last-child) .job__body::after { left: -15px; }
  .job h3 { font-size: 1.08rem; }
  .job__list li { font-size: 0.94rem; }
  .job__list.is-collapsed > li:nth-child(n+5) { display: none; }
  .job__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: none;
    font: 600 14px/1 var(--font);
    color: var(--accent);
    cursor: pointer;
  }

  .flow__node small { font-size: 12px; }
  .stats dd { white-space: normal; }
  .stats dt { font-size: 12px; }

  .contact__actions .btn { width: 100%; justify-content: center; }
  .contact__links { gap: 8px 20px; flex-wrap: wrap; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .features,
  .skills,
  .projects { grid-template-columns: 1fr; }
  .cp__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .cp__stats a { padding: 12px 10px; }
  .cp__num { font-size: 1.2rem; }
  .cp__label { font-size: 12px; line-height: 1.35; }
  .edu { flex-direction: column; align-items: flex-start; }
  .terminal__body { font-size: 11.5px; padding: 16px; }
  .stats dd { font-size: 1.15rem; }
  .stats div { padding: 16px; }
  .chains .chains__sep { display: none; }
}

@media (hover: none) {
  .btn:hover,
  .card:hover,
  .feature:hover,
  .project:hover,
  .socials a:hover,
  .cp__stats a:hover { transform: none; }
  .project:hover { box-shadow: none; }
}

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

@media print {
  .nav, .bg-grid, .bg-glow, .toast, .hero__cta, .contact__actions { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
