/* ============================================================
   George Vogas — portfolio
   Light editorial system on baby-blue tinted paper, navy ink, and a
   royal blue / sky / cyan accent palette. Color-coded project cards.
   DM Serif Display / DM Sans / DM Mono.
   ============================================================ */

:root {
  color-scheme: light;

  /* Type */
  --serif: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* Surfaces — baby-blue paper */
  --bg: #f4f8fc;
  --bg-alt: #e9f1f9;
  --surface: #ffffff;
  --surface-2: #f1f6fb;

  /* Ink + text — navy */
  --ink: #0b1f3a;
  --text: #20334d;
  --muted: #415873;
  --faint: #526780;

  /* Hairlines */
  --line: #dbe6f1;
  --line-strong: #c3d3e3;

  /* Accent — royal blue */
  --accent: #1a56db;
  --accent-strong: #0b2a5b;
  --accent-deep: #071b3d;
  --accent-soft: rgba(26, 86, 219, 0.09);
  --accent-line: rgba(26, 86, 219, 0.28);

  /* Secondary — sky blue */
  --violet: #0369a1;
  --violet-deep: #075985;
  --violet-soft: rgba(56, 189, 248, 0.14);

  /* Tertiary — cyan */
  --cyan: #0e7490;
  --cyan-soft: rgba(34, 211, 238, 0.14);

  /* Tag colours */
  --tag-production:  #0b2a5b;  --tag-production-bg:  rgba(26, 86, 219, 0.10);
  --tag-commissioned:#0b2a5b;  --tag-commissioned-bg:rgba(26, 86, 219, 0.10);
  --tag-deployed:    #0369a1;  --tag-deployed-bg:    rgba(56, 189, 248, 0.16);
  --tag-team:        #0369a1;  --tag-team-bg:        rgba(56, 189, 248, 0.16);
  --tag-hackathon:   #0e7490;  --tag-hackathon-bg:   rgba(34, 211, 238, 0.14);
  --tag-academic:    #415873;  --tag-academic-bg:    rgba(93, 113, 137, 0.10);
  --tag-contributor: #0b2a5b;  --tag-contributor-bg: rgba(26, 86, 219, 0.10);

  /* Buttons — accent surfaces that carry white text in both themes */
  --accent-btn: #1a56db;
  --accent-btn-hover: #0b2a5b;

  /* Theme-swapped surfaces that can't route through the vars above */
  --nav-glass: rgba(244, 248, 252, 0.82);
  --nav-glass-solid: rgba(244, 248, 252, 0.97);
  --card-mix-base: #ffffff;
  --card-pill-bg: #ffffff;
  --dot-field: rgba(11, 31, 58, 0.08);
  --selection-bg: rgba(26, 86, 219, 0.18);
  --tooltip-bg: #0b1f3a;
  --tooltip-fg: #f4f8fc;

  /* Contribution heatmap ramp */
  --heat-0: #e1ecf7;
  --heat-1: #bfdcf5;
  --heat-2: #7fbcf0;
  --heat-3: #3b82f6;
  --heat-4: #1e40af;

  /* Skill-sphere wireframe line colour (r, g, b) */
  --sphere-wire: 56, 189, 248;

  /* Geometry */
  --radius: 8px;
  --radius-lg: 14px;
  --nav-h: 64px;
  --font-sm: 0.875rem;

  --shadow-card: 0 18px 40px -28px rgba(11, 31, 58, 0.30);
  --shadow-lift: 0 26px 55px -30px rgba(11, 31, 58, 0.36);

  --transition: 0.18s ease;
  --transition-slow: 0.35s ease;
}

/* ===== Dark theme =====
   Same editorial system on a navy night surface. Accents shift
   lighter so text-level uses keep AA contrast; buttons keep their own
   saturated surface via --accent-btn. */
[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0b1220;
  --bg-alt: #0f172a;
  --surface: #141e33;
  --surface-2: #1b2740;

  --ink: #f1f6ff;
  --text: #dce6f5;
  --muted: #b7c7df;
  --faint: #a3b5d0;

  --line: #22304a;
  --line-strong: #33456a;

  --accent: #8ec5ff;
  --accent-strong: #b6dbff;
  --accent-deep: #d6eaff;
  --accent-soft: rgba(142, 197, 255, 0.14);
  --accent-line: rgba(142, 197, 255, 0.42);

  --violet: #5fd4ff;
  --violet-deep: #a5e8ff;
  --violet-soft: rgba(95, 212, 255, 0.14);

  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.14);

  --tag-production:  #b6dbff;  --tag-production-bg:  rgba(142, 197, 255, 0.18);
  --tag-commissioned:#b6dbff;  --tag-commissioned-bg:rgba(142, 197, 255, 0.18);
  --tag-deployed:    #5fd4ff;  --tag-deployed-bg:    rgba(95, 212, 255, 0.14);
  --tag-team:        #5fd4ff;  --tag-team-bg:        rgba(95, 212, 255, 0.14);
  --tag-hackathon:   #22d3ee;  --tag-hackathon-bg:   rgba(34, 211, 238, 0.14);
  --tag-academic:    #a3b3cc;  --tag-academic-bg:    rgba(163, 179, 204, 0.14);
  --tag-contributor: #b6dbff;  --tag-contributor-bg: rgba(142, 197, 255, 0.18);

  --accent-btn: #2563eb;
  --accent-btn-hover: #3b82f6;

  --nav-glass: rgba(11, 18, 32, 0.82);
  --nav-glass-solid: rgba(11, 18, 32, 0.97);
  --card-mix-base: #141e33;
  --card-pill-bg: #0f172a;
  --dot-field: rgba(241, 246, 255, 0.07);
  --selection-bg: rgba(142, 197, 255, 0.35);
  --tooltip-bg: #f1f6ff;
  --tooltip-fg: #0b1220;

  --heat-0: #172238;
  --heat-1: #1f3a6b;
  --heat-2: #2f66c4;
  --heat-3: #5aa9ff;
  --heat-4: #b6dbff;

  --sphere-wire: 95, 212, 255;

  --shadow-card: 0 18px 40px -28px rgba(2, 8, 20, 0.7);
  --shadow-lift: 0 26px 55px -30px rgba(2, 8, 20, 0.8);
}

/* Dark surfaces get a hairline top highlight so cards read as raised
   rather than merely lighter. */
[data-theme="dark"] .card,
[data-theme="dark"] .hero__card,
[data-theme="dark"] .about__callout {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-card);
}
[data-theme="dark"] .study__icon { background: color-mix(in srgb, var(--tint, var(--accent)) 18%, transparent); }

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

::selection { background: var(--selection-bg); color: var(--ink); }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}

