/* ==========================================================================
   Girish Gandhi - Portfolio
   Design system: 8px grid, one easing curve, dark + light themes, gold accent.
   Spacing rule: every padding / margin / gap is a multiple of 8px
   (documented exceptions: 1px borders, 2px focus rings and 4px micro-gaps in
   inline icon rows).
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 56px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.25s;
  --dur: 0.8s;
  --dur-slow: 1.2s;

  --radius-1: 8px;
  --radius-2: 16px;
  --radius-3: 24px;

  --font-head: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --nav-h: 88px;
  --container: calc(1760px + 2 * var(--gutter)); /* content grows with the screen up to 1760px, then stops (never shrinks) */
  --gutter: clamp(16px, 5.5vw - 4px, 144px); /* side space scales smoothly with the screen */
  --edge: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
}

:root,
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-elev: #12141a;
  --surface: #161821;
  --surface-2: #1d1f2a;
  --border: #272a37;
  --text: #f2f2f6;
  --text-muted: #a7a9b6;
  /* Primary colour: violet to cyan gradient (solid fallback = violet) */
  --grad: linear-gradient(100deg, #8b7cff, #6ee7f9 55%, #8b7cff);
  --grad-v: linear-gradient(180deg, #8b7cff, #6ee7f9);
  --grad-rev: linear-gradient(100deg, #6ee7f9, #8b7cff 55%, #6ee7f9);
  --accent: #8b7cff;
  --accent-strong: #a89dff;
  --accent-2: #6ee7f9;
  --accent-ink: #0a0b12;
  --accent-soft: rgba(139, 124, 255, 0.14);
  --glow-a: rgba(139, 124, 255, 0.16);
  --glow-b: rgba(110, 231, 249, 0.08);
  --glow-c: rgba(99, 76, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.05);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.5);
  --scrim: rgba(5, 6, 10, 0.72);
  --tile: #0b0c10;
  --grid: rgba(139, 124, 255, 0.07);
  --star: rgba(255, 255, 255, 0.7);
  --plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='none' stroke='rgba(139,124,255,0.16)' stroke-width='1'%3E%3Cpath d='M24 32H72L88 48V96'/%3E%3Ccircle cx='24' cy='32' r='3'/%3E%3Ccircle cx='88' cy='96' r='3'/%3E%3Cpath d='M120 24V64L136 80H168'/%3E%3Ccircle cx='120' cy='24' r='3'/%3E%3Ccircle cx='168' cy='80' r='3'/%3E%3Cpath d='M40 152H96L112 136H160'/%3E%3Ccircle cx='40' cy='152' r='3'/%3E%3Ccircle cx='160' cy='136' r='3'/%3E%3Cpath d='M24 96H48'/%3E%3Ccircle cx='24' cy='96' r='3'/%3E%3Ccircle cx='48' cy='96' r='1.5'/%3E%3Cpath d='M152 168V184'/%3E%3Ccircle cx='152' cy='168' r='2'/%3E%3C/svg%3E");
  --code: rgba(190, 196, 230, 0.32);
  --code-k: rgba(139, 124, 255, 0.68);
  --code-s: rgba(110, 231, 249, 0.58);
  --dot: rgba(255, 255, 255, 0.09);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f7fb;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #efeff7;
  --border: #e1e1ec;
  --text: #15161d;
  --text-muted: #565868;
  /* Same gradient, deepened so text stays readable on light backgrounds */
  --grad: linear-gradient(100deg, #5b4bd6, #0b7285 55%, #5b4bd6);
  --grad-v: linear-gradient(180deg, #5b4bd6, #0b7285);
  --grad-rev: linear-gradient(100deg, #0b7285, #5b4bd6 55%, #0b7285);
  --accent: #5b4bd6;
  --accent-strong: #4437b5;
  --accent-2: #0b7285;
  --accent-ink: #ffffff;
  --accent-soft: rgba(91, 75, 214, 0.1);
  --glow-a: rgba(91, 75, 214, 0.12);
  --glow-b: rgba(11, 114, 133, 0.07);
  --glow-c: rgba(91, 75, 214, 0.1);
  --hover: rgba(21, 22, 29, 0.05);
  --shadow: 0 8px 24px rgba(30, 30, 60, 0.08);
  --shadow-lg: 0 24px 48px rgba(30, 30, 60, 0.16);
  --scrim: rgba(21, 22, 29, 0.5);
  --tile: #0b0c10;
  --grid: rgba(91, 75, 214, 0.08);
  --star: rgba(21, 22, 29, 0.55);
  --plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='192' height='192' fill='none' stroke='rgba(91,75,214,0.2)' stroke-width='1'%3E%3Cpath d='M24 32H72L88 48V96'/%3E%3Ccircle cx='24' cy='32' r='3'/%3E%3Ccircle cx='88' cy='96' r='3'/%3E%3Cpath d='M120 24V64L136 80H168'/%3E%3Ccircle cx='120' cy='24' r='3'/%3E%3Ccircle cx='168' cy='80' r='3'/%3E%3Cpath d='M40 152H96L112 136H160'/%3E%3Ccircle cx='40' cy='152' r='3'/%3E%3Ccircle cx='160' cy='136' r='3'/%3E%3Cpath d='M24 96H48'/%3E%3Ccircle cx='24' cy='96' r='3'/%3E%3Ccircle cx='48' cy='96' r='1.5'/%3E%3Cpath d='M152 168V184'/%3E%3Ccircle cx='152' cy='168' r='2'/%3E%3C/svg%3E");
  --code: rgba(45, 48, 90, 0.4);
  --code-k: rgba(91, 75, 214, 0.68);
  --code-s: rgba(11, 114, 133, 0.65);
  --dot: rgba(21, 22, 29, 0.12);
}


/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
img, svg { display: block; max-width: 100%; }

/* Site backdrop: the original developer-style editor grid + fine dot matrix + soft glows.
   One fixed, non-interactive layer (no scroll cost); it fades toward the bottom of the viewport. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(48% 40% at 86% 0%, var(--glow-a), transparent 70%),
    radial-gradient(40% 36% at 0% 26%, var(--glow-b), transparent 70%),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(var(--dot) 1px, transparent 1.4px);
  background-size: auto, auto, 64px 64px, 64px 64px, 16px 16px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px, 0 0;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, rgba(0, 0, 0, 0.35) 100%);
}
body::after { content: none; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; transition: color var(--dur-fast) var(--ease); }
a:hover { color: var(--accent-strong); }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Gradient primary colour helpers */
@keyframes shimmer { to { background-position: 200% 0; } }
.grad-text {
  background-image: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmer 6s linear infinite;
}

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

.skip-link {
  position: fixed; left: var(--space-2); top: -64px; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: var(--space-1) var(--space-2); border-radius: var(--radius-1); font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--space-2); color: var(--accent-ink); }

.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;
}

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
section { scroll-margin-top: var(--nav-h); }

/* ---------- Reveal animations ---------- */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes line-rise {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* Hidden-until-revealed only when JS is running (progressive enhancement) */
.js [data-reveal]:not(.is-visible) { opacity: 0; transform: translateY(20px); }
.js [data-reveal].is-visible {
  animation: fade-up var(--dur) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.2s);
}
/* Page-load stagger: content rises 20px and fades in, 0.2s after the previous */
.js [data-load] { opacity: 0; }
.js.is-loaded [data-load] {
  animation: fade-up var(--dur-slow) var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.2s);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1);
  min-height: 48px; padding: 0 var(--space-3);
  border-radius: var(--radius-1); border: 1px solid transparent;
  font-weight: 600; font-size: 0.9375rem; line-height: 1; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary {
  background-image: var(--grad); background-size: 200% 100%; background-position: 0 0; background-color: var(--accent);
  color: var(--accent-ink); box-shadow: 0 8px 24px var(--accent-soft);
  transition: transform var(--dur-fast) var(--ease), background-position var(--dur) var(--ease), box-shadow var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn-primary:hover { background-position: 100% 0; color: var(--accent-ink); box-shadow: 0 12px 32px var(--glow-a); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-sm { min-height: 40px; padding: 0 var(--space-2); font-size: 0.875rem; }

/* label slide-swap on hover */
.btn .swap { position: relative; display: inline-block; overflow: hidden; height: 1.2em; line-height: 1.2; }
.btn .swap span { display: block; transition: transform var(--dur-fast) var(--ease); }
.btn .swap span + span { position: absolute; left: 0; top: 100%; }
.btn:hover .swap span, .btn:focus-visible .swap span { transform: translateY(-100%); }

.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px;
  border-radius: var(--radius-1); border: 1px solid var(--border); background: transparent; color: var(--text);
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.brand { display: inline-flex; align-items: center; gap: var(--space-1); font-family: var(--font-head); font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.nav-links { display: none; align-items: center; gap: var(--space-1); }
.nav-links a {
  position: relative; padding: var(--space-1) var(--space-2); color: var(--text-muted); font-size: 0.9375rem; font-weight: 500;
  transition: color var(--dur-fast) var(--ease);
}
.nav-links a::after {
  content: ''; position: absolute; left: var(--space-2); right: var(--space-2); bottom: 0; height: 2px; background-image: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform var(--dur-fast) var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }
.nav-actions { display: flex; align-items: center; gap: var(--space-1); }
.nav-cv { display: none; }
.menu-btn { display: inline-grid; }
.theme-toggle .sun { display: none; }
:root[data-theme='light'] .theme-toggle .sun { display: block; }
:root[data-theme='light'] .theme-toggle .moon { display: none; }

.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99; background: var(--bg);
  padding: var(--space-3) var(--gutter); display: flex; flex-direction: column; gap: var(--space-1);
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), visibility var(--dur-fast);
  overflow-y: auto;
}
.mobile-menu.is-open { transform: none; opacity: 1; visibility: visible; }
.mobile-menu a {
  padding: var(--space-2); border-radius: var(--radius-1); color: var(--text);
  font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; display: flex; justify-content: space-between;
}
.mobile-menu a:hover { background: var(--hover); color: var(--accent); }
.mobile-menu .btn { margin-top: var(--space-2); }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cv { display: inline-flex; }
  .menu-btn { display: none; }
  .mobile-menu { display: none; }
}

/* ---------- Hero ---------- */
.hero { padding: var(--space-8) 0 var(--space-6); position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: var(--space-6); align-items: center; }
.hero-copy { order: 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.hero-media { order: 1; display: flex; justify-content: center; }

.badge {
  display: inline-flex; align-items: center; gap: var(--space-1); padding: 0 var(--space-2); min-height: 32px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-muted); font-size: 0.8125rem; font-weight: 500;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; animation: pulse 2s var(--ease) infinite; }

.role-tag { font-family: var(--font-mono); font-size: 0.9375rem; color: var(--text-muted); }
.role-tag .kw { color: var(--accent); }
.role-tag .cursor { display: inline-block; width: 8px; height: 1.1em; margin-left: 0; vertical-align: text-bottom; background: var(--accent); animation: blink 1s steps(1) infinite; }

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.5rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 700;
}
.hero .line { display: block; overflow: hidden; padding-bottom: 8px; margin-bottom: -8px; }
.hero .line > span { display: inline-block; }
.js .hero .line > span { transform: translateY(110%); }
.js.is-loaded .hero .line > span {
  animation: line-rise var(--dur-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 0.2s + 0.2s);
}


.hero-lead { max-width: 560px; font-size: 1.125rem; color: var(--text-muted); }
.hero-lead mark { background: none; color: var(--text); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.social-row { display: flex; gap: var(--space-1); flex-wrap: wrap; }

.portrait {
  position: relative; width: min(100%, 320px); aspect-ratio: 1; border-radius: 50%;
  padding: 8px; background-image: linear-gradient(135deg, #8b7cff, #6ee7f9 60%, transparent);
  box-shadow: var(--shadow-lg);
}
.portrait { perspective: 1200px; }
.portrait-inner { position: relative; width: 100%; height: 100%; border-radius: 50%; transform-style: preserve-3d; transition: transform 1.4s var(--ease); }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface-2); }
.portrait .photo-b { transform: rotateY(180deg); }
.portrait.has-swap:hover .portrait-inner, .portrait.has-swap:focus-visible .portrait-inner, .portrait.has-swap.is-swapped .portrait-inner { transform: rotateY(180deg); }
.portrait.has-swap { cursor: pointer; }

.stats {
  margin-top: var(--space-8); display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-1);
  border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--surface); padding: var(--space-3);
}
.stat { padding: var(--space-1); }
.stat-value { font-family: var(--font-head); font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }

.stat-label { margin-top: var(--space-1); font-size: 0.8125rem; color: var(--text-muted); }

@media (min-width: 768px) {
  .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2); }
}
@media (min-width: 960px) {
  .hero { padding: var(--space-12) 0 var(--space-8); }
  .hero-grid { grid-template-columns: 1.3fr 1fr; gap: var(--space-8); }
  .hero-copy { order: 1; }
  .hero-media { order: 2; }
  .portrait { width: min(100%, 400px); }
}

/* ---------- Sections ---------- */
.section { padding: var(--space-10) 0; }
.section-head { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-6); max-width: 720px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); }
.section-head h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 700; }
.section-head p { color: var(--text-muted); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-2); padding: var(--space-3);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

