/* ---------- Palettes (switchable from the nav) ---------- */
:root,
:root[data-palette="aurora"] {
  --bg: #0a0a16;
  --bg-soft: #14132a;
  --text: #f4f1ff;
  --muted: #b6aed3;
  --primary: #a78bfa;
  --secondary: #f472b6;
  --success: #34d399;
  --on-primary: #150b2e;
  --bg-rgb: 10, 10, 22;
  --panel-rgb: 24, 22, 48;
  --deep-rgb: 14, 12, 30;
  --primary-rgb: 167, 139, 250;
  --secondary-rgb: 244, 114, 182;
  --success-rgb: 52, 211, 153;
  --muted-rgb: 182, 174, 211;
  --skin: #f5c9a3;
  --hair: #6b3f23;
}

:root[data-palette="ocean"] {
  --bg: #06131f;
  --bg-soft: #0d1c2d;
  --text: #edf6ff;
  --muted: #a9bfd3;
  --primary: #66d9ff;
  --secondary: #9a7bff;
  --success: #7ef0c6;
  --on-primary: var(--on-primary);
  --bg-rgb: 6, 19, 31;
  --panel-rgb: 17, 31, 47;
  --deep-rgb: 10, 20, 33;
  --primary-rgb: 102, 217, 255;
  --secondary-rgb: 154, 123, 255;
  --success-rgb: 126, 240, 198;
  --muted-rgb: 166, 191, 213;
}

:root[data-palette="emerald"] {
  --bg: #04130f;
  --bg-soft: #0a211a;
  --text: #ecfdf5;
  --muted: #a7c9ba;
  --primary: #34d399;
  --secondary: #22d3ee;
  --success: #bef264;
  --on-primary: #022c1e;
  --bg-rgb: 4, 19, 15;
  --panel-rgb: 12, 36, 29;
  --deep-rgb: 6, 24, 19;
  --primary-rgb: 52, 211, 153;
  --secondary-rgb: 34, 211, 238;
  --success-rgb: 190, 242, 100;
  --muted-rgb: 167, 201, 186;
}

:root[data-palette="sunset"] {
  --bg: #140a0d;
  --bg-soft: #231217;
  --text: #fff4ef;
  --muted: #d6b4aa;
  --primary: #fb923c;
  --secondary: #f43f5e;
  --success: #facc15;
  --on-primary: #2a0f02;
  --bg-rgb: 20, 10, 13;
  --panel-rgb: 42, 20, 26;
  --deep-rgb: 26, 12, 16;
  --primary-rgb: 251, 146, 60;
  --secondary-rgb: 244, 63, 94;
  --success-rgb: 250, 204, 21;
  --muted-rgb: 214, 180, 170;
}

:root {
  --line: rgba(var(--muted-rgb), 0.18);
  --warn: #ff9f7a;
  --radius: 24px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.12), transparent 22%),
    radial-gradient(circle at bottom right, rgba(var(--secondary-rgb), 0.12), transparent 28%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

::selection {
  background: rgba(var(--primary-rgb), 0.3);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

b {
  color: var(--text);
  font-weight: 600;
}

/* ---------- Ambient layers ---------- */

#network-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.09), rgba(var(--secondary-rgb), 0.05) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 400ms ease;
  will-change: transform;
}

body.has-pointer .cursor-glow {
  opacity: 1;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--success));
  z-index: 50;
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.6);
}

.page-shell {
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
  pointer-events: none;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* ---------- Nav ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(var(--bg-rgb), 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 250ms ease, box-shadow 250ms ease;
}

.topbar.scrolled {
  background: rgba(var(--bg-rgb), 0.82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-primary);
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.35);
  transition: transform 400ms var(--ease-out);
}

.brand:hover .brand-mark {
  transform: rotate(-12deg) scale(1.08);
}

.nav-links {
  display: flex;
  align-items: center;
  margin: 0 auto;
  gap: 24px;
  color: var(--muted);
  font-size: 0.94rem;
}

.nav-links a {
  position: relative;
  transition: color 180ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible,
.nav-links a.active {
  color: var(--text);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  padding: 0;
  cursor: pointer;
  place-items: center;
  align-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 250ms ease, opacity 200ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0.9rem 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  overflow: hidden;
  transition: transform 250ms var(--ease-out), box-shadow 200ms ease, border-color 200ms ease;
}

.btn:not(.magnetic):hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-primary);
  box-shadow: 0 18px 38px rgba(var(--primary-rgb), 0.25);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 3.6s ease-in-out infinite;
}

