/* ==========================================================================
   Atanu Adhikari, portfolio styles
   Dark, futuristic HUD theme by default; light via the header toggle.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #05060a;
  --bg-soft: #090b11;
  --surface: #0c0f17;
  --surface-2: #121624;
  --glass: rgba(12, 15, 23, .66);
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --fg: #ecedf2;
  --muted: #9ba1b3;
  --subtle: #8a90a2;
  --accent: #7c9cff;
  --accent-2: #5eead4;
  --accent-rgb: 124, 156, 255;
  --accent-2-rgb: 94, 234, 212;
  --accent-3: #c084fc;
  --accent-3-rgb: 192, 132, 252;
  --grad-text: linear-gradient(100deg, #5eead4 0%, #7c9cff 50%, #c084fc 100%);
  --grad-btn: linear-gradient(100deg, #5eead4, #7c9cff);
  --on-grad: #05060a;
  --hud: rgba(94, 234, 212, .75);
  --warn: #fbbf24;
  --scan-opacity: .035;
  --focus: #5eead4;
  --chip-bg: rgba(124, 156, 255, .07);
  --chip-border: rgba(124, 156, 255, .2);
  --badge-border: rgba(94, 234, 212, .35);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .8);
  --blob-opacity: .55;
  --spot-opacity: .07;
  --grain-opacity: .045;
  --net-line: 124, 156, 255;
  --net-dot: 94, 234, 212;
  --net-opacity: .5;
  --code-k: #c4a7ff;
  --code-s: #5eead4;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f7f9;
  --bg-soft: #eff0f4;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --glass: rgba(255, 255, 255, .7);
  --border: rgba(15, 17, 23, .09);
  --border-strong: rgba(15, 17, 23, .2);
  --fg: #0f1117;
  --muted: #4a5163;
  --subtle: #555c6e;
  --accent: #3451d1;
  --accent-2: #0f766e;
  --accent-rgb: 52, 81, 209;
  --accent-2-rgb: 15, 118, 110;
  --accent-3: #7c3aed;
  --accent-3-rgb: 124, 58, 237;
  --grad-text: linear-gradient(100deg, #0f766e 0%, #3451d1 55%, #7c3aed 100%);
  --hud: rgba(15, 118, 110, .7);
  --warn: #b45309;
  --scan-opacity: 0;
  --focus: #3451d1;
  --chip-bg: rgba(52, 81, 209, .05);
  --chip-border: rgba(52, 81, 209, .18);
  --badge-border: rgba(15, 118, 110, .38);
  --shadow: 0 20px 40px -24px rgba(15, 17, 23, .25);
  --blob-opacity: .35;
  --spot-opacity: .06;
  --grain-opacity: .03;
  --net-line: 52, 81, 209;
  --net-dot: 15, 118, 110;
  --net-opacity: .35;
  --code-k: #7c3aed;
  --code-s: #0f766e;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 96px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
/* Lenis smooth scroll takes over when it loads */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: Geist, Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
/* film grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 90;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(var(--accent-rgb), .3); color: var(--fg); }

img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}
/* sections receive focus programmatically after in-page navigation; no ring needed */
[tabindex="-1"]:focus { outline: none; }

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

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--surface); color: var(--fg);
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: 16px;
}
.container.narrow { max-width: 860px; }
@media (min-width: 768px) {
  .container { padding-inline: 32px; }
}

.mono, .eyebrow, .badge, .hero-meta, .chips li, .tags li, .card-kicker, .tl-date,
.site-footer, .brand, .facts dt, .metrics dt, .marquee, .group-title, .quest-status, .level-meta,
.loot li, .pc-top, .pc-name span, .xp-head, .pc-stats dt, .boot-line, .boot-hint {
  font-family: "Geist Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-title, .section h2, .card h4, .level-card h3, .ach h3, .skill-group h3, .btn, .boot-logo, .pc-name strong {
  font-family: "Chakra Petch", Geist, system-ui, sans-serif;
}

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

/* ---------- Cursor spotlight ---------- */
.spotlight {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
  background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 50%), rgba(var(--accent-rgb), var(--spot-opacity)), transparent 70%);
}
.spotlight.is-on { opacity: 1; }
main, .site-footer { position: relative; z-index: 1; }

/* ---------- Icons & buttons ---------- */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  transition: border-color .25s, background-color .25s, transform .25s, color .25s;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }

