/* ================================================================
   DHRUV VERMA PORTFOLIO — style.css
   Design: Minimal · Dark-first · Cabinet Grotesk + Geist
   v8 — June 2026
   ================================================================ */

/* ── 0. Self-hosted Fonts ─────────────────────────────────── */
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('assets/fonts/CabinetGrotesk-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cabinet Grotesk';
  src: url('assets/fonts/CabinetGrotesk-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist';
  src: url('assets/fonts/Geist-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* ── 1. Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { border: none; background: none; cursor: pointer; font: inherit; color: inherit; }

/* ── 2. Design Tokens ─────────────────────────────────────── */
:root {
  /* Typefaces */
  --font-display: 'Cabinet Grotesk', system-ui, sans-serif;
  --font-body:    'Geist', system-ui, sans-serif;

  /* Type scale */
  --text-xs:   0.75rem;     /* 12px — tags, footer, muted labels */
  --text-sm:   0.875rem;    /* 14px — education, captions */
  --text-base: 1rem;        /* 16px — body prose */
  --text-lg:   1.125rem;    /* 18px — hero statement */
  --text-xl:   1.5rem;      /* 24px — section headings (H2) */
  --text-2xl:  2rem;        /* 32px — sub-display */
  --text-3xl:  3rem;        /* 48px — H1 desktop */
  --text-4xl:  3.75rem;     /* 60px — H1 large desktop */

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radii */
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Transitions */
  --t-fast: 150ms ease;
  --t-base: 250ms ease;
  --t-slow: 400ms ease-out;

  /* Layout */
  --max-w:      1200px;
  --nav-h:      64px;
  --section-py: var(--space-24);
}

/* ── 3. Dark Theme (default) ──────────────────────────────── */
:root,
[data-theme="dark"] {
  /* Primary v3 tokens */
  --color-bg:      #0d0d0d;
  --color-surface: #141414;
  --color-border:  #262626;
  --color-text:    #f0f0f0;
  --color-muted:   #6b7280;
  --color-accent:  #4f98a3;

  /* Extended tokens for components */
  --color-surface-elevated: #1a1a1a;
  --color-border-subtle:    rgba(255,255,255,0.05);
  --color-border-strong:    rgba(255,255,255,0.16);
  --color-accent-hover:     #63b0bc;
  --color-accent-dim:       rgba(79,152,163,0.12);
  --color-accent-border:    rgba(79,152,163,0.26);

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.55);
  --shadow-lg:    0 8px 36px rgba(0,0,0,0.65);
  --shadow-hover: 0 20px 60px rgba(0,0,0,0.8);

  /* Timeline */
  --color-timeline:     rgba(79,152,163,0.3);
  --color-timeline-dot: #4f98a3;
}

/* ── 4. Light Theme ───────────────────────────────────────── */
[data-theme="light"] {
  /* Primary v4 tokens — tightened for WCAG AA */
  --color-bg:      #f5f5f5;
  --color-surface: #ffffff;
  --color-border:  #d1d5db;
  --color-text:    #0a0a0a;
  --color-muted:   #4b5563;
  --color-accent:  #01696f;

  /* Extended tokens for components */
  --color-surface-elevated: #f4f4f5;
  --color-border-subtle:    rgba(0,0,0,0.05);
  --color-border-strong:    rgba(0,0,0,0.16);
  --color-accent-hover:     #015960;
  --color-accent-dim:       rgba(1,105,111,0.08);
  --color-accent-border:    rgba(1,105,111,0.2);

  /* Shadows */
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.09);
  --shadow-lg:    0 8px 36px rgba(0,0,0,0.11);
  --shadow-hover: 0 20px 60px rgba(0,0,0,0.15);

  /* Timeline */
  --color-timeline:     rgba(1,105,111,0.28);
  --color-timeline-dot: #01696f;
}

/* ── 5. Base Typography ───────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.section-header { margin-bottom: var(--space-12); }

/* ── 6. Utilities ─────────────────────────────────────────── */
/* Screen-reader only — visually hidden but accessible */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 7. Layout ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

section { padding: var(--section-py) 0; }

/* ── 7. Skip Link ─────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: var(--space-4); left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: #fff;
  font-size: var(--text-sm); font-weight: 600;
  border-radius: var(--r-md);
  z-index: 200;
  transform: translateY(-200%);
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: translateY(0); }

/* ── 8. Navigation ────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(13,13,13,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background var(--t-base), border-color var(--t-base);
}
[data-theme="light"] .site-header { background: rgba(250,250,250,0.92); }

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
[data-theme="light"] .site-header.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.08); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  padding: var(--space-1);
  /* ❌ No border-radius, no overflow:hidden — circle lives inside the SVG */
}