/* ===== Focus ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ===== Skip link ===== */
.skip-link {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 9999;
  background: var(--accent-btn);
  color: #fff;
  font-family: var(--mono);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius);
  transform: translateY(-150%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

/* ===== Progress bar ===== */
#progress-bar {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  z-index: 200;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.1s linear;
  pointer-events: none;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===== Scroll reveal ===== */
/* Uses the independent `translate` property so an element's own
   transform (hover lift, the callout's tilt) is left alone. Only applied
   once the boot script has confirmed JS is running. */
.js .reveal {
  opacity: 0;
  translate: 0 26px;
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              translate 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform var(--transition-slow),
              border-color var(--transition-slow),
              box-shadow var(--transition-slow);
}
.js .reveal.visible { opacity: 1; translate: none; }

/* ===== Navigation ===== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(244, 248, 252, 0);
  backdrop-filter: blur(0px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.scrolled {
  background: var(--nav-glass);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}
.nav__logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -0.01em;
  background: linear-gradient(115deg, var(--accent), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity var(--transition);
}
.nav__logo:hover { opacity: 0.75; }
.nav__links { display: flex; align-items: center; gap: 2px; }
.nav__links a {
  position: relative;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: transform var(--transition);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a.active { color: var(--ink); }
.nav__links a.active::after { transform: translateX(-50%) scaleX(1); }
.nav__links a.nav__cta {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid var(--accent-line);
  margin-left: 8px;
}
.nav__links a.nav__cta:hover {
  background: var(--accent-btn);
  color: #fff;
  border-color: var(--accent-btn);
}
.nav__links a.nav__cta::after { display: none; }

.nav__right { display: flex; align-items: center; gap: 6px; }

.nav__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition),
              border-color var(--transition);
}
.nav__theme:hover { color: var(--ink); background: var(--accent-soft); }
.nav__theme svg { width: 17px; height: 17px; }
.nav__theme-sun { display: none; }
[data-theme="dark"] .nav__theme-moon { display: none; }
[data-theme="dark"] .nav__theme-sun { display: block; }

.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.nav__hamburger:hover { background: var(--accent-soft); }
.nav__hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav__hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Sections ===== */
.section { padding: 104px 0; }
.section--alt { background: var(--bg-alt); }

.section__head { margin-bottom: 44px; }
.section__title {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section__lede {
  margin-top: 12px;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

/* Native hero card shares the page's typography and theme colours. */
.hero__content.hero__content--banner { grid-template-columns: minmax(0, 1fr); gap: 30px; }
.hero__intro-card { border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); overflow: hidden; }
.hero__intro-main { display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 32px; padding: clamp(26px, 5vw, 56px); }
.hero__intro-label { font: .7rem/1.6 var(--mono); color: var(--muted); }
.hero__intro-label span { color: var(--faint); margin: 0 10px; }
.hero__intro-title { margin: 22px 0 20px; font: clamp(2.8rem, 6.5vw, 5.5rem)/1.02 var(--serif); letter-spacing: -.045em; color: var(--ink); }
.hero__intro-title em { color: var(--accent); font-weight: inherit; }
.hero__intro-motto { margin-bottom: 14px; font: 1.5rem/1.3 var(--serif); color: var(--ink); }
.hero__intro-description { color: var(--muted); font-size: 1rem; line-height: 1.7; }
.hero__circuit { display: block; width: 100%; max-width: 320px; justify-self: center; color: var(--accent); opacity: .5; }
.hero__intro-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 24px; padding: 18px clamp(26px, 5vw, 56px); border-top: 1px solid var(--line); color: var(--muted); font: .68rem/1.6 var(--mono); }
.hero__content--banner .hero__copy { text-align: left; max-width: 760px; }
.hero__content--banner .hero__eyebrow { font: 500 .95rem/1.7 var(--sans); color: var(--ink); letter-spacing: 0; text-transform: none; margin-bottom: 12px; }
.hero__content--banner .hero__tagline { max-width: 720px; color: var(--text); }
.hero__content--banner .hero__stats, .hero__content--banner .hero__links { justify-content: flex-start; }
@media (max-width: 640px) {
  .hero__intro-main { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero__circuit { display: none; }
  .hero__intro-label { font-size: .65rem; }
  .hero__intro-label span { margin: 0 4px; }
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(88vh, 860px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 72px + env(safe-area-inset-top, 0px)) 28px 96px;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 48% at 22% -6%, var(--accent-soft) 0%, transparent 62%),
    radial-gradient(ellipse 44% 38% at 88% 74%, var(--violet-soft) 0%, transparent 60%),
    radial-gradient(ellipse 34% 28% at 8% 64%, var(--cyan-soft) 0%, transparent 64%);
}
/* Blueprint dot field — technical, quiet. */
.hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot-field) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 64% at 28% 44%, #000 0%, transparent 74%);
  -webkit-mask-image: radial-gradient(ellipse 70% 64% at 28% 44%, #000 0%, transparent 74%);
}
.hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr);
  gap: 48px 72px;
  align-items: center;
}
.hero__copy { min-width: 0; }

/* Index card: a paper note pinned beside the intro. Same stock as the
   About callout so the two read as one system. */
.hero__card {
  position: relative;
  justify-self: end;
  width: min(100%, 380px);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 22px 24px 20px;
  box-shadow: var(--shadow-lift);
  transform: rotate(1.4deg);
  animation: heroCard 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}
.hero__card::before {
  /* Ruled margin line, like an index card. */
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 58px;
  height: 1px;
  background: var(--accent-line);
  opacity: 0.6;
}
.hero__card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}
.hero__card-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.hero__card-stamp {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 3px 10px;
}
.hero__card-list { display: flex; flex-direction: column; gap: 12px; }
.hero__card-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.hero__card-row:last-child { border-bottom: 0; padding-bottom: 0; }
.hero__card-row dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.hero__card-row dd {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.45;
}
.hero__card-clock {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.hero__card-clock:empty { display: none; }
.hero__card-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  margin-right: 8px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px var(--cyan-soft);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 3px var(--cyan-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
/* A tiny skyline at the foot of the card, a nod to the repo city below. */
.hero__card-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 46px;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.hero__card-bars span {
  flex: 1;
  height: calc(var(--h) * 34px);
  background: linear-gradient(to top, var(--heat-2), var(--heat-4));
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
  transform-origin: bottom;
  animation: barUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.hero__card-bars span:nth-child(odd) { animation-delay: 0.9s; }
.hero__card-bars span:nth-child(even) { animation-delay: 1.05s; }
.hero__card-bars span:nth-child(3n) { animation-delay: 1.2s; }
@keyframes barUp { from { transform: scaleY(0); } to { transform: none; } }
@keyframes heroCard {
  from { opacity: 0; transform: translateY(26px) rotate(3deg); }
  to { opacity: 1; transform: rotate(1.4deg); }
}

.hero__eyebrow {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 26px;
  animation: heroUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both;
}
.hero__name {
  font-size: clamp(3rem, 6.6vw, 5.2rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 26px;
  animation: heroUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.18s both;
}
.hero__name-accent {
  font-style: italic;
  color: var(--accent);
  position: relative;
  display: inline-block;
}
/* Drawn by hand, so it does not quite line up with the baseline. */
.hero__underline {
  position: absolute;
  left: -1%;
  right: -3%;
  bottom: -0.06em;
  width: 104%;
  height: 0.16em;
  color: var(--violet);
  opacity: 0.75;
  overflow: visible;
}
.hero__tagline {
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: var(--muted);
  max-width: 580px;
  margin: 0 0 34px;
  line-height: 1.8;
  animation: heroUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}
.hero__stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 4px;
  margin-bottom: 40px;
  font-family: var(--mono);
  animation: heroUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.42s both;
}
.hero__stats span { font-size: var(--font-sm); color: var(--faint); }
.hero__stats strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.hero__stats .github-stats__value {
  font-family: var(--mono);
  font-size: inherit;
  font-weight: 600;
  color: var(--ink);
}
.hero__stats .github-stats__shimmer {
  min-width: 2.4ch;
  border-radius: 4px;
  padding: 0 2px;
  vertical-align: baseline;
}
.hero__stats-sep { color: var(--line-strong); padding: 0 6px; }

.hero__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: heroUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.54s both;
}
@keyframes heroUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition),
              box-shadow var(--transition);
  user-select: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.99); }

.btn--primary { background: var(--accent-btn); color: #fff; border-color: var(--accent-btn); }
.btn--primary:hover {
  background: var(--accent-btn-hover);
  border-color: var(--accent-btn-hover);
  box-shadow: 0 12px 26px -14px rgba(11, 42, 91, 0.7);
}
.btn--secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn--secondary:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  box-shadow: 0 12px 26px -16px rgba(26, 86, 219, 0.45);
}

/* ===== About ===== */
.about__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: start;
}
.about__text p {
  color: var(--text);
  margin-bottom: 20px;
  font-size: 1.08rem;
  line-height: 1.8;
}
.about__text p:last-child { margin-bottom: 0; }
.about__text strong { color: var(--ink); font-weight: 600; }

.about__callout {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 28px 28px 30px;
  box-shadow: 0 10px 26px -22px rgba(11, 31, 58, 0.5);
  transform: rotate(-0.7deg);
  margin-top: 6px;
}
.about__callout-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.about__callout-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.about__callout-label { color: var(--muted); letter-spacing: 0.12em; }
.about__callout-list { display: flex; flex-direction: column; gap: 15px; }
.about__callout-list li {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 500;
  padding-left: 24px;
  position: relative;
  line-height: 1.5;
}
.about__callout-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.62em;
  width: 11px; height: 2px;
  background: var(--violet);
  border-radius: 2px;
}
.about__callout-list--links a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: color var(--transition);
}
.about__callout-list--links a:hover { color: var(--accent-strong); }
.about__callout-list--links li:hover::before { background: var(--accent); width: 16px; }
.about__callout-list li::before { transition: width var(--transition), background var(--transition); }
.about__callout-note {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ===== Projects — color-coded cards ===== */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  --tint: var(--card-tint, var(--accent));
  position: relative;
  background: color-mix(in srgb, var(--tint) 6%, var(--card-mix-base));
  border: 1px solid color-mix(in srgb, var(--tint) 22%, var(--line));
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: border-color var(--transition-slow), transform var(--transition-slow),
              box-shadow var(--transition-slow);
}
/* Only the featured project gets the coloured rule. */
.card--featured::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tint);
}
.card:hover {
  border-color: color-mix(in srgb, var(--tint) 58%, var(--line-strong));
  transform: translateY(-4px);
  box-shadow: 0 24px 46px -28px color-mix(in srgb, var(--tint) 60%, transparent);
}