/* About */
.about-grid { display: grid; gap: var(--space-4); }
.about-text { display: flex; flex-direction: column; gap: var(--space-2); color: var(--text-muted); font-size: 1.0625rem; }
.about-text strong { color: var(--text); font-weight: 600; }
.facts { display: grid; gap: var(--space-1); }
.fact { display: flex; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); font-size: 0.9375rem; }
.fact span:first-child { color: var(--text-muted); }
.fact span:last-child { text-align: right; font-weight: 500; }
.banner { margin-top: var(--space-6); border-radius: var(--radius-2); overflow: hidden; border: 1px solid var(--border); }
.banner img { width: 100%; height: auto; }
@media (min-width: 960px) { .about-grid { grid-template-columns: 1.4fr 1fr; gap: var(--space-8); } }

/* Skills */
.skills-grid { display: grid; gap: var(--space-2); }
.skill-card h3 { font-size: 1.0625rem; margin-bottom: var(--space-2); display: flex; align-items: center; gap: var(--space-1); }
.skill-card h3::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background-image: var(--grad); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.chip {
  padding: 0 var(--space-2); min-height: 32px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
  font-size: 0.8125rem; color: var(--text); line-height: 1.6;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.js .skill-card.is-visible .chip { animation: pop-in 0.7s var(--ease) both; animation-delay: calc(var(--c, 0) * 0.06s + 0.4s); }
.js .skill-card:not(.is-visible) .chip { opacity: 0; }
@media (min-width: 768px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .skills-grid { grid-template-columns: repeat(3, 1fr); } .skill-card.wide { grid-column: span 2; } }

.ticker { margin-top: var(--space-6); overflow: hidden; border-block: 1px solid var(--border); padding: var(--space-2) 0;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }

/* Projects */
.projects-grid { display: grid; gap: var(--space-3); }
.project-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-1); }
.project-index { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.status { padding: 0 var(--space-2); min-height: 24px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.75rem; font-weight: 600; }
@media (min-width: 720px) { .projects-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .projects-grid { grid-template-columns: repeat(3, 1fr); } }

dialog.project-dialog {
  width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--border);
  border-radius: var(--radius-3); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg); overflow: auto;
}
dialog.project-dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
dialog.project-dialog[open] { animation: pop-in 0.3s var(--ease); }
dialog.project-dialog[open]::backdrop { animation: fade-in 0.3s var(--ease); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.dialog-body { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-2); }
.dialog-head h3 { font-size: clamp(1.5rem, 4vw, 2rem); }
.dialog-head .sub { color: var(--text-muted); margin-top: var(--space-1); }
.dialog-section h4 { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: var(--space-1); font-family: var(--font-mono); font-weight: 500; }
.dialog-section p { color: var(--text-muted); }
.dialog-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Experience timeline */
.timeline { position: relative; display: grid; gap: var(--space-4); padding-left: var(--space-4); }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border);
}
.timeline::after {
  content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background-image: var(--grad-v);
  transform: scaleY(var(--progress, 0)); transform-origin: top; transition: transform 0.2s linear;
}
.job { position: relative; }
.job::before {
  content: ''; position: absolute; left: -32px; top: 8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent); z-index: 1;
}
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-2); margin-bottom: var(--space-2); }
.job-title { font-size: 1.25rem; }
.job-company { color: var(--text-muted); font-weight: 500; }
.job-company a { color: var(--accent); }
.job-meta { color: var(--text-muted); font-size: 0.875rem; font-family: var(--font-mono); }
.job ul { display: grid; gap: var(--space-1); color: var(--text-muted); font-size: 0.9375rem; }
.job li { position: relative; padding-left: var(--space-3); }
.job li::before { content: ''; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background-image: var(--grad); }

/* Education / interests */
.split { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .split { grid-template-columns: repeat(2, 1fr); } }
.edu h3 { font-size: 1.125rem; margin-bottom: var(--space-1); }
.edu p { color: var(--text-muted); font-size: 0.9375rem; }

.interests { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
.interest {
  display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--border);
  border-radius: var(--radius-2); background: var(--surface);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.interest:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--accent-soft); }
.interest svg { width: 24px; height: 24px; color: var(--accent); flex: none; }
@media (min-width: 768px) { .interests { grid-template-columns: repeat(4, 1fr); } }

/* Contact */
.contact-card { display: grid; gap: var(--space-4); padding: var(--space-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-3); position: relative; overflow: hidden; }
.contact-card::before { content: ''; position: absolute; inset: auto -120px -160px auto; width: 480px; height: 480px; background: radial-gradient(closest-side, var(--accent-soft), transparent 70%); pointer-events: none; }
.contact-card h3 { font-size: clamp(1.5rem, 3.5vw, 2rem); max-width: 560px; }
.contact-card p.lead { color: var(--text-muted); max-width: 560px; margin-top: var(--space-1); }
.contact-list { display: grid; gap: var(--space-1); }
.contact-item { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--bg-elev);
  color: var(--text); transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
a.contact-item:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.contact-item svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.contact-item small { display: block; color: var(--text-muted); font-size: 0.75rem; }
@media (min-width: 960px) { .contact-card { grid-template-columns: 1.2fr 1fr; align-items: center; padding: var(--space-8); } }

.footer { padding: var(--space-4) 0 var(--space-8); border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.875rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: var(--space-4); z-index: 300; transform: translate(-50%, 16px); opacity: 0;
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-1); background: var(--text); color: var(--bg);
  font-size: 0.875rem; font-weight: 500; pointer-events: none;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Chatbot ---------- */
.chat-launcher {
  position: fixed; right: var(--space-2); bottom: var(--space-2); z-index: 150; display: inline-flex; align-items: center; gap: var(--space-1);
  min-height: 56px; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: 999px;
  background-image: var(--grad); background-size: 200% 100%; background-color: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow-lg);
  transition: transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.chat-launcher:hover { transform: translateY(-4px); background-position: 100% 0; }
.chat-launcher { transition: transform var(--dur-fast) var(--ease), background-position var(--dur) var(--ease); }
.chat-launcher svg { width: 20px; height: 20px; }
.chat-launcher .label { display: none; }
.chat-launcher.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
@media (min-width: 640px) { .chat-launcher { right: var(--space-4); bottom: var(--space-4); } .chat-launcher .label { display: inline; } }

.chat-panel {
  position: fixed; z-index: 160; right: 0; bottom: 0; width: 100%; height: min(640px, 100dvh - 64px);
  display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-3) var(--radius-3) 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(24px); opacity: 0; visibility: hidden;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease), visibility var(--dur-fast);
}
.chat-panel.is-open { transform: none; opacity: 1; visibility: visible; }
@media (min-width: 640px) {
  .chat-panel { right: var(--space-4); bottom: var(--space-4); width: 392px; border-radius: var(--radius-3); }
}
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-1); padding: var(--space-2); border-bottom: 1px solid var(--border); }
.chat-title { display: flex; align-items: center; gap: var(--space-1); font-family: var(--font-mono); font-size: 0.875rem; }
.chat-title .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; }
.chat-title small { display: block; color: var(--text-muted); font-size: 0.75rem; font-family: var(--font-body); }
.chat-head-actions { display: flex; gap: var(--space-1); }
.chat-head-actions button {
  min-width: 40px; min-height: 40px; padding: 0 var(--space-1); border: 0; border-radius: var(--radius-1); background: transparent; color: var(--text-muted);
  font-size: 0.8125rem; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chat-head-actions button:hover { background: var(--hover); color: var(--text); }
.chat-log { flex: 1; overflow-y: auto; padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); scroll-behavior: smooth; }
.msg { max-width: 88%; padding: var(--space-1) var(--space-2); border-radius: var(--radius-2); font-size: 0.9375rem; line-height: 1.5; animation: fade-up 0.3s var(--ease) both; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background-image: var(--grad); background-color: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg .actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.msg .actions a { padding: 0 var(--space-2); min-height: 32px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; font-size: 0.8125rem; background: var(--bg-elev); }
.msg .actions a:hover { border-color: var(--accent); }
.typing { display: inline-flex; gap: var(--space-1); padding: 0; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
.chat-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: 0 var(--space-2) var(--space-1); }
.chat-chips button {
  padding: 0 var(--space-2); min-height: 32px; border: 1px solid var(--border); border-radius: 999px; background: transparent; font-size: 0.8125rem; color: var(--text);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.chat-chips button:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.chat-form { display: flex; gap: var(--space-1); padding: var(--space-2); border-top: 1px solid var(--border); }
.chat-form input {
  flex: 1; min-width: 0; min-height: 48px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-1);
  background: var(--surface); color: var(--text); font: inherit;
}
.chat-form input::placeholder { color: var(--text-muted); }
.chat-form input:focus-visible { outline-offset: 0; }
.chat-note { padding: 0 var(--space-2) var(--space-1); color: var(--text-muted); font-size: 0.75rem; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-reveal], .js [data-load], .js .hero .line > span, .js .skill-card:not(.is-visible) .chip { opacity: 1 !important; transform: none !important; }
  .ticker-track { animation: none; }
}

/* Skills layout helpers */
@media (min-width: 1080px) {
  .skill-card.full { grid-column: 1 / -1; }
}
.noscript-note { padding: var(--space-4); text-align: center; color: var(--text-muted); }

/* Nav polish */
.brand span:last-child { white-space: nowrap; }
@media (max-width: 480px) { .brand span:last-child { display: none; } }
@media (min-width: 960px) and (max-width: 1119px) { .nav-links a { padding: var(--space-1) 8px; font-size: 0.875rem; } .nav-links a::after { left: 8px; right: 8px; } }



/* ---------- Projects: large stacked cards ---------- */
.stack { display: grid; gap: var(--space-3); }
.stack-card {
  position: relative; display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-3);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow);
  transform: scale(var(--s, 1)); transform-origin: top center;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.stack-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); }
/* spotlight that follows the cursor */
.stack-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 0;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), var(--glow-a), var(--glow-b) 40%, transparent 65%);
  transition: opacity var(--dur-fast) var(--ease);
}
.stack-card:hover::before { opacity: 1; }
/* dimming overlay used by the stacking effect */
.stack-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3; background: #000; opacity: var(--dim, 0); }
.stack-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding: var(--space-3); }
.stack-copy h3 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.stack-copy .sub { display: block; margin-top: var(--space-1); color: var(--text-muted); }
.stack-copy .project-top { justify-content: flex-start; flex-wrap: wrap; gap: var(--space-2); }
.project-co { color: var(--text-muted); font-size: 0.8125rem; }
.stack-copy .sum { color: var(--text-muted); font-size: 1.0625rem; max-width: 520px; }
.role-line { display: flex; gap: var(--space-1); align-items: flex-start; color: var(--text); font-size: 0.9375rem; max-width: 520px; }
.role-line svg { width: 20px; height: 20px; flex: none; transform: translateY(2px); color: var(--accent); }
.stack-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; }
.stack-visual { display: none; }
.ghost-index { position: absolute; right: var(--space-4); top: var(--space-2); font-family: var(--font-head); font-weight: 700; font-size: clamp(6rem, 14vw, 12rem); line-height: 1; letter-spacing: -0.06em; opacity: 0.06; color: var(--text); }
.mock { position: relative; z-index: 1; width: min(100%, 400px); border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--bg-elev); box-shadow: var(--shadow-lg); overflow: hidden; font-family: var(--font-mono); font-size: 0.8125rem; }
.mock-bar { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--border); color: var(--text-muted); }
.mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.mock-bar span { margin-left: var(--space-1); }
.mock-body { padding: var(--space-3); display: grid; gap: var(--space-1); color: var(--text); overflow-wrap: anywhere; }
.mock-body .k { color: var(--accent); }
.mock-body .v { color: var(--accent-2); }

@media (min-width: 1024px) {
  .stack { display: block; }
  .stack-item { position: sticky; top: calc(var(--nav-h) + var(--space-4)); margin-bottom: var(--space-8); }
  .stack-item:last-child { margin-bottom: 0; }
  .stack-card { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); min-height: min(560px, calc(100vh - 160px)); }
  .stack-copy { padding: var(--space-5); }
  .stack-visual {
    position: relative; display: grid; place-items: center; padding: var(--space-4); overflow: hidden;
    background: radial-gradient(60% 70% at 70% 30%, var(--glow-a), transparent 70%), radial-gradient(50% 60% at 20% 80%, var(--glow-b), transparent 70%), var(--bg-elev);
    border-left: 1px solid var(--border);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader { display: none !important; }
  html.is-intro { overflow: auto; }
  .stack-card { transform: none !important; }
}

/* Bold hero statement */
.hero-statement {
  font-family: var(--font-head); font-weight: 700; font-size: clamp(1.5rem, 3.4vw, 2.25rem); line-height: 1.2; letter-spacing: -0.02em; color: var(--text);
}
.hero-statement .line > span { display: inline-block; }