.nav-logo-img {
  width: 40px;
  height: 40px;        /* equal dimensions — enforces 1:1 render for square SVG */
  display: block;
  object-fit: contain; /* never distort; renders full circle without clipping */
  overflow: visible;
}

.nav-logo:hover .nav-logo-img {
  opacity: 0.8;
  transition: opacity 150ms ease;
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-8);
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.015em;
  transition: color var(--t-fast);
  position: relative;
  padding-bottom: 2px;
}
/* Nav underline slide left→right on hover */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 200ms ease;
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--color-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-3); }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  color: var(--color-muted);
  transition: color var(--t-fast), background var(--t-fast);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-elevated); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Icon swap: dark mode shows sun (to switch to light), light shows moon */
.icon-sun  { display: none; }
.icon-moon { display: block; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="light"] .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Hamburger */
.hamburger {
  display: flex; flex-direction: column; justify-content: center;
  gap: 5px; width: 36px; height: 36px;
  border-radius: var(--r-md); padding: var(--space-2);
  color: var(--color-muted);
  transition: color var(--t-fast), background var(--t-fast);
}
.hamburger:hover { color: var(--color-text); background: var(--color-surface-elevated); }
.hamburger span {
  display: block; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: transform var(--t-base), opacity var(--t-base);
  transform-origin: center;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav overlay */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90;
  background: var(--color-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--space-8);
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--t-base), transform var(--t-base);
}
.mobile-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.mobile-nav a {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 800;
  color: var(--color-muted);
  letter-spacing: -0.02em;
  transition: color var(--t-fast);
}
.mobile-nav a:hover { color: var(--color-accent); }

/* ── 9. Buttons / CTAs ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--r-md);
  font-size: var(--text-sm); font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform var(--t-fast), box-shadow var(--t-fast),
              background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-border-strong); }

/* ── 10. Hero ─────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + var(--space-16)) 0 var(--space-20);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-16);
  align-items: center;
  position: relative;
}

/* Eyebrow: small caps, muted */
.hero-eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-5);
}

/* H1: Cabinet Grotesk, largest weight, clamp between 3xl and 4xl */
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 9vw, var(--text-4xl));
  font-weight: 900;
  color: var(--color-text);
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: var(--space-6);
  overflow: hidden;
}

/* Character stagger — 400ms total, applied by JS.
   Scoped to .js-active so elements are visible without JS
   (no noscript inline style needed — avoids CSP conflict). */
.js-active .hero-name .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  animation: char-in 400ms ease-out forwards;
}
@keyframes char-in {
  to { opacity: 1; transform: translateY(0); }
}

/* Hero statement: Geist Regular, --text-lg */
.hero-tagline {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: 46ch;
  line-height: 1.75;
  margin-bottom: var(--space-8);
  font-weight: 300;
}
.hero-br { display: none; }

.hero-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* Scroll chevron — subtle, animated, no label */
.hero-scroll {
  margin-top: var(--space-12);
}
.hero-scroll-chevron {
  color: var(--color-muted);
  animation: bounce 2.2s ease-in-out infinite;
}
.hero-scroll-chevron svg { width: 20px; height: 20px; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* Portrait — circular crop, mobile-first */
.hero-portrait { display: flex; justify-content: center; }

.portrait-wrap {
  width: clamp(200px, 60vw, 320px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-surface);
}

.portrait-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  border-radius: 0;
}

/* ── 11. About ────────────────────────────────────────────── */
.about {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

/* Career Timeline Bar */
.about-timeline { margin-bottom: var(--space-16); }

.timeline-bar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: var(--space-5);
}

/* Thin horizontal line */
.tbar-track {
  position: absolute;
  top: var(--space-5);
  left: 0; right: 0;
  height: 1px;
  background: var(--color-border);
  transform: translateY(-50%);
}

