/* ==========================================================================
   Bhupender Yadav — portfolio
   Design tokens → base → layout → components → responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* dark is the default palette; [data-theme="light"] overrides below */
  --bg: #07090d;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-2: rgba(255, 255, 255, 0.055);
  --surface-solid: #0e131b;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text: #e9eff7;
  --text-dim: #9aadc2;
  --text-faint: #6c8099;

  --accent: #22d3ee;
  --accent-2: #818cf8;
  --accent-3: #34d399;
  --accent-ink: #04222a;
  --accent-soft: rgba(34, 211, 238, 0.13);
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));

  --shadow-md: 0 12px 30px -12px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 32px 70px -28px rgba(0, 0, 0, 0.8);
  --glow: 0 0 0 1px rgba(34, 211, 238, 0.22), 0 22px 60px -26px rgba(34, 211, 238, 0.5);

  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --code-bg: rgba(9, 13, 20, 0.92);
  --code-key: #ff7ab6;
  --code-fn: #6ee7ff;
  --code-str: #a5f3a0;
  --code-type: #c3b1ff;
  --code-com: #5f7386;
  --grid-line: rgba(255, 255, 255, 0.045);
}

[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: #ffffff;
  --surface-solid: #ffffff;
  --border: rgba(13, 26, 46, 0.10);
  --border-strong: rgba(13, 26, 46, 0.20);

  --text: #0c1526;
  --text-dim: #4a5b72;
  --text-faint: #74869c;

  --accent: #0891b2;
  --accent-2: #5b5bd6;
  --accent-3: #059669;
  --accent-ink: #ffffff;
  --accent-soft: rgba(8, 145, 178, 0.10);

  --shadow-md: 0 14px 34px -18px rgba(15, 30, 55, 0.28);
  --shadow-lg: 0 30px 64px -30px rgba(15, 30, 55, 0.32);
  --glow: 0 0 0 1px rgba(8, 145, 178, 0.28), 0 22px 50px -26px rgba(8, 145, 178, 0.4);

  --code-bg: #0d1220;
  --grid-line: rgba(13, 26, 46, 0.05);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.18; letter-spacing: -0.022em; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: inherit; }
img, svg { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

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

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

.skip-link {
  position: fixed; top: 10px; left: 50%;
  transform: translate(-50%, -180%);
  z-index: 200;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; text-decoration: none;
  transition: transform 0.25s var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

.container { width: min(1180px, calc(100% - 2.5rem)); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 108px) 0; position: relative; }
#impact { padding: clamp(38px, 5vw, 58px) 0; }

/* --------------------------------------------------------------------------
   3. Ambient backdrop
   -------------------------------------------------------------------------- */
.backdrop {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
  background: var(--bg);
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  will-change: transform;
}
.aurora-1 {
  width: 46vw; height: 46vw; min-width: 340px; min-height: 340px;
  top: -14vw; left: -10vw;
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.aurora-2 {
  width: 42vw; height: 42vw; min-width: 300px; min-height: 300px;
  top: 6vw; right: -12vw;
  background: radial-gradient(circle, var(--accent-2) 0%, transparent 68%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
.aurora-3 {
  width: 38vw; height: 38vw; min-width: 260px; min-height: 260px;
  top: 78vh; left: 32vw;
  background: radial-gradient(circle, var(--accent-3) 0%, transparent 70%);
  opacity: 0.3;
  animation: drift-a 38s ease-in-out infinite alternate-reverse;
}
[data-theme="light"] .aurora { opacity: 0.3; filter: blur(110px); }
[data-theme="light"] .aurora-3 { opacity: 0.18; }

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 5vh, 0) scale(1.12); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.06); }
  to   { transform: translate3d(-7vw, 7vh, 0) scale(0.94); }
}

.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 10%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 10%, transparent 78%);
}

.noise {
  position: absolute; inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="light"] .noise { opacity: 0.02; }