/* ---------- Contact: drifting stars ---------- */
@keyframes star-rise { from { transform: translateY(0); } to { transform: translateY(-2000px); } }
.contact-card { isolation: isolate; background: var(--surface); }
.contact-card::before { display: none; }
.sky { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.star-layer { position: absolute; left: 0; top: 0; display: block; width: var(--size); height: var(--size); background: transparent; box-shadow: var(--shadows); animation: star-rise var(--dur) linear infinite; will-change: transform; }
.star-layer::after { content: ''; position: absolute; left: 0; top: 2000px; width: var(--size); height: var(--size); background: transparent; box-shadow: var(--shadows); }
.contact-main, .contact-list { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .star-layer { animation: none; } .hero-wire { transition: none; } }

/* ==========================================================================
   Hero redesign: big typography, rotating roles, aurora + system-diagram canvas
   ========================================================================== */
.hero { isolation: isolate; padding: var(--space-10) 0 var(--space-8); }
.hero-aurora { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.hero-aurora i { position: absolute; border-radius: 50%; will-change: transform; }
.hero-aurora i:nth-child(1) { width: 720px; height: 720px; right: -160px; top: -240px; background: radial-gradient(circle, var(--glow-a), transparent 66%); animation: drift-a 26s var(--ease) infinite alternate; }
.hero-aurora i:nth-child(2) { width: 640px; height: 640px; left: -200px; top: 30%; background: radial-gradient(circle, var(--glow-b), transparent 66%); animation: drift-b 32s var(--ease) infinite alternate; }
.hero-aurora i:nth-child(3) { width: 560px; height: 560px; right: 12%; bottom: -260px; background: radial-gradient(circle, var(--glow-c), transparent 68%); animation: drift-a 38s var(--ease) infinite alternate-reverse; }
@keyframes drift-a { to { transform: translate3d(-72px, 48px, 0) scale(1.08); } }
@keyframes drift-b { to { transform: translate3d(88px, -40px, 0) scale(1.1); } }
.hero-graph { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.js .hero-graph, .js .hero-aurora { opacity: 0; transition: opacity 2.2s var(--ease); }
.js.is-loaded .hero-graph, .js.is-loaded .hero-aurora { opacity: 1; }
.hero-content { position: relative; z-index: 1; max-width: var(--container); }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.6fr 1fr; } }

/* Heading 1: name + rotating role */
.hero h1.hero-title { font-size: 1rem; line-height: 1; letter-spacing: 0; display: block; }
.hero-name { font-size: clamp(2rem, 4.6vw, 3.5rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.08; color: var(--text); }
.role-rotator { display: grid; margin-top: var(--space-1); font-size: clamp(2.25rem, 5.4vw, 4.25rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; min-height: 1em; }
.role { grid-area: 1 / 1; visibility: hidden; }              /* every role occupies the same cell, so the tallest one reserves the space (no layout shift) */
.role.is-active, .role.is-leaving { visibility: visible; }
.rotor-line { display: block; overflow: hidden; padding: 0.02em 0 0.16em; margin-bottom: -0.1em; }
.rotor-line > span {
  display: inline-block; transform: translateY(118%); opacity: 0;
  background-image: var(--grad); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.role.is-active .rotor-line > span {
  animation: role-in 1s var(--ease) both, shimmer 7s linear infinite;
  animation-delay: calc(var(--n, 0) * 0.14s + 0.35s), 0s;
}
.role.is-leaving .rotor-line > span { animation: role-out 0.75s var(--ease) both; animation-delay: calc(var(--n, 0) * 0.08s); }
@keyframes role-in { from { transform: translateY(118%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes role-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-118%); opacity: 0; } }

/* Heading 2: statement with oversized key words */
.hero-statement { font-size: clamp(1.75rem, 4.4vw, 2.75rem); line-height: 1.12; letter-spacing: -0.025em; }
.hero-statement .emph { font-size: 1.5em; line-height: 1; letter-spacing: -0.04em; }
.hero-statement .line { padding-bottom: var(--space-2); margin-bottom: calc(var(--space-2) * -1); }

@media (prefers-reduced-motion: reduce) {
  .role.is-active .rotor-line > span { transform: none; opacity: 1; animation: none; }
  .hero-aurora i { animation: none; }
}

/* ==========================================================================
   Sections: hairline dividers for a consistent rhythm
   ========================================================================== */
.section { position: relative; }
.section::before {
  content: ''; position: absolute; top: 0; left: 50%; width: min(720px, 80%); height: 1px; transform: translateX(-50%);
  background-image: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent); opacity: 0.35;
}

/* ==========================================================================
   Hero heading row (name + roles) spans the full width, copy + photo sit below
   ========================================================================== */
.hero-heading { order: 2; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.hero-copy { order: 3; }
.hero-media { order: 1; }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.4fr 1fr; gap: var(--space-4) var(--space-8); }
  .hero-heading { grid-column: 1 / -1; order: 0; }
  .hero-copy { order: 1; }
  .hero-media { order: 2; align-self: start; }
}
.role .pipe {
  display: none; align-self: center; margin: 0 0.28em; font-weight: 400; color: var(--text-muted); -webkit-text-fill-color: var(--text-muted);
  opacity: 0; transform: translateY(8px);
}
.role-rotator:not(.is-stacked) .role { display: flex; flex-wrap: nowrap; align-items: baseline; white-space: nowrap; }
.role-rotator:not(.is-stacked) .pipe { display: inline-block; }
.role.is-active .pipe { animation: pipe-in 0.8s var(--ease) 0.5s both; }
.role.is-leaving .pipe { animation: pipe-out 0.5s var(--ease) both; }
@keyframes pipe-in { to { opacity: 0.55; transform: none; } }
@keyframes pipe-out { from { opacity: 0.55; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
.role-rotator.is-stacked { font-size: clamp(2.25rem, 9.5vw, 3.5rem); }
.role-rotator.is-stacked .rotor-line > span { white-space: normal; }
@media (prefers-reduced-motion: reduce) { .role.is-active .pipe { animation: none; opacity: 0.55; transform: none; } }

/* ==========================================================================
   Ambient background below the hero: section glows + faint code beside headings
   ========================================================================== */
.section { overflow-x: clip; }
.section::after {
  content: ''; position: absolute; z-index: -1; width: 720px; height: 720px; border-radius: 50%; pointer-events: none;
  top: 8%; right: -240px; background: radial-gradient(circle, var(--glow-a), transparent 66%);
}
.section:nth-of-type(even)::after { right: auto; left: -280px; top: 24%; background: radial-gradient(circle, var(--glow-b), transparent 66%); }
.section:nth-of-type(3n)::after { background: radial-gradient(circle, var(--glow-c), transparent 66%); }
.bg-code {
  display: none; position: absolute; z-index: 0; top: var(--space-12); right: var(--gutter); margin: 0; max-width: 440px; padding: 0;
  font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; color: var(--code); white-space: pre; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 80%, transparent); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 80%, transparent);
}
.bg-code .k { color: var(--code-k); }
.bg-code .s { color: var(--code-s); }
.bg-code .c, .bg-code .n { color: var(--code); }
.bg-code .d { color: var(--code-k); }
@media (min-width: 1100px) { .bg-code { display: block; right: var(--edge); } }
@media (min-width: 1500px) { .bg-code { right: var(--edge); } }

/* ==========================================================================
   Navigation: dock with a sliding highlight and reading progress
   ========================================================================== */
.nav { height: var(--nav-h); padding-top: var(--space-2); background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0; pointer-events: none; }
.nav .container { pointer-events: none; }
.nav-shell {
  pointer-events: auto; position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  height: 56px; padding: 0 var(--space-1);
  border: 1px solid var(--border); border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elev) 72%, transparent);
  backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%);
  box-shadow: var(--shadow);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.nav.is-scrolled .nav-shell { background: color-mix(in srgb, var(--bg-elev) 88%, transparent); border-color: color-mix(in srgb, var(--accent) 38%, var(--border)); box-shadow: var(--shadow-lg); }