.tbar-item {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3); position: relative;
  flex: 1;
}
.tbar-item:first-child { align-items: flex-start; }
.tbar-item:last-child  { align-items: flex-end; }

/* Small dots — teal only on active/current */
.tbar-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  position: relative; z-index: 1;
}
.tbar-dot--now {
  background: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-dim);
}

.tbar-label {
  display: flex; flex-direction: column;
  align-items: center; gap: 2px;
  text-align: center;
}
.tbar-item:first-child .tbar-label { align-items: flex-start; text-align: left; }
.tbar-item:last-child  .tbar-label { align-items: flex-end;   text-align: right; }

/* Quiet year labels — Geist Light 300, muted */
.tbar-year {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 300;
  color: var(--color-muted);
  letter-spacing: 0.06em;
}
.tbar-year--now { color: var(--color-accent); font-weight: 500; }

.tbar-event {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-muted);
  white-space: nowrap;
}

/* Domain Prose Blocks */
.about-prose {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-12);
}

.prose-block { max-width: 60ch; }

/* Block label: small caps, teal */
.prose-label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

/* Lead sentence: Geist Medium, body colour */
.prose-lead {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.prose-block p {
  font-size: var(--text-base);
  color: var(--color-text);
  line-height: 1.75;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ── 12. Background ───────────────────────────────────────── */
.background {
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.background-prose {
  max-width: 65ch;
}

/* Lead sentence: Geist Medium, --color-text */
.bg-lead {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: var(--space-6);
  letter-spacing: -0.01em;
}

.background-prose p {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  line-height: 1.75;
  margin-bottom: var(--space-6);
  letter-spacing: -0.01em;
}
.background-prose p:last-child { margin-bottom: 0; }

/* <strong> carries emphasis by weight only — no colour change */
.background-prose strong {
  font-weight: 500;
  color: var(--color-text);
}

.bg-closing {
  color: var(--color-muted);
  font-style: italic;
}

/* ── 14. Built ────────────────────────────────────────────── */
.built {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
}

.built-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* Case study: clean 1px border, hover = shadow lift only */
.case-study {
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: var(--space-8);
  display: flex; flex-direction: column;
  gap: var(--space-6);
  transition: box-shadow var(--t-base);
}
.case-study:hover { box-shadow: var(--shadow-hover); }

.case-title {
  font-family: var(--font-display);
  font-size: var(--text-xl); font-weight: 800;
  color: var(--color-text); letter-spacing: -0.01em;
  line-height: 1.25;
}

.case-block { display: flex; flex-direction: column; gap: var(--space-2); }

/* Problem/Build labels: small caps, teal */
.case-block-label {
  font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-accent);
}

.case-block p {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.78;
  font-weight: 300;
}

/* Tech row: flat inline text, muted, middot-separated */
.case-tech {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--color-muted);
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* ── 15. Capabilities ─────────────────────────────────────── */
.capabilities {
  border-top: 1px solid var(--color-border-subtle);
}

.caps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-16);
}

/* Teal accent on column headings only */
.caps-col-heading {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-5);
}

.caps-list {
  display: flex; flex-direction: column;
  gap: var(--space-3);
}

/* Geist Regular 400, body text colour */
.caps-list li {
  font-size: var(--text-base);
  color: var(--color-muted);
  line-height: 1.55;
  font-weight: 400;
  display: flex; flex-direction: column; gap: var(--space-1);
}

/* Venue sub-items: Geist Light 300, muted, indented by --space-4 */
.caps-sub {
  display: block;
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--color-muted);
  padding-left: var(--space-4);
}

/* Education — compact block, below divider, inside Capabilities */
.caps-education {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.edu-item { display: flex; flex-direction: column; gap: var(--space-1); }

/* Geist Light 300, --text-sm, --color-muted */
.edu-degree {
  font-size: var(--text-sm);
  color: var(--color-muted);
  font-weight: 300;
  line-height: 1.5;
}

.edu-inst {
  font-size: var(--text-xs);
  color: var(--color-muted);
  font-weight: 300;
  letter-spacing: 0.02em;
}

/* ── 16. Contact ──────────────────────────────────────────── */
.contact-inner { max-width: 600px; }

.contact-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl); font-weight: 800;
  color: var(--color-text); letter-spacing: -0.025em;
  line-height: 1.12;
  margin-top: var(--space-3); margin-bottom: var(--space-5);
}

