/* ==========================================================================
   Aditya Sharma · portfolio
   Plain CSS, no build step. Colours are tokens so light and dark stay in sync.
   ========================================================================== */

:root {
  --bg: #f6f4ef;
  --bg-soft: #efece4;
  --card: #fffdf8;
  --text: #16181b;
  --muted: #5b636c;
  --faint: #8a9199;
  --line: rgba(22, 24, 27, 0.1);
  --line-strong: rgba(22, 24, 27, 0.22);
  --accent: #c2410c;
  --accent-soft: rgba(194, 65, 12, 0.1);
  --accent-ink: #fff7ed;
  --viz: #2f5fd0;
  --viz-soft: rgba(47, 95, 208, 0.12);
  --live: #15803d;
  --shadow: 0 1px 2px rgba(22, 24, 27, 0.04), 0 12px 32px -12px rgba(22, 24, 27, 0.14);
  --nav-bg: rgba(246, 244, 239, 0.78);

  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-serif: "Instrument Serif", ui-serif, Georgia, "Times New Roman", serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius: 18px;
  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10;
    --bg-soft: #101318;
    --card: #12161b;
    --text: #e9ebee;
    --muted: #9aa3ad;
    --faint: #6b747e;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.18);
    --accent: #ffb04a;
    --accent-soft: rgba(255, 176, 74, 0.12);
    --accent-ink: #1d1304;
    --viz: #7fb2ff;
    --viz-soft: rgba(127, 178, 255, 0.12);
    --live: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
    --nav-bg: rgba(11, 13, 16, 0.72);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0d10;
  --bg-soft: #101318;
  --card: #12161b;
  --text: #e9ebee;
  --muted: #9aa3ad;
  --faint: #6b747e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #ffb04a;
  --accent-soft: rgba(255, 176, 74, 0.12);
  --accent-ink: #1d1304;
  --viz: #7fb2ff;
  --viz-soft: rgba(127, 178, 255, 0.12);
  --live: #4ade80;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -16px rgba(0, 0, 0, 0.6);
  --nav-bg: rgba(11, 13, 16, 0.72);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.nav.is-scrolled {
  background: var(--nav-bg);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-family: var(--f-serif);
  font-size: 18px;
  font-style: italic;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  position: relative;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14.5px;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-current { color: var(--text); background: var(--line); }
.nav-links .nav-cta {
  margin-left: 6px;
  color: var(--accent-ink);
  background: var(--accent);
}
.nav-links .nav-cta:hover,
.nav-links .nav-cta.is-current { color: var(--accent-ink); background: var(--accent); filter: brightness(1.05); }

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

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.icon-btn:hover { border-color: var(--line-strong); background: var(--line); }
.icon-btn svg { width: 18px; height: 18px; }

/* Show the icon for the theme you would switch to. */
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .i-sun { display: none; }
  :root:not([data-theme="dark"]) .i-moon { display: block; }
}

.menu-btn { display: none; }
.menu-btn span {
  grid-area: 1 / 1;
  width: 16px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease;
}
.menu-btn span:first-child { transform: translateY(-3.5px); }
.menu-btn span:last-child { transform: translateY(3.5px); }
.menu-btn[aria-expanded="true"] span:first-child { transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: rotate(-45deg); }

/* ---------- Buttons and small pieces ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--text); }

.icon-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.icon-link:hover { color: var(--text); background: var(--line); }
.icon-link svg { width: 19px; height: 19px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.points { display: grid; gap: 8px; }
.points li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 15px;
}
.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 7px;
  height: 1.5px;
  background: var(--accent);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow span {
  color: var(--accent);
}
.eyebrow span::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: var(--line-strong);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  padding: 132px 0 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  overflow: hidden;
  isolation: isolate;
}

.landscape {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 8%, #000 52%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 8%, #000 52%, #000 82%, transparent 100%);
}

/* Fade the terrain behind the text column so the copy stays readable. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(100deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 34%, transparent 62%);
}
@media (max-width: 820px) {
  .hero::after {
    background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 80%, transparent) 55%, transparent 80%);
  }
}

.hero-inner { position: relative; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.pulse {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--live);
  opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

.display {
  font-family: var(--f-serif);
  font-size: clamp(3.4rem, 10.5vw, 8.6rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.02em;
}
.display em {
  color: var(--accent);
  font-style: italic;
}

.lead {
  max-width: 40rem;
  margin-top: 30px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
  line-height: 1.6;
}
.lead strong { color: var(--text); font-weight: 500; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 36px;
}
.socials { display: inline-flex; gap: 2px; margin-left: 6px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-top: 1px solid var(--line-strong);
}
.stat {
  padding: 22px 22px 6px 0;
}
.stat + .stat {
  padding-left: 22px;
  border-left: 1px solid var(--line);
}
.stat dt { margin-bottom: 6px; }
.num {
  font-family: var(--f-serif);
  font-size: clamp(2.2rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.num sup { font-size: 0.42em; vertical-align: super; margin-left: 2px; font-style: italic; }
.num small { font-size: 0.42em; margin-left: 4px; font-family: var(--f-mono); letter-spacing: 0; color: var(--muted); }
.stat dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 22ch; }

.now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 14.5px;
}
.now-tag {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Sections ---------- */

.section { padding: clamp(80px, 11vw, 140px) 0 0; }

.section-head { margin-bottom: 36px; }
.section-head h2,
.about h2,
.contact h2 {
  font-family: var(--f-serif);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.015em;
}
.section-sub {
  max-width: 36rem;
  margin-top: 16px;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- Projects ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.chip {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.chip:hover { color: var(--text); border-color: var(--text); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.3s ease, box-shadow 0.35s ease, opacity 0.35s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}
.card.is-hidden { display: none; }

.card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.card-wide .viz { min-height: 100%; border-bottom: 0; border-right: 1px solid var(--line); }

.viz {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 1px 1px, var(--line-strong) 1px, transparent 0) 0 0 / 18px 18px,
    var(--bg-soft);
  overflow: hidden;
}
.viz::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 60% at 50% 45%, transparent 40%, var(--bg-soft) 100%);
  pointer-events: none;
}
.viz-svg {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  height: auto;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.card:hover .viz-svg { transform: scale(1.03); }
.card-wide .viz-svg { max-width: 560px; }

.badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.badge-live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 22%, transparent);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 26px 24px;
  flex: 1;
}
.card-wide .card-body { padding: 32px 32px 28px; }
.card-meta {
  color: var(--faint);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card h3 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-wide h3 { font-size: 1.85rem; }
.card-body > p { color: var(--muted); }
.card-body > p em { font-style: italic; }
.card-body .tags { margin-top: 2px; }

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: auto;
  padding-top: 8px;
}
.card-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.card-links a:hover { color: var(--accent); border-color: var(--accent); }
.card-links svg { width: 15px; height: 15px; }