.nav-shell .brand { padding-left: 4px; }
.nav-center { display: none; flex: 1; justify-content: center; }
.nav-links { position: relative; display: none; align-items: center; gap: 0; padding: 4px; border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.nav-links li { position: relative; z-index: 1; }
.nav-links a { display: flex; align-items: baseline; gap: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: 999px; color: var(--text-muted); font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
.nav-links a::after { display: none; }
.nav-links a .n { font-family: var(--font-mono); font-size: 0.6875rem; opacity: 0.55; transition: opacity var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a.is-active { color: var(--text); }
.nav-links a:hover .n, .nav-links a.is-active .n { opacity: 1; color: var(--accent); }
.nav-pill {
  position: absolute; z-index: 0; left: 0; top: 4px; bottom: 4px; width: 0; border-radius: 999px; pointer-events: none; opacity: 0;
  background-image: linear-gradient(100deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 18%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav-pill.is-on { opacity: 1; }
.nav-shell .icon-btn { width: 40px; height: 40px; border-radius: 50%; }
.nav-shell .icon-btn svg { width: 20px; height: 20px; }
.nav-actions { display: flex; align-items: center; gap: var(--space-1); }
kbd { font-family: var(--font-mono); font-size: 0.6875rem; padding: 0 var(--space-1); min-height: 24px; display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text-muted); }
.nav-progress { position: absolute; left: var(--space-4); right: var(--space-4); bottom: -1px; height: 2px; border-radius: 2px; background-image: var(--grad); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.brand-name { display: none; }

.mobile-menu a .mn { font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); margin-right: var(--space-2); }

@media (min-width: 768px) { .brand-name { display: inline; } }
@media (min-width: 960px) { .nav-center { display: flex; } .nav-links { display: flex; } .brand-name { display: none; } }
@media (min-width: 1180px) { .brand-name { display: inline; } }
@media (max-width: 480px) { .brand-name { display: none; } }


/* Hero photo sits slightly higher (same size) */
@media (min-width: 960px) { .hero-media { margin-top: calc(var(--space-3) * -1); } }

/* ==========================================================================
   Responsive fixes: nav dock never overflows; hero grid items can shrink
   ========================================================================== */
.hero-grid { grid-template-columns: minmax(0, 1fr); }
.hero-heading, .hero-copy, .hero-media { min-width: 0; max-width: 100%; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

.nav .container { max-width: var(--container); }
.nav-shell { min-width: 0; }
.nav-center { min-width: 0; }
.nav-links { max-width: 100%; }
.nav-links a { padding: var(--space-1); }
.nav-links a .n { display: none; }              /* numbers only when there is room */
.nav-cv { display: none; }
               /* keep the search icon + shortcut only */
.brand-name { display: none !important; }
@media (min-width: 1280px) { .nav-cv { display: inline-flex; } .nav-links a { padding: var(--space-1) var(--space-2); } }
@media (min-width: 1600px) { .brand-name { display: inline !important; } }
@media (max-width: 959px) { .nav-cv { display: none; } }

/* Very small phones */
.interests { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.interest span { min-width: 0; overflow-wrap: anywhere; }
.contact-card { grid-template-columns: minmax(0, 1fr); }
.contact-main, .contact-list, .contact-item > span { min-width: 0; }
.contact-item > span { overflow-wrap: anywhere; }
@media (min-width: 960px) { .contact-card { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
@media (max-width: 360px) { .interests { grid-template-columns: minmax(0, 1fr); } .contact-card { padding: var(--space-3); } }

/* Slim divider instead of a text pipe */
.role .pipe { font-size: 0; width: 3px; height: 0.72em; min-height: 24px; margin: 0 0.4em; border-radius: 3px; background: var(--text-muted); align-self: center; -webkit-text-fill-color: transparent; }
@keyframes pipe-in { to { opacity: 0.5; transform: none; } }
@keyframes pipe-out { from { opacity: 0.5; transform: none; } to { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 599px) { .portrait { width: min(100%, 264px); } .hero { padding-top: var(--space-4); } }

.role .pipe { height: calc(var(--rs, 40px) * 0.7); min-height: 0; margin: 0 calc(var(--rs, 40px) * 0.42); width: max(2px, calc(var(--rs, 40px) * 0.045)); }

/* ==========================================================================
   Roles stacked one per line (Technology Lead / Software Engineer, ...)
   Heading sits in the left column again, photo on the right. Smaller text on phones.
   ========================================================================== */
.role-rotator, .role-rotator.is-stacked { font-size: clamp(2.25rem, 5.4vw, 4.25rem); }
.role-rotator .rotor-line > span { white-space: normal; }
.role .pipe { display: none !important; }
.hero-name { font-size: clamp(2rem, 4.6vw, 3.5rem); }
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--space-2) var(--space-8); }
  .hero-heading { grid-column: 1; grid-row: 1; }
  .hero-copy { grid-column: 1; grid-row: 2; }
  .hero-media { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: calc(var(--space-3) * -1); }
}
@media (max-width: 599px) {
  .hero-name { font-size: 1.75rem; }
  .role-rotator, .role-rotator.is-stacked { font-size: 2rem; }
  .hero-statement { font-size: 1.5rem; }
  .hero-statement .emph { font-size: 1.45em; }
  .hero-lead { font-size: 1rem; }
  .role-tag { font-size: 0.8125rem; }
}

/* ==========================================================================
   Header docked to the top edge: full-width sticky bar with comfortable spacing
   ========================================================================== */
:root { --nav-h: 72px; }
.nav {
  position: sticky; top: 0; z-index: 100; height: var(--nav-h); padding-top: 0; pointer-events: auto;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(18px) saturate(170%); -webkit-backdrop-filter: blur(18px) saturate(170%);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom-color: color-mix(in srgb, var(--accent) 30%, var(--border)); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16); }
.nav .container { height: 100%; pointer-events: auto; }
.nav-shell, .nav.is-scrolled .nav-shell {
  height: 100%; padding: 0; gap: var(--space-4); border: 0; border-radius: 0; background: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.nav-shell .brand { padding-left: 0; }
.nav-actions { gap: var(--space-2); }
.nav-links { padding: 4px; }
.nav-links a { padding: var(--space-1) var(--space-2); }
.nav-progress { left: 0; right: 0; bottom: -1px; }
.hero { padding-top: var(--space-8); }

/* Per-section glows removed for now (back to the plain grid backdrop) */
.section::after { content: none; }

/* Chat launcher: smaller text, tucked against the right edge */
.chat-launcher { right: var(--space-1); bottom: var(--space-3); min-height: 40px; padding: 0 var(--space-2); gap: var(--space-1); font-size: 0.8125rem; }
.chat-launcher svg { width: 16px; height: 16px; }
@media (min-width: 640px) { .chat-launcher { right: var(--space-1); bottom: var(--space-3); } .chat-panel { right: var(--space-1); bottom: var(--space-1); } }

/* Backdrop removed: plain theme background */
body::before, body::after { content: none; }

/* Hero: slightly smaller gradient headings, photo a little higher */
.role-rotator, .role-rotator.is-stacked { font-size: clamp(2rem, 4.8vw, 3.75rem); }
.hero-statement .emph { font-size: 1.3em; }
@media (min-width: 960px) { .hero-media { margin-top: calc(var(--space-8) * -1); } }
@media (max-width: 599px) {
  .role-rotator, .role-rotator.is-stacked { font-size: 1.75rem; }
  .hero-statement .emph { font-size: 1.3em; }
}

/* Show the name next to the logo at every width */
.brand-name { display: inline !important; white-space: nowrap; font-size: 1rem; }
@media (max-width: 359px) { .brand-name { font-size: 0.9375rem; } }

/* Code snippets sit BEHIND all section content (cards, text) */
.bg-code { z-index: -1; }
.section > .container { position: relative; z-index: 1; }

/* ==========================================================================
   GG monogram logo (two interlocking G letterforms)
   ========================================================================== */
:root, :root[data-theme='dark'] { --logo-a: #8b7cff; --logo-b: #6ee7f9; --logo-bg: #0b0c10; }
:root[data-theme='light'] { --logo-a: #5b4bd6; --logo-b: #0b7285; --logo-bg: #ffffff; }
.logo-gg { width: 44px; height: 44px; flex: none; display: block; filter: drop-shadow(0 4px 14px var(--accent-soft)); transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease); }
.brand:hover .logo-gg { transform: translateY(-2px) rotate(-4deg); filter: drop-shadow(0 8px 20px var(--glow-a)); }
.pl-logo { --logo-a: #8b7cff; --logo-b: #6ee7f9; --logo-bg: #0b0c10; width: 112px; height: 112px; display: block; filter: drop-shadow(0 12px 40px rgba(139, 124, 255, 0.35)); }

.role-tag { display: grid; }
.role-tag .tag-size, .role-tag .tag-live { grid-area: 1 / 1; }
.role-tag .tag-size { visibility: hidden; }

/* ==========================================================================
   Every button: gradient fill on hover (primary buttons flip the gradient direction)
   ========================================================================== */
.btn-secondary:hover, .btn-ghost:hover, .icon-btn:hover, .chat-chips button:hover, .msg .actions a:hover,
.chat-head-actions button:hover, .btn-secondary:focus-visible, .btn-ghost:focus-visible {
  background-image: var(--grad); background-size: 200% 100%; background-position: 0 0; background-color: var(--accent);
  color: var(--accent-ink); border-color: transparent;
}
.btn-primary:hover, .chat-launcher:hover {
  background-image: var(--grad-rev); background-size: 200% 100%; background-position: 0 0; color: var(--accent-ink);
}
.btn-secondary:hover svg, .btn-ghost:hover svg, .icon-btn:hover svg { color: var(--accent-ink); }

/* More room between the name/role heading and the "I Engineer the Systems..." statement */
.hero-statement { margin-top: var(--space-5); }
@media (max-width: 599px) { .hero-statement { margin-top: var(--space-3); } }

/* More space between the navigation items (only as wide as the screen allows) */
@media (min-width: 1180px) { .nav-links { gap: var(--space-1); } .nav-links a { padding: var(--space-1) var(--space-2); } }
@media (min-width: 1440px) { .nav-links { gap: var(--space-2); } .nav-links a { padding: var(--space-1) var(--space-3); } }

/* About: the facts card spans the full width so values stay on one line */
.about-grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
.about-text { max-width: 880px; }
.facts { padding: var(--space-2) var(--space-4); }
.fact { align-items: baseline; gap: var(--space-4); }
.fact span:first-child { flex: none; min-width: 232px; }
.fact span:last-child { flex: 1; text-align: right; }
.fact a { color: var(--accent); font-weight: 600; }
.fact a:hover { color: var(--accent-strong); text-decoration: underline; }
@media (max-width: 719px) {
  .facts { padding: var(--space-1) var(--space-3); }
  .fact { flex-direction: column; gap: 4px; }
  .fact span:first-child { min-width: 0; }
  .fact span:last-child { text-align: left; }
}
.edu-grid { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .edu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Download CV + theme toggle sit further toward the right edge on wide screens */
@media (min-width: 1280px) { .nav-actions { margin-right: calc(max(0px, min(96px, (100vw - 1280px) / 2 - 32px)) * -1); } }

/* Wider gaps between nav options; header buttons pushed further right (only as far as each screen allows) */
@media (min-width: 1280px) { .nav-links { gap: var(--space-2); } .nav-links a { padding: var(--space-1) var(--space-3); } }
@media (min-width: 1440px) { .nav-links { gap: var(--space-3); } }
@media (min-width: 1600px) { .nav-links { gap: var(--space-4); } }
@media (min-width: 1280px) { .nav-actions { margin-right: 0; } }
@media (min-width: 1700px) { .nav .container { padding-inline: var(--space-8); } }

/* ==========================================================================
   Contact: details list + message form (stars background kept)
   ========================================================================== */
.contact-card { align-items: start; }
.contact-form-wrap { position: relative; z-index: 1; min-width: 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-2); background: color-mix(in srgb, var(--bg-elev) 80%, transparent); }
.cform { display: grid; gap: var(--space-1); }
.cform label, .cf-label { margin-top: var(--space-1); font-size: 0.8125rem; font-weight: 600; }
.seg { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.seg-btn { min-height: 32px; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: 999px; background: transparent; font-size: 0.8125rem; color: var(--text); transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.seg-btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.seg-btn.is-on { background-image: var(--grad); background-color: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.cform input, .cform textarea { width: 100%; min-height: 48px; padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-1); background: var(--surface); color: var(--text); font: inherit; resize: vertical; transition: border-color var(--dur-fast) var(--ease); }
.cform textarea { min-height: 128px; }
.cform input::placeholder, .cform textarea::placeholder { color: var(--text-muted); }
.cform input:focus-visible, .cform textarea:focus-visible { outline-offset: 0; border-color: var(--accent); }
.cform .is-bad { border-color: #ff6b81; }
.cf-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.cf-note { margin-top: var(--space-1); color: var(--text-muted); font-size: 0.75rem; }
@media (min-width: 960px) { .contact-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-8); } }
.seg-btn.is-on:hover, .btn-primary:hover { color: var(--accent-ink); }

/* ==========================================================================
   Skills: icon pills in opposite-moving rows (marquee), pause on hover
   ========================================================================== */
@keyframes sk-run { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.sk-rows { display: grid; gap: var(--space-2); margin-inline: calc(var(--gutter) * -1); }
.sk-row { overflow: hidden; padding: var(--space-1) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.sk-track { display: flex; width: max-content; }
.sk-list { display: flex; flex: none; gap: var(--space-2); padding-right: var(--space-2); animation: sk-run var(--sk-dur, 60s) linear infinite; will-change: transform; }
.sk-row.is-rev .sk-list { animation-direction: reverse; }
.sk-row:hover .sk-list { animation-play-state: paused; }
.sk-pill {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: 48px; padding: 0 var(--space-3) 0 var(--space-2);
  border: 1px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); white-space: nowrap; font-size: 0.9375rem; font-weight: 500;
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.sk-pill:hover { border-color: var(--accent); transform: translateY(-4px); background: var(--surface); }
.sk-ico { width: 24px; height: 24px; flex: none; display: grid; place-items: center; background-color: var(--ic, var(--accent)); -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; }
.sk-glyph { background: none; color: var(--accent); -webkit-mask: none; mask: none; }
.sk-glyph svg { width: 22px; height: 22px; }
@media (prefers-reduced-motion: reduce) {
  .sk-row { -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .sk-track { width: auto; flex-wrap: wrap; }
  .sk-list { animation: none; flex-wrap: wrap; padding-right: 0; }
  .sk-list[aria-hidden='true'] { display: none; }
  .sk-rows { margin-inline: 0; }
}

/* Skills pills a bit more solid so background code never shows through */
.sk-pill { background: color-mix(in srgb, var(--surface) 97%, transparent); }

/* Hero photo: sits higher, soft layered shadow, gentle float to invite a hover */
@keyframes photo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.portrait { box-shadow: 0 24px 56px rgba(0, 0, 0, 0.38), 0 8px 20px rgba(0, 0, 0, 0.22), 0 0 64px var(--glow-a); }
:root[data-theme='light'] .portrait { box-shadow: 0 24px 56px rgba(40, 40, 90, 0.26), 0 8px 20px rgba(40, 40, 90, 0.14), 0 0 64px var(--glow-a); }
.portrait.has-swap { animation: photo-float 5s var(--ease) infinite; }
.portrait.has-swap:hover, .portrait.is-swapped { animation-play-state: paused; }
@media (min-width: 960px) { .hero-media { margin-top: calc(var(--space-12) * -1); } }
@media (prefers-reduced-motion: reduce) { .portrait.has-swap { animation: none; } }

/* Hero: focus line higher; more room between the gradient role and the "I Engineer..." line */
.hero { padding-top: var(--space-3); }
.hero-statement { margin-top: var(--space-10); }
@media (max-width: 599px) { .hero { padding-top: var(--space-2); } .hero-statement { margin-top: var(--space-6); } }

/* Navigation: even more space between options (as much as each width allows) */
@media (min-width: 1280px) { .nav-links { gap: var(--space-4); } }
@media (min-width: 1440px) { .nav-links { gap: var(--space-5); } .nav-links a { padding: var(--space-1) var(--space-3); } }
@media (min-width: 1700px) { .nav-links { gap: var(--space-6); } }

/* About: text and facts card side by side */
@media (min-width: 960px) {
  .about-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--space-6); align-items: start; }
  .about-text { max-width: none; font-size: 1rem; }
  .facts { padding: var(--space-1) var(--space-3); }
  .fact { gap: var(--space-2); font-size: 0.875rem; padding: var(--space-2) 0; }
  .fact span:first-child { min-width: 168px; }
}
@media (min-width: 1280px) { .fact { font-size: 0.9375rem; } .fact span:first-child { min-width: 192px; } }

/* Hero: a little less space between the role and the statement; Contact me looks clickable */
.hero-statement { margin-top: var(--space-6); }
@media (max-width: 599px) { .hero-statement { margin-top: var(--space-4); } }
.hero-actions .btn-ghost { border: 1px solid var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); cursor: pointer; }
.hero-actions .btn-ghost svg { transition: transform var(--dur-fast) var(--ease); }
.hero-actions .btn-ghost:hover svg { transform: translateX(4px); }
@media (min-width: 1280px) { .about-grid { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); } .fact span:first-child { min-width: 176px; } .fact span:last-child { white-space: nowrap; } }

.contact-main .contact-list { margin-top: var(--space-3); display: grid; gap: var(--space-1); }
.footer-inner { justify-content: flex-start; }

/* Nav gaps: reduced a little from the widest setting */
@media (min-width: 1280px) { .nav-links { gap: var(--space-2); } }
@media (min-width: 1440px) { .nav-links { gap: var(--space-3); } }
@media (min-width: 1700px) { .nav-links { gap: var(--space-4); } }

/* Nav gaps: a little tighter again */
@media (min-width: 1280px) { .nav-links { gap: var(--space-1); } }
@media (min-width: 1440px) { .nav-links { gap: var(--space-2); } }
@media (min-width: 1700px) { .nav-links { gap: var(--space-3); } }

/* Nav: tighter gaps, logo further right; focus line gets a 5px top margin */
@media (min-width: 1280px) { .nav-links { gap: 0; } .nav-shell .brand { margin-left: var(--space-8); } }
@media (min-width: 1440px) { .nav-links { gap: var(--space-1); } .nav-shell .brand { margin-left: var(--space-10); } }
@media (min-width: 1700px) { .nav-links { gap: var(--space-2); } .nav-shell .brand { margin-left: var(--space-12); } }
@media (max-width: 1279px) { .nav-shell .brand { margin-left: var(--space-3); } }
@media (max-width: 599px) { .nav-shell .brand { margin-left: var(--space-1); } }
.role-tag { margin-top: 5px; }

/* Skills: icon rows plus the grouped cards underneath */
.sk-cards { margin-top: var(--space-6); }
/* About: wider container so the Education row fits on one line next to the text */
@media (min-width: 1280px) { #about > .container { max-width: var(--container); } }
@media (max-width: 1279px) { .fact span:last-child { white-space: normal; } }
.fact span:last-child { min-width: 0; }

/* Hero photo nudged 5px down */
@media (min-width: 960px) { .hero-media { margin-top: calc(var(--space-12) * -1 + 5px); } }

.sk-cards { margin-top: 0; margin-bottom: var(--space-6); }

/* Hero photo: another 5px down */
@media (min-width: 960px) { .hero-media { margin-top: calc(var(--space-12) * -1 + 10px); } }

/* About: balanced 50:50 split (text | facts card); long values may wrap onto a second line */
@media (min-width: 960px) {
  #about > .container { max-width: var(--container); }
  .about-grid, .about-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
  .fact span:last-child { white-space: normal; }
  .fact span:first-child { min-width: 152px; }
  .fact { gap: var(--space-2); font-size: 0.9375rem; }
}

/* A little more space at the start of the hero (below the header) */
.hero { padding-top: var(--space-6); }
@media (max-width: 599px) { .hero { padding-top: var(--space-4); } }

/* Hero photo: a bit more space above it */
@media (min-width: 960px) { .hero-media { margin-top: calc(var(--space-12) * -1 + 24px); } }

/* Header right side (menu, Download CV, theme toggle) shifted a little to the left */
@media (min-width: 1280px) { .nav .container { padding-right: var(--space-12); } }
@media (min-width: 1700px) { .nav .container { padding-right: calc(var(--space-12) + var(--space-8)); } }

/* ==========================================================================
   About facts card: animated gradient border, tinted background, icons, staggered rows
   ========================================================================== */
@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes ang-spin { to { --ang: 360deg; } }
@keyframes row-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes sheen { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(120%); } }
.facts.card {
  position: relative; overflow: hidden; isolation: isolate; border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--ang), var(--accent), var(--accent-2), transparent 35%, var(--accent) 65%, var(--accent-2), var(--accent)) border-box;
  animation: ang-spin 8s linear infinite;
  box-shadow: 0 24px 56px var(--glow-a);
}
.facts.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 60% at 100% 0%, var(--glow-a), transparent 70%), radial-gradient(60% 60% at 0% 100%, var(--glow-b), transparent 70%);
}
.facts.card::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; z-index: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent);
  animation: sheen 6s var(--ease) infinite;
}
.fact { position: relative; z-index: 1; border-radius: var(--radius-1); transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), padding var(--dur-fast) var(--ease); }
.js .facts:not(.is-visible) .fact { opacity: 0; }
.js .facts.is-visible .fact { animation: row-in 0.8s var(--ease) both; animation-delay: calc(var(--n, 0) * 0.14s + 0.3s); }
.fact:hover { background-image: linear-gradient(100deg, var(--accent-soft), transparent); transform: translateX(4px); padding-inline: var(--space-1); }
.fact-k { display: inline-flex; align-items: center; gap: var(--space-1); }
.fact-ico { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 10px; color: var(--accent-ink);
  background-image: var(--grad); background-size: 200% 100%; transition: transform var(--dur-fast) var(--ease), background-position var(--dur) var(--ease); }
.fact-ico svg { width: 18px; height: 18px; }
.fact:hover .fact-ico { transform: rotate(-8deg) scale(1.08); background-position: 100% 0; }
.fact span:first-child.fact-k { min-width: 0; }
@media (min-width: 960px) { .fact span:first-child { min-width: 212px; } }
@media (prefers-reduced-motion: reduce) { .facts.card, .facts.card::after { animation: none; } .js .facts:not(.is-visible) .fact { opacity: 1; } .js .facts.is-visible .fact { animation: none; } }

/* Softer sheen on the facts card */
.facts.card::after { opacity: 0.55; width: 28%; }

/* ==========================================================================
   Interests: gradient icon badges, cursor spotlight, gradient fill on hover
   ========================================================================== */
@keyframes int-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-6deg); } }
.interests { gap: var(--space-2); }
.interest {
  position: relative; overflow: hidden; isolation: isolate; gap: var(--space-2); padding: var(--space-2); border-radius: var(--radius-2);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.interest::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity var(--dur-fast) var(--ease); background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), var(--glow-a), transparent 70%); }