.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600; font-size: 15.5px;
  letter-spacing: .02em;
  text-decoration: none;
  border: 1px solid transparent;
  transition: box-shadow .3s, border-color .3s, background-color .3s;
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; flex: none; transition: transform .3s; }
.btn-primary {
  background: var(--grad-btn);
  color: var(--on-grad);
  box-shadow: 0 10px 30px -12px rgba(var(--accent-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { box-shadow: 0 16px 40px -12px rgba(var(--accent-rgb), .85), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:hover svg { transform: translateX(2px); }
.btn-ghost {
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-color: var(--border-strong);
  color: var(--fg);
}
.btn-ghost:hover { border-color: rgba(var(--accent-rgb), .7); }

.soon-tag {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11px; font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--badge-border);
  color: var(--accent-2);
}

/* magnetic buttons spring back smoothly when the pointer leaves */
.magnetic { transition: transform .5s cubic-bezier(.2, .9, .3, 1.3), box-shadow .3s, border-color .3s, background-color .3s; }
.magnetic.is-pulling { transition: transform .12s linear, box-shadow .3s, border-color .3s, background-color .3s; }

/* ---------- Header (floating pill) ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 14px 16px 0;
  pointer-events: none;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1);
}
.site-header.is-hidden { transform: translateY(calc(-100% - 8px)); }
.header-inner {
  pointer-events: auto;
  position: relative;
  display: flex; align-items: center; gap: 12px;
  max-width: 1100px;
  min-height: 60px;
  margin-inline: auto;
  padding: 8px 8px 8px 16px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: background-color .35s, border-color .35s, box-shadow .35s, max-width .45s cubic-bezier(.2, .8, .2, 1);
}
.site-header.is-scrolled .header-inner {
  max-width: 920px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500; font-size: 15px;
  text-decoration: none;
  margin-right: auto;
}
.brand img { border-radius: 8px; transition: transform .5s cubic-bezier(.2, .9, .3, 1.3); }
.brand:hover img { transform: rotate(-12deg) scale(1.08); }
.brand-dot { color: var(--accent-2); }

.site-nav { position: relative; display: flex; align-items: center; }
.nav-links { display: flex; gap: 2px; position: relative; z-index: 1; }
.nav-links a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500; font-size: 14.5px;
  transition: color .25s;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--fg); }
.nav-indicator {
  position: absolute; top: 50%; left: 0;
  height: 36px; width: var(--ind-w, 0);
  transform: translate(var(--ind-x, 0), -50%);
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), width .45s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.nav-indicator.is-on { opacity: 1; }
.nav-toggle { display: none; }

/* theme toggle shows the icon of the theme you'd switch TO */
.theme-toggle svg { transition: transform .5s cubic-bezier(.2, .9, .3, 1.3); }
.theme-toggle:hover svg { transform: rotate(40deg); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 767px) {
  .site-header { padding: 10px 10px 0; }
  .header-inner { padding-left: 12px; }
  .nav-indicator { display: none; }
  .js .nav-toggle { display: inline-grid; }
  .js .nav-links {
    position: fixed; left: 10px; right: 10px; top: 80px;
    flex-direction: column; gap: 2px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    opacity: 0; visibility: hidden;
    transform: translateY(-10px) scale(.98);
    transform-origin: top center;
    transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s .35s;
  }
  .js .nav-links.is-open {
    opacity: 1; visibility: visible;
    transform: none;
    transition: opacity .3s, transform .35s cubic-bezier(.2, .8, .2, 1), visibility 0s;
  }
  .js .nav-links a { padding: 14px 16px; font-size: 17px; border-radius: 12px; }
  .js .nav-links a.is-active { background: var(--surface-2); }
  /* without JS, keep links visible and scrollable */
  html:not(.js) .nav-links { overflow-x: auto; }
  html:not(.js) .nav-links a { padding: 8px; font-size: 14px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: min(100vh, 900px);
  display: flex; align-items: center;
  padding-block: 128px 112px;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.blob {
  position: absolute;
  width: 46vmax; height: 46vmax;
  border-radius: 50%;
  opacity: var(--blob-opacity);
  will-change: transform;
}
.blob-1 { top: -22vmax; left: -12vmax; background: radial-gradient(circle, rgba(var(--accent-rgb), .45), transparent 65%); animation: drift-1 22s ease-in-out infinite alternate; }
.blob-2 { top: -10vmax; right: -18vmax; background: radial-gradient(circle, rgba(var(--accent-2-rgb), .32), transparent 65%); animation: drift-2 26s ease-in-out infinite alternate; }
.blob-3 { bottom: -28vmax; left: 25%; background: radial-gradient(circle, rgba(168, 85, 247, .22), transparent 65%); animation: drift-3 30s ease-in-out infinite alternate; }
@keyframes drift-1 { to { transform: translate(10vmax, 8vmax) scale(1.1); } }
@keyframes drift-2 { to { transform: translate(-8vmax, 10vmax) scale(.9); } }
@keyframes drift-3 { to { transform: translate(-6vmax, -8vmax) scale(1.15); } }
.hero-grid {
  position: absolute; inset: 0;
  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% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}
.hero-net {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: -1;
  opacity: var(--net-opacity);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 56px;
}
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; line-height: 1.4;
  color: var(--accent-2);
  border: 1px solid var(--badge-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 28px;
}
.badge-dot, .status-dot {
  position: relative;
  width: 8px; height: 8px; flex: none;
  border-radius: 50%;
  background: var(--accent-2);
}
.badge-dot::after, .status-dot::after {
  content: ""; position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--accent-2);
  animation: ping 1.8s cubic-bezier(0, 0, .2, 1) infinite;
}
@keyframes ping { 75%, 100% { transform: scale(2.6); opacity: 0; } }

.hero-title {
  font-size: clamp(54px, 11vw, 128px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: .92;
  text-transform: uppercase;
}
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; }

.hero-role {
  margin-top: 22px;
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 600;
  letter-spacing: -.02em;
  min-height: 1.4em;
}
.scramble { color: var(--accent-2); }
.scramble .dud { color: var(--subtle); opacity: .7; }
.caret {
  display: inline-block;
  width: 3px; height: 1em;
  margin-left: 4px;
  vertical-align: -.12em;
  background: var(--accent-2);
  border-radius: 2px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-lead {
  margin-top: 16px;
  max-width: 46ch;
  font-size: clamp(16px, 1.9vw, 18.5px);
  line-height: 1.6;
  color: var(--muted);
}
.hero-meta {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--subtle);
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 34px;
}
.social { display: flex; gap: 10px; margin-top: 26px; }

/* intro: staggered entrance on page load */
.js .intro {
  opacity: 0;
  animation: rise .9s cubic-bezier(.2, .8, .2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms + 80ms);
}
.js .hero-title .intro { animation-name: rise-line; animation-duration: 1.1s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes rise-line { from { opacity: 0; transform: translateY(105%) rotate(3deg); } to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  display: grid; place-items: center;
  width: 44px; height: 44px;
  color: var(--subtle);
}
.mouse {
  width: 22px; height: 34px;
  border: 2px solid currentColor;
  border-radius: 12px;
  display: flex; justify-content: center;
  padding-top: 6px;
}
.mouse span {
  width: 3px; height: 7px; border-radius: 2px;
  background: currentColor;
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(-3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(9px); } }
.scroll-cue:hover { color: var(--fg); }

@media (max-width: 1023px) {
  .hero-inner { gap: 32px; }
}

@media (max-width: 860px) {
  .hero { min-height: 0; padding-block: 112px 88px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .badge { margin-bottom: 20px; font-size: 12px; border-radius: 14px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .scroll-cue { display: none; }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: 1;
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: var(--bg-soft);
  padding-block: 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; width: max-content;
  animation: marquee 45s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span {
  display: inline-flex; align-items: center;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  padding-inline: 22px;
}
.marquee span::after {
  content: "✦";
  margin-left: 44px;
  font-size: 11px;
  color: var(--accent);
  opacity: .7;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(56px, 8vw, 104px);
}
.section-head { margin-bottom: 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--accent-2);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.eyebrow span {
  display: inline-grid; place-items: center;
  min-width: 30px; height: 22px;
  padding-inline: 6px;
  border-radius: 6px;
  border: 1px solid var(--badge-border);
  font-size: 11.5px;
}
.section h2 {
  font-size: clamp(36px, 5.6vw, 64px);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.02;
  text-transform: uppercase;
}
.section-sub { margin-top: 14px; }
.prose {
  font-size: clamp(16px, 2vw, 18.5px);
  color: var(--muted);
  max-width: 64ch;
}
.prose + .prose { margin-top: 18px; }

/* scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .9s cubic-bezier(.2, .8, .2, 1), transform .9s cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--d, 0ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Glow surfaces (border lights up near the cursor) ---------- */
.glow { position: relative; isolation: isolate; }
.glow::before, .glow::after {
  content: ""; position: absolute; inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s;
}
.glow::before {
  padding: 1px;
  background: radial-gradient(320px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--accent-rgb), .9), rgba(var(--accent-2-rgb), .4) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.glow::after {
  z-index: -1;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(var(--accent-rgb), .07), transparent 60%);
}
.glow-on .glow::before, .glow-on .glow::after { opacity: 1; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.facts {
  border-radius: 12px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  padding: 8px 22px;
}
.facts div {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px;
  padding-block: 14px;
}
.facts div + div { border-top: 1px dashed var(--border); }
.facts dt { font-size: 12px; color: var(--subtle); text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.facts dd { font-weight: 500; display: flex; align-items: center; gap: 10px; }
.local-time { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Skills (bento) ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.skill-group {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), border-color .3s;
}
.skill-group:hover { transform: translateY(-4px); }
.bento { counter-reset: slot; }
.skill-group h3 {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 16px;
}
.skill-group h3::after {
  counter-increment: slot;
  content: "SLOT 0" counter(slot);
  margin-left: auto;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px; font-weight: 500; letter-spacing: .1em;
  color: var(--subtle);
}
.skill-group h3 svg {
  width: 34px; height: 34px;
  padding: 7px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
}
.skill-ai { background-color: var(--surface-2); }
.skill-ai h3 { font-size: 18px; }
.chips, .tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 12.5px; line-height: 1.3;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--fg);
  transition: background-color .25s, border-color .25s, transform .25s;
}
.chips li:hover { background: rgba(var(--accent-rgb), .16); border-color: rgba(var(--accent-rgb), .5); transform: translateY(-2px); }
@media (max-width: 1023px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento > * { grid-column: span 1; }
  .bento > .span-8 { grid-column: span 2; }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .bento > *, .bento > .span-8 { grid-column: auto; }
}

/* ---------- Projects ---------- */
.filters {
  position: relative;
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 5px;
  margin-bottom: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.filter {
  position: relative; z-index: 1;
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600; font-size: 14px;
  transition: color .3s;
}
.filter:hover { color: var(--fg); }
.filter[aria-pressed="true"] { color: var(--on-grad); background: var(--grad-btn); }
.filter-indicator { display: none; }
/* with JS, a single pill slides between the buttons */
.js .filter[aria-pressed="true"] { background: none; }
.js .filter-indicator {
  display: block;
  position: absolute; top: 5px; left: 0;
  height: 40px; width: var(--fw, 0);
  transform: translateX(var(--fx, 0));
  border-radius: 999px;
  background: var(--grad-btn);
  box-shadow: 0 8px 20px -10px rgba(var(--accent-rgb), .8);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), width .5s cubic-bezier(.2, .8, .2, 1);
}

.project-group + .project-group { margin-top: 56px; }
.project-group[hidden] { display: none; }
.project-group.is-entering .card { animation: card-in .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: var(--d, 0ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.group-title {
  display: flex; align-items: center; gap: 14px;
  font-size: 12.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--subtle);
  margin-bottom: 18px;
}
.group-title::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: 16px;
}
.card {
  display: flex; flex-direction: column; gap: 12px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s, opacity .45s, filter .45s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-6px); }
.card:focus-within { border-color: rgba(var(--accent-rgb), .6); }
/* hovering one card softly dims its siblings */
@media (hover: hover) and (pointer: fine) {
  .cards:hover .card:not(:hover) { opacity: .55; filter: saturate(.6); }
}
.card-kicker {
  font-size: 12px;
  color: var(--accent-2);
}
.card h4 {
  font-size: 22px; font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
  transition: color .3s;
}
.card:hover h4 { color: var(--accent); }
.card > p:not(.card-kicker):not(.note) { color: var(--muted); font-size: 15px; }
.card-compact { padding: 22px; }
.card-compact h4 { font-size: 18px; }

.metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.metrics div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.metrics dt { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.metrics dd { font-size: 26px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

.note {
  font-size: 14px;
  color: var(--muted);
  border-left: 2px solid var(--accent-2);
  padding: 4px 0 4px 12px;
}
.note strong { color: var(--fg); font-weight: 600; }

.tags li {
  font-size: 11.5px; line-height: 1.3;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.card-links {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}
.card-links:empty { display: none; }
.card-links a {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-weight: 600; font-size: 13.5px;
  transition: border-color .25s, color .25s, background-color .25s, transform .25s;
}
.card-links a:hover { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), .08); transform: translateY(-2px); }
.card-links svg { width: 16px; height: 16px; }

/* ---------- Journey ---------- */
.tl-points { margin-top: 14px; display: grid; gap: 8px; }
.tl-points li {
  position: relative; padding-left: 20px;
  color: var(--muted);
}
.tl-points li::before {
  content: ""; position: absolute; left: 0; top: .72em;
  width: 8px; height: 2px; border-radius: 2px; background: var(--accent);
}

/* ---------- Contact ---------- */
.contact-section {
  position: relative;
  overflow: hidden;
}
.contact-section::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; bottom: -40%;
  width: 900px; height: 600px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .18), transparent);
  pointer-events: none;
}
.contact { text-align: center; }
.contact .prose { margin-inline: auto; }
.contact-title { font-size: clamp(40px, 8vw, 92px) !important; }
.contact-email {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px;
  margin-top: 32px;
}
.email-link {
  position: relative;
  font-size: clamp(20px, 4.4vw, 36px);
  font-weight: 650;
  letter-spacing: -.025em;
  text-decoration: none;
  overflow-wrap: anywhere;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 2px no-repeat;
  transition: background-size .5s cubic-bezier(.2, .8, .2, 1), color .3s;
  padding-bottom: 4px;
}
.email-link:hover { color: var(--accent); background-size: 0 2px; background-position: 100% 100%; }
.copy-status { font-size: 14px; color: var(--accent-2); min-width: 1px; }
.contact-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: 36px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 28px;
  font-size: 13px;
  color: var(--subtle);
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.site-footer a { color: inherit; text-underline-offset: 3px; }
.site-footer a:hover { color: var(--fg); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 55;
  display: grid; place-items: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--fg);
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden;
  transform: translateY(16px) scale(.9);
  transition: opacity .35s, transform .45s cubic-bezier(.2, .9, .3, 1.3), visibility 0s .45s;
}
.to-top.is-visible {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .35s, transform .45s cubic-bezier(.2, .9, .3, 1.3), visibility 0s;
}
.to-top:hover .to-top-icon { transform: translateY(-3px); }
.to-top-icon { width: 20px; height: 20px; transition: transform .3s; }
.to-top-ring {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 138.23;
  stroke-dashoffset: calc(138.23 * (1 - var(--progress, 0)));
}
html:not(.js) .to-top { display: none; }

/* ==========================================================================
   Futuristic HUD layer
   ========================================================================== */

/* CRT scanlines (dark theme only) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 89;
  pointer-events: none;
  opacity: var(--scan-opacity);
  background: repeating-linear-gradient(to bottom, #fff 0 1px, transparent 1px 3px);
}

/* HUD corner brackets, drawn as background layers so ::before/::after stay free for .glow */
.hud {
  --hl: 14px; --hw: 2px; --hi: 6px;
  border-radius: 8px;
  background-image:
    linear-gradient(var(--hud), var(--hud)), linear-gradient(var(--hud), var(--hud)),
    linear-gradient(var(--hud), var(--hud)), linear-gradient(var(--hud), var(--hud)),
    linear-gradient(var(--hud), var(--hud)), linear-gradient(var(--hud), var(--hud)),
    linear-gradient(var(--hud), var(--hud)), linear-gradient(var(--hud), var(--hud));
  background-repeat: no-repeat;
  background-size:
    var(--hl) var(--hw), var(--hw) var(--hl), var(--hl) var(--hw), var(--hw) var(--hl),
    var(--hl) var(--hw), var(--hw) var(--hl), var(--hl) var(--hw), var(--hw) var(--hl);
  background-position:
    var(--hi) var(--hi), var(--hi) var(--hi),
    calc(100% - var(--hi)) var(--hi), calc(100% - var(--hi)) var(--hi),
    var(--hi) calc(100% - var(--hi)), var(--hi) calc(100% - var(--hi)),
    calc(100% - var(--hi)) calc(100% - var(--hi)), calc(100% - var(--hi)) calc(100% - var(--hi));
}
.card, .skill-group { --hud: rgba(var(--accent-2-rgb), .45); }
.card:hover, .skill-group:hover { --hud: rgba(var(--accent-2-rgb), .9); }

/* glitch: two coloured copies flicker in briefly every few seconds */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  width: 100%;
  pointer-events: none;
  opacity: 0;
  background: none;
  -webkit-text-fill-color: currentColor;
}
.glitch::before { color: var(--accent-2); animation: glitch-a 5s steps(1) infinite; }
.glitch::after { color: var(--accent-3); animation: glitch-b 5s steps(1) infinite; }
.line:nth-child(2) .glitch::before, .line:nth-child(2) .glitch::after { animation-delay: .35s; }
@keyframes glitch-a {
  0%, 90%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  91% { opacity: .85; transform: translate(-5px, 1px); clip-path: inset(12% 0 58% 0); }
  93% { opacity: .85; transform: translate(4px, -1px); clip-path: inset(62% 0 6% 0); }
  95% { opacity: .85; transform: translate(-2px, 0); clip-path: inset(38% 0 40% 0); }
  97% { opacity: 0; }
}
@keyframes glitch-b {
  0%, 90%, 100% { opacity: 0; transform: none; clip-path: inset(0 0 100% 0); }
  91% { opacity: .85; transform: translate(5px, -1px); clip-path: inset(55% 0 20% 0); }
  93% { opacity: .85; transform: translate(-4px, 1px); clip-path: inset(8% 0 70% 0); }
  95% { opacity: .85; transform: translate(3px, 0); clip-path: inset(75% 0 2% 0); }
  97% { opacity: 0; }
}

.prompt { color: var(--accent-2); font-family: "Geist Mono", ui-monospace, monospace; margin-right: 4px; }

/* retro-future floor */
.horizon {
  position: absolute; left: 0; right: 0; bottom: 96px; /* matches the projected top edge of .floor */
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-2-rgb), .9) 30%, rgba(var(--accent-3-rgb), .9) 70%, transparent);
  box-shadow: 0 0 40px 10px rgba(var(--accent-rgb), .25);
  opacity: .55;
}
.floor {
  position: absolute; left: -60%; right: -60%; bottom: 0;
  height: 520px;
  overflow: hidden;
  transform: perspective(300px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000, transparent 96%);
  mask-image: linear-gradient(to top, #000, transparent 96%);
  opacity: .6;
}
.floor-lines {
  position: absolute; left: 0; right: 0; top: -64px; bottom: 0;
  background-image:
    linear-gradient(rgba(var(--accent-2-rgb), .55) 2px, transparent 2px),
    linear-gradient(90deg, rgba(var(--accent-rgb), .45) 2px, transparent 2px);
  background-size: 64px 64px;
  animation: floor 2.6s linear infinite;
}
@keyframes floor { to { transform: translateY(64px); } }

/* player card */
.player-card {
  position: relative;
  width: 340px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  background-color: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow), 0 0 80px -24px rgba(var(--accent-2-rgb), .45);
}
@media (max-width: 1023px) {
  .player-card { width: 290px; }
}
@media (max-width: 860px) {
  .player-card { width: 100%; max-width: 420px; }
  .pc-stats dt { font-size: 9.5px; letter-spacing: .04em; }
}
.pc-top {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; letter-spacing: .14em;
  color: var(--subtle);
  margin-bottom: 12px;
}
.pc-online { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-2); }
.pc-portrait {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--accent-rgb), .4), transparent 62%),
    linear-gradient(180deg, rgba(var(--accent-3-rgb), .14), rgba(var(--accent-2-rgb), .1)),
    var(--bg-soft);
}
.pc-portrait::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(var(--accent-2-rgb), .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-2-rgb), .12) 1px, transparent 1px);
  background-size: 22px 22px;
}
.pc-portrait:has(img) .pc-initials { display: none; } /* photo has a transparent background */
.pc-initials {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: "Chakra Petch", sans-serif;
  font-size: 84px; font-weight: 700;
  color: var(--fg);
}
.pc-portrait img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 100%;
  filter: contrast(1.08);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.pc-scan {
  position: absolute; left: 0; right: 0; top: 0;
  height: 30%;
  background: linear-gradient(to bottom, transparent, rgba(var(--accent-2-rgb), .22), transparent);
  transform: translateY(-100%);
  animation: scan 4.5s linear infinite;
}
@keyframes scan { to { transform: translateY(340%); } }
.pc-name {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px;
}
.pc-name p { display: grid; gap: 2px; }
.pc-name strong { font-size: 21px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; text-transform: uppercase; }
.pc-name p span { font-size: 11.5px; color: var(--muted); }
.pc-lvl {
  flex: none;
  font-family: "Chakra Petch", sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: .06em;
  padding: 7px 11px;
  background: var(--grad-btn);
  color: var(--on-grad);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}
