/* ========================================================================
   Aryaraj Singh — Personal Site v2
   Warm editorial · bone + ink + terracotta · purposeful motion
   Themed via [data-theme="light|dark"] on <html>; default = light.
   ======================================================================== */

:root {
  /* Theme-invariant tokens (typography, motion, geometry) */
  --font-serif: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

:root,
[data-theme="light"] {
  /* Warm editorial palette */
  --bg: #f4efe6;
  --bg-elev: #ece5d7;
  --bg-paper: #faf6ec;
  --bg-glass: rgba(26, 22, 18, 0.04);
  --bg-glass-strong: rgba(26, 22, 18, 0.07);
  --border: rgba(26, 22, 18, 0.12);
  --border-strong: rgba(26, 22, 18, 0.22);
  --ink: #1a1612;
  --ink-soft: #3a332c;
  --ink-muted: #6b6258;
  --ink-dim: #8d8478;
  --accent: #c2410c;          /* terracotta */
  --accent-2: #0a5e3e;        /* deep forest */
  --accent-soft: rgba(194, 65, 12, 0.12);
  --accent-glow: rgba(194, 65, 12, 0.28);

  /* Hero gradient halos */
  --bg-halo-1: rgba(194, 65, 12, 0.08);
  --bg-halo-2: rgba(10, 94, 62, 0.06);

  /* Paper grain */
  --grain-blend: multiply;
  --grain-opacity: 0.04;

  /* Scrollbar */
  --scrollbar-thumb: rgba(26, 22, 18, 0.18);
  --scrollbar-thumb-hover: rgba(26, 22, 18, 0.34);

  /* Glass surfaces (nav, mobile dock) */
  --glass: rgba(250, 246, 236, 0.78);
  --glass-mdock: rgba(250, 246, 236, 0.86);
  --glass-border: rgba(26, 22, 18, 0.08);

  /* Shadows */
  --shadow-soft: 0 8px 30px rgba(26, 22, 18, 0.08);
  --shadow-md: 0 14px 40px rgba(26, 22, 18, 0.10);
  --shadow-card: 0 20px 60px rgba(26, 22, 18, 0.10);
  --shadow-mdock:
    0 14px 44px rgba(26, 22, 18, 0.16),
    0 2px 8px rgba(26, 22, 18, 0.06),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] {
  /* Deep ink — warmer than #000, sits next to the terracotta naturally */
  --bg: #14110e;
  --bg-elev: #221d18;
  --bg-paper: #1c1814;
  --bg-glass: rgba(244, 239, 230, 0.05);
  --bg-glass-strong: rgba(244, 239, 230, 0.08);
  --border: rgba(244, 239, 230, 0.12);
  --border-strong: rgba(244, 239, 230, 0.24);
  --ink: #f4efe6;             /* bone is now foreground */
  --ink-soft: #d8cfbe;
  --ink-muted: #9d9282;
  --ink-dim: #6f6657;
  --accent: #e96437;          /* brighter terracotta — needed for AA on dark */
  --accent-2: #2e8a64;        /* brighter forest */
  --accent-soft: rgba(233, 100, 55, 0.16);
  --accent-glow: rgba(233, 100, 55, 0.36);

  /* Hero gradient halos — slightly stronger so they read on the dark ground */
  --bg-halo-1: rgba(233, 100, 55, 0.14);
  --bg-halo-2: rgba(46, 138, 100, 0.10);

  /* Paper grain — screen blend lets the noise lift OUT of the dark field */
  --grain-blend: screen;
  --grain-opacity: 0.06;

  /* Scrollbar */
  --scrollbar-thumb: rgba(244, 239, 230, 0.18);
  --scrollbar-thumb-hover: rgba(244, 239, 230, 0.34);

  /* Glass surfaces — bone-on-dark, slightly more opaque than light theme */
  --glass: rgba(28, 24, 20, 0.82);
  --glass-mdock: rgba(28, 24, 20, 0.88);
  --glass-border: rgba(244, 239, 230, 0.10);

  /* Shadows — softer + cooler so they don't disappear into the dark ground */
  --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.60);
  --shadow-mdock:
    0 14px 44px rgba(0, 0, 0, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.35),
    inset 0 0 0 0.5px rgba(244, 239, 230, 0.08);
}