.btn-primary:hover {
  box-shadow: 0 22px 48px rgba(var(--primary-rgb), 0.4);
}

.btn-secondary,
.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn-secondary:hover,
.btn-ghost:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 52px;
  min-height: 88vh;
  padding: 72px 0 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  background: rgba(var(--primary-rgb), 0.07);
  color: var(--primary);
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.eyebrow-typed {
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  gap: 8px;
  min-height: 34px;
}

.prompt {
  color: var(--success);
}

.caret {
  width: 8px;
  height: 1.05em;
  margin-left: -4px;
  background: var(--primary);
  animation: blink 1s steps(1) infinite;
}

.hero-copy h1 {
  margin: 20px 0 18px;
  font-size: clamp(2.6rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.split-words .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.6em) rotate(3deg);
  filter: blur(6px);
  animation: word-in 800ms var(--ease-out) forwards;
  animation-delay: calc(var(--w) * 55ms + 100ms);
}

.text-gradient {
  background: linear-gradient(120deg, var(--primary), var(--text) 30%, var(--secondary) 60%, var(--primary) 90%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-pan 6s linear infinite;
}

.hero-copy p {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fade-up 900ms var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 30px;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.mini-stats li {
  min-width: 120px;
  padding: 14px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  transition: border-color 200ms ease, transform 250ms var(--ease-out);
}

.mini-stats li:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  transform: translateY(-3px);
}

.mini-stats strong {
  display: block;
  font-size: 1.7rem;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.mini-stats li > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  perspective: 1000px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  animation: float 8s ease-in-out infinite;
}

.orb-one {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.4), rgba(var(--primary-rgb), 0.05) 60%, transparent 70%);
  top: 32px;
  right: 18px;
}

.orb-two {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.3), rgba(var(--secondary-rgb), 0.04) 60%, transparent 75%);
  bottom: 38px;
  left: 36px;
  animation-delay: 1.5s;
}

.float-chip {
  position: absolute;
  z-index: 3;
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(var(--panel-rgb), 0.85);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.03) inset;
  backdrop-filter: blur(8px);
  animation: bob 6s ease-in-out infinite;
}

.chip-a { top: 12%; left: 2%; animation-delay: 0s; }
.chip-b { top: 22%; right: 0; animation-delay: 1.2s; border-color: rgba(var(--secondary-rgb), 0.35); }
.chip-c { top: 52%; left: 0; animation-delay: 2.1s; border-color: rgba(var(--success-rgb), 0.35); }
.chip-d { bottom: 8%; right: 6%; animation-delay: 3s; }

.glass {
  background: linear-gradient(180deg, rgba(var(--panel-rgb), 0.86), rgba(var(--deep-rgb), 0.88));
  border: 1px solid rgba(var(--muted-rgb), 0.12);
  box-shadow: 0 30px 60px rgba(var(--deep-rgb), 0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.profile-card {
  position: relative;
  z-index: 2;
  width: min(100%, 470px);
  padding: 14px 14px 18px;
  border-radius: var(--radius);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 500ms var(--ease-out);
}

.profile-card.tilting {
  transition: transform 80ms linear;
}

/* Rotating gradient border */
.profile-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle), transparent 0deg, var(--primary) 60deg, transparent 120deg, transparent 180deg, var(--secondary) 240deg, transparent 300deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin-border 6s linear infinite;
  pointer-events: none;
}

@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 0%), rgba(255, 255, 255, 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 300ms ease;
}

.profile-card.tilting .card-glare {
  opacity: 1;
}

.card-topline {
  display: inline-flex;
  flex-shrink: 0;
  white-space: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(var(--success-rgb), 0.09);
  border: 1px solid rgba(var(--success-rgb), 0.18);
  color: var(--success);
  font-size: 0.8rem;
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 18px rgba(var(--success-rgb), 0.8);
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: ping 1.8s ease-out infinite;
}

.tag-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tag-cluster span,
.chips span,
.project-meta span,
.case-tags span {
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.78rem;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 250ms var(--ease-out);
}