.interest::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background-image: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.interest:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 16px 36px var(--glow-a), 0 0 0 1px var(--accent); background: var(--surface); }
.interest:hover::before { opacity: 1; }
.interest:hover::after { transform: scaleX(1); }
.int-ico { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px; color: var(--accent-ink); background-image: var(--grad); background-size: 200% 100%; transition: background-position var(--dur) var(--ease); }
.int-ico svg { width: 24px; height: 24px; color: inherit; }
.interest:hover .int-ico { background-position: 100% 0; animation: int-bob 0.9s var(--ease); }
.int-name { font-family: var(--font-head); font-weight: 600; font-size: 1.0625rem; flex: 1; min-width: 0; }
.int-idx { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }
.interest svg { color: inherit; }

/* Pointer cursor on everything clickable */
a, button, [role='button'], [role='radio'], summary, label[for], select, input[type='submit'], .btn, .icon-btn, .seg-btn, .sk-pill, .contact-item, .stack-card, .project-card, .portrait.has-swap, .chat-launcher, .chat-chips button, .msg .actions a, .nav-links a, .brand { cursor: pointer; }
a:not([href]), button:disabled { cursor: default; }

/* Section animations: bigger motion, longer duration, more delay between items */
@keyframes reveal-up { from { opacity: 0; transform: translateY(64px) scale(0.97); } to { opacity: 1; transform: none; } }
.js [data-reveal]:not(.is-visible) { opacity: 0; transform: translateY(64px) scale(0.97); }
.js [data-reveal].is-visible { animation: reveal-up 1.3s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.3s + 0.25s); }
.js .section-head[data-reveal].is-visible { animation-delay: 0.1s; }
@media (prefers-reduced-motion: reduce) { .js [data-reveal], .js [data-reveal].is-visible { opacity: 1; transform: none; animation: none; } }

/* Section animations: faster again (still bigger than the original) */
@keyframes reveal-up { from { opacity: 0; transform: translateY(40px) scale(0.98); } to { opacity: 1; transform: none; } }
.js [data-reveal]:not(.is-visible) { transform: translateY(40px) scale(0.98); }
.js [data-reveal].is-visible { animation: reveal-up 0.9s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.18s + 0.05s); }
.js .section-head[data-reveal].is-visible { animation-delay: 0s; }

/* ==========================================================================
   Skills cards: per-group colours, icon chips, animated border, shiny type
   ========================================================================== */