/* Theme cross-fade.
   Animate just the colors so we don't fight motion choreography elsewhere.
   Skipped under reduced-motion — falls back to instant swap. */
html { transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out); }
body,
.nav, .nav-cta, .nav-brand, .nav-links a,
.btn, .btn-primary, .btn-ghost,
.project, .project-visual, .project-tag, .project-status, .project-open,
.now-card, .now-card-icon,
.skill-cat, .tag,
.edu-row, .edu-footer,
.contact, .contact-email, .contact-socials a,
.eyebrow,
.xp, .xp-badge,
.mdock-track, .mdock-btn,
.section-label, .section-title, .section-note,
.scroll-progress,
.theme-toggle, .theme-toggle-thumb {
  transition:
    background-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    border-color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  html, body, * { transition: none !important; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Scrollbar — transparent track so the body gradient shows through seamlessly */
html {
  scrollbar-color: var(--scrollbar-thumb) transparent;
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
::-webkit-scrollbar-corner { background: transparent; }

body {
  background:
    radial-gradient(1000px 700px at 10% -5%, var(--bg-halo-1), transparent 60%),
    radial-gradient(800px 600px at 95% 15%, var(--bg-halo-2), transparent 55%),
    var(--bg);
  min-height: 100vh;
  /* iOS rubber-band shouldn't expose a different color when pulled */
  overscroll-behavior-y: none;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Subtle paper grain — opacity + blend mode swap by theme so it reads on both palettes */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--grain-opacity);
  mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ===== Layout ===== */
.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }
@media (max-width: 720px) { .container { padding: 0 28px; } }

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 8px 7px 18px;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.nav-brand {
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  padding-right: 14px;
  border-right: 1px solid var(--border);
  margin-right: 8px;
  line-height: 1;
}
.nav-brand em { font-style: italic; color: var(--accent); }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-muted);
  transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.nav-links a:hover { color: var(--ink); background: var(--bg-glass); }
.nav-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg-paper);
  margin-left: 6px;
  font-weight: 500;
  transition: transform 0.25s var(--ease-out), background 0.25s;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-cta:hover { background: var(--accent); transform: scale(1.03); }

/* ===== Theme toggle ===== */
/* Desktop: pill with sun + moon, sliding thumb */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 48px;
  height: 26px;
  padding: 3px;
  margin: 0 4px 0 4px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: var(--bg-glass-strong); }
.theme-toggle-icon {
  position: relative;
  z-index: 2;
  flex: 1 1 0;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  transition: color 0.25s var(--ease-out);
}
.theme-toggle-icon svg { width: 12px; height: 12px; display: block; }
.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: var(--ink);
  border-radius: 50%;
  transition: transform 0.32s var(--ease-out), background-color 0.25s var(--ease-out);
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(22px); background: var(--accent); }
[data-theme="light"] .theme-toggle .theme-toggle-icon[data-side="sun"],
:root .theme-toggle .theme-toggle-icon[data-side="sun"] { color: var(--bg-paper); }
[data-theme="dark"] .theme-toggle .theme-toggle-icon[data-side="moon"] { color: var(--bg-paper); }

/* Mobile: standalone icon button beside Resume CTA, single icon (current state) */
.theme-toggle-mobile {
  display: none;
  appearance: none;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-right: 2px;
  border-radius: 50%;
  color: var(--ink-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  justify-content: center;
  position: relative;
}
.theme-toggle-mobile svg { width: 16px; height: 16px; display: block; }
.theme-toggle-mobile:active { background: var(--bg-glass-strong); }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .theme-toggle { display: none; }
  .theme-toggle-mobile { display: inline-flex; }
  .nav { top: 14px; }
}

/* ===== Hero ===== */
.hero-bleed {
  position: relative;
  width: 100%;
  /* Establishes a stacking context so the shader bg and content layer cleanly */
  isolation: isolate;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .hero-bg { /* still visible — shader rendered one frame statically */ }
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
  padding: 160px 0 100px;
  z-index: 2;
}
@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 140px 0 80px; }
  .hero-visual { max-width: 420px; justify-self: center; }
}
.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 680px;
  min-width: 0;
}
.hero-visual {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 520px;
  justify-self: end;
  align-self: center;
}
.hero-visual canvas { width: 100% !important; height: 100% !important; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 110px; }
  .hero-visual { order: -1; max-width: 360px; justify-self: center; margin-bottom: 20px; }
}