/* --------------------------------------------------------------------------
   4. Scroll progress
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 120; pointer-events: none;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: var(--gradient);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.7);
  transition: width 0.1s linear;
}

/* --------------------------------------------------------------------------
   5. Header + navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); box-shadow: var(--glow); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-role { font-size: 11.5px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav > a {
  position: relative;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14.5px; font-weight: 500;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav > a:hover { color: var(--text); background: var(--surface); }
.nav > a.active { color: var(--text); }
.nav > a.active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 2px;
  height: 2px; border-radius: 2px; background: var(--gradient);
}

.nav-cta {
  display: inline-flex; align-items: center; gap: 7px;
  margin-left: 8px; padding: 8px 15px !important;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text) !important;
  font-weight: 600;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.nav-cta:hover { border-color: var(--accent); box-shadow: var(--glow); transform: translateY(-1px); }
.nav-cta::after { display: none !important; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: 8px; }

.icon-btn {
  width: 38px; height: 38px; flex: none; padding: 0;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.theme-toggle .icon-sun,
.theme-toggle .icon-moon { grid-area: 1 / 1; transition: opacity 0.3s var(--ease), transform 0.4s var(--ease); }
[data-theme="dark"] .theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="dark"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(-70deg) scale(0.6); }
[data-theme="light"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(70deg) scale(0.6); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

.nav-toggle { display: none; gap: 4.5px; grid-auto-flow: row; align-content: center; justify-items: center; }
.nav-scrim {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(3, 6, 11, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.28s var(--ease), visibility 0.28s;
}
body.nav-open .nav-scrim { opacity: 1; visibility: visible; }
@media (min-width: 881px) { .nav-scrim { display: none; } }

.nav-toggle span {
  display: block; width: 17px; height: 2px; border-radius: 2px;
  background: currentColor;
  transition: transform 0.28s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   6. Buttons + shared bits
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-weight: 600; font-size: 15px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.btn svg { flex: none; }

.btn.primary {
  position: relative;
  border-color: transparent;
  background: var(--gradient);
  color: var(--accent-ink);
  box-shadow: 0 14px 34px -14px rgba(34, 211, 238, 0.65);
}
[data-theme="light"] .btn.primary { color: #fff; box-shadow: 0 14px 30px -14px rgba(8, 145, 178, 0.6); }
.btn.primary:hover { box-shadow: 0 20px 44px -14px rgba(34, 211, 238, 0.8); }
.btn.primary svg { transition: transform 0.3s var(--ease); }
.btn.primary:hover svg { transform: translateX(3px); }

.btn.ghost { background: transparent; border-color: var(--border); }
.btn.big { padding: 15px 26px; font-size: 16px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  margin: 0 0 18px;
  padding: 7px 15px 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
}
.eyebrow-plain {
  padding: 0; border: 0; background: none;
  color: var(--accent);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 12px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.section-head { max-width: 620px; margin-bottom: clamp(30px, 4vw, 44px); }
.section-title { font-size: clamp(28px, 4.2vw, 42px); margin: 0 0 10px; }
.section-sub { color: var(--text-dim); font-size: 16.5px; margin: 0; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px);
}

.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(36px, 5.6vw, 62px);
  font-weight: 800;
  letter-spacing: -0.035em;
}
.hero h1 .accent {
  display: block;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent) 100%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 7s linear infinite;
}
@keyframes shimmer {
  to { background-position: 220% center; }
}

.lead {
  color: var(--text-dim);
  font-size: clamp(15.5px, 1.35vw, 17.5px);
  max-width: 60ch;
  margin: 0 0 26px;
}

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.meta { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.meta li { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: baseline; gap: 4px 12px; font-size: 14.5px; }
.meta-key {
  color: var(--accent);
  line-height: 1.5;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}
.meta-val { color: var(--text-dim); }

/* Hero art -------------------------------------------------------------- */
.hero-content, .hero-art { min-width: 0; }
.hero-art { position: relative; padding: 42px 0 56px; }

.hero-art::before {
  content: ""; position: absolute; inset: 8% -6% 6% 4%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 62%);
  opacity: 0.16; filter: blur(60px);
  pointer-events: none;
}
[data-theme="light"] .hero-art::before { opacity: 0.2; }