@keyframes shine { to { background-position: 200% 0; } }
@keyframes chip-pop { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: none; } }
.sk-ai { --g1: #8b7cff; --g2: #c084fc; }
.sk-architecture { --g1: #22d3ee; --g2: #6366f1; }
.sk-leadership { --g1: #f472b6; --g2: #fb923c; }
.sk-cloud { --g1: #38bdf8; --g2: #34d399; }
.sk-stack { --g1: #a78bfa; --g2: #22d3ee; }
.sk-data { --g1: #fbbf24; --g2: #f472b6; }
.sk-integrations { --g1: #34d399; --g2: #8b7cff; }
:root[data-theme='light'] .sk-ai { --g1: #6d4df2; --g2: #a21caf; }
:root[data-theme='light'] .sk-architecture { --g1: #0e7490; --g2: #4338ca; }
:root[data-theme='light'] .sk-leadership { --g1: #be185d; --g2: #c2410c; }
:root[data-theme='light'] .sk-cloud { --g1: #0369a1; --g2: #047857; }
:root[data-theme='light'] .sk-stack { --g1: #6d28d9; --g2: #0e7490; }
:root[data-theme='light'] .sk-data { --g1: #b45309; --g2: #be185d; }
:root[data-theme='light'] .sk-integrations { --g1: #047857; --g2: #5b4bd6; }
.skill-card {
  position: relative; overflow: hidden; isolation: isolate; border: 1px solid transparent; padding: var(--space-3);
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--ang), var(--g1), transparent 30%, var(--g2) 60%, transparent 85%, var(--g1)) border-box;
  animation: ang-spin 10s linear infinite;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.skill-card::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 70% at 100% 0%, color-mix(in srgb, var(--g1) 16%, transparent), transparent 70%), radial-gradient(50% 60% at 0% 100%, color-mix(in srgb, var(--g2) 12%, transparent), transparent 70%); }
.skill-card:hover { transform: translateY(-4px); box-shadow: 0 20px 44px color-mix(in srgb, var(--g1) 28%, transparent); }
.sk-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.skill-card h3 { margin: 0; flex: 1; font-size: 1.375rem; display: block;
  background-image: linear-gradient(100deg, var(--g1), var(--text) 35%, var(--g2) 65%, var(--g1)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shine 6s linear infinite; }
.skill-card h3::before { display: none; }
.sk-badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; color: #fff; background-image: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 8px 20px color-mix(in srgb, var(--g1) 40%, transparent); }
.sk-badge svg { width: 22px; height: 22px; }
.sk-count { font-family: var(--font-mono); font-size: 0.8125rem; padding: 0 var(--space-1); min-height: 24px; display: inline-flex; align-items: center; border-radius: 999px; color: var(--g1); border: 1px solid color-mix(in srgb, var(--g1) 45%, transparent); }
.sk-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.sk-chip {
  display: inline-flex; align-items: center; gap: var(--space-1); min-height: 40px; padding: 0 var(--space-2) 0 var(--space-1); border-radius: 999px; font-size: 0.9375rem; font-weight: 500; line-height: 1.3;
  border: 1px solid color-mix(in srgb, var(--g1) 32%, var(--border)); background: color-mix(in srgb, var(--g1) 8%, var(--surface));
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.sk-chip .sk-ico { width: 20px; height: 20px; }
.sk-chip .sk-glyph svg { width: 18px; height: 18px; color: var(--g1); }
.sk-chip > span:last-child { background-image: linear-gradient(100deg, var(--text) 40%, var(--g1) 50%, var(--text) 60%); background-size: 250% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.sk-chip:hover { transform: translateY(-3px) scale(1.04); border-color: var(--g1); box-shadow: 0 10px 24px color-mix(in srgb, var(--g1) 35%, transparent); background: color-mix(in srgb, var(--g1) 14%, var(--surface)); }
.sk-chip:hover > span:last-child { animation: shine 1.1s var(--ease); }
.js .skill-card.is-visible .sk-chip { animation: chip-pop 0.6s var(--ease) both; animation-delay: calc(var(--c, 0) * 0.04s + 0.25s); }
.js .skill-card:not(.is-visible) .sk-chip { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .skill-card, .skill-card h3 { animation: none; } .js .skill-card .sk-chip { opacity: 1; animation: none; } }

/* ==========================================================================
   Back to top: larger pill, gradient badge, bobbing arrow, shine sweep
   ========================================================================== */
@keyframes tt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tt-sweep { 0% { transform: translateX(-130%) skewX(-20deg); } 55%, 100% { transform: translateX(260%) skewX(-20deg); } }
.footer { padding: var(--space-6) 0 var(--space-8); }
.to-top {
  position: relative; overflow: hidden; isolation: isolate; display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 64px; padding: 0 var(--space-4) 0 var(--space-1); border-radius: 999px; color: var(--text); font-family: var(--font-head); font-weight: 600; font-size: 1.125rem;
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ang), var(--accent), var(--accent-2), transparent 40%, var(--accent)) border-box;
  animation: ang-spin 6s linear infinite; box-shadow: 0 14px 36px var(--glow-a);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.to-top::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 36%; z-index: -1; pointer-events: none; background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent); animation: tt-sweep 4.5s var(--ease) infinite; }
.tt-arrow { position: relative; overflow: hidden; display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; color: var(--accent-ink); background-image: var(--grad); background-size: 200% 100%; transition: background-position var(--dur) var(--ease); }
.tt-arrow svg { width: 24px; height: 24px; grid-area: 1 / 1; animation: tt-bob 1.8s var(--ease) infinite; }
.tt-arrow svg + svg { transform: translateY(150%); animation: none; }
.tt-label { position: relative; overflow: hidden; display: inline-block; height: 1.4em; line-height: 1.4; }
.tt-label span { display: block; transition: transform var(--dur-fast) var(--ease); }
.to-top:hover { transform: translateY(-6px); box-shadow: 0 22px 48px var(--glow-a), 0 0 0 1px var(--accent); color: var(--text); }
.to-top:hover .tt-arrow { background-position: 100% 0; }
.to-top:hover .tt-arrow svg:first-child { animation: none; transform: translateY(-150%); transition: transform var(--dur-fast) var(--ease); }
.to-top:hover .tt-arrow svg + svg { transform: translateY(0); transition: transform var(--dur-fast) var(--ease); }
.to-top:active { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .to-top, .to-top::after, .tt-arrow svg { animation: none; } }

/* Theme toggle shows the theme you will switch TO: moon on the light page, sun on the dark page */
.theme-toggle .moon { display: none; }
.theme-toggle .sun { display: block; }
:root[data-theme='light'] .theme-toggle .moon { display: block; }
:root[data-theme='light'] .theme-toggle .sun { display: none; }

/* ==========================================================================
   Education: colourful cards with ghost labels, spotlight, icon badges
   ========================================================================== */
@keyframes edu-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-4deg); } }
.edu-deg { --g1: #8b7cff; --g2: #22d3ee; }
.edu-sch { --g1: #f472b6; --g2: #fb923c; }
.edu-cert { --g1: #34d399; --g2: #38bdf8; }
:root[data-theme='light'] .edu-deg { --g1: #5b4bd6; --g2: #0e7490; }
:root[data-theme='light'] .edu-sch { --g1: #be185d; --g2: #c2410c; }
:root[data-theme='light'] .edu-cert { --g1: #047857; --g2: #0369a1; }
.edu-card {
  position: relative; overflow: hidden; isolation: isolate; padding: var(--space-4); border: 1px solid transparent; border-radius: var(--radius-3);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, conic-gradient(from var(--ang), var(--g1), transparent 30%, var(--g2) 60%, transparent 85%, var(--g1)) border-box;
  animation: ang-spin 10s linear infinite; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.edu-card::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx, 100%) var(--my, 0%), color-mix(in srgb, var(--g1) 22%, transparent), transparent 70%), radial-gradient(60% 60% at 0% 100%, color-mix(in srgb, var(--g2) 12%, transparent), transparent 70%); }
.edu-card:hover { transform: translateY(-6px); box-shadow: 0 24px 52px color-mix(in srgb, var(--g1) 30%, transparent); }
.edu-ghost { position: absolute; right: var(--space-2); bottom: -8px; z-index: -1; font-family: var(--font-head); font-weight: 700; font-size: clamp(3.5rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.05em; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--g1) 30%, transparent); opacity: 0.55; transition: transform var(--dur) var(--ease); }
.edu-card:hover .edu-ghost { transform: translateX(-8px) scale(1.04); }
.edu-top { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.edu-badge { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; background-image: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 10px 24px color-mix(in srgb, var(--g1) 40%, transparent); }
.edu-badge svg { width: 24px; height: 24px; }
.edu-card:hover .edu-badge { animation: edu-float 1s var(--ease); }
.edu-tag { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g1); }
.edu-card h3 { font-size: 1.375rem; margin-bottom: var(--space-1);
  background-image: linear-gradient(100deg, var(--g1), var(--text) 40%, var(--g2) 70%, var(--g1)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shine 6s linear infinite; }
.edu-card p { color: var(--text-muted); }
.edu-card p a { color: var(--g1); font-weight: 600; }
.edu-meta { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.edu-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-2); border-radius: 999px; font-size: 0.8125rem; color: var(--text); border: 1px solid color-mix(in srgb, var(--g1) 40%, var(--border)); background: color-mix(in srgb, var(--g1) 10%, var(--surface)); }
.edu-certs { display: grid; gap: var(--space-1); margin-top: var(--space-1); }
.edu-certs li { display: flex; align-items: flex-start; gap: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: var(--radius-1); color: var(--text); border: 1px solid color-mix(in srgb, var(--g1) 30%, var(--border)); background: color-mix(in srgb, var(--g1) 8%, var(--surface)); transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.edu-certs li:hover { transform: translateX(6px); border-color: var(--g1); }
.edu-certs svg { width: 20px; height: 20px; flex: none; margin-top: 2px; color: var(--g1); }
@media (prefers-reduced-motion: reduce) { .edu-card, .edu-card h3 { animation: none; } }

/* Hero photo: quick, light entrance (it is the first thing visitors look for) */
.js.is-loaded .portrait[data-load] { animation-duration: 0.6s; animation-delay: 0s; }

/* Less space between the role heading and the "I Engineer the..." statement */
.hero-statement { margin-top: var(--space-3); }
@media (max-width: 599px) { .hero-statement { margin-top: var(--space-2); } }

/* ==========================================================================
   All projects: compact card grid under the stacked cards
   ========================================================================== */
.allp { margin-top: var(--space-10); position: relative; z-index: 2; }
.allp-title { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: var(--space-3);
  background-image: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shine 6s linear infinite; display: inline-block; }
.allp-grid { display: grid; gap: var(--space-2); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .allp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .allp-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.allp-grid li { display: flex; }
.allp-card {
  position: relative; overflow: hidden; isolation: isolate; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); text-align: left; padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--surface); color: var(--text); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.allp-card::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity var(--dur-fast) var(--ease); background: radial-gradient(200px circle at var(--mx, 50%) var(--my, 50%), var(--glow-a), transparent 70%); }
.allp-card::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background-image: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.allp-card:hover, .allp-card:focus-visible { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 18px 40px var(--glow-a); }
.allp-card:hover::before { opacity: 1; }
.allp-card:hover::after { transform: scaleX(1); }
.allp-top { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.allp-idx { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.allp-go { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent-ink); background-image: var(--grad); transform: rotate(-45deg); transition: transform var(--dur-fast) var(--ease); }
.allp-go svg { width: 16px; height: 16px; }
.allp-card:hover .allp-go { transform: rotate(0); }
.allp-name { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.allp-sum { color: var(--text-muted); font-size: 0.875rem; flex: 1; }
.allp-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
.allp-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--space-1); border-radius: 999px; font-size: 0.75rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); }

/* ==========================================================================
   "Ask about Girish" launcher: floating motion, shiny sweep, pulsing halo
   ========================================================================== */
@keyframes bot-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bot-sweep { 0% { transform: translateX(-140%) skewX(-20deg); } 45%, 100% { transform: translateX(320%) skewX(-20deg); } }
@keyframes bot-halo { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-lg); } 70%, 100% { box-shadow: 0 0 0 18px transparent, var(--shadow-lg); } }
@keyframes bot-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg) scale(1.15); } 40% { transform: rotate(12deg) scale(1.15); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(6deg); } }
.chat-launcher { overflow: hidden; isolation: isolate; animation: bot-float 3.4s var(--ease) infinite, bot-halo 2.6s var(--ease) infinite; }
.chat-launcher::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: bot-sweep 3.8s var(--ease) infinite; }
.chat-launcher svg { animation: bot-wiggle 5s var(--ease) 1.5s infinite; }
.chat-launcher:hover, .chat-launcher:focus-visible { animation: bot-halo 1.4s var(--ease) infinite; transform: translateY(-6px) scale(1.06); }
.chat-launcher:focus-visible { outline-offset: 4px; }
.chat-launcher:hover svg, .chat-launcher:focus-visible svg { animation: bot-wiggle 0.8s var(--ease); }
.chat-launcher:hover::after, .chat-launcher:focus-visible::after { animation-duration: 1.4s; }
@media (prefers-reduced-motion: reduce) { .chat-launcher, .chat-launcher::after, .chat-launcher svg { animation: none; } }

/* Experience dates and locations in bold */
.job-meta { font-weight: 700; }

/* ==========================================================================
   Site backdrop (added): engineering dot grid, cursor spotlight, drifting glows
   ========================================================================== */
@keyframes orb-a { to { transform: translate3d(-6vw, 8vh, 0) scale(1.12); } }
@keyframes orb-b { to { transform: translate3d(7vw, -7vh, 0) scale(1.1); } }
.site-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; --bx: -999px; --by: -999px; }
.bg-dots { position: absolute; inset: 0; background-image: radial-gradient(var(--dot-c, rgba(255, 255, 255, 0.10)) 1px, transparent 1.4px); background-size: 24px 24px; }
.bg-lit { --dot-c: color-mix(in srgb, var(--accent) 80%, transparent); -webkit-mask-image: radial-gradient(260px circle at var(--bx) var(--by), #000, transparent 70%); mask-image: radial-gradient(260px circle at var(--bx) var(--by), #000, transparent 70%); }
:root[data-theme='light'] .bg-dots { --dot-c: rgba(30, 30, 80, 0.13); }
:root[data-theme='light'] .bg-lit { --dot-c: color-mix(in srgb, var(--accent) 75%, transparent); }
.bg-orb { position: absolute; border-radius: 50%; will-change: transform; }
.bg-orb.o1 { width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; right: -12vw; top: 18vh; background: radial-gradient(circle, var(--glow-a), transparent 66%); animation: orb-a 28s var(--ease) infinite alternate; }
.bg-orb.o2 { width: 55vw; height: 55vw; max-width: 700px; max-height: 700px; left: -14vw; bottom: -8vh; background: radial-gradient(circle, var(--glow-b), transparent 66%); animation: orb-b 34s var(--ease) infinite alternate; }
@media (prefers-reduced-motion: reduce) { .bg-orb { animation: none; } }

/* ==========================================================================
   Theme toggle: tiny float, soft glow, shine sweep, icon spin on hover/switch
   ========================================================================== */
@keyframes tg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes tg-glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes tg-sweep { 0% { transform: translateX(-140%) skewX(-20deg); } 45%, 100% { transform: translateX(320%) skewX(-20deg); } }
@keyframes tg-spin { from { transform: rotate(-90deg) scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
.theme-toggle { position: relative; overflow: hidden; isolation: isolate; animation: tg-float 3.2s var(--ease) infinite, tg-glow 3s var(--ease) infinite; }
.theme-toggle::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; z-index: -1; pointer-events: none; background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent-2) 45%, transparent), transparent); animation: tg-sweep 4.2s var(--ease) infinite; }
.theme-toggle svg { animation: tg-spin 0.6s var(--ease) both; transition: transform var(--dur-fast) var(--ease); }
.theme-toggle:hover svg, .theme-toggle:focus-visible svg { transform: rotate(25deg) scale(1.15); }
.theme-toggle:hover::after, .theme-toggle:focus-visible::after { animation-duration: 1.4s; }
@media (prefers-reduced-motion: reduce) { .theme-toggle, .theme-toggle::after, .theme-toggle svg { animation: none; } }

/* Extra background code: bottom-left of each section (behind all content) */
.bg-code.low { top: auto; right: auto; bottom: var(--space-2); left: var(--gutter); max-width: 420px;
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
@media (min-width: 1100px) { .bg-code.low { left: var(--edge); } }

/* Hero keeps its original look: the site-wide backdrop (dots, glows) does not show through it */
.hero { background-color: var(--bg); }

/* Soft fade: the dot grid and glows ease in gradually below the hero */
#about::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 240px; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, var(--bg), transparent); }


/* ==========================================================================
   Audit: performance + uniform spacing (appended last so it wins the cascade)
   ========================================================================== */
/* 1) Continuous animations are paused when their element is off screen (class set by JS) */
.is-off, .is-off *, .is-off::before, .is-off::after { animation-play-state: paused !important; }

/* 2) Rotating gradient borders + shimmering titles only move on hover (nothing repaints at rest) */
.skill-card, .edu-card, .facts.card { animation: none; }
.js .skill-card.is-done:hover, .js .edu-card.is-done:hover, .js .facts.is-done:hover { animation: ang-spin 6s linear infinite; }
.to-top { animation: none; }
.to-top:hover, .to-top:focus-visible { animation: ang-spin 5s linear infinite; }
.skill-card h3, .edu-card h3, .allp-title { animation-play-state: paused; }
.skill-card:hover h3, .edu-card:hover h3, .allp-title:hover { animation-play-state: running; }
.js [data-reveal].is-done { animation: none; }
.skill-card, .edu-card, .facts.card, .allp-card, .interest { contain: layout paint; }

/* 3) Stack cards promote to their own layer only while Projects is on screen */
.stack.is-live .stack-card { will-change: transform; }

/* 4) Cursor spotlight: one small layer that is moved with transform (no full-screen repaint) */
.bg-lit { inset: auto; left: 0; top: 0; width: 528px; height: 528px; will-change: transform;
  -webkit-mask-image: radial-gradient(circle at center, #000, transparent 70%); mask-image: radial-gradient(circle at center, #000, transparent 70%); }

/* 5) Contact stars: tiled mask layers that slide exactly one tile (seamless loop, tiny textures) */
@keyframes star-rise { to { transform: translate3d(0, calc(var(--tile) * -1), 0); } }
.star-layer { position: absolute; left: 0; top: 0; display: block; width: 100%; height: calc(100% + var(--tile)); background: var(--star);
  -webkit-mask-repeat: repeat; mask-repeat: repeat; animation: star-rise var(--dur) linear infinite; will-change: transform; box-shadow: none; }
.star-layer::after { content: none; }
@media (prefers-reduced-motion: reduce) { .star-layer { animation: none; } }

/* 6) Header: lighter blur (large blurs behind a sticky bar are expensive while scrolling) */
.nav { background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.nav.is-scrolled { background: color-mix(in srgb, var(--bg) 94%, transparent); }

/* 7) Uniform vertical rhythm: every section has the same padding and heading gap */
.section { padding-block: var(--space-10); }
@media (max-width: 599px) { .section { padding-block: var(--space-8); } .section-head { margin-bottom: var(--space-4); } }
.footer .container { max-width: var(--container); }

/* 8) Fallback for browsers without dvh */
.chat-panel { max-height: calc(100vh - var(--space-8)); }

/* Download CV buttons: light sweep + arrow that nudges down; bounces on hover (transform/opacity only) */
@keyframes dl-sweep { 0% { transform: translateX(-160%) skewX(-20deg); } 40%, 100% { transform: translateX(380%) skewX(-20deg); } }
@keyframes dl-nudge { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(3px); } 90% { transform: translateY(-1px); } }
@keyframes dl-drop { 0% { transform: translateY(-6px); opacity: 0; } 60% { transform: translateY(2px); opacity: 1; } 100% { transform: translateY(0); } }
a.btn[download] { position: relative; overflow: hidden; isolation: isolate; }
a.btn[download]::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent); transform: translateX(-160%) skewX(-20deg); animation: dl-sweep 4.2s var(--ease) infinite; }
a.btn-secondary[download]::after { background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 28%, transparent), transparent); }
a.btn[download] svg { animation: dl-nudge 2.6s var(--ease) infinite; }
a.btn[download]:hover svg, a.btn[download]:focus-visible svg { animation: dl-drop 0.6s var(--ease) infinite; }
a.btn[download]:hover::after, a.btn[download]:focus-visible::after { animation-duration: 1.2s; }
@media (prefers-reduced-motion: reduce) { a.btn[download]::after, a.btn[download] svg { animation: none; } }

/* Hero rotating roles: a bright highlight glides across the gradient text on top of the flowing colours */
@keyframes role-shine { 0% { background-position: 120% 0, 0 0; } 100% { background-position: -20% 0, 200% 0; } }
.rotor-line > span {
  background-image: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.95) 50%, transparent 62%), var(--grad);
  background-size: 250% 100%, 200% 100%; background-repeat: no-repeat, repeat; background-position: 120% 0, 0 0;
}
.role.is-active .rotor-line > span { animation: role-in 1s var(--ease) both, role-shine 3.4s linear infinite; animation-delay: calc(var(--n, 0) * 0.14s + 0.35s), 0.8s; }
@media (prefers-reduced-motion: reduce) { .role.is-active .rotor-line > span { animation: none; } }