.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(44px, 5.8vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  color: var(--ink);
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero-sub {
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--ink-soft);
  max-width: 560px;
  line-height: 1.65;
  margin-bottom: 40px;
  text-wrap: pretty;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  transition: transform 0.3s var(--ease-out), background 0.25s, border-color 0.25s, color 0.25s;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  color: inherit;
  font-family: inherit;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg-paper);
}
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--bg-glass); transform: translateY(-2px); border-color: var(--ink); }
.btn svg { width: 14px; height: 14px; }

/* Hero stats strip — product thinking: quick signal of what I am */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
@media (max-width: 520px) { .hero-stats { grid-template-columns: 1fr; gap: 16px; } }
.hero-stat-num {
  font-family: var(--font-serif);
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: block;
}
.hero-stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
  display: block;
  max-width: 140px;
  line-height: 1.4;
}

/* ===== Section chrome ===== */
.section {
  padding: 120px 0;
  position: relative;
  z-index: 2;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 56px;
  gap: 24px;
  flex-wrap: wrap;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.section-label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin-top: 8px;
  max-width: 760px;
  color: var(--ink);
}
.section-title em { font-style: italic; color: var(--accent); }
.section-note {
  max-width: 320px;
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* ===== Projects — redesigned card ===== */
.projects { display: grid; gap: 20px; grid-template-columns: repeat(12, 1fr); }
.project {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg-paper);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.4s;
  display: flex; flex-direction: column;
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
.project-wide { grid-column: span 7; }
.project-tall { grid-column: span 5; }
.project-half { grid-column: span 6; }
@media (max-width: 900px) {
  .project-wide, .project-tall, .project-half { grid-column: span 12; }
}

.project-visual {
  position: relative;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.project-tag {
  position: absolute; top: 16px; left: 16px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-paper);
  color: var(--ink-muted);
  border: 1px solid var(--border);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-status {
  position: absolute; top: 16px; right: 16px;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.project-status-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: #10b981;
}
.project-body {
  padding: 28px 28px 24px;
  display: flex; flex-direction: column; gap: 14px;  flex: 1;
}
.project h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.project h3 em { font-style: italic; color: var(--accent); }
.project-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: -8px;
}
.project-desc {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

.project-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.project-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.project-meta span { display: inline-flex; align-items: center; gap: 6px; }
.project-meta span + span::before {
  content: "·";
  margin-right: 6px;
  color: var(--ink-dim);
}
.project-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-glass);
  border: 1px solid var(--border);
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.3s var(--ease-out);
  white-space: nowrap;
}
.project-open:hover {
  background: var(--ink);
  color: var(--bg-paper);
  border-color: var(--ink);
  transform: translateX(2px);
}
.project-open svg { width: 12px; height: 12px; transition: transform 0.25s; }
.project-open:hover svg { transform: translate(2px, -2px); }
.project-open-soon {
  background: transparent;
  color: var(--ink-muted);
  border-style: dashed;
  cursor: default;
  font-style: italic;
}
.project-open-soon:hover { background: transparent; color: var(--ink-muted); border-color: var(--border); transform: none; }