.card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 0.92fr 1.42fr;
  gap: 38px;
  align-items: start;
}
.card__aside { display: flex; flex-direction: column; gap: 16px; }
.card__body { display: flex; flex-direction: column; gap: 16px; }

.card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 5px;
}
.tag--production   { color: var(--tag-production);   background: var(--tag-production-bg); }
.tag--commissioned { color: var(--tag-commissioned); background: var(--tag-commissioned-bg); }
.tag--hackathon    { color: var(--tag-hackathon);    background: var(--tag-hackathon-bg); }
.tag--team         { color: var(--tag-team);         background: var(--tag-team-bg); }
.tag--academic     { color: var(--tag-academic);     background: var(--tag-academic-bg); }
.tag--contributor,
.tag--solo         { color: var(--tag-contributor);  background: var(--tag-contributor-bg); }
.tag--deployed     { color: var(--tag-deployed);     background: var(--tag-deployed-bg); }

.card__link--private { cursor: default; display: inline-flex; align-items: center; gap: 4px; }
.card__link {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted);
  transition: color var(--transition);
  white-space: nowrap;
}
.card__link:hover { color: var(--accent-strong); }
.card__links-multi { display: flex; gap: 14px; }

.card__title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; }
.card--featured .card__title { font-size: 2rem; }

.card__desc { font-size: 0.95rem; color: var(--text); line-height: 1.7; }
.card--featured .card__desc { font-size: 1.05rem; }

.card__bullets { display: flex; flex-direction: column; gap: 9px; }
.card--featured .card__bullets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 28px;
}
.card__bullets li {
  font-size: 0.86rem;
  color: var(--text);
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}
.card__bullets li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.6em;
  width: 9px; height: 2px;
  background: color-mix(in srgb, var(--tint) 64%, var(--ink));
  border-radius: 2px;
}
.card__arch {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--tint) 28%, var(--line));
  line-height: 1.6;
}
.card__arch strong { color: var(--ink); font-weight: 600; }

.card__stack { display: flex; flex-wrap: wrap; gap: 6px; }
/* Project tech chips read as crisp white on the tinted card. */
.card__stack .pill {
  background: var(--card-pill-bg);
  color: var(--text);
  border-color: color-mix(in srgb, var(--tint) 26%, var(--line-strong));
}

/* Project gallery */
.projects__heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.projects__heading .section__title em { color: var(--accent); }
.projects__heading .section__lede { margin: 0; line-height: 1.8; }
/* Cards in a row share a height while every "Inside the build" is closed;
   once one opens, each card falls back to its own content height. */
#projects .projects__grid { gap: 24px; }
#projects .projects__grid:has(.project__details[open]) { align-items: start; }
#projects .card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; padding: 30px; gap: 20px; box-shadow: 0 8px 30px -24px var(--ink); }
#projects .card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow-card); }
#projects .card__meta { width: 100%; justify-content: space-between; }
#projects .card__title { font-size: clamp(1.5rem, 2.5vw, 1.9rem); line-height: 1.15; }
#projects .card__stack { gap: 5px 8px; }
#projects .card__stack .pill { padding: 2px 0; background: transparent; border: 0; color: var(--muted); font-size: .66rem; border-radius: 0; }
#projects .card__stack .pill:not(:last-child)::after { content: '/'; margin-left: 8px; opacity: .5; }
/* On the half-width cards the stack line and the toggle sit at the card foot. */
#projects .card > .card__stack { margin-top: auto; }
#projects .card__desc { line-height: 1.8; }
.project__details { border-top: 1px solid var(--line); padding-top: 16px; }
.project__details summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 32px; cursor: pointer; list-style: none; color: var(--ink); font: .72rem var(--mono); }
.project__details summary::-webkit-details-marker { display: none; }
.project__details summary span { font: 1.35rem var(--sans); transition: transform var(--transition); }
.project__details[open] summary span { transform: rotate(45deg); }
.project__details[open] summary { margin-bottom: 18px; }
.project__details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 3px; }
.project__details .card__arch { margin-top: 18px; }
.project__details .card__arch + .card__arch { margin-top: 8px; padding-top: 0; border-top: 0; }
#projects .card--featured { padding: 36px; grid-template-columns: .85fr 1.3fr; gap: 26px 48px; background: linear-gradient(120deg, var(--surface), var(--surface-2)); }
#projects .card--featured::before { height: 4px; background: var(--accent); }
#projects .card--featured .card__aside { gap: 24px; }
#projects .card--featured .card__title { font-size: clamp(2rem, 4vw, 2.9rem); max-width: 260px; }
#projects .card--featured .card__meta { align-items: start; flex-direction: column; gap: 20px; }
#projects .card--featured .card__link { color: var(--accent); }
#projects .card--featured .card__desc { font-size: .98rem; }
#projects .card--featured .card__bullets { grid-template-columns: 1fr; }
/* Wide: the closing full-width card, on the featured card's column lines. */
#projects .card--wide { grid-column: 1 / -1; display: grid; grid-template-columns: .85fr 1.3fr; gap: 26px 48px; align-items: start; padding: 30px 36px; }
#projects .card--wide .card__aside { gap: 20px; }
@media (max-width: 900px) {
  #projects .projects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #projects .card { padding: 24px; }
  #projects .card--featured, #projects .card--wide { grid-template-columns: 1fr 1.2fr; gap: 24px; }
  #projects .card--wide { padding: 24px; }
}
@media (max-width: 760px) {
  #projects .projects__grid { grid-template-columns: 1fr; gap: 18px; }
  #projects .card--featured, #projects .card--wide { display: flex; flex-direction: column; gap: 22px; }
  #projects .card--featured .card__title { max-width: none; }
  #projects .card--featured .card__meta { flex-direction: row; align-items: center; }
}
@media (max-width: 640px) {
  .projects__heading { display: block; }
  .projects__heading .section__lede { margin-top: 18px; }
  #projects .card, #projects .card--featured, #projects .card--wide { padding: 24px 20px; }
}

/* A quieter night palette, with depth from dark shadows and soft edges. */
[data-theme="dark"] #projects {
  --ink: #eaf0f8;
  --text: #b9c5d6;
  --muted: #95a5ba;
  --line: #293447;
  --line-strong: #344258;
  --accent: #a4c7f5;
  background: #0d1420;
}
[data-theme="dark"] #projects .card {
  background: linear-gradient(155deg, #1a2433, #151e2c);
  border-color: #2b3749;
  box-shadow: inset 0 1px 0 #ffffff06, 0 12px 28px -16px #00000080;
}
[data-theme="dark"] #projects .card:hover,
[data-theme="dark"] #projects .card:focus-within {
  border-color: #506683;
  box-shadow: inset 0 1px 0 #ffffff09, 0 18px 38px -18px #000000b3;
}
[data-theme="dark"] #projects .card--featured {
  background: radial-gradient(ellipse at 100% 0%, #263b56 0%, transparent 65%), #182332;
  border-color: #3c506b;
}
[data-theme="dark"] #projects .card--featured::before {
  height: 2px;
  background: linear-gradient(90deg, #6b93c6, #aacdf6 55%, #506883);
}
[data-theme="dark"] #projects .tag {
  border: 1px solid #ffffff0d;
  font-weight: 500;
  letter-spacing: .045em;
}
[data-theme="dark"] #projects .tag--production,
[data-theme="dark"] #projects .tag--deployed {
  color: #a6d9c9;
  background: #a6d9c910;
  border-color: #a6d9c926;
}
[data-theme="dark"] #projects .tag--commissioned,
[data-theme="dark"] #projects .tag--contributor,
[data-theme="dark"] #projects .tag--solo,
[data-theme="dark"] #projects .tag--team {
  color: #b1c9e9;
  background: #b1c9e90c;
}
[data-theme="dark"] #projects .tag--hackathon {
  color: #c9b8eb;
  background: #c9b8eb10;
}
[data-theme="dark"] #projects .tag--academic {
  color: #adb9cb;
  background: #adb9cb0c;
}
[data-theme="dark"] #projects .card__link { color: #a4c7f5; }
[data-theme="dark"] #projects .card__link:hover { color: #d9e9ff; }
[data-theme="dark"] #projects .project__details summary { color: #c0d2e9; }
[data-theme="dark"] #projects .project__details summary:hover { color: #edf4ff; }
[data-theme="dark"] #projects .project__details summary span { color: #91accd; }
[data-theme="dark"] #projects .card__bullets li::before { background: #819ab9; }