/* ==========================================================================
   Fluid width: content grows and shrinks with the screen (header, hero, sections and footer share it)
   ========================================================================== */
.container { padding-inline: var(--gutter); }
.nav .container, .hero-content, .footer .container { max-width: var(--container); padding-inline: var(--gutter); }
.nav-shell .brand { margin-left: 0; }
@media (min-width: 960px) { .portrait { width: min(100%, clamp(320px, 27vw, 520px)); } }
.about-text, .hero-lead, .stack-copy .sum, .role-line { max-width: 62ch; }

/* Background dots: fainter (base grid and the cursor-lit dots) */
.bg-dots { --dot-c: rgba(255, 255, 255, 0.05); }
.bg-lit { --dot-c: color-mix(in srgb, var(--accent) 50%, transparent); }
:root[data-theme='light'] .bg-dots { --dot-c: rgba(30, 30, 80, 0.07); }
:root[data-theme='light'] .bg-lit { --dot-c: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ==========================================================================
   Intro (first screen): blueprint grid + glow, drawing logo in spinning rings,
   rising name, big counter with glowing bar, boot log, then the tile wave reveals the page
   ========================================================================== */
@keyframes pl-spin { to { transform: rotate(360deg); } }
@keyframes pl-pulse { 0%, 100% { transform: scale(0.92); opacity: 0.55; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes pl-draw { to { stroke-dashoffset: 0; } }
@keyframes pl-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pl-fade { to { opacity: 1; } }
@keyframes pl-scan { from { transform: translateY(-10vh); } to { transform: translateY(110vh); } }
@keyframes tile-out { from { transform: scale(1.02); } to { transform: scale(0); } }
.preloader { display: none; position: fixed; inset: 0; z-index: 1000; }
.js .preloader { display: block; }
html.is-intro { overflow: hidden; }
.pl-tiles { position: absolute; inset: 0; display: grid; }
.pl-tiles span { background: #0b0c10; transform: scale(1.02); will-change: transform; }
.pl-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transition: opacity 0.5s var(--ease);
  background:
    radial-gradient(55% 48% at 50% 42%, rgba(139, 124, 255, 0.26), transparent 70%),
    radial-gradient(40% 40% at 88% 92%, rgba(110, 231, 249, 0.14), transparent 70%),
    linear-gradient(rgba(139, 124, 255, 0.08) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(139, 124, 255, 0.08) 1px, transparent 1px) 0 0 / 64px 64px;
  -webkit-mask-image: radial-gradient(75% 70% at 50% 45%, #000, transparent 95%); mask-image: radial-gradient(75% 70% at 50% 45%, #000, transparent 95%); }
.pl-fx::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, transparent, rgba(110, 231, 249, 0.7), transparent); box-shadow: 0 0 24px rgba(110, 231, 249, 0.6); animation: pl-scan 2.6s linear infinite; }
.pl-core { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3); text-align: center; color: #f2f2f6;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease); }
.pl-emblem { position: relative; width: clamp(128px, 22vw, 176px); aspect-ratio: 1; display: grid; place-items: center; margin-bottom: var(--space-1); }
.pl-halo { position: absolute; inset: -28px; border-radius: 50%; background: radial-gradient(circle, rgba(139, 124, 255, 0.4), transparent 65%); animation: pl-pulse 2.2s var(--ease) infinite; }
.pl-ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#8b7cff, #6ee7f9, transparent 58%, #8b7cff);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: pl-spin 2.4s linear infinite; }
.pl-ring.r2 { inset: 14px; opacity: 0.5; animation-duration: 3.8s; animation-direction: reverse; }
.preloader .pl-logo { position: relative; width: 58%; height: 58%; display: block; filter: drop-shadow(0 10px 30px rgba(139, 124, 255, 0.45)); }
.preloader .pl-logo path { stroke-dasharray: 80; stroke-dashoffset: 80; animation: pl-draw 1.2s var(--ease) 0.25s forwards; }
.pl-name { display: flex; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: clamp(0.95rem, 2.8vw, 1.3rem); letter-spacing: 0.32em; text-transform: uppercase; }
.pl-name span { display: inline-block; opacity: 0; animation: pl-rise 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 0.04s + 0.55s); }
.pl-role { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.08em; color: #a7a9b6; opacity: 0; animation: pl-fade 0.8s var(--ease) 1.1s forwards; }
.pl-num { display: flex; align-items: baseline; gap: 4px; margin-top: var(--space-2); font-family: var(--font-head); font-weight: 700; line-height: 1; font-size: clamp(3rem, 10vw, 5rem); font-variant-numeric: tabular-nums;
  background-image: linear-gradient(100deg, #8b7cff, #6ee7f9); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
.pl-pct { font-size: 0.4em; }
.pl-bar { width: min(320px, 70vw); height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.pl-bar i { display: block; height: 100%; background-image: linear-gradient(100deg, #8b7cff, #6ee7f9); box-shadow: 0 0 14px rgba(110, 231, 249, 0.7); transform: scaleX(0); transform-origin: left; }
.pl-log { list-style: none; margin: var(--space-1) 0 0; padding: 0; display: grid; gap: 4px; min-width: min(280px, 80vw); text-align: left; font-family: var(--font-mono); font-size: 0.75rem; color: #6e7080; }
.pl-log li { opacity: 0.35; transition: opacity 0.3s var(--ease), color 0.3s var(--ease); }
.pl-log li::before { content: '> '; color: #8b7cff; }
.pl-log li.on { opacity: 1; color: #c4c6d6; }
.pl-log li.on::after { content: ' \2713'; color: #34d399; }
.preloader.is-leaving .pl-core { opacity: 0; transform: translateY(-12px) scale(0.98); }
.preloader.is-leaving .pl-fx { opacity: 0; }
.preloader.is-leaving .pl-tiles span { animation: tile-out 0.6s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 1ms + 320ms); }
.preloader.is-leaving { pointer-events: none; }
@media (max-width: 599px) { .pl-log { font-size: 0.6875rem; } .pl-name { letter-spacing: 0.22em; } }

/* Hero -> About: one continuous surface (no hard edge, no divider line) */
.hero-aurora, .hero-graph { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 180px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 180px), transparent); }
#about::before { display: none; }
#about::after { height: 320px; }
#about::after { width: auto; border-radius: 0; transform: none; animation: none; }

/* Stats: five items; on phones the last one spans both columns */
@media (max-width: 767px) { .stat:last-child { grid-column: 1 / -1; } }

/* Intro counter: plain number (no leading zeros); reserved width keeps the % from jumping */
.pl-count { display: inline-block; min-width: 3ch; text-align: right; }
.pl-count { min-width: 0; text-align: center; }

/* ==========================================================================
   Services: card grid (2 wide / 3 narrow / 1 full) with preview window, spotlight, shiny titles
   ========================================================================== */
@keyframes svc-caret { 50% { opacity: 0; } }
@keyframes svc-line { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.svc-web { --g1: #8b7cff; --g2: #22d3ee; }
.svc-mobile { --g1: #f472b6; --g2: #fb923c; }
.svc-api { --g1: #34d399; --g2: #38bdf8; }
.svc-ai { --g1: #a78bfa; --g2: #c084fc; }
.svc-arch { --g1: #38bdf8; --g2: #6366f1; }
.svc-consult { --g1: #fbbf24; --g2: #f472b6; }
:root[data-theme='light'] .svc-web { --g1: #5b4bd6; --g2: #0e7490; }
:root[data-theme='light'] .svc-mobile { --g1: #be185d; --g2: #c2410c; }
:root[data-theme='light'] .svc-api { --g1: #047857; --g2: #0369a1; }
:root[data-theme='light'] .svc-ai { --g1: #6d28d9; --g2: #a21caf; }
:root[data-theme='light'] .svc-arch { --g1: #0369a1; --g2: #4338ca; }
:root[data-theme='light'] .svc-consult { --g1: #b45309; --g2: #be185d; }
.svc-grid { display: grid; gap: var(--space-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .svc-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } .svc-card { grid-column: span 3; } .svc-card.is-full { grid-column: 1 / -1; } }
@media (min-width: 1100px) { .svc-card { grid-column: span 2; } .svc-card.is-wide { grid-column: span 3; } .svc-card.is-full { grid-column: 1 / -1; } }
.svc-card {
  position: relative; overflow: hidden; isolation: isolate; contain: layout paint; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-3); background: var(--surface);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.svc-card::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 100%) var(--my, 0%), color-mix(in srgb, var(--g1) 20%, transparent), transparent 70%), radial-gradient(60% 60% at 0% 100%, color-mix(in srgb, var(--g2) 10%, transparent), transparent 70%); }
.svc-card:hover { transform: translateY(-6px); border-color: var(--g1); box-shadow: 0 24px 52px color-mix(in srgb, var(--g1) 28%, transparent); }
.svc-visual { border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--bg-elev); overflow: hidden; font-family: var(--font-mono); font-size: 0.8125rem; }
.svc-lines { position: relative; display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); min-height: 136px; align-content: center; color: var(--text); overflow-wrap: anywhere; }
.svc-lines p { margin: 0; }
.svc-lines .k { color: var(--g1); }
.svc-lines .v { color: var(--text-muted); }
.js .svc-card.is-visible .svc-lines p { animation: svc-line 0.6s var(--ease) both; animation-delay: calc(var(--k, 0) * 0.18s + 0.5s); }
.svc-caret { display: inline-block; width: 8px; height: 1em; margin-top: 2px; background: var(--g1); animation: svc-caret 1s steps(1) infinite; }
.svc-head { display: flex; align-items: center; gap: var(--space-2); }
.svc-badge { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; color: #fff; background-image: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 8px 20px color-mix(in srgb, var(--g1) 38%, transparent); }
.svc-badge svg { width: 22px; height: 22px; }
.svc-card:hover .svc-badge { animation: edu-float 1s var(--ease); }
.svc-head h3 { flex: 1; margin: 0; font-size: 1.375rem;
  background-image: linear-gradient(100deg, var(--g1), var(--text) 40%, var(--g2) 70%, var(--g1)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shine 6s linear infinite; animation-play-state: paused; }
.svc-card:hover .svc-head h3 { animation-play-state: running; }
.svc-n { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--g1); opacity: 0.8; }
.svc-desc { margin: 0; color: var(--text-muted); font-size: 1rem; max-width: 62ch; }
.svc-tags { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.svc-tags li { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--space-2); border-radius: 999px; font-size: 0.8125rem; border: 1px solid color-mix(in srgb, var(--g1) 38%, var(--border)); background: color-mix(in srgb, var(--g1) 9%, var(--surface)); }
.svc-cta { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: var(--space-1); min-height: 40px; font-family: var(--font-mono); font-size: 0.875rem; color: var(--g1); cursor: pointer; }
.svc-cta svg { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease); }
.svc-card:hover .svc-cta svg, .svc-cta:focus-visible svg { transform: translateX(6px); }
.svc-cta:hover { color: var(--g2); }
.svc-card.is-full { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .svc-card.is-full { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: var(--space-4); align-items: start; } .svc-card.is-full .svc-visual { grid-row: 1 / span 4; grid-column: 2; } .svc-card.is-full .svc-head, .svc-card.is-full .svc-desc, .svc-card.is-full .svc-tags, .svc-card.is-full .svc-cta { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { .svc-head h3, .svc-caret { animation: none; } .js .svc-card .svc-lines p { animation: none; opacity: 1; } }

/* Experience snippet: shorter and a little higher so it never reaches the first job's date line */
#experience > .bg-code { top: var(--space-8); }

/* Slightly tighter space between sections (still identical on every section) */
.section { padding-block: var(--space-8); }
@media (max-width: 599px) { .section { padding-block: var(--space-6); } }

/* Data card: labelled sub-groups (NoSQL, RDBMS, Vector, Cache, Time-series) */
.sk-sub { display: grid; gap: var(--space-2); }
.sk-subgroup h4 { margin: 0 0 var(--space-1); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--g1); }

/* Cloud & DevOps: sub-groups laid out in columns on wider cards */
@media (min-width: 720px) { .sk-cloud .sk-sub { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-3); } }

/* Skills grid on wide screens: 12 columns so the first row can be AI/GenAI narrower and Architecture wider */
@media (min-width: 1080px) {
  .skills-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .skills-grid .skill-card { grid-column: span 4; }
  .skills-grid .sk-ai { grid-column: span 7; }
  .skills-grid .sk-architecture { grid-column: span 5; }
  .skills-grid .sk-cloud, .skills-grid .sk-stack { grid-column: span 8; }
  .skills-grid .sk-integrations { grid-column: 1 / -1; }
}

/* Intro: no grid lines (they read as thin white lines); tile layer gets a solid base so no seams show between tiles */
.pl-fx { background: radial-gradient(55% 48% at 50% 42%, rgba(139, 124, 255, 0.26), transparent 70%), radial-gradient(40% 40% at 88% 92%, rgba(110, 231, 249, 0.14), transparent 70%); }
.pl-tiles { background: #0b0c10; }
.pl-tiles span { margin: -0.5px; }

/* Glass-tile break-away effect restored (grid lines stay removed): the intro is made of glass-like tiles that shatter away in a wave */
.pl-tiles { background: transparent; }
.pl-tiles span { margin: 0; background-image: linear-gradient(160deg, #1d1e2e, #0c0d14); background-color: #0b0c10; }

/* Intro: richer, more solid dark-blue tiles (less washed-out) with a stronger glow */
.pl-tiles span { background-image: linear-gradient(160deg, #1f2466, #0a0c2a); background-color: #0a0c2a; }
.pl-fx { background: radial-gradient(55% 48% at 50% 42%, rgba(139, 124, 255, 0.45), transparent 70%), radial-gradient(40% 40% at 88% 92%, rgba(110, 231, 249, 0.2), transparent 70%); }

/* Intro: back to the darker, near-black glass tiles with a gentle glow */
.pl-tiles span { background-image: linear-gradient(160deg, #181925, #07080d); background-color: #07080d; }
.pl-fx { background: radial-gradient(55% 48% at 50% 42%, rgba(139, 124, 255, 0.24), transparent 70%), radial-gradient(40% 40% at 88% 92%, rgba(110, 231, 249, 0.12), transparent 70%); }

/* ==========================================================================
   Hero code card: tilted editor window layered over the photo (desktop/tablet only, never blocks hover)
   ========================================================================== */
@keyframes hc-line { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes hc-blink { 50% { opacity: 0; } }
.hero-code {
  display: none; position: absolute; z-index: 4; left: -22%; bottom: 6%; width: clamp(236px, 22vw, 300px); pointer-events: none;
  border: 1px solid var(--border); border-radius: var(--radius-2); background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.32), 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); transform: rotate(-5deg); overflow: hidden;
  font-family: var(--font-mono); font-size: 0.78rem;
}
:root[data-theme='light'] .hero-code { box-shadow: 0 24px 56px rgba(40, 40, 90, 0.22), 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent); }
.hc-bar { display: flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); border-bottom: 1px solid var(--border); color: var(--text-muted); }
.hc-bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.hc-bar span { margin-left: var(--space-1); }
.hc-body { padding: var(--space-2); display: grid; gap: 4px; color: var(--text); }
.hc-body p { margin: 0; white-space: nowrap; }
.hc-body em { font-style: normal; color: var(--text-muted); opacity: 0.7; margin-right: var(--space-1); }
.hc-body .kw { color: var(--accent); }
.hc-body .fn { color: var(--accent-2); }
.hc-body .val { color: #34d399; }
:root[data-theme='light'] .hc-body .val { color: #047857; }
.hc-caret { display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: var(--accent-2); animation: hc-blink 1s steps(1) infinite; }
.js .hero-code .hc-body p { opacity: 0; }
.js.is-loaded .hero-code .hc-body p { animation: hc-line 0.6s var(--ease) both; animation-delay: calc(var(--k, 0) * 0.35s + 1.4s); }
@media (min-width: 600px) { .hero-code { display: block; } }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { left: -8%; width: 240px; } }
@media (prefers-reduced-motion: reduce) { .hc-caret { animation: none; } .js .hero-code .hc-body p { opacity: 1; animation: none; } }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { left: -14%; width: 276px; font-size: 0.72rem; bottom: 4%; } }

/* hero code card: top-left of the portrait */
.hero-code { top: 2%; bottom: auto; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: 0; bottom: auto; } }
.hero-code { top: -8%; left: -26%; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -9%; left: -12%; } }

/* project dialog: logo, highlights, screens */
.dialog-logo { display: block; margin-bottom: var(--space-2); }
.dialog-logo img { height: 24px; width: auto; display: none; }
.dialog-logo .logo-on-dark { display: block; }
:root[data-theme='light'] .dialog-logo .logo-on-dark { display: none; }
:root[data-theme='light'] .dialog-logo .logo-on-light { display: block; }
.dialog-list { list-style: none; display: grid; gap: var(--space-1); padding: 0; margin: 0; }
.dialog-list li { position: relative; padding-left: var(--space-3); color: var(--text-muted); }
.dialog-list li::before { content: ''; position: absolute; left: 0; top: 0.7em; width: 8px; height: 2px; background: var(--accent); }
.shot { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-2); overflow: hidden; background: var(--surface-2); }
.shot-main { display: block; width: 100%; height: auto; aspect-ratio: 2000 / 969; object-fit: cover; }
.shot-cap { padding: var(--space-1) var(--space-2); font-size: 0.8125rem; color: var(--text-muted); font-family: var(--font-mono); }
.shot-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--space-1); margin-top: var(--space-1); }
.shot-thumb { padding: 0; border: 1px solid var(--border); border-radius: var(--radius-1, 8px); overflow: hidden; background: var(--surface-2); cursor: pointer; opacity: 0.6; transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease); }
.shot-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.shot-thumb:hover, .shot-thumb.is-active { opacity: 1; }
.shot-thumb.is-active { border-color: var(--accent); }

/* hero code card: tucked behind the photo, top-left */
.portrait .portrait-inner { z-index: 1; }
.hero-code { z-index: 0; top: -14%; left: -44%; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -14%; left: -26%; } }
.hero-code { top: -16%; left: -56%; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -17%; left: -44%; } }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -21%; left: -40%; width: 256px; } }
.dialog-logo img { height: 32px; }

.dialog-logo.plate { display: inline-block; background: #fff; padding: var(--space-1) var(--space-2); border-radius: var(--radius-1, 8px); }
.dialog-logo.plate img { height: 32px; }
:root[data-theme='light'] .dialog-logo.plate .logo-on-dark { display: none; }
.shot-thumbs { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
dialog.project-dialog { width: min(1120px, calc(100% - 32px)); }
.hero-code { top: -27%; left: -66%; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -23%; left: -50%; } }
.hero-code { left: -60%; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -17%; left: -46%; } }
.hero-code { width: clamp(188px, 17vw, 236px); font-size: 0.64rem; top: -24%; left: -58%; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { width: 204px; font-size: 0.6rem; top: -16%; left: -42%; } }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { left: -54%; top: -15%; } }
.hero-code { top: -19%; margin-top: 5px; }
@media (min-width: 600px) and (max-width: 959px) { .hero-code { top: -10%; margin-top: 5px; } }

/* project card visual: number (1) < project image (2) < code window (3) */
.ghost-index { z-index: 1; }
.visual-bg { position: absolute; z-index: 2; inset: var(--space-3) var(--space-3) var(--space-3) var(--space-3); width: calc(100% - 2 * var(--space-3)); height: calc(100% - 2 * var(--space-3)); object-fit: cover; object-position: left top; border-radius: var(--radius-2); opacity: 0.3; pointer-events: none; -webkit-mask-image: linear-gradient(to left, #000 20%, transparent 100%); mask-image: linear-gradient(to left, #000 20%, transparent 100%); }
.mock { z-index: 3; }
dialog.project-dialog { width: min(1440px, calc(100% - 32px)); }

/* project card visual: logo (2) sits above the big number (1) and under the code window (3) */
.visual-bg { display: none; }
.visual-logo { position: absolute; z-index: 2; top: 12%; left: 50%; transform: translateX(-50%); display: block; pointer-events: none; }
.visual-logo img { display: none; height: clamp(40px, 6vw, 72px); width: auto; max-width: 70vw; }
.visual-logo .logo-on-dark { display: block; }
:root[data-theme='light'] .visual-logo .logo-on-dark { display: none; }
:root[data-theme='light'] .visual-logo .logo-on-light { display: block; }
.visual-logo.plate { background: #fff; padding: var(--space-1) var(--space-2); border-radius: var(--radius-2); box-shadow: var(--shadow-lg); }
:root[data-theme='light'] .visual-logo.plate .logo-on-dark { display: none; }
.sk-subgroup h4 { font-size: 0.9375rem; letter-spacing: 0.06em; margin-bottom: var(--space-1); }

/* project logo on the compact Projects cards */
.allp-logo { display: inline-flex; align-self: flex-start; align-items: center; margin-top: var(--space-1); pointer-events: none; }
.allp-logo img { display: none; height: 28px; width: auto; max-width: 100%; }
.allp-logo .logo-on-dark { display: block; }
:root[data-theme='light'] .allp-logo .logo-on-dark { display: none; }
:root[data-theme='light'] .allp-logo .logo-on-light { display: block; }
.allp-logo.plate { background: #fff; padding: 4px var(--space-1); border-radius: 8px; }
:root[data-theme='light'] .allp-logo.plate .logo-on-dark { display: none; }

/* Holotrak-style cover: number (1) < cover image (2) < code window (3) */
.visual-bg { display: block; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; border-radius: 0; opacity: 0.9; -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 35%); mask-image: linear-gradient(to right, transparent 0%, #000 35%); }

/* cards with a cover image: number sits on top of the image */
.stack-visual.has-cover .ghost-index { z-index: 4; color: #fff; opacity: 0.3; text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35); }
.stack-visual.has-cover .ghost-index { top: var(--space-1); }

/* portrait screens in the project gallery */
.shot-main.is-portrait { aspect-ratio: auto; height: min(70vh, 640px); object-fit: contain; background: var(--surface-2); }
.nav-links a, .mobile-menu a { font-weight: 700; }
@media (min-width: 960px) and (max-width: 1119px) {
  .nav-links a { padding: var(--space-1) 6px; font-size: 0.8125rem; gap: 4px; }
  .nav-links a::after { left: 6px; right: 6px; }
  .hero-code { left: -26%; top: -20%; width: 176px; font-size: 0.58rem; }
}
/* project card visual: full, sharp cover image (no fade, no veil); number stays on top */
.visual-bg { opacity: 1; -webkit-mask-image: none; mask-image: none; image-rendering: auto; }
.stack-visual { padding: 0; }

/* contact form status */
.cform { position: relative; }
.cf-status { min-height: 0; margin-top: var(--space-1); font-size: 0.875rem; }
.cf-status:empty { display: none; }
.cf-status.is-ok { color: #1f9d6b; }
.cf-status.is-err { color: #e5484d; }
.cf-status a { color: var(--accent); text-decoration: underline; cursor: pointer; }
.btn[disabled] { opacity: 0.7; cursor: progress; }

/* cookie consent */
.consent { position: fixed; left: var(--space-2); right: var(--space-2); bottom: var(--space-2); z-index: 200; max-width: 480px; display: grid; gap: var(--space-2); padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-2); background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.consent.is-open { opacity: 1; transform: translateY(0); }
.consent-text { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--text-muted); }
.consent-actions { display: flex; gap: var(--space-1); justify-content: flex-end; }
.consent-link { margin-left: auto; padding: var(--space-1); background: none; border: 0; color: var(--text-muted); font: inherit; font-size: 0.8125rem; text-decoration: underline; cursor: pointer; }
.consent-link:hover, .consent-link:focus-visible { color: var(--accent); }
.footer-inner { flex-wrap: wrap; }
@media (min-width: 768px) { .consent { right: auto; left: var(--space-3); bottom: var(--space-3); } }
@media (prefers-reduced-motion: reduce) { .consent { transition: none; } }