/* Project visuals — warm backgrounds */
.vis-konnect { background: linear-gradient(135deg, #f4efe6 0%, #e8dcc8 100%); }
.vis-osint { background: linear-gradient(135deg, #f0e9da 0%, #d9cbb3 100%); }
.vis-titan { background: linear-gradient(135deg, #ede3d1 0%, #e0cfb0 100%); }
.project-visual.vis-matrivita { background: #fff; padding: 12px; height: 320px; }
.project-visual.vis-matrivita img { display: block; }
@media (max-width: 640px) {
  .project-visual.vis-matrivita { height: 260px; }
}

/* ===== Experience timeline ===== */
.timeline { display: flex; flex-direction: column; }
.xp {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  align-items: start;
  transition: background 0.3s;
}
.xp:last-child { border-bottom: 1px solid var(--border); }
.xp:hover { background: var(--bg-glass); }
.xp-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  padding-top: 6px;
}
.xp-body h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 4px;
  color: var(--ink);
}
.xp-role {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}
.xp-body ul {
  list-style: none;
  display: flex; flex-direction: column; gap: 8px;
}
.xp-body li {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
}
.xp-body li::before {
  content: "";
  position: absolute;
  left: 0; top: 10px;
  width: 8px; height: 1px;
  background: var(--accent);
}
.xp-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}
@media (max-width: 800px) {
  .xp { grid-template-columns: 1fr; gap: 10px; }
  .xp-badge { justify-self: start; }
}

/* ===== Now cards ===== */
.now-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.now-card {
  grid-column: span 4;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--bg-paper);
  border: 1px solid var(--border);
  min-height: 220px;
  display: flex; flex-direction: column; gap: 14px;
  transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.3s;
}
.now-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.now-card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft);
  display: grid; place-items: center;
  color: var(--accent);
}
.now-card-icon svg { width: 18px; height: 18px; }
.now-card h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.now-card p { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.now-card-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  text-transform: uppercase;
}
@media (max-width: 900px) { .now-card { grid-column: span 12; } }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.skill-cat {
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-paper);
  border: 1px solid var(--border);
}
.skill-cat h5 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  margin-bottom: 16px;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--bg-glass);
  color: var(--ink-soft);
  border: 1px solid transparent;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.tag:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .skills-grid { grid-template-columns: 1fr; } }

/* ===== Education ===== */
.edu { display: flex; flex-direction: column; gap: 12px; }
.edu-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--bg-paper);
  border: 1px solid var(--border);
  align-items: center;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.edu-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-soft); }
.edu-date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); }
.edu-body h4 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 22px; letter-spacing: -0.01em; margin-bottom: 4px;
  color: var(--ink);
}
.edu-body p { font-size: 13px; color: var(--ink-muted); font-family: var(--font-mono); }
@media (max-width: 800px) {
  .edu-row { grid-template-columns: 1fr; gap: 8px; }
}

.edu-footer {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px dashed var(--border-strong);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.edu-footer strong { color: var(--accent); font-weight: 500; }

/* ===== Contact ===== */
.contact {
  padding: 80px 48px;
  border-radius: var(--radius-xl);
  background: var(--ink);
  color: var(--bg-paper);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px circle at 20% 30%, rgba(194, 65, 12, 0.35), transparent 60%),
    radial-gradient(500px circle at 80% 70%, rgba(10, 94, 62, 0.2), transparent 60%);
  pointer-events: none;
}
.contact > * { position: relative; z-index: 2; }
.contact h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.contact h2 em {
  font-style: italic;
  color: #f59e42;
}
.contact p {
  color: rgba(244, 239, 230, 0.7);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.6;
}
.contact-email {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 16px 26px;
  background: var(--bg-paper);
  color: var(--ink);
  border-radius: 999px;
  transition: transform 0.3s var(--ease-out), background 0.25s, color 0.25s;
}
.contact-email:hover { background: var(--accent); color: var(--bg-paper); transform: scale(1.03); }
.contact-socials {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 28px;
}
.contact-socials a {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(244, 239, 230, 0.2);
  background: rgba(244, 239, 230, 0.06);
  display: grid; place-items: center;
  color: rgba(244, 239, 230, 0.7);
  transition: color 0.25s, border-color 0.25s, transform 0.3s var(--ease-out), background 0.25s;
}
.contact-socials a:hover { color: var(--bg-paper); border-color: var(--bg-paper); background: rgba(244,239,230,0.1); transform: translateY(-3px); }
.contact-socials svg { width: 18px; height: 18px; }

/* ===== Footer ===== */
.footer {
  padding: 40px 0 60px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
  position: relative; z-index: 2;
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim);
  gap: 20px; flex-wrap: wrap;
}
.footer-inner a { transition: color 0.2s; }
.footer-inner a:hover { color: var(--accent); }

/* ===== Reveal on scroll =====
   GSAP drives the entrances now; we keep .reveal as a no-FOUT shell so
   anything not yet animated stays at final state by default. */
.reveal { opacity: 1; transform: none; }
.reveal.in { opacity: 1; transform: none; }

/* SplitText injected wrappers — used by hero h1 + section titles */
.word-split { display: inline-block; overflow: hidden; padding: 0 0.04em; }
.char-split { display: inline-block; }