.contact-copy {
  font-size: var(--text-base);
  color: var(--color-muted);
  line-height: 1.78; max-width: 50ch;
  font-weight: 300;
  margin-bottom: var(--space-8);
}

.contact-ctas { display: flex; flex-wrap: wrap; gap: var(--space-3); }

/* ── 17. Footer ───────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-8) 0;
}

/* One line, centred, --text-xs, --color-muted */
.footer-line {
  font-size: var(--text-xs);
  font-weight: 300;
  color: var(--color-muted);
  text-align: center;
}

/* ── 18. Scroll Reveal ────────────────────────────────────── */
/* Scoped to .js-active: without JS, [data-reveal] elements remain
   visible. JS adds .js-active to <html> immediately on load. */
.js-active [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms ease-out, transform 400ms ease-out;
}
.js-active [data-reveal].is-visible { opacity: 1; transform: translateY(0); }

[data-reveal-delay="1"] { transition-delay: 80ms; }
[data-reveal-delay="2"] { transition-delay: 160ms; }
[data-reveal-delay="3"] { transition-delay: 240ms; }

/* ── 19. Focus Rings ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── 20. System Light Fallback (no-JS) ────────────────────── */
@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]):not([data-theme="light"]) {
    --color-bg:               #f5f5f5;
    --color-surface:          #ffffff;
    --color-border:           #d1d5db;
    --color-text:             #0a0a0a;
    --color-muted:            #4b5563;
    --color-accent:           #01696f;
    --color-surface-elevated: #f4f4f5;
    --color-border-subtle:    rgba(0,0,0,0.05);
    --color-border-strong:    rgba(0,0,0,0.16);
    --color-accent-hover:     #015960;
    --color-accent-dim:       rgba(1,105,111,0.08);
    --color-accent-border:    rgba(1,105,111,0.2);
    --shadow-sm:              0 1px 3px rgba(0,0,0,0.07);
    --shadow-md:              0 4px 20px rgba(0,0,0,0.09);
    --shadow-lg:              0 8px 36px rgba(0,0,0,0.11);
    --shadow-hover:           0 20px 60px rgba(0,0,0,0.15);
    --color-timeline:         rgba(1,105,111,0.28);
    --color-timeline-dot:     #01696f;
  }
}

/* ── 20b. Background Canvas ──────────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

/* All content layers sit above canvas */
header, nav, main, footer {
  position: relative;
  z-index: 1;
}

/* Quieter in light mode */
[data-theme="light"] #bg-canvas {
  opacity: 0.15;
}

/* ── 21. 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-active [data-reveal] { opacity: 1; transform: none; }
  .js-active .hero-name .char { opacity: 1; transform: none; animation: none; }
}

/* ── 22. Responsive ───────────────────────────────────────── */

/* 375px — base (mobile-first, no query needed) */

/* 768px — tablet */
@media (min-width: 768px) {
  :root { --section-py: var(--space-32); }

  .nav-links { display: flex; }
  .hamburger { display: none; }
  .mobile-nav { display: none; }

  .hero-grid {
    grid-template-columns: 1fr 0.65fr;
    gap: var(--space-16);
    align-items: center;
  }
  .hero-portrait { justify-content: flex-end; }
  .portrait-wrap { width: clamp(240px, 38vw, 480px); }
  .hero-br { display: inline; }

  /* About prose: 3-column on tablet+ */
  .about-prose {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-12);
  }

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

  .caps-grid { grid-template-columns: 1fr 1fr; gap: var(--space-16); }

  .caps-education {
    flex-direction: row;
    gap: var(--space-12);
    align-items: flex-start;
  }
  .edu-item { flex: 1; }
}

/* 1024px — desktop */
@media (min-width: 1024px) {
  .container { padding: 0 var(--space-8); }
  .section-title { font-size: var(--text-3xl); }
}

/* 1280px — large desktop */
@media (min-width: 1280px) {
  .container { padding: 0 var(--space-10); }
}