.xp { margin-top: 14px; }
.xp-head {
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtle);
}
.xp-val { color: var(--accent-2); }
.xp-bar {
  position: relative;
  margin-top: 8px;
  height: 10px;
  border-radius: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.xp-bar span {
  display: block;
  height: 100%;
  width: calc(var(--xp, .56) * 100%);
  background: var(--grad-btn);
  box-shadow: 0 0 14px rgba(var(--accent-2-rgb), .8);
  transform-origin: left;
  animation: xp-fill 1.6s cubic-bezier(.2, .8, .2, 1) .7s backwards;
}
.xp-bar::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 10px, var(--surface-2) 10px 12px);
}
@keyframes xp-fill { from { transform: scaleX(0); } }
.pc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 14px;
}
.pc-stats div {
  padding: 10px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-align: center;
}
.pc-stats dt { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.pc-stats dd { font-family: "Chakra Petch", sans-serif; font-size: 26px; font-weight: 700; line-height: 1.2; }

/* boot screen */
.boot { display: none; }
.booting .boot, .boot.is-leaving {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
}
.boot.is-leaving { animation: boot-out .5s ease forwards; }
@keyframes boot-out { to { opacity: 0; visibility: hidden; } }
.booting body { overflow: hidden; }
.booting .intro, .booting .xp-bar span { animation-play-state: paused; }
.boot-inner { width: min(320px, calc(100% - 48px)); }
.boot-logo { font-size: 44px; font-weight: 700; letter-spacing: .04em; line-height: 1; }
.boot-logo span { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot-line { margin-top: 18px; font-size: 13px; color: var(--accent-2); }
.boot-bar {
  margin-top: 12px; height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.boot-bar span {
  display: block; height: 100%;
  background: var(--grad-btn);
  box-shadow: 0 0 12px rgba(var(--accent-2-rgb), .9);
  transform-origin: left;
  animation: boot-load 1.15s cubic-bezier(.6, 0, .3, 1) forwards;
}
@keyframes boot-load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.boot-hint { margin-top: 16px; font-size: 11px; color: var(--subtle); letter-spacing: .08em; animation: blink 1.1s steps(1) infinite; }

/* quest status on project cards */
.card-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.quest-status {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.quest-status::before { margin-right: 6px; }
.quest-status.is-done { color: var(--accent-2); }
.quest-status.is-done::before { content: "✓"; }
.quest-status.is-wip { color: var(--warn); }
.quest-status.is-wip::before { content: "◐"; }
.quest-status.is-side { color: var(--accent-3); }
.quest-status.is-side::before { content: "◆"; }

.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; }

/* journey map */
.journey { position: relative; display: grid; gap: 28px; }
.journey::before, .journey::after {
  content: ""; position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px;
  border-radius: 2px;
}
.journey::before { background: repeating-linear-gradient(to bottom, var(--border-strong) 0 8px, transparent 8px 14px); }
.journey::after {
  background: linear-gradient(var(--accent-2), var(--accent), var(--accent-3));
  box-shadow: 0 0 14px rgba(var(--accent-2-rgb), .7);
  transform-origin: top;
}
.js .journey::after { transform: scaleY(var(--tl, 0)); }
.level { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: start; }
.level-node {
  grid-column: 2; grid-row: 1;
  justify-self: center;
  position: relative; z-index: 1;
  width: 54px; height: 60px;
  margin-top: 18px;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--border-strong);
  transition: background .6s;
}
.level-node span {
  width: 48px; height: 54px;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--bg-soft);
  font-family: "Chakra Petch", sans-serif;
  font-size: 16px; font-weight: 700;
  color: var(--subtle);
  transition: color .6s, background-color .6s;
}
.level.is-in .level-node { background: var(--grad-btn); }
.level.is-in .level-node span { color: var(--fg); }
.level.is-current.is-in .level-node span { background: rgba(var(--accent-2-rgb), .18); animation: node-pulse 1.8s ease-in-out infinite; }
@keyframes node-pulse { 50% { background-color: rgba(var(--accent-2-rgb), .4); } }
.level-card {
  grid-row: 1;
  padding: 22px 24px;
  border: 1px solid var(--border);
  background-color: var(--surface);
}
.level:nth-child(odd) .level-card { grid-column: 1; }
.level:nth-child(even) .level-card { grid-column: 3; }
.level-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  font-size: 12px;
  color: var(--accent-2);
}
.level-tag {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(var(--accent-rgb), .14);
  color: var(--accent);
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.is-boss .level-tag { background: rgba(var(--accent-3-rgb), .16); color: var(--accent-3); }
.level-status { margin-left: auto; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.level-status::before { content: "✓ "; }
.is-current .level-status { color: var(--warn); }
.is-current .level-status::before { content: "◐ "; }
.level-card h3 { font-size: 21px; font-weight: 700; letter-spacing: .01em; line-height: 1.25; margin-top: 12px; }
.level-org { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.level-card > p:not(.level-meta):not(.level-org) { color: var(--muted); margin-top: 10px; }
.level-card .btn { margin-top: 16px; }
.loot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.loot li {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(var(--accent-2-rgb), .45);
  color: var(--fg);
}
.loot li::before { content: "+" / ""; color: var(--accent-2); margin-right: 4px; }
@media (max-width: 860px) {
  .journey::before, .journey::after { left: 27px; }
  .level { grid-template-columns: 54px minmax(0, 1fr); column-gap: 14px; }
  .level-node { grid-column: 1; }
  .level:nth-child(odd) .level-card, .level:nth-child(even) .level-card { grid-column: 2; }
  .level-card { padding: 18px; }
}

/* achievements */
.badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 14px;
}
.ach {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  background-color: var(--surface);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
}
.ach:hover { transform: translateY(-4px); }
.ach-icon {
  flex: none;
  width: 48px; height: 54px;
  display: grid; place-items: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--grad-btn);
  color: var(--on-grad);
  transition: transform .5s cubic-bezier(.2, .9, .3, 1.3);
}
.ach-icon svg { width: 22px; height: 22px; }
.ach:hover .ach-icon { transform: rotate(-10deg) scale(1.08); }
.ach h3 { font-size: 16px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ach p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.ach-locked { border-style: dashed; background-color: transparent; --hud: var(--border-strong); }
.ach-locked .ach-icon { background: var(--surface-2); color: var(--subtle); }
.ach-locked a { color: var(--accent-2); text-underline-offset: 3px; }

/* achievement toast */
.toast-label {
  display: block;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-2);
}
.toast.is-achievement { border-radius: 10px; padding: 10px 18px; border-color: rgba(var(--accent-2-rgb), .5); box-shadow: var(--shadow), 0 0 40px -10px rgba(var(--accent-2-rgb), .6); }

/* ---------- Command menu ---------- */
.cmdk-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px;
  padding: 0 8px 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  transition: border-color .25s, color .25s, transform .25s;
}
.cmdk-btn:hover { color: var(--fg); border-color: var(--border-strong); transform: translateY(-2px); }
.cmdk-btn svg { width: 17px; height: 17px; }
kbd, .cmdk-kbd {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
}
.cmdk-kbd { display: inline-flex; gap: 2px; }
html:not(.js) .cmdk-btn { display: none; }
@media (min-width: 768px) and (max-width: 1023px) {
  .brand > span { display: none; }
}
@media (max-width: 1023px) {
  .cmdk-btn { width: 42px; padding: 0; justify-content: center; }
  .cmdk-kbd { display: none; }
  .nav-links a { padding-inline: 10px; font-size: 14px; }
}