/* ===== Hero status pill / eyebrow (Phase 6) ===== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  padding: 7px 14px;
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 28px;
  white-space: nowrap;
  line-height: 1;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;       /* live-status green — universal across themes */
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.55);
  animation: pulse-dot 2.2s var(--ease-in-out) infinite;
  flex: 0 0 auto;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}
@media (prefers-reduced-motion: reduce) {
  .eyebrow-dot { animation: none; }
}
@media (max-width: 720px) {
  .eyebrow {
    margin-bottom: 22px;
    font-size: 11px;
    padding: 6px 12px;
    /* Don't crowd the small viewport */
    max-width: calc(100vw - 32px);
  }
}
@media (max-width: 380px) {
  .eyebrow {
    /* Allow wrap on tiny phones (iPhone SE etc.) so the full status reads */
    white-space: normal;
    line-height: 1.35;
    font-size: 10.5px;
    padding: 8px 12px;
    border-radius: 14px;
  }
}

/* ===== Hello section (Phase 6) ===== */
.hello-section { padding: 100px 0; }
.hello-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.hello-image-wrap {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.hello-image {
  position: absolute;
  inset: -8% 0;       /* extra room for parallax y-translate */
  width: 100%;
  height: 116%;
  will-change: transform;
}
.hello-image img,
.hello-image .hello-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hello-headline {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(56px, 7vw, 96px);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 8px 0 24px;
}
.hello-headline em {
  font-style: italic;
  color: var(--accent);
}
.hello-bio {
  font-size: clamp(15.5px, 1.2vw, 17px);
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 460px;
  text-wrap: pretty;
}
@media (max-width: 900px) {
  .hello-section { padding: 72px 0; }
  .hello-grid { grid-template-columns: 1fr; gap: 28px; }
  .hello-image-wrap { aspect-ratio: 4 / 3; max-height: 50svh; }
  .hello-headline { font-size: clamp(48px, 12vw, 72px); margin: 4px 0 18px; }
  .hello-bio { font-size: 15px; }
}

/* ===== Custom cursor (Phase 5) ===== */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s ease, width 0.3s var(--ease-out), height 0.3s var(--ease-out), background 0.25s ease;
  will-change: transform;
}
.cursor-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.cursor-ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: transparent;
  mix-blend-mode: difference;
}
.cursor-ring.ring-hover {
  width: 56px;
  height: 56px;
  background: var(--accent-soft);
  mix-blend-mode: normal;
}
html.cursor-on .cursor-dot,
html.cursor-on .cursor-ring { opacity: 1; }

/* Hide native cursor on hover-capable devices once our cursor activates */
@media (hover: hover) and (pointer: fine) {
  html.cursor-on, html.cursor-on body, html.cursor-on a, html.cursor-on button { cursor: none; }
}
/* Disable on touch + reduced-motion */
@media (hover: none) {
  .cursor-dot, .cursor-ring { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor-dot, .cursor-ring { display: none !important; }
}

/* ===== 3D-tilt cards (Phase 5) ===== */
@media (hover: hover) and (pointer: fine) {
  /* JS sets transform inline; suppress the original CSS hover transform so they don't fight */
  .tilt-card:hover { transform: none; }
}
@media (hover: none) {
  /* Touch alternative — press-down feedback */
  .tilt-card:active {
    transform: scale(0.985);
    transition: transform 0.12s var(--ease-out);
  }
}

/* Magnetic CTAs — pressing on touch */
@media (hover: none) {
  .btn-primary:active, .btn-ghost:active, .contact-email:active {
    transform: scale(0.96);
    transition: transform 0.12s var(--ease-out);
  }
}

/* ===== Marquee (Phase 4) ===== */
.marquee {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  padding: 36px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 24px 0;
  /* Soft fade at the edges so words feather in/out instead of hard-cutting */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  will-change: transform;
}
.marquee-row {
  display: inline-flex;
  align-items: baseline;
  gap: 32px;
  padding-right: 32px;
  flex-shrink: 0;
}
.marquee-item {
  display: inline-flex;
  align-items: baseline;
  gap: 32px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--accent);
}
.marquee-item em {
  font-style: italic;
  color: var(--accent);
}
.marquee-dot {
  font-style: normal;
  font-size: 0.6em;
  color: var(--ink-dim);
  line-height: 1;
  padding: 0 4px;
}
@media (max-width: 720px) {
  .marquee { padding: 24px 0; margin: 16px 0; }
  .marquee-item { font-size: clamp(36px, 12vw, 56px); }
  .marquee-row { gap: 22px; padding-right: 22px; }
  .marquee-item { gap: 22px; }
}