.chips span:hover,
.tag-cluster span:hover {
  color: var(--text);
  border-color: rgba(var(--primary-rgb), 0.45);
  background: rgba(var(--primary-rgb), 0.08);
  transform: translateY(-2px);
}

/* ---------- Hero scene: animated illustration ---------- */

.speech {
  position: absolute;
  top: 30px;
  right: 22px;
  z-index: 3;
  padding: 0.55rem 0.85rem;
  border-radius: 14px 14px 14px 4px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.35);
  transform-origin: bottom left;
  transition: opacity 400ms ease, transform 700ms var(--ease-out);
}

.js .speech:not(.show) {
  opacity: 0;
  transform: scale(0.4) rotate(-8deg);
}

.dev-scene {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(var(--deep-rgb), 0.7), rgba(var(--panel-rgb), 0.35));
  border: 1px solid rgba(255, 255, 255, 0.05);
  --ink: #2a1b17;
}

.dev-scene * {
  transform-box: view-box;
}

/* Bold cartoon outlines */
.brick,
.hoodie,
.hood,
.skin,
.hair,
.laptop-lid,
.laptop-base,
.leaf,
.pot,
.cup,
.cup-lid,
.cup-band,
.desk {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
}

.scene-back { fill: rgba(var(--primary-rgb), 0.28); }
.brick { fill: rgba(var(--primary-rgb), 0.75); }
.dot { fill: rgba(var(--primary-rgb), 0.8); }

.ink-line,
.ear-in,
.brow-line,
.glasses-line,
.smile,
.leaf-vein {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}

.ear-in { stroke-width: 2; opacity: 0.5; }
.brow-line { stroke-width: 4; }
.smile { stroke-width: 2.8; }
.leaf-vein { stroke-width: 1.6; opacity: 0.6; }

.star {
  fill: var(--ink);
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.9s);
}