/* Research card with real figures */
.viz-figs {
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 56px 22px 22px;
}
.viz-figs figure {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
}
.viz-figs figure { transform: rotate(-1.6deg); }
.card:hover .viz-figs figure { transform: rotate(-0.6deg) translateY(-3px); }
.viz-figs img { width: 100%; height: auto; border-radius: 6px; }

/* Epistasis summary drawn in HTML so it stays sharp and themed. */
.epi {
  position: relative;
  z-index: 1;
  align-self: center;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.35);
  transform: rotate(1.2deg) translateY(12px);
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1);
}
.card:hover .epi { transform: rotate(0.4deg) translateY(6px); }
.epi-head { color: var(--muted); font-size: 13px; line-height: 1.35; }
.epi-n {
  display: block;
  color: var(--text);
  font-family: var(--f-serif);
  font-size: 2.4rem;
  line-height: 1;
}
.epi-bar {
  display: flex;
  gap: 2px;
  height: 12px;
  margin: 14px 0 12px;
  border-radius: 4px;
  overflow: hidden;
}
.epi-bar span { flex: var(--w) 1 0; }
.epi-legend { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
.epi-legend li { display: flex; align-items: center; gap: 8px; }
.epi-legend i { width: 9px; height: 9px; border-radius: 2px; }
.epi-legend b { margin-left: auto; color: var(--text); font-family: var(--f-mono); font-weight: 500; }
.e-neg { background: var(--accent); }
.e-none { background: var(--line-strong); }
.e-sign { background: var(--viz); }
.e-pos { background: var(--live); }

/* SVG illustration styles */
.v-paper { fill: var(--card); stroke: var(--line-strong); stroke-width: 1.2; }
.v-paper-back { fill: var(--card); stroke: var(--line-strong); stroke-width: 1; }
.v-rule { stroke: var(--line-strong); stroke-width: 4; stroke-linecap: round; fill: none; }
.v-label { fill: var(--faint); font-family: var(--f-mono); font-size: 12px; }
.v-code { fill: var(--muted); font-family: var(--f-mono); font-size: 14px; }
.v-flow { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 6; fill: none; animation: dash 1.4s linear infinite; }
.v-acc-stroke { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.v-bar-acc { fill: var(--accent); }
.v-bar-muted { fill: var(--viz); opacity: 0.85; }
.v-axis { stroke: var(--line-strong); stroke-width: 1.4; }
.v-face { fill: none; stroke: var(--line-strong); stroke-width: 1.4; stroke-dasharray: 3 5; }
.v-mesh circle { fill: var(--viz); }
.v-gaze { stroke: var(--viz); stroke-width: 1.2; stroke-dasharray: 2 4; opacity: 0.7; }
.v-wave rect { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: wave 1.6s ease-in-out infinite; }
.v-wave rect:nth-child(2n) { animation-delay: -0.4s; }
.v-wave rect:nth-child(3n) { animation-delay: -0.8s; }
.v-wave rect:nth-child(5n) { animation-delay: -1.2s; }
.v-edges path { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.v-node { fill: var(--card); stroke: var(--viz); stroke-width: 2; }
.v-node-acc { fill: var(--accent); }
.v-node-alt { fill: var(--viz); }
.v-bubble { fill: var(--card); stroke: var(--line-strong); stroke-width: 1.2; }
.v-bubble-acc { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; }
.v-check { stroke: var(--accent-ink); stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.v-track { stroke: var(--line-strong); stroke-width: 2; }
.v-track-flow { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 18; animation: dash 1.2s linear infinite; }
.v-stages circle { fill: var(--card); stroke: var(--line-strong); stroke-width: 1.4; }
.v-stages circle.is-acc { stroke: var(--accent); stroke-width: 2; }
.v-stages text { fill: var(--faint); font-family: var(--f-mono); font-size: 12px; text-anchor: middle; }
.v-stage-icons path { stroke: var(--muted); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }

@keyframes dash { to { stroke-dashoffset: -20; } }
@keyframes wave {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.45); }
}

/* "More I have built" */
.more {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.more-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.more-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.more-list li.is-hidden { display: none; }
.more-name { font-weight: 500; }
.more-name a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.more-name a:hover { color: var(--accent); }
.more-name svg { width: 14px; height: 14px; }
.more-desc { color: var(--muted); font-size: 15px; }
.more-tags { color: var(--faint); font-family: var(--f-mono); font-size: 12px; text-align: right; }

/* ---------- Experience ---------- */

.timeline { position: relative; }
.role {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}
.role:last-child { border-bottom: 1px solid var(--line); }
.role-when {
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 13.5px;
  line-height: 1.5;
}
.role-when span {
  display: block;
  margin-top: 4px;
  color: var(--faint);
}
.role-body { display: grid; gap: 14px; max-width: 760px; }
.role h3 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.role .at { color: var(--muted); font-weight: 400; }
.role-body > p { color: var(--muted); }
.inline-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.inline-link:hover { color: var(--accent); }

/* ---------- Toolkit ---------- */

.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.skill {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.3s ease;
}
.skill:hover { border-color: var(--line-strong); }
.skill h3 {
  margin-bottom: 16px;
  font-size: 1.05rem;
  font-weight: 500;
}
.skill .tags li { color: var(--text); background: var(--bg-soft); }

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
.about h2 { margin-bottom: 28px; }
.about-text p:not(.eyebrow) {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.edu {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.edu-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.edu-item { padding: 20px 0; }
.edu-item + .edu-item { border-top: 1px solid var(--line); }
.edu-item:last-child { padding-bottom: 0; }
.edu-when { color: var(--accent); font-family: var(--f-mono); font-size: 12.5px; }
.edu h4 { margin-top: 6px; font-size: 1.15rem; font-weight: 500; letter-spacing: -0.01em; }
.edu-where { margin-top: 2px; color: var(--text); font-size: 15px; }
.edu-note { margin-top: 8px; color: var(--muted); font-size: 14px; }

/* ---------- Contact ---------- */

.contact { padding-bottom: clamp(80px, 10vw, 120px); }
.contact-card {
  position: relative;
  padding: clamp(32px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(80% 120% at 100% 0%, var(--accent-soft), transparent 60%),
    radial-gradient(60% 100% at 0% 100%, var(--viz-soft), transparent 60%),
    var(--card);
  overflow: hidden;
}
.contact h2 { max-width: 14ch; }
.contact h2 em { color: var(--accent); font-style: italic; }
.contact-card > p:not(.eyebrow) {
  max-width: 34rem;
  margin-top: 22px;
  color: var(--muted);
  font-size: 17px;
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}
.noscript { margin-top: 16px; color: var(--muted); }

/* ---------- Footer ---------- */

.footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13.5px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}
.to-top { text-decoration: none; }
.to-top:hover { color: var(--text); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s cubic-bezier(.2,.7,.2,1), transform 0.8s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }
/* Cards keep their own hover transition once revealed. */
.js .card.reveal.is-in { transition: transform 0.35s cubic-bezier(.2,.7,.2,1), border-color 0.3s ease, box-shadow 0.35s ease, opacity 0.8s ease; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
  .card-wide { grid-template-columns: 1fr; }
  .card-wide .viz { border-right: 0; border-bottom: 1px solid var(--line); min-height: 240px; }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more-list li { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .more-tags { grid-column: 2; text-align: left; }
}

@media (max-width: 820px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px var(--gutter) 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav-links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav-links a { padding: 12px 14px; font-size: 16px; }
  .nav-links .nav-cta { margin: 8px 0 0; text-align: center; }
  .nav-actions { margin-left: auto; }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { padding-left: 0; border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }

  .projects { grid-template-columns: 1fr; }
  .role { grid-template-columns: 1fr; gap: 10px; }
  .about { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .hero { padding-top: 112px; gap: 40px; }
  .kicker { font-size: 12px; align-items: flex-start; }
  .kicker .pulse { margin-top: 5px; }
  .hero-cta .btn { flex: 1 1 auto; justify-content: center; }
  .socials { margin-left: 0; width: 100%; }
  .stat { padding-right: 12px; }
  .stat + .stat { padding-left: 14px; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat dd { font-size: 13px; }
  .now { align-items: flex-start; }
  .skills { grid-template-columns: 1fr; }
  .viz-figs { padding: 52px 14px 16px; gap: 10px; }
  .card-body, .card-wide .card-body { padding: 22px 20px 20px; }
  .more-list li { grid-template-columns: 1fr; gap: 6px; }
  .more-tags { grid-column: auto; }
  .contact-actions .btn { flex: 1 1 calc(50% - 6px); justify-content: center; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  .nav, .landscape, .filters, .toast, .hero-cta, .viz { display: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .card { break-inside: avoid; }
}