/* ===== Section divider (Phase 4) ===== */
.divider {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 1px;
  display: block;
  pointer-events: none;
}
.divider span {
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    var(--border) 14%,
    var(--accent) 50%,
    var(--border) 86%,
    transparent 100%);
  opacity: 0.6;
  transform-origin: left center;
}
@media (prefers-reduced-motion: reduce) {
  .divider span { transform: none !important; }
}

/* ===== Scroll progress (Phase 2) ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 100;
  pointer-events: none;
  /* No transition — scaleX is GSAP-driven on scroll */
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
}

/* ==========================================================================
   MOBILE DOCK — premium tab bar (phones only)
   icon-over-label, fixed-width items, color-shift active state
   ========================================================================== */
.mdock {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  transform: translate(-50%, 140%);
  opacity: 0;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  transition:
    transform 0.55s cubic-bezier(0.2, 1, 0.3, 1),
    opacity 0.4s ease;
  pointer-events: none;
}
.mdock-in { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.mdock-hidden { transform: translate(-50%, 160%); opacity: 0; pointer-events: none; }

.mdock-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  padding: 8px 4px 6px;
  background: var(--glass-mdock);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  border-radius: 26px;
  box-shadow: var(--shadow-mdock);
}

.mdock-btn {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 6px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.25s ease, transform 0.18s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.mdock-btn:active { transform: scale(0.94); }

/* Tiny terracotta dot above icon — active indicator */
.mdock-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -2px) scale(0);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.32s var(--ease-out), opacity 0.25s ease;
  opacity: 0;
}
.mdock-btn.is-active::before {
  transform: translate(-50%, -2px) scale(1);
  opacity: 1;
}

.mdock-btn.is-active { color: var(--ink); }

.mdock-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}
.mdock-icon svg {
  width: 21px;
  height: 21px;
  transition: stroke-width 0.25s ease, transform 0.25s var(--ease-out);
}
.mdock-btn.is-active .mdock-icon svg {
  stroke-width: 2;
  transform: translateY(-1px);
}

.mdock-label {
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Only show on phones */
@media (max-width: 640px) {
  .mdock { display: block; }
  .footer { padding-bottom: calc(40px + 110px + env(safe-area-inset-bottom, 0px)); }
}

/* Small phone — slightly denser */
@media (max-width: 380px) {
  .mdock { width: calc(100vw - 20px); }
  .mdock-track { padding: 7px 2px 5px; border-radius: 22px; }
  .mdock-btn { font-size: 10px; padding: 5px 2px 3px; gap: 3px; }
  .mdock-icon svg { width: 19px; height: 19px; }
}

/* Hide desktop scrollbar on mobile — mobile dock is the nav, and desktop-style
   scrollbar gutters create a 10px white sliver on the right edge */
@media (max-width: 640px) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; width: 0; height: 0; }
  body::-webkit-scrollbar { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
  .mdock { transform: translate(-50%, 0) !important; opacity: 1 !important; }
}

/* ==========================================================================
   MOBILE — systematic, editorial, scaled with care
   ========================================================================== */

/* Tablet (max 900px) — keeps some two-column where it reads well */
@media (max-width: 900px) {
  .section { padding: 84px 0; }
  .section-head { margin-bottom: 40px; }
  .section-title { font-size: clamp(32px, 6vw, 48px); }

  .hero { padding: 130px 0 70px; min-height: auto; }
  .hero-visual { max-width: 340px; margin-bottom: 8px; }
  .hero h1 { margin-bottom: 24px; }
  .hero-sub { font-size: 16px; margin-bottom: 30px; }
  .hero-stats { margin-top: 36px; padding-top: 22px; gap: 20px; }
  .hero-stat-num { font-size: 30px; }
}