.hoodie { fill: var(--primary); }
.hood { fill: color-mix(in srgb, var(--primary) 70%, #000); }
.skin { fill: var(--skin); }
.hair { fill: var(--hair); }
.hair-shine { fill: rgba(255, 255, 255, 0.22); }
.pupil { fill: #2b1a12; }
.shine { fill: #fff; }
.blush { fill: #ff7b7b; opacity: 0.55; }

.glasses {
  fill: rgba(255, 255, 255, 0.12);
  stroke: var(--ink);
  stroke-width: 3.2;
}

.laptop-lid { fill: #eef0f5; }
.laptop-base { fill: #cfd4de; }

.laptop-logo {
  fill: var(--primary);
  animation: logo-pulse 2.6s ease-in-out infinite;
}

.logo-text {
  fill: var(--on-primary);
  font-size: 13px;
  font-weight: 900;
  font-family: "Inter", sans-serif;
}

.leaf { fill: #5dbb7c; }
.leaf:nth-child(3) { fill: #4aa86a; }
.pot { fill: #d98b52; }
.cup { fill: color-mix(in srgb, var(--primary) 75%, #1a1a2e); }
.cup-lid { fill: #3a3a4a; }
.cup-band { fill: #f4f4f8; }
.bean { fill: var(--ink); }
.desk { fill: #d9955a; }
.desk-shadow { fill: rgba(0, 0, 0, 0.35); }

.steam {
  fill: none;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  animation: steam 3s ease-out infinite;
  animation-delay: calc(var(--i) * 1s);
}

.float-code {
  fill: var(--primary);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  animation: rise 6s ease-out infinite;
  animation-delay: calc(var(--i) * 1.5s);
}

/* Body language */
.head {
  transform-origin: 240px 250px;
  animation: head-bob 5s ease-in-out infinite;
}

.cowlick {
  transform-origin: 236px 104px;
  animation: sway 2.2s ease-in-out infinite;
}

.eyes {
  transform-origin: 240px 198px;
  animation: blink-eyes 4.6s ease-in-out infinite;
}

.pupils {
  animation: glance 9s ease-in-out infinite;
}

.torso {
  transform-origin: 240px 348px;
  animation: breathe 4s ease-in-out infinite;
}

.arm-l,
.arm-r {
  animation: typing 2.4s ease-in-out infinite;
}

.arm-r {
  animation-delay: 0.14s;
}

.leaves {
  transform-origin: 118px 294px;
  animation: sway 5s ease-in-out infinite;
}

.scene-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 6px 0;
}

.scene-caption h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.scene-caption p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.now-doing {
  margin: 12px 6px 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(var(--muted-rgb), 0.2);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.now-text {
  display: inline-block;
  color: var(--primary);
  transition: opacity 300ms ease, transform 300ms var(--ease-out);
}

.now-text.swap {
  opacity: 0;
  transform: translateY(6px);
}

/* ---------- Palette switcher ---------- */

.palette-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin-right: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.palette-switch button {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  transition: transform 250ms var(--ease-out), box-shadow 250ms ease;
}

.palette-switch button:hover {
  transform: scale(1.18);
}

.palette-switch button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c1);
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- Aurora lights ---------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.aurora i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.22), transparent 62%);
  animation: drift 26s ease-in-out infinite alternate;
}

.aurora i:nth-child(1) {
  top: -22vmax;
  left: -16vmax;
}

.aurora i:nth-child(2) {
  right: -18vmax;
  bottom: -26vmax;
  background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.2), transparent 62%);
  animation-duration: 32s;
  animation-delay: -9s;
}

.aurora i:nth-child(3) {
  top: 35%;
  left: 35%;
  width: 45vmax;
  height: 45vmax;
  background: radial-gradient(circle, rgba(var(--success-rgb), 0.08), transparent 62%);
  animation-duration: 38s;
  animation-delay: -15s;
}

/* ---------- Marquee ---------- */

.marquee {
  position: relative;
  overflow: hidden;
  padding: 18px 0;
  margin: 8px 0 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(var(--bg-rgb), 0.4);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  gap: 44px;
  animation: marquee 38s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-track span {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(var(--muted-rgb), 0.75);
  white-space: nowrap;
  transition: color 200ms ease;
}

.marquee-track span::before {
  content: "◆";
  margin-right: 44px;
  color: rgba(var(--primary-rgb), 0.4);
  font-size: 0.6rem;
  vertical-align: middle;
}

.marquee-track span:hover {
  color: var(--primary);
}

/* ---------- Sections ---------- */

.about,
.impact,
.experience,
.case-studies,
.projects,
.skills,
.education,
.footer {
  padding: 56px 0 28px;
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 16px 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.06em;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
}

.about-card {
  padding: 28px;
  border-radius: var(--radius);
}

.about-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.03rem;
}

.terminal {
  margin-top: 8px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(var(--deep-rgb), 0.75);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.terminal-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 8px; }

.terminal-body {
  margin: 0;
  padding: 14px 16px 16px;
  min-height: 150px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--success);
  white-space: pre-wrap;
}

.terminal-body .cmd {
  color: var(--text);
}

.terminal-body .cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: text-bottom;
  background: var(--primary);
  animation: blink 1s steps(1) infinite;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.stat-box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 18px;
  border-radius: 22px;
  transition: transform 300ms var(--ease-out), border-color 200ms ease;
}

.stat-box:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--primary-rgb), 0.3);
}

.stat-box strong {
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-box > span {
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Spotlight hover (shared) ---------- */

.spotlight {
  position: relative;
  isolation: isolate;
}

.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--primary-rgb), 0.12), transparent 45%);
  opacity: 0;
  transition: opacity 300ms ease;
}

.spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--primary-rgb), 0.6), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.spotlight:hover::before,
.spotlight:hover::after {
  opacity: 1;
}

/* ---------- Impact ---------- */

.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.impact-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  border-radius: var(--radius);
  transition: transform 300ms var(--ease-out);
}

.impact-card:hover {
  transform: translateY(-4px);
}

.impact-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.impact-num {
  font-size: clamp(2rem, 3vw, 2.6rem);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.impact-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.deploy-bars {
  display: grid;
  gap: 10px;
  margin: 4px 0 2px;
}

.deploy-row {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--muted);
}

.deploy-row em {
  font-style: normal;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  transition: width 1.6s var(--ease-out);
}