.cmdk {
  margin: min(14vh, 120px) auto 0;
  width: min(620px, calc(100% - 32px));
  max-width: none; max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  overflow: visible;
}
.cmdk::backdrop {
  background: rgba(4, 5, 8, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.cmdk[open] { animation: cmdk-in .28s cubic-bezier(.2, .8, .2, 1); }
.cmdk[open]::backdrop { animation: fade-in .28s ease; }
.cmdk.is-closing { animation: cmdk-out .18s ease forwards; }
.cmdk.is-closing::backdrop { animation: fade-out .18s ease forwards; }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes cmdk-out { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.cmdk-panel {
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(var(--accent-rgb), .06);
  overflow: hidden;
}
.cmdk-search {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.cmdk-search svg { width: 20px; height: 20px; color: var(--subtle); flex: none; }
.cmdk-search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 16.5px;
  color: var(--fg);
  background: none; border: 0; outline: none;
}
.cmdk-search input::placeholder { color: var(--subtle); }
.cmdk-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
}
.cmdk-group {
  padding: 12px 12px 6px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--subtle);
}
.cmdk-list [role="option"] {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.cmdk-list [role="option"] svg { width: 18px; height: 18px; flex: none; }
.cmdk-list [role="option"][aria-selected="true"] {
  background: rgba(var(--accent-rgb), .12);
  color: var(--fg);
}
.cmdk-list [role="option"][aria-selected="true"] svg { color: var(--accent); }
.cmdk-list [hidden] { display: none; }
.cmdk-hint {
  margin-left: auto;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--subtle);
}
.cmdk-empty { padding: 28px; text-align: center; color: var(--subtle); }
.cmdk-foot {
  display: flex; gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--subtle);
}
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }
.cmdk-foot kbd { padding: 3px 5px; font-size: 11px; }
@media (max-width: 600px) {
  .cmdk-foot { display: none; }
  .cmdk-search kbd { display: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 120;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .3s, transform .4s cubic-bezier(.2, .9, .3, 1.3);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

/* ---------- Theme switch: circular reveal (View Transitions) ---------- */
::view-transition-old(root), ::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: .01ms !important;
  }
  .card:hover, .skill-group:hover, .icon-btn:hover { transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  .spotlight { display: none; }
}