.code-window {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--code-bg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease);
}
.code-window::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.55), transparent 42%, rgba(129, 140, 248, 0.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

.code-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.code-file {
  margin-left: 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12.5px; color: #8ba0b6;
}
.code-lang {
  margin-left: auto;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: rgba(34, 211, 238, 0.14);
  color: #67e8f9;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
}

.code-body {
  margin: 0;
  padding: 18px 20px 22px;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(11.5px, 1.02vw, 13.2px);
  line-height: 1.75;
  color: #cfe0f0;
  tab-size: 4;
}
.code-body code { font: inherit; }
.code-body .k { color: var(--code-key); }
.code-body .f { color: var(--code-fn); }
.code-body .s { color: var(--code-str); }
.code-body .t { color: var(--code-type); }
.code-body .c { color: var(--code-com); font-style: italic; }

.float-card {
  position: absolute;
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-solid) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  animation: bob 6s ease-in-out infinite;
}
[data-theme="light"] .float-card { background: rgba(255, 255, 255, 0.92); }
.float-1 { left: -34px; bottom: 0; }
.float-2 { right: -16px; top: 0; flex-direction: row; align-items: center; gap: 8px; animation-delay: -3s; }
.float-label {
  color: var(--text-faint);
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
}
.float-value { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.float-value small { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-left: 2px; }
.float-value.ok { font-size: 13.5px; color: var(--accent-3); }
.float-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px var(--accent-3);
}
.spark { display: flex; align-items: flex-end; gap: 3px; height: 22px; margin-top: 4px; }
.spark i {
  width: 4px; border-radius: 2px;
  height: var(--h);
  background: var(--gradient);
  opacity: 0.85;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

/* --------------------------------------------------------------------------
   8. Marquee
   -------------------------------------------------------------------------- */
.marquee {
  position: relative;
  padding: 20px 0;
  border-block: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  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; animation: slide 42s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 30px; padding-right: 30px; }
.marquee-group span {
  display: inline-flex; align-items: center; gap: 30px;
  color: var(--text-faint);
  font-size: 15px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
}
.marquee-group span::after {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: 0.5;
}
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --------------------------------------------------------------------------
   9. Stats
   -------------------------------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 26px 22px;
  background: color-mix(in srgb, var(--bg) 88%, var(--surface-2));
  transition: background 0.3s var(--ease);
}
.stat:hover { background: var(--surface-2); }
.stat-value {
  font-size: clamp(30px, 3.6vw, 42px);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.05;
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { color: var(--text-dim); font-size: 13.5px; line-height: 1.45; }

/* --------------------------------------------------------------------------
   10. Cards (skills, education)
   -------------------------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
/* cursor spotlight */
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.card:hover::before { opacity: 1; }

.card-icon {
  display: grid; place-items: center;
  width: 42px; height: 42px; margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card-icon svg { width: 21px; height: 21px; }
.card:hover .card-icon { transform: translateY(-2px) scale(1.05); box-shadow: var(--glow); }

.card h3 { margin: 0 0 8px; font-size: 17.5px; }
.card p { margin: 0 0 16px; color: var(--text-dim); font-size: 14.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.chip {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 500;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* --------------------------------------------------------------------------
   11. Timeline
   -------------------------------------------------------------------------- */
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 34px; }
.timeline-rail {
  position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 2px; border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.timeline-rail i {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform-origin: top;
  transform: scaleY(var(--fill, 0));
  transition: transform 0.15s linear;
}

.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-node {
  position: absolute; left: -34px; top: 26px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.timeline-node::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--gradient);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.timeline-item:hover .timeline-node,
.timeline-item.is-active .timeline-node { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.timeline-item:hover .timeline-node::after,
.timeline-item.is-active .timeline-node::after { opacity: 1; }

.timeline-item .content {
  position: relative;
  padding: 24px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.timeline-item:hover .content { transform: translateX(4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.role-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
/* White plate so each brand's own colours stay accurate in both themes —
   several of these wordmarks are dark ink and vanish on the dark background. */
.logo-chip {
  position: relative;
  flex: none;
  width: 60px; height: 44px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.timeline-item:hover .logo-chip { transform: translateY(-2px); box-shadow: var(--glow); }
[data-theme="light"] .logo-chip { border-color: rgba(13, 26, 46, 0.16); }

/* Sits behind the image, so a missing logo file degrades to a monogram. */
.logo-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #334155;
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
}
.logo-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  padding: 7px 8px;
  object-fit: contain;
  background: #fff;
}
.role-head h3 { margin: 0 0 2px; font-size: 18px; }
.role-head .at { color: var(--text-faint); font-weight: 400; margin: 0 2px; }
.role-head .company {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.role-meta { margin: 0; color: var(--text-faint); font-size: 13px; }

.time {
  flex: none; margin-left: auto;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.time.now { border-color: rgba(52, 211, 153, 0.4); color: var(--accent-3); background: rgba(52, 211, 153, 0.1); }

.timeline-item .content > p { color: var(--text-dim); font-size: 15px; margin: 0 0 14px; }

.bullets { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.bullets li {
  position: relative;
  padding-left: 22px;
  color: var(--text-dim);
  font-size: 14.5px; line-height: 1.6;
}
.bullets li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; border-radius: 2px;
  background: var(--gradient);
  transform: rotate(45deg);
}
.bullets strong { color: var(--text); font-weight: 650; }

/* --------------------------------------------------------------------------
   12. Projects
   -------------------------------------------------------------------------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}
.project {
  position: relative;
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.project::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.35s var(--ease); pointer-events: none;
}
.project:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.project:hover::before { opacity: 1; }
.project-glow {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.55s var(--ease);
}
.project:hover .project-glow { transform: scaleX(1); }

.project-head { display: flex; align-items: center; gap: 12px; }
.project-head h3 { margin: 0; font-size: 22px; }
.project > p { margin: 0; color: var(--text-dim); font-size: 15px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-faint);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
}

.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 6px; }
.links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  font-size: 14px; font-weight: 600;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease);
}
.links a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.links .arrow { transition: transform 0.25s var(--ease); }
.links a:hover .arrow { transform: translate(2px, -2px); }

.card .bullets { margin-bottom: 16px; }
.card .links { padding-top: 0; }

/* --------------------------------------------------------------------------
   13. Contact
   -------------------------------------------------------------------------- */
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 52px);
  align-items: center;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(700px circle at 0% 0%, var(--accent-soft), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-md);
}
.contact-intro .section-title { font-size: clamp(26px, 3.4vw, 36px); }
.contact-intro .section-sub { margin-bottom: 24px; }
.contact-intro .btn.big { word-break: break-word; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: start; }
.contact-list a,
.contact-list .static {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 15px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease);
}
.contact-list a:hover { border-color: var(--accent); transform: translateX(4px); }
.ci {
  flex: none; width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}
.cc { display: flex; flex-direction: column; font-size: 14.5px; font-weight: 600; line-height: 1.35; min-width: 0; }
.cc small {
  color: var(--text-faint);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.contact-list .arrow { margin-left: auto; color: var(--text-faint); transition: transform 0.25s var(--ease), color 0.25s var(--ease); }
.contact-list a:hover .arrow { color: var(--accent); transform: translate(2px, -2px); }

/* --------------------------------------------------------------------------
   14. Footer + back to top
   -------------------------------------------------------------------------- */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; padding: 26px 0;
  color: var(--text-faint); font-size: 14px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 9px; color: var(--accent); }
.brand-mark.small svg { width: 18px; height: 18px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--text-faint); text-decoration: none; transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--accent); }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--surface-solid) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  box-shadow: var(--shadow-md);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s, border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   15. Reveal animation
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--delay, 0ms);
}
[data-reveal].in-view { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   16. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 620px; }
  .float-1 { left: 0; }
  .float-2 { right: 0; }
}