/* ===== Pills ===== */
.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line-strong);
  letter-spacing: 0.01em;
}

/* ===== Tech stack ===== */
/* Skills tech sphere — a CSS-3D tag cloud built from the pills below.
   The stage stays hidden until skill-sphere.js flips #skill-sphere.is-live;
   until then (and under reduced motion / no JS) the .sphere__fallback grid
   is the section. */
.sphere__stage { display: none; }
.sphere__subtitle {
  font-size: 0.96rem;
  color: var(--muted);
  margin-top: -40px;
  margin-bottom: 16px;
  max-width: 600px;
}
.sphere.is-live .sphere__stage {
  display: block;
  position: relative;
  width: min(840px, 100%);
  aspect-ratio: 1 / 1;
  margin: 8px auto 0;
  touch-action: pan-y;
  cursor: grab;
}
.sphere.is-live .sphere__stage.is-grabbing { cursor: grabbing; }
/* Soft glow pooled at the centre of the globe, behind the wireframe + icons. */
.sphere.is-live .sphere__stage::before {
  content: '';
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%,
              color-mix(in srgb, var(--accent) 12%, transparent),
              transparent 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 0 0 65px color-mix(in srgb, var(--accent) 5%, transparent),
              0 0 80px color-mix(in srgb, var(--accent) 4%, transparent);
  pointer-events: none;
}
/* Rotating wireframe globe (drawn by skill-sphere.js), sits under the icons. */
.sphere__wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* When the sphere is live it carries the visuals (and is aria-hidden), so the
   pill grid is hidden from sight but kept in the a11y tree / DOM for screen
   readers, copy-paste and SEO. */
.sphere.is-live .sphere__fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.sphere__tag {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: max-content;
  min-width: 68px;
  padding: 10px 9px 8px;
  user-select: none;
  will-change: transform, opacity;
  color: color-mix(in srgb,
          var(--brand, var(--accent)) calc(var(--depth, 0) * 100%), var(--faint));
  transition: color 120ms ease;
}
.sphere__tag iconify-icon {
  font-size: 2.05rem;
  color: inherit;
  cursor: pointer;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
              filter 200ms ease;
}
.sphere__tag:hover { --depth: 1 !important; }
.sphere__tag:hover iconify-icon {
  filter: drop-shadow(0 0 8px
          color-mix(in srgb, var(--brand, var(--accent)) 45%, transparent));
}
/* Clicked / active icon: full brand colour, label shown, brand glow + bump. */
.sphere__tag.is-active {
  --depth: 1 !important;
  opacity: 1 !important;
  z-index: 200 !important;
}
.sphere__tag.is-active iconify-icon {
  transform: scale(1.16);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--brand, var(--accent)) 70%, transparent))
          drop-shadow(0 0 24px color-mix(in srgb, var(--brand, var(--accent)) 45%, transparent));
}
.sphere__tag.is-active .sphere__label {
  opacity: 1;
  color: var(--ink);
  font-weight: 600;
}
.sphere__label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  /* Only the front-most labels read; the rest fade out quadratically. */
  opacity: calc(var(--depth, 0) * var(--depth, 0));
}

.sphere__controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 24px;
}
.sphere__controls button {
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font: 0.75rem var(--mono);
  cursor: pointer;
}
.sphere__controls button:hover,
.sphere__controls button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--accent);
}
.sphere__controls button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.sphere.is-list .sphere__stage { display: none; }
.sphere.is-list .sphere__fallback {
  position: static;
  width: auto;
  height: auto;
  margin: 24px 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
}
@media (max-width: 600px) {
  .sphere__tag { min-width: 54px; padding: 8px 6px 6px; }
}

.stack__groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.stack__group {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  transition: border-color var(--transition-slow), transform var(--transition-slow),
              box-shadow var(--transition-slow);
}
.stack__group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.9;
}
.stack__group--lang      { color: var(--accent); }
.stack__group--framework { color: var(--violet); }
.stack__group--infra     { color: var(--cyan); }
.stack__group:hover {
  border-color: var(--line-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.stack__group-header { display: flex; align-items: center; gap: 10px; }
.stack__group-title {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
}
.stack__group-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.stack__group-dot--lang      { color: var(--accent); }
.stack__group-dot--framework { color: var(--violet); }
.stack__group-dot--infra     { color: var(--cyan); }
.stack__group-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
}

.stack__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.stack__pills .pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  padding: 6px 12px;
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line-strong);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease,
              transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
              color 180ms ease, border-color 180ms ease,
              background 180ms ease, box-shadow 180ms ease;
  transition-delay: clamp(0ms, calc(var(--i, 0) * 35ms), 500ms);
  will-change: transform, opacity;
}
.stack__group.visible .stack__pills .pill { opacity: 1; transform: none; }
/* The list toggle must not depend on the entrance-animation observer. */
.sphere.is-list .stack__pills .pill {
  opacity: 1;
  transform: none;
  transition-delay: 0ms;
}
.stack__pills .pill iconify-icon {
  display: inline-block;
  width: 1em; height: 1em;
  font-size: 1.05em;
  flex-shrink: 0;
  color: var(--faint);
  transition: color 180ms ease, transform 180ms ease;
}
.stack__pills .pill:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 55%, var(--line-strong));
  background: color-mix(in srgb, var(--brand, var(--accent)) 9%, var(--surface));
  box-shadow: 0 12px 24px -16px color-mix(in srgb, var(--brand, var(--accent)) 75%, transparent);
  transform: translateY(-3px);
}
.stack__pills .pill:hover iconify-icon { color: var(--brand, var(--accent)); transform: scale(1.14); }