.bar-fill.before {
  background: linear-gradient(90deg, #ff7a7a, var(--warn));
}

.bar-fill.after {
  background: linear-gradient(90deg, var(--success), var(--primary));
  box-shadow: 0 0 14px rgba(var(--success-rgb), 0.6);
  transition-delay: 500ms;
}

.visible .bar-fill {
  width: var(--w);
}

/* ---------- Timeline ---------- */

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
  padding-left: 44px;
}

.timeline-track {
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: rgba(var(--muted-rgb), 0.12);
}

.timeline-progress {
  width: 100%;
  height: 100%;
  transform-origin: top;
  transform: scaleY(0);
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  box-shadow: 0 0 14px rgba(var(--primary-rgb), 0.6);
  border-radius: inherit;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
  padding: 24px 22px;
  border-radius: var(--radius);
  transition: border-color 400ms ease, transform 400ms var(--ease-out);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid rgba(var(--muted-rgb), 0.35);
  transition: background 400ms ease, border-color 400ms ease, box-shadow 400ms ease, transform 400ms var(--ease-out);
}

.timeline-item.lit {
  border-color: rgba(var(--primary-rgb), 0.22);
}

.timeline-item.lit::before {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-color: transparent;
  box-shadow: 0 0 0 6px rgba(var(--primary-rgb), 0.12), 0 0 20px rgba(var(--primary-rgb), 0.65);
  transform: scale(1.15);
}

.time-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  min-height: 42px;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
}

.timeline-body h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
}

.timeline-body h4 {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 1rem;
}

.tech {
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 600;
}

.tech.sub-project {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed rgba(var(--muted-rgb), 0.2);
}

.timeline-body ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.timeline-body li::marker {
  color: var(--primary);
}

/* ---------- Case studies ---------- */

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.case-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 24px;
  border-radius: var(--radius);
}

.case-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--success);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-card h3 {
  margin: 8px 0 10px;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.case-card header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

/* Tenant map */
.tenant-map {
  --r: min(135px, 32vw);
  position: relative;
  height: calc(var(--r) * 2 + 60px);
  display: grid;
  place-items: center;
}

.tenant-core {
  position: relative;
  z-index: 2;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0.08), 0 0 40px rgba(var(--primary-rgb), 0.45);
  animation: core-pulse 3s ease-in-out infinite;
}

.spoke {
  --a: calc(360deg / 11 * var(--i) - 90deg);
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--r);
  height: 2px;
  transform-origin: 0 50%;
  transform: rotate(var(--a)) scaleX(0);
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.5), rgba(var(--secondary-rgb), 0.25));
  transition: transform 700ms var(--ease-out);
  transition-delay: calc(var(--i) * 110ms);
}

.visible .spoke {
  transform: rotate(var(--a)) scaleX(1);
}

.spoke::after {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px var(--primary);
  opacity: 0;
}

.visible .spoke::after {
  animation: packet 2.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 250ms + 1.4s);
}

.tenant {
  position: absolute;
  right: 0;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px -20px 0 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(var(--panel-rgb), 0.95);
  border: 1px solid rgba(var(--primary-rgb), 0.35);
  transform: rotate(calc(var(--a) * -1)) scale(0);
  transition: transform 500ms var(--ease-out), box-shadow 300ms ease;
  transition-delay: calc(var(--i) * 110ms + 450ms);
}

.visible .tenant {
  transform: rotate(calc(var(--a) * -1)) scale(1);
}

.tenant:hover {
  box-shadow: 0 0 18px rgba(var(--primary-rgb), 0.6);
}

/* RAG flow */
.rag-flow {
  list-style: none;
  margin: auto 0;
  padding: 10px 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.rag-step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px;
  border-radius: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  animation: step-glow 5s ease-in-out infinite;
  animation-delay: calc(var(--i) * 1s);
  animation-play-state: paused;
}

.visible .rag-step {
  animation-play-state: running;
}

.rag-icon {
  font-size: 1.4rem;
}

.rag-step b {
  font-size: 0.78rem;
  line-height: 1.3;
}

.rag-step small {
  font-size: 0.66rem;
  color: var(--muted);
}

.rag-link {
  position: relative;
  flex: 0 0 22px;
  align-self: center;
  height: 2px;
  background: rgba(var(--primary-rgb), 0.25);
}

.rag-link::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  opacity: 0;
  animation: flow-x 5s linear infinite;
  animation-delay: calc(var(--i) * 1s + 0.6s);
  animation-play-state: paused;
}