@media (max-width: 880px) {
  .nav-toggle { display: grid; }
  .brand-role { display: none; }

  .nav {
    position: fixed; inset: var(--header-h) 0 auto;
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0; padding: 14px 20px 22px;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 96;
    transform: translateY(-14px);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .nav > a { padding: 13px 12px; font-size: 16px; border-radius: 12px; }
  .nav > a.active { background: var(--surface-2); }
  .nav > a.active::after { display: none; }
  .nav-cta { margin: 10px 0 0; justify-content: center; padding: 13px 15px !important; }

  .contact-panel { grid-template-columns: 1fr; }
  .timeline { padding-left: 26px; }
  .timeline-rail { left: 3px; }
  .timeline-node { left: -30px; top: 22px; width: 14px; height: 14px; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 2rem); }
  .hero { padding-top: 34px; }
  .hero h1 { font-size: clamp(31px, 8.6vw, 40px); }
  .float-card { display: none; }
  .hero-art { padding: 0; }
  .code-body { font-size: 11px; padding: 14px 16px 18px; }
  .timeline-item .content { padding: 20px 18px; }
  .role-head { flex-wrap: wrap; }
  .logo-chip { width: 54px; height: 40px; }
  .role-head .time { margin-left: 0; order: 3; width: fit-content; }
  .project { padding: 22px 20px; }
  .stat { padding: 20px 18px; }
  .meta li { grid-template-columns: 1fr; gap: 2px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .to-top { right: 14px; bottom: 14px; }
}

/* --------------------------------------------------------------------------
   17. Motion / print preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .aurora, .float-card, .marquee-track { animation: none !important; }
}

@media print {
  .backdrop, .site-header, .to-top, .marquee, .scroll-progress, .hero-art { display: none !important; }
  body { color: #000; background: #fff; }
  .section { padding: 18px 0; page-break-inside: avoid; }
}