/* ===== Areas of study — open, numbered subject index ===== */
.study__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
  row-gap: 0;
}
.study__item {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  column-gap: 18px;
  row-gap: 10px;
  padding: 30px 0 32px;
  border-top: 1px solid var(--line-strong);
  transition: border-color var(--transition);
}
.study__item:hover {
  border-color: var(--accent);
}
.study__icon {
  display: grid;
  place-items: center;
  grid-row: 1 / 4;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--tint, var(--accent));
  font-size: 1.25rem;
}
.study__icon iconify-icon { display: block; width: 1em; height: 1em; }
.study__title {
  grid-column: 2;
  padding-right: 0;
  font: 1.5rem/1.2 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
}
.study__blurb { grid-column: 2; font-size: 0.9rem; color: var(--muted); line-height: 1.65; }
.study__skills {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 7px 14px;
  padding-top: 6px;
}
.study__skills .pill {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  color: var(--text);
  font: 0.68rem/1.7 var(--mono);
}
.study__skills .pill::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-right: 7px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--faint);
}
.study__divider {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 40px 0 22px;
}
.study__divider h3 { font: 1.65rem var(--serif); color: var(--ink); }
.study__divider p { font-size: 0.87rem; color: var(--muted); }
/* Photography: a compact editorial gallery with a native-dialog viewer. */
.photography__instagram { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.photography { border-top: 1px solid var(--line); }
.photography__heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 30px; }
.photography__eyebrow { font: .65rem var(--mono); letter-spacing: .17em; color: var(--muted); margin-bottom: 14px; }
.photography .section__title { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.1; }
.photography .section__title em { color: var(--accent); font-weight: inherit; }
.photography__intro { color: var(--muted); margin-top: 14px; font-size: .95rem; }
.photography__social { display: flex; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line-strong); font-size: .85rem; white-space: nowrap; }
.photography__social:hover { color: var(--accent); }
.photography__featured { display: grid; grid-template-columns: 1.65fr 1fr; grid-template-rows: repeat(2, 220px); gap: 14px; }
.photography__photo { position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer; text-align: left; overflow: hidden; border-radius: 8px; background: #102131; isolation: isolate; }
.photography__photo img, .photo-viewer__stage img { user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none; }
.photography__featured .photography__photo:first-child { grid-row: span 2; }
.photography__photo img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.photography__photo:hover img { transform: scale(1.035); }
.photography__caption { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; align-items: end; gap: 8px; padding: 42px 20px 17px; background: linear-gradient(transparent, #000a); color: #fff; font: .68rem var(--mono); letter-spacing: .06em; }
.photography__eyebrow { display: flex; align-items: center; gap: 18px; }
.photography__logo { display: block; width: 132px; height: 48px; object-fit: cover; border-radius: 4px; background: #000; }
.photography__eyebrow .photography__logo { width: 104px; height: 38px; border-radius: 0; filter: invert(1); mix-blend-mode: multiply; opacity: .8; }
[data-theme="dark"] .photography__eyebrow .photography__logo { filter: none; mix-blend-mode: screen; opacity: .9; }
.photography__credit { letter-spacing: 0; white-space: nowrap; opacity: .85; }
.photography__photo:focus-visible, .photography__more summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.photography__more { margin-top: 24px; }
.photography__more summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; padding: 16px 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); list-style: none; font-size: .9rem; }
.photography__more summary::-webkit-details-marker { display: none; }
.photography__count { color: var(--muted); font: .65rem var(--mono); }
.photography__count > span { display: inline-block; margin-left: 14px; font-size: 1rem; }
.photography__hide, .photography__more[open] .photography__show { display: none; }
.photography__more[open] .photography__hide { display: inline; }
.photography__more[open] .photography__count > span { transform: rotate(45deg); }
.photography__grid { columns: 3; column-gap: 14px; padding-top: 24px; }
.photography__grid .photography__photo { break-inside: avoid; margin-bottom: 14px; }
.photography__grid img { height: auto; }
.photo-viewer { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 24px 32px; border: 0; background: #080d14; color: #f5f7fa; }
.photo-viewer[open] { display: flex; flex-direction: column; }
.photo-viewer::backdrop { background: #080d14ed; }
.photo-viewer__bar, .photo-viewer__footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; font: .72rem var(--mono); letter-spacing: .05em; }
.photo-viewer button { border: 1px solid #ffffff30; border-radius: 50px; padding: 12px 18px; color: white; background: #ffffff0d; cursor: pointer; }
.photo-viewer button:hover { background: #ffffff22; }
.photo-viewer :focus-visible { outline: 2px solid #8ec5ff; outline-offset: 4px; }
.photo-viewer__stage { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 20px; flex: 1; min-height: 0; padding: 20px 0; }
.photo-viewer__stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-viewer__footer { min-height: 36px; color: #bdc9d8; }
.photo-viewer__footer a { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) {
  .photography__heading { align-items: start; flex-direction: column; gap: 12px; }
  .photography__featured { grid-template-columns: 1fr 1fr; grid-template-rows: 280px 160px; gap: 10px; }
  .photography__featured .photography__photo:first-child { grid-column: 1 / -1; grid-row: auto; }
  .photography__caption { padding: 30px 12px 12px; font-size: .6rem; }
  .photography__grid { columns: 2; column-gap: 10px; }
  .photography__grid .photography__photo { margin-bottom: 10px; }
  .photography__count { font-size: .6rem; }
  .photo-viewer { padding: 16px 12px; }
  .photo-viewer__stage { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0,1fr) auto; gap: 12px; }
  .photo-viewer__stage img { grid-column: 1 / -1; grid-row: 1; }
  .photo-viewer__stage button { justify-self: center; }
}
.study__list--personal { gap: 24px; }
.study__list--personal .study__item {
  padding: 30px;
  padding-top: 30px;
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%);
}
.study__list--personal .study__item::before { content: none; }
.study__list--personal .study__title { padding-right: 0; }
.study__item--self { --tint: var(--violet); }
.study__item--play { --tint: var(--cyan); }
.study__list--personal .study__item--play {
  background: linear-gradient(135deg, var(--cyan-soft), transparent 80%);
}
.study__item--self .study__icon { --tint: var(--violet); --tint-soft: var(--violet-soft); }
.study__item--play .study__icon { --tint: var(--cyan); --tint-soft: var(--cyan-soft); }
.study__note {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tint, var(--muted));
  position: absolute;
  top: 25px; left: 30px;
}
.study__item--self .study__note { color: var(--violet); }
.study__item--play .study__note { color: var(--cyan); }

/* Open study index with simple dividers and unboxed personal interests. */
#study .study__eyebrow { margin-bottom: 14px; color: var(--muted); font: .65rem/1.6 var(--mono); letter-spacing: .17em; }
#study .section__title { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.1; }
#study .section__title em { color: var(--accent); font-weight: inherit; }
#study .section__lede { max-width: 600px; margin-top: 14px; color: var(--text); }
#study .study__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
#study .study__item { grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 12px 16px; padding: 28px 0; border: 0; border-top: 1px solid var(--line-strong); border-radius: 0; background: transparent; }
#study .study__item:hover { border-color: var(--line-strong); }
#study .study__icon { grid-column: 1; grid-row: 1; width: 24px; height: 30px; border-radius: 0; color: var(--accent); background: transparent; font-size: 1.2rem; }
#study .study__title { grid-column: 2; font-size: 1.4rem; line-height: 1.25; }
#study .study__blurb { grid-column: 2; color: var(--text); font-size: .92rem; line-height: 1.75; }
#study .study__skills { grid-column: 2; gap: 6px 14px; padding-top: 4px; margin-top: 0; border: 0; }
#study .study__skills .pill { font-size: .68rem; color: var(--muted); }
#study .study__skills .pill::before { content: none; }
#study .study__skills a.pill { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
#study .study__divider { margin: 48px 0 22px; }
#study .study__divider h3 { font-size: 1.8rem; }
#study .study__list--personal { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
#study .study__list--personal .study__item { background: transparent; }
@media (max-width: 1000px) {
  #study .study__list { column-gap: 28px; }
  #study .study__list--personal { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 640px) {
  #study .study__list { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #study .study__item { padding: 24px 0; }
}

/* Interactive study explorer; the plain subject list is the no-script fallback. */
.study-explorer { display: grid; grid-template-columns: minmax(240px, .85fr) minmax(0, 1.6fr); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.study-explorer__tabs { display: flex; flex-direction: column; padding: 22px 28px 22px 0; gap: 4px; }
.study-explorer__tabs button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--text); text-align: left; font: 500 .95rem/1.4 var(--sans); cursor: pointer; }
.study-explorer__tabs button:hover { color: var(--accent); background: var(--accent-soft); }
.study-explorer__tabs button[aria-selected="true"] { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.study-explorer__stage { position: relative; display: grid; align-items: center; overflow: hidden; border-left: 1px solid var(--line-strong); padding: clamp(28px, 4vw, 52px); background: radial-gradient(ellipse at 100% 0, var(--accent-soft), transparent 65%); }
.study-explorer__panel { position: relative; min-width: 0; }
.study-explorer__panel[hidden] { display: none; }
.study-explorer__label { margin-bottom: 30px; font: .65rem/1.6 var(--mono); letter-spacing: .14em; color: var(--muted); }
#study .study-explorer__panel > .study__icon { position: absolute; right: 0; top: -8px; width: 64px; height: 64px; font-size: 3.5rem; opacity: .18; }
#study .study-explorer__panel .study__title { max-width: 440px; font-size: clamp(2rem, 3.5vw, 3.2rem); line-height: 1.12; letter-spacing: -.03em; margin-bottom: 22px; }
#study .study-explorer__panel .study__blurb { max-width: 460px; font-size: 1.05rem; line-height: 1.8; }
#study .study-explorer__panel .study__skills { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line-strong); gap: 10px 20px; }
#study .study-explorer__panel .study__skills .pill { color: var(--accent); font-size: .75rem; }
.study-explorer :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (max-width: 760px) {
  .study-explorer { grid-template-columns: minmax(0, 1fr); }
  .study-explorer__tabs { padding: 14px 0; gap: 0; }
  .study-explorer__tabs button { padding: 10px 12px; }
  .study-explorer__stage { border-left: 0; border-top: 1px solid var(--line-strong); padding: 30px 12px; min-height: 330px; }
}

/* ===== Commit skyline (dark night panel inside light page) ===== */
.city-section { background: var(--bg-alt); }
.city__heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.city__heading .section__title { margin: 0; }
.city__heading .section__title em { color: var(--accent); font-weight: inherit; }
.city__eyebrow { font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.city__dashboard { overflow: hidden; border: 1px solid #293b50; border-radius: 20px; background: #0b1422; color: #e1eaf4; box-shadow: 0 24px 64px #020b1826; }
.city__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid #ffffff12; }
.city__location { display: flex; align-items: center; gap: 10px; font: .65rem var(--mono); letter-spacing: .1em; }
.city__location > span:last-child { color: #91a6bd; }
.city__live-dot { width: 6px; height: 6px; border-radius: 50%; background: #72dfbc; box-shadow: 0 0 12px #72dfbc66; }
.city__controls { display: flex; gap: 8px; }
.city__controls button { border: 1px solid #ffffff24; border-radius: 7px; background: #ffffff05; color: #c2d1e2; padding: 8px 12px; font: .7rem var(--mono); cursor: pointer; }
.city__controls button:hover, .city__controls button[aria-pressed="true"] { border-color: #74cbbd77; color: #a1ebd8; background: #74cbbd10; }
.city__controls button:disabled { opacity: .4; cursor: wait; }
.city__dashboard :focus-visible { outline: 2px solid #a1ebd8; outline-offset: 4px; }
.city__scene-label { position: absolute; top: 28px; left: 28px; z-index: 1; pointer-events: none; }
.city__scene-label span { display: block; font: .6rem var(--mono); letter-spacing: .17em; color: #95adc3; }
.city__scene-label strong { display: block; margin-top: 8px; font: italic 1.4rem var(--serif); color: #d5e4f2; }
.city__coordinates { position: absolute; right: 24px; bottom: 23px; color: #9aafc5; font: .6rem/1.8 var(--mono); letter-spacing: .08em; pointer-events: none; }
.city__legend { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 24px; border-top: 1px solid #ffffff12; color: #a7b9cc; font: .65rem/1.6 var(--mono); }
.city__legend p { margin: 0; }
.city__legend-bars { color: #88d9c6; letter-spacing: 2px; margin-right: 10px; }
.city__directory { border-top: 1px solid #ffffff12; }
.city__directory summary { padding: 17px 24px; cursor: pointer; font-size: .8rem; color: #c9d7e6; }
.city__directory summary > span { float: right; color: #88d9c6; }
.city__repos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 24px 24px; }
.city__repos a { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #ffffff14; border-radius: 6px; color: #b9cddd; font: .7rem/1.5 var(--mono); overflow-wrap: anywhere; text-decoration: none; }
.city__repos a:hover { background: #ffffff08; color: #fff; }
.city__repo-dot { flex: 0 0 6px; height: 6px; border-radius: 50%; }
[data-theme="light"] .city__dashboard { background: #edf4f7; color: #263f50; border-color: #b7cbd5; }
[data-theme="light"] .city__toolbar,
[data-theme="light"] .city__legend,
[data-theme="light"] .city__directory { border-color: #c7d8e0; }
[data-theme="light"] .city__location > span:last-child,
[data-theme="light"] .city__legend,
[data-theme="light"] .city__directory summary,
[data-theme="light"] .city__coordinates,
[data-theme="light"] .city__scene-label span { color: #3f5d70; }
[data-theme="light"] .city__scene-label strong { color: #213f51; }
[data-theme="light"] .city__controls button,
[data-theme="light"] .city__repos a { color: #365569; border-color: #b7ccd6; background: #ffffff70; }
[data-theme="light"] .city__controls button:hover,
[data-theme="light"] .city__controls button[aria-pressed="true"],
[data-theme="light"] .city__repos a:hover { background: #d2e9e1; color: #205b4f; border-color: #8db6a8; }
[data-theme="light"] .city__touch-hint { color: #345165; background: #f0f7f1e6; border-color: #b7cbd5; }
[data-theme="light"] .city__legend-bars,
[data-theme="light"] .city__directory summary > span { color: #287361; }
[data-theme="light"] .city__dashboard :focus-visible { outline-color: #287361; }
[data-theme="light"] .city__loading,
[data-theme="light"] .city__wrap { background: #c1dce9; color: #365569; }
.city__subtitle {
  font-size: 0.96rem;
  color: var(--muted);
  margin: 0;
  max-width: 340px;
}
.city__wrap {
  position: relative;
  width: 100%;
  background: #060a12;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-card);
}
#city-canvas { display: block; width: 100%; cursor: grab; touch-action: none; }
#city-canvas:active { cursor: grabbing; }

.city__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(220, 226, 235, 0.6);
  font-family: var(--mono);
  font-size: var(--font-sm);
  background: #0a0e16;
  z-index: 2;
  transition: opacity 0.4s ease;
}
.city__loading.hidden { opacity: 0; pointer-events: none; }
.city__spinner {
  display: block;
  width: 28px; height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.city__tooltip {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 300;
  min-width: 160px;
  box-shadow: var(--shadow-lift);
}
.city__tooltip.visible { opacity: 1; transform: translateY(0); }
.city__tooltip-name {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.city__tooltip-row {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.city__tooltip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.city__touch-hint {
  display: block;
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: #afc2d6;
  background: #08111ed9;
  border: 1px solid #ffffff18;
  border-radius: 30px;
  padding: 9px 16px;
  white-space: nowrap;
  pointer-events: none;
}

/* ===== GitHub contribution graph ===== */
.github-stats__subtitle {
  font-size: 0.96rem;
  color: var(--muted);
  margin-top: -40px;
  margin-bottom: 40px;
  max-width: 600px;
}
.github-stats__subtitle a {
  color: var(--ink);
  border-bottom: 1px solid var(--line-strong);
  transition: color var(--transition), border-color var(--transition);
}
.github-stats__subtitle a:hover { color: var(--accent-strong); border-bottom-color: var(--accent-strong); }

.github-stats__value { font-variant-numeric: tabular-nums; }
.github-stats__shimmer {
  display: inline-block;
  color: transparent;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--bg-alt) 0%, var(--line) 50%, var(--bg-alt) 100%);
  background-size: 200% 100%;
  animation: github-stats-shimmer 1.4s linear infinite;
}
@keyframes github-stats-shimmer { to { background-position: -200% 0; } }
.github-stats__error {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--faint);
}

.github-graph {
  --cell-size: 12px;
  --cell-gap: 3px;
  position: relative;
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 24px 20px;
  box-shadow: var(--shadow-card);
}
.github-graph__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.github-graph__total { font-family: var(--mono); font-size: 0.85rem; color: var(--muted); }
.github-graph__total strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.github-graph__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.github-graph__tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  font-variant-numeric: tabular-nums;
}
.github-graph__tab:hover { color: var(--ink); background: var(--surface-2); }
.github-graph__tab--active,
.github-graph__tab[aria-selected="true"] {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.github-graph__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.github-graph__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.github-graph__scroll::-webkit-scrollbar { height: 6px; }
.github-graph__scroll::-webkit-scrollbar-track { background: transparent; }
.github-graph__scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.github-graph__chart {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: ".    months" "days grid";
  gap: 6px;
  min-width: max-content;
}
.github-graph__months {
  grid-area: months;
  display: grid;
  grid-template-columns: repeat(53, var(--cell-size));
  column-gap: var(--cell-gap);
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  height: 14px;
}
.github-graph__months span { grid-row: 1; white-space: nowrap; pointer-events: none; }
.github-graph__days {
  grid-area: days;
  display: grid;
  grid-template-rows: repeat(7, var(--cell-size));
  row-gap: var(--cell-gap);
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--faint);
  padding-right: 6px;
  align-content: start;
}
.github-graph__days span { line-height: var(--cell-size); height: var(--cell-size); }
.github-graph__grid {
  grid-area: grid;
  display: grid;
  grid-template-columns: repeat(53, var(--cell-size));
  grid-template-rows: repeat(7, var(--cell-size));
  gap: var(--cell-gap);
}
.github-graph__cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 2px;
  outline: 1px solid transparent;
  transition: transform 140ms ease, outline-color 140ms ease;
  cursor: default;
}
.github-graph__cell:hover,
.github-graph__cell:focus-visible {
  outline-color: var(--ink);
  transform: scale(1.25);
  z-index: 2;
  position: relative;
}
.github-graph__cell:focus { outline: none; }
/* Low → high activity ramp in the brand blue. */
.github-graph__cell[data-level="0"] { background: var(--heat-0); box-shadow: inset 0 0 0 1px var(--line); }
.github-graph__cell[data-level="1"] { background: var(--heat-1); }
.github-graph__cell[data-level="2"] { background: var(--heat-2); }
.github-graph__cell[data-level="3"] { background: var(--heat-3); }
.github-graph__cell[data-level="4"] { background: var(--heat-4); }

.github-graph__legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
}
.github-graph__legend .github-graph__cell { width: 11px; height: 11px; transform: none; cursor: default; }
.github-graph__legend-label { margin: 0 4px; }

.github-graph__tooltip {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, calc(-100% - 8px));
  background: var(--tooltip-bg);
  color: var(--tooltip-fg);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
  z-index: 5;
  box-shadow: var(--shadow-card);
}
.github-graph__tooltip[aria-hidden="false"] { opacity: 1; }

/* ===== Contact ===== */
.contact { text-align: center; position: relative; overflow: hidden; }
.contact::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 110%, var(--accent-soft) 0%, transparent 68%),
    radial-gradient(ellipse 40% 30% at 18% 14%, var(--violet-soft) 0%, transparent 60%);
  pointer-events: none;
}
.contact__inner { position: relative; max-width: 560px; margin: 0 auto; }
.contact__heading {
  font-size: clamp(2.2rem, 5.5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.contact__body {
  color: var(--muted);
  margin-bottom: 40px;
  font-size: 1.08rem;
  line-height: 1.8;
}
.contact__links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  background: var(--bg-alt);
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer__copy {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer__sep { color: var(--line-strong); }
.footer__links { display: flex; gap: 22px; }
.footer__links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  transition: color var(--transition);
}
.footer__links a:hover { color: var(--accent-strong); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .stack__groups { grid-template-columns: 1fr; gap: 14px; }
  .stack__group { padding: 20px 20px 18px; }
  .sphere.is-live .sphere__stage { width: 100%; }
  .sphere__tag iconify-icon { font-size: 1.7rem; }
  .sphere__label { font-size: 0.56rem; }
  .projects__grid { grid-template-columns: 1fr; }
  .card--featured { grid-template-columns: 1fr; gap: 22px; }
  .card--featured .card__bullets { grid-template-columns: 1fr; }
  .hero__content { grid-template-columns: 1fr; gap: 44px; }
  .hero__card { justify-self: start; transform: rotate(-0.6deg); }
  @keyframes heroCard {
    from { opacity: 0; transform: translateY(26px) rotate(-2deg); }
    to { opacity: 1; transform: rotate(-0.6deg); }
  }
  .study__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .container { padding: 0 18px; }

  .nav__hamburger { display: flex; }
  .nav__links {
    position: fixed;
    top: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
    left: 0; right: 0;
    background: var(--nav-glass-solid);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line-strong);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 12px 16px;
    transform: translateY(-110%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links li { opacity: 0; transform: translateY(-8px); transition: opacity 0.2s, transform 0.2s; }
  .nav__links.open li { opacity: 1; transform: none; }
  .nav__links.open li:nth-child(1) { transition-delay: 0.04s; }
  .nav__links.open li:nth-child(2) { transition-delay: 0.08s; }
  .nav__links.open li:nth-child(3) { transition-delay: 0.12s; }
  .nav__links.open li:nth-child(4) { transition-delay: 0.16s; }
  .nav__links.open li:nth-child(5) { transition-delay: 0.20s; }
  .nav__links a {
    padding: 13px 16px;
    font-size: 0.95rem;
    border-radius: var(--radius);
    min-height: 48px;
    display: flex;
    align-items: center;
  }
  .nav__links a::after { display: none; }
  .nav__cta { margin-left: 0; margin-top: 4px; justify-content: center; }

  .section { padding: 68px 0; }
  .section__head { margin-bottom: 36px; }

  .hero { padding: calc(var(--nav-h) + 36px + env(safe-area-inset-top, 0px)) 18px 68px; }
  .hero__tagline { font-size: 1rem; }
  .hero__stats { gap: 6px 8px; }

  .about__grid { grid-template-columns: 1fr; gap: 28px; }
  .about__callout { transform: none; }
  .about__text p { font-size: 1.02rem; }

  .card { padding: 24px 20px; }
  .card--featured .card__title { font-size: 1.6rem; }

  .stack__pills .pill { padding: 7px 13px; font-size: 0.82rem; }

  .city__wrap { min-height: 300px; }
  .city__heading { display: block; }
  .city__subtitle { font-size: var(--font-sm); margin-top: 16px; margin-bottom: 0; }
  .city__toolbar { flex-wrap: wrap; padding: 16px; }
  .city__scene-label { top: 20px; left: 18px; }
  .city__coordinates { display: none; }
  .city__touch-hint { font-size: .56rem; padding: 8px 10px; }
  .city__legend { align-items: start; flex-direction: column; padding: 16px; gap: 6px; }
  .city__repos { grid-template-columns: 1fr; padding: 0 16px 16px; }
  .city__touch-hint { display: block; }

  .github-stats__subtitle { font-size: var(--font-sm); margin-top: -26px; margin-bottom: 26px; }
  .github-graph { --cell-size: 10px; padding: 18px 16px 14px; margin-top: 20px; }
  .github-graph__days { display: none; }
  .github-graph__chart { grid-template-columns: 1fr; grid-template-areas: "months" "grid"; }

  .study__list { column-gap: 28px; }
  .study__item { padding: 24px 0; column-gap: 12px; }
  .study__title { font-size: 1.3rem; }
  .hero__card { width: 100%; transform: none; }
  .hero__card::before { display: none; }

  .btn { min-height: 44px; }

  .footer .container { flex-direction: column; text-align: center; gap: 14px; }
  .footer__links { justify-content: center; }
}

@media (max-width: 540px) {
  .container { padding: 0 16px; }

  .hero__stats-sep { display: none; }
  .hero__stats { gap: 4px 14px; }
  .hero__links .btn { flex: 1 1 auto; justify-content: center; }

  .section { padding: 58px 0; }
  .study__list { grid-template-columns: 1fr; }
  .study__list--personal .study__item { padding: 24px 20px; }
  .study__note { left: 20px; }

  .card { padding: 22px 18px; }

  .contact__links { flex-direction: column; align-items: center; }
  .contact__links .btn { width: 100%; justify-content: center; max-width: 300px; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; translate: none; }
  .nav__links li { opacity: 1 !important; transform: none !important; }
  .stack__pills .pill { opacity: 1 !important; transform: none !important; transition-delay: 0ms !important; }
}

/* Non-link "Private repo" label on client projects */
#projects .card__link--private,
#projects .card__link--private:hover,
[data-theme="dark"] #projects .card__link--private,
[data-theme="dark"] #projects .card__link--private:hover { color: var(--muted); text-decoration: none; }

/* ===== Plainer look =====
   Drops the decorative gradient glows, dot field, and italic accent words. */
.hero__bg, .hero__bg::before, .contact::before { display: none; }
.study-explorer__stage { background: none; }
#projects .card--featured { background: var(--surface); }
[data-theme="dark"] #projects .card--featured { background: #182332; }
.section__title em, .hero__intro-title em { font-style: normal; color: inherit; }
.hero__intro-main { grid-template-columns: minmax(0, 1fr); }
.hero__intro-title { margin-top: 0; }
.hero__intro-description { font-size: 1.15rem; color: var(--text); max-width: 34em; }
.hero__intro-card { border: 0; background: none; border-radius: 0; overflow: visible; }
.hero__intro-main { padding: 0; }
#projects .card--featured .card__link--private,
[data-theme="dark"] #projects .card--featured .card__link--private { color: var(--muted); }
.hero { min-height: 0; padding-bottom: 48px; }

/* ============================================================
   Motion and polish layer
   Sharper type, the hero circuit board, the sliding nav pill, card
   spotlights. Everything here is an enhancement: the page reads the
   same with animation switched off (see the reduced-motion block at
   the end).
   ============================================================ */
:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* ----- Type ----- */
.section__title {
  font-size: clamp(2.2rem, 4.8vw, 3.3rem);
  letter-spacing: -0.03em;
}
/* The same short rule that sits above the name in the README banner. */
.section__head .section__title::before {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 22px;
  background: var(--accent);
  transform-origin: left center;
  transition: transform 0.9s var(--ease-out) 0.2s;
}
.js .section__head.reveal:not(.visible) .section__title::before { transform: scaleX(0); }
.contact__heading { font-size: clamp(2.4rem, 5.4vw, 3.8rem); letter-spacing: -0.03em; }

/* ----- Progress bar ----- */
#progress-bar { height: 3px; }

/* ----- Nav: sliding pill ----- */
@media (min-width: 769px) { .nav__links { position: relative; } }
.nav__links a::after { display: none; }
.nav__links a { z-index: 1; }
.nav__pill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 32px;
  margin-top: -16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out), opacity 0.25s ease;
}
.nav__pill.is-on { opacity: 1; }
.nav__links a.active { color: var(--accent-strong); }
.nav__links a.nav__cta.active {
  background: var(--accent-btn);
  color: #fff;
  border-color: var(--accent-btn);
}
.nav__logo { transition: opacity var(--transition), transform 0.4s var(--ease-out); }
.nav__logo:hover { transform: rotate(-6deg) scale(1.08); }
.nav__theme svg { transition: transform 0.5s var(--ease-out); }
.nav__theme:hover svg { transform: rotate(35deg); }

/* Theme switch: the new theme opens out from the toggle. */
html.theme-transition::view-transition-old(root),
html.theme-transition::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.theme-transition::view-transition-new(root) {
  animation: themeReveal 0.65s cubic-bezier(0.65, 0, 0.35, 1);
}
@keyframes themeReveal {
  from { clip-path: circle(0 at var(--vt-x) var(--vt-y)); }
  to { clip-path: circle(var(--vt-r) at var(--vt-x) var(--vt-y)); }
}

/* ----- Hero ----- */
.hero {
  min-height: min(88vh, 840px);
  padding: calc(var(--nav-h) + 56px + env(safe-area-inset-top, 0px)) 0 72px;
}
.hero__content.hero__content--split {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 40px 56px;
  align-items: center;
}
.hero__intro-title {
  margin: 0 0 22px;
  font-size: clamp(3.2rem, 7.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}
/* Each word rises out of its own clipped line. */
.hero__word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.06em 0.05em 0.14em;
  margin: -0.06em -0.05em -0.14em;
}
.hero__word > span {
  display: inline-block;
  animation: heroWord 1s var(--ease-out) 0.05s both;
}
.hero__word + .hero__word > span { animation-delay: 0.16s; }
@keyframes heroWord { from { transform: translateY(112%) rotate(4deg); } to { transform: none; } }

.hero__intro-description {
  margin-bottom: 18px;
  font-size: clamp(1.1rem, 1.9vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink);
  animation: heroUp 0.8s var(--ease-out) 0.32s both;
}
.hero__content--split .hero__tagline {
  max-width: 34em;
  font-size: 1.04rem;
  color: var(--muted);
  animation-delay: 0.44s;
}
.hero__content--split .hero__stats { gap: 8px 0; animation-delay: 0.56s; }
.hero__content--split .hero__links { animation-delay: 0.68s; }
.hero__stats [data-stat]:not([hidden]) ~ [data-stat]:not([hidden])::before {
  content: '·';
  padding: 0 12px;
  color: var(--line-strong);
}

/* ----- Hero circuit board ----- */
.hero__visual { min-width: 0; perspective: 900px; }
.circuit {
  --px: 0;
  --py: 0;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform: rotateY(calc(var(--px) * 5deg)) rotateX(calc(var(--py) * -5deg));
}
.circuit__layer--back { transform: translate(calc(var(--px) * -5px), calc(var(--py) * -5px)); }
.circuit__layer--front { transform: translate(calc(var(--px) * 7px), calc(var(--py) * 7px)); }

#circuit-grid path { fill: none; stroke: var(--line-strong); stroke-width: 0.6; }
.circuit__grid { animation: circuitFade 1.6s ease 0.3s both; }

.circuit__trace,
.circuit__pulse {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* pathLength="1" on every path, so one dash is the whole trace. */
.circuit__trace {
  stroke: color-mix(in srgb, var(--accent) 42%, var(--line-strong));
  stroke-width: 2;
  stroke-dasharray: 1 1.5;
  stroke-dashoffset: 1.01;
  animation: circuitDraw 1s cubic-bezier(0.65, 0, 0.35, 1) calc(0.6s + var(--i) * 45ms) forwards;
}
@keyframes circuitDraw { to { stroke-dashoffset: 0; } }

/* A short dash that runs from the chip out to the end of the trace,
   then waits for the rest of the cycle. */
.circuit__pulse {
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-dasharray: 0.12 1.4;
  stroke-dashoffset: 0.12;
  animation: circuitPulse 6s linear calc(2.4s + var(--d)) infinite;
}
@keyframes circuitPulse {
  0% { stroke-dashoffset: 0.12; }
  26%, 100% { stroke-dashoffset: -1; }
}
[data-theme="dark"] .circuit__pulses { filter: drop-shadow(0 0 4px var(--accent)); }

.circuit__node,
.circuit__pill,
.circuit__chip {
  transform-box: fill-box;
  transform-origin: center;
}
.circuit__node {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 1.5;
  animation: circuitPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) calc(1.45s + var(--i) * 45ms) both;
}
.circuit__pill { animation: circuitPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) calc(1.45s + var(--i) * 45ms) both; }
.circuit__pill rect {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.5;
  transition: fill var(--transition);
}
.circuit__pill text {
  font: 500 12.5px var(--mono);
  letter-spacing: 0.02em;
  fill: var(--ink);
}
.circuit__pill:hover rect { fill: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
@keyframes circuitPop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes circuitFade { from { opacity: 0; } to { opacity: 1; } }

.circuit__chip { animation: circuitChip 0.9s var(--ease-out) 0.3s both; }
@keyframes circuitChip { from { opacity: 0; transform: scale(0.82); } to { opacity: 1; transform: none; } }
.circuit__chip-glow {
  fill: var(--accent);
  opacity: 0.1;
  filter: blur(14px);
  animation: circuitGlow 4.5s ease-in-out 1.6s infinite alternate;
}
@keyframes circuitGlow { to { opacity: 0.3; } }
.circuit__chip-body {
  fill: color-mix(in srgb, var(--accent) 9%, var(--surface));
  stroke: var(--accent);
  stroke-width: 1.5;
}
.circuit__chip-inner { fill: none; stroke: var(--accent-line); }
.circuit__chip-glyph {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.circuit.is-paused .circuit__pulse,
.circuit.is-paused .circuit__chip-glow { animation-play-state: paused; }

/* ----- Buttons ----- */
.btn { transition-duration: 0.25s; transition-timing-function: var(--ease-out); }
.btn svg { transition: transform 0.35s var(--ease-out); }
.btn:hover svg { transform: scale(1.14) rotate(-6deg); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn--primary { position: relative; overflow: hidden; isolation: isolate; }
.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn--primary:hover::after { transform: translateX(120%); transition: transform 0.75s var(--ease-out); }

/* ----- Project cards ----- */
#projects .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--tint);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--ease-out);
}
#projects .card:hover::before,
#projects .card:focus-within::before,
#projects .card--featured::before { transform: none; }
/* Soft light that follows the pointer (script.js sets --mx / --my). */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--tint) 13%, transparent), transparent 68%);
  transition: opacity 0.4s ease;
}
.card:hover::after { opacity: 1; }
#projects .card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--tint) 50%, var(--line-strong));
  box-shadow: 0 28px 50px -30px color-mix(in srgb, var(--tint) 55%, transparent);
}
.card__link span { display: inline-block; transition: transform 0.3s var(--ease-out); }
.card__link:hover span { transform: translateX(4px); }
.project__details summary span { transition: transform 0.4s var(--ease-out); }
.project__details.is-closing summary span { transform: none; }
.project__details[open]:not(.is-closing) > :not(summary) { animation: detailsIn 0.5s var(--ease-out) both; }
@keyframes detailsIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ----- Activity: contribution graph and skyline in one section ----- */
.activity__city {
  margin-top: 76px;
  padding-top: 60px;
  border-top: 1px solid var(--line-strong);
  scroll-margin-top: calc(var(--nav-h) + 8px);
}
.city__heading .city__title { font-size: clamp(1.7rem, 3.2vw, 2.3rem); letter-spacing: -0.025em; }

/* ----- About links ----- */
.about__callout { transition: opacity 0.75s var(--ease-out), translate 0.75s var(--ease-out), transform 0.5s var(--ease-out), box-shadow 0.5s ease; }
.about__callout:hover { transform: rotate(0deg) translateY(-3px); box-shadow: var(--shadow-lift); }

@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero__content.hero__content--split { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero__visual { width: 100%; max-width: 440px; margin: 0 auto; }
}
@media (max-width: 768px) {
  .hero { padding: calc(var(--nav-h) + 32px + env(safe-area-inset-top, 0px)) 0 52px; }
  .nav__pill { display: none; }
  .nav__links a.active:not(.nav__cta) { background: var(--accent-soft); }
  .nav__links.open li:nth-child(6) { transition-delay: 0.24s; }
  .activity__city { margin-top: 52px; padding-top: 44px; }
  .about__callout:hover { transform: none; }
}
@media (max-width: 540px) {
  .hero__stats [data-stat]:not([hidden]) ~ [data-stat]:not([hidden])::before { content: none; }
  .hero__content--split .hero__stats { gap: 4px 14px; }
  .circuit__pill text { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__word > span, .hero__intro-description, .hero__tagline, .hero__stats, .hero__links,
  .circuit * { animation-delay: 0s !important; }
  .circuit__pulses { display: none; }
  .circuit, .circuit__layer--back, .circuit__layer--front { transform: none; }
  .js .section__head.reveal .section__title::before { transform: none; }
}