.visible .rag-link::after {
  animation-play-state: running;
}

/* ---------- Projects & skills ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.project-card,
.skill-card {
  padding: 24px 22px;
  border-radius: var(--radius);
  transition: transform 350ms var(--ease-out);
}

.project-card:hover,
.skill-card:hover {
  transform: translateY(-6px);
}

.project-card {
  display: flex;
  flex-direction: column;
}

.project-card.featured {
  grid-column: span 2;
  background:
    radial-gradient(circle at 100% 0%, rgba(var(--secondary-rgb), 0.16), transparent 50%),
    linear-gradient(180deg, rgba(var(--panel-rgb), 0.86), rgba(var(--deep-rgb), 0.88));
}

.project-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.project-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 20px rgba(var(--primary-rgb),0.55);
}

.project-role {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.project-card h3,
.skill-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.project-card p {
  margin: 0 0 16px;
  line-height: 1.8;
  color: var(--muted);
}

.project-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.project-impact span {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(var(--success-rgb), 0.08);
  border: 1px solid rgba(var(--success-rgb), 0.2);
}

.project-impact span::before {
  content: "▲ ";
  font-size: 0.6rem;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.skill-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.skill-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Education & footer ---------- */

.education-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-radius: var(--radius);
}

.education-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.education-card p {
  margin: 0;
  color: var(--muted);
}

.education-date {
  color: var(--primary);
  font-family: var(--mono);
  font-weight: 700;
}

.footer {
  padding-bottom: 55px;
}

.footer-card {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 36px 32px;
  border-radius: calc(var(--radius) + 8px);
}

.footer-glow {
  position: absolute;
  width: 480px;
  height: 480px;
  right: -140px;
  top: -220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--secondary-rgb), 0.25), transparent 65%);
  animation: float 9s ease-in-out infinite;
  pointer-events: none;
}

.footer-card h2 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
  letter-spacing: -0.06em;
}

.footer-sub {
  margin: 12px 0 0;
  color: var(--muted);
}

.contact-links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 14px;
  color: var(--muted);
  max-width: 480px;
}

.contact-links a,
.email-pill {
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  transition: border-color 180ms ease, color 180ms ease, transform 250ms var(--ease-out);
}

.contact-links a:hover {
  color: var(--text);
  border-color: rgba(var(--primary-rgb), 0.3);
  transform: translateY(-2px);
}

.email-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.35rem 0.4rem 0.35rem 0.9rem;
}

.email-pill a {
  padding: 0;
  border: 0;
  background: none;
}

.email-pill a:hover {
  transform: none;
}

.copy-btn {
  font: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  color: var(--on-primary);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transition: transform 200ms var(--ease-out);
}

.copy-btn:hover {
  transform: scale(1.06);
}

.copyright {
  margin-top: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: rgba(var(--panel-rgb), 0.95);
  border: 1px solid rgba(var(--success-rgb), 0.35);
  color: var(--success);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform 400ms var(--ease-out), opacity 300ms ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 700ms ease, transform 700ms var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.js .stagger > * {
  opacity: 0;
  transform: translateY(22px) scale(0.98);
  transition: opacity 600ms ease, transform 700ms var(--ease-out);
  transition-delay: calc(var(--s, 0) * 90ms + 150ms);
}

.visible .stagger > *,
.stagger.visible > * {
  opacity: 1;
  transform: none;
}

/* Hover transforms override the stagger entry once it has finished */
.visible .stagger > .spotlight:hover,
.visible .stagger > .stat-box:hover {
  transform: translateY(-5px);
  transition-delay: 0ms;
}

/* ---------- Keyframes ---------- */

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-18px) translateX(10px); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-12px) rotate(2deg); }
}

@keyframes word-in {
  to { opacity: 1; transform: none; filter: blur(0); }
}

@keyframes fade-up {
  to { opacity: 1; transform: none; }
}