/* Phone (max 640px) — single column everywhere, everything tightens */
@media (max-width: 640px) {
  body { font-size: 16px; }

  .container { padding: 0 32px !important; }

  /* Nav — brand + resume CTA only */
  .nav {
    top: 12px;
    padding: 6px 6px 6px 14px;
    gap: 4px;
  }
  .nav-brand {
    font-size: 18px;
    padding-right: 10px;
    margin-right: 4px;
  }
  .nav-cta {
    font-size: 11px;
    padding: 11px 14px;       /* 44px touch height: 11+22+11 */
    margin-left: 2px;
    min-height: 44px;
  }

  /* Section rhythm */
  .section { padding: 64px 0; }
  .section-head { margin-bottom: 32px; gap: 12px; }
  .section-title { font-size: 34px; line-height: 1.05; }
  .section-note { font-size: 13px; max-width: none; }

  /* Hero */
  .hero { padding: 110px 0 56px; gap: 28px; }
  .hero-visual { max-width: 280px; }
  .hero h1 { font-size: 42px; line-height: 1.04; margin-bottom: 20px; }
  .hero-sub { font-size: 15.5px; line-height: 1.6; margin-bottom: 26px; }
  .hero-ctas { width: 100%; gap: 10px; }
  .hero-ctas .btn { flex: 1 1 auto; justify-content: center; padding: 13px 18px; font-size: 13.5px; }
  .hero-stats { margin-top: 30px; padding-top: 20px; gap: 14px; grid-template-columns: 1fr; text-align: left; }
  .hero-stats > div { display: flex; align-items: baseline; gap: 14px; }
  .hero-stat-num { font-size: 28px; flex: 0 0 auto; min-width: 88px; }
  .hero-stat-label { margin-top: 0; max-width: none; }

  /* Project cards */
  .projects { gap: 16px; }
  .project-visual { height: 180px; }
  .project-body { padding: 22px 22px 20px; gap: 12px; }
  .project h3 { font-size: 26px; }
  .project-subtitle { font-size: 10.5px; margin-top: -6px; }
  .project-desc { font-size: 14.5px; }
  .project-foot { padding: 14px 22px; gap: 12px; }
  .project-meta { font-size: 10.5px; gap: 8px; }
  .project-open { font-size: 11px; padding: 12px 14px; min-height: 44px; }
  .project-tag, .project-status { font-size: 9.5px; padding: 4px 8px; top: 12px; }
  .project-tag { left: 12px; }
  .project-status { right: 12px; }

  /* Experience */
  .xp { padding: 24px 0; gap: 8px; }
  .xp-date { font-size: 11px; padding-top: 0; }
  .xp-body h3 { font-size: 22px; }
  .xp-role { font-size: 12px; margin-bottom: 12px; }
  .xp-body li { font-size: 14px; }

  /* Now cards */
  .now-grid { gap: 14px; }
  .now-card { padding: 22px; min-height: 0; }
  .now-card h4 { font-size: 21px; }
  .now-card p { font-size: 13.5px; }

  /* Skills */
  .skill-cat { padding: 20px; }
  .tag { font-size: 11.5px; padding: 4px 9px; }

  /* Education */
  .edu-row { padding: 20px; gap: 8px; }
  .edu-body h4 { font-size: 19px; }

  /* Contact */
  .contact { padding: 56px 24px; border-radius: 24px; }
  .contact h2 { font-size: 44px; }
  .contact p { font-size: 15px; margin-bottom: 28px; }
  .contact-email { font-size: 14px; padding: 14px 20px; }
  .contact-socials { margin-top: 22px; gap: 8px; }
  .contact-socials a { width: 44px; height: 44px; }

  /* Footer */
  .footer { padding: 28px 0 40px; margin-top: 48px; }
  .footer-inner { justify-content: center; text-align: center; font-size: 11.5px; gap: 10px; }
}

/* Small phone (max 380px) — prevent overflow on iPhone SE etc. */
@media (max-width: 380px) {
  .container { padding: 0 24px !important; }
  .hero h1 { font-size: 38px; }
  .section-title { font-size: 30px; }
  .project h3 { font-size: 23px; }
  .contact { padding: 48px 20px; }
  .contact h2 { font-size: 38px; }
}

/* Touch devices — kill hover-translate jiggle on tap */
@media (hover: none) {
  .project:hover,
  .now-card:hover,
  .edu-row:hover,
  .btn-primary:hover,
  .btn-ghost:hover,
  .nav-cta:hover,
  .contact-email:hover,
  .contact-socials a:hover { transform: none; }
}