@keyframes gradient-pan {
  to { background-position: 220% center; }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes shine {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-border {
  to { --angle: 360deg; }
}

@keyframes ping {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(2.8); opacity: 0; }
}

@keyframes marquee {
  to { transform: translateX(-50%); }
}

@keyframes core-pulse {
  0%, 100% { box-shadow: 0 0 0 8px rgba(var(--primary-rgb), 0.08), 0 0 40px rgba(var(--primary-rgb), 0.45); }
  50% { box-shadow: 0 0 0 16px rgba(var(--primary-rgb), 0.04), 0 0 60px rgba(var(--secondary-rgb), 0.55); }
}

@keyframes packet {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  70% { left: calc(100% - 24px); opacity: 1; }
  80%, 100% { left: calc(100% - 24px); opacity: 0; }
}

@keyframes flow-x {
  0% { left: 0; opacity: 0; }
  4% { opacity: 1; }
  16% { left: calc(100% - 8px); opacity: 1; }
  20%, 100% { left: calc(100% - 8px); opacity: 0; }
}

@keyframes flow-y {
  0% { top: 0; opacity: 0; }
  4% { opacity: 1; }
  16% { top: calc(100% - 8px); opacity: 1; }
  20%, 100% { top: calc(100% - 8px); opacity: 0; }
}

@keyframes step-glow {
  0%, 24%, 100% { border-color: var(--line); box-shadow: none; }
  6%, 16% { border-color: rgba(var(--primary-rgb), 0.6); box-shadow: 0 0 22px rgba(var(--primary-rgb), 0.25); }
}

/* Nodding along to the beat */
@keyframes head-bob {
  0%, 100% { transform: none; }
  25% { transform: translateY(-2px) rotate(-2deg); }
  55% { transform: translateY(-1px) rotate(1.5deg); }
}

@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(0.55) rotate(45deg); opacity: 0.5; }
}

@keyframes blink-eyes {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

@keyframes glance {
  0%, 38%, 78%, 100% { transform: translate(0, 0); }
  44%, 72% { transform: translate(3px, -1px); }
}

@keyframes breathe {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.015); }
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  8%, 24%, 40%, 56% { transform: translateY(-3px); }
  16%, 32%, 48% { transform: translateY(0); }
}

@keyframes sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes steam {
  0% { opacity: 0; transform: translateY(6px); }
  30% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-14px); }
}

@keyframes rise {
  0% { opacity: 0; transform: translateY(0); }
  15% { opacity: 0.9; }
  60% { opacity: 0; transform: translateY(-110px); }
  100% { opacity: 0; transform: translateY(-110px); }
}

@keyframes logo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(12vmax, 8vmax) scale(1.15); }
  100% { transform: translate(-8vmax, 14vmax) scale(0.9); }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .nav-toggle {
    display: grid;
    order: 3;
  }

  .palette-switch {
    margin-left: auto;
  }

  .nav-resume {
    display: none;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 16px;
    background: rgba(var(--bg-rgb), 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, transform 250ms var(--ease-out), visibility 250ms;
  }

  .nav-links.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 14px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links a.active {
    color: var(--primary);
  }
}

@media (max-width: 860px) {
  .hero,
  .about-grid,
  .footer-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero {
    padding-top: 40px;
    min-height: auto;
  }

  .hero-visual {
    min-height: 480px;
  }

  .project-grid,
  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline-track {
    left: 11px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .timeline-item::before {
    left: -27px;
    top: 30px;
  }

  .time-tag {
    justify-self: start;
  }

  .education-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .contact-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .project-grid,
  .skills-grid,
  .impact-grid {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-column: auto;
  }

  .float-chip {
    display: none;
  }

  .hero-visual {
    min-height: auto;
    padding: 20px 0;
  }

  .rag-flow {
    flex-direction: column;
    align-items: stretch;
  }

  .rag-step {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
    padding: 12px 14px;
  }

  .rag-step small {
    margin-left: auto;
  }

  .rag-link {
    flex: 0 0 18px;
    width: 2px;
    height: auto;
    align-self: center;
  }

  .rag-link::after {
    top: 0;
    left: -3px;
    animation-name: flow-y;
  }
}

@media (max-width: 560px) {
  .btn {
    width: 100%;
  }

  .cta-row {
    flex-direction: column;
  }

  .mini-stats,
  .stats-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-copy h1 {
    letter-spacing: -0.05em;
  }

  .footer-card {
    padding: 26px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0ms !important;
  }

  .marquee-track {
    animation: none;
  }

  #network-bg,
  .cursor-glow {
    display: none;
  }
}
