/* ═══════════════════════════════════════
   Wonsuk Choi — resume site
   Palette: deep specimen-slide navy + fluorophore accents
   ═══════════════════════════════════════ */

:root {
  --bg:          #05070d;
  --bg-2:        #080c16;
  --surface:     rgba(255,255,255,0.028);
  --stroke:      rgba(255,255,255,0.09);
  --stroke-soft: rgba(255,255,255,0.05);

  --text:        #e8edf5;
  --text-dim:    #8c97ac;
  --text-faint:  #5a6479;

  /* fluorophores */
  --fitc:        #4ade80;   /* green */
  --cy5:         #38bdf8;   /* cyan  */
  --pe:          #f472b6;   /* pink  */
  --dapi:        #818cf8;   /* violet*/

  --accent:      var(--cy5);
  --glow:        0 0 40px rgba(56,189,248,0.18);

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* subtle radial vignettes — like a slide under a scope */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 600px at 80% -5%,  rgba(56,189,248,0.10), transparent 60%),
    radial-gradient(700px 500px at 5% 30%,   rgba(129,140,248,0.08), transparent 60%),
    radial-gradient(800px 600px at 60% 105%, rgba(244,114,182,0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#bg-field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* film grain */
.grain {
  position: fixed; inset: -50%;
  z-index: 1; pointer-events: none; opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

main, header, footer, nav { position: relative; z-index: 2; }

/* ── scroll progress ───────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px; z-index: 100;
  background: rgba(255,255,255,0.04);
}
#progress-bar {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--dapi), var(--cy5), var(--fitc));
  box-shadow: 0 0 12px rgba(56,189,248,0.7);
  transition: width 0.1s linear;
}

/* ── nav ───────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(5,7,13,0.85), rgba(5,7,13,0));
  transition: background 0.4s var(--ease), padding 0.4s var(--ease);
}
nav.scrolled {
  background: rgba(5,7,13,0.82);
  border-bottom: 1px solid var(--stroke-soft);
  padding: 12px clamp(20px, 5vw, 56px);
}
.logo {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-mark {
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.14em;
  color: var(--text);
}
.logo-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fitc);
  box-shadow: 0 0 10px var(--fitc);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.9); opacity: 0.35; }
}
nav ul { display: flex; gap: clamp(16px, 2.6vw, 34px); list-style: none; }
nav ul a {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}
nav ul a::after {
  content: '';
  position: absolute; left: 0; bottom: -5px;
  width: 0; height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  transition: width 0.35s var(--ease);
}
nav ul a:hover { color: var(--text); }
nav ul a:hover::after, nav ul a.active::after { width: 100%; }
nav ul a.active { color: var(--accent); }

/* hamburger — hidden on desktop */
#nav-toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px;      /* 44px = min comfortable tap target */
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}
#nav-toggle span {
  position: absolute; left: 50%; top: 50%;
  width: 17px; height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.4s var(--ease), opacity 0.3s;
}
#nav-toggle span:nth-child(1) { transform: translate(-50%, -4px); }
#nav-toggle span:nth-child(2) { transform: translate(-50%, 4px); }
nav.open #nav-toggle span:nth-child(1) { transform: translate(-50%, 0) rotate(45deg); }
nav.open #nav-toggle span:nth-child(2) { transform: translate(-50%, 0) rotate(-45deg); }

#nav-scrim {
  position: fixed; inset: 0;
  z-index: 80;
  background: rgba(5,7,13,0.6);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
#nav-scrim.show { opacity: 1; pointer-events: auto; }

@media (max-width: 780px) {
  nav { padding: 12px 18px; padding-top: max(12px, env(safe-area-inset-top)); }
  #nav-toggle { display: block; }

  nav ul {
    position: fixed;
    top: 0; right: 0;
    z-index: 95;
    width: min(78vw, 300px);
    height: 100svh;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 32px;
    background: rgba(8,12,22,0.97);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--stroke);
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
  }
  nav.open ul { transform: none; }

  nav ul li { width: 100%; }
  nav ul a {
    display: block;
    padding: 16px 4px;               /* generous tap targets */
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--stroke-soft);
  }
  nav ul a::after { display: none; }
}

/* ── hero ──────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid; place-items: center;
  padding: 120px clamp(20px, 5vw, 56px) 80px;
  overflow: hidden;
}
#orb {
  position: absolute;
  top: 50%; right: -6%;
  transform: translateY(-50%);
  width: 820px; height: 820px;
  max-width: 60vw;
  opacity: 0.95;
  pointer-events: none;
}
@media (max-width: 900px) {
  #orb { right: 50%; transform: translate(50%, -50%); max-width: 100vw; opacity: 0.4; }
}
.hero-inner {
  position: relative;
  width: 100%; max-width: var(--maxw);
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim);
  padding: 7px 16px 7px 12px;
  border: 1px solid var(--stroke);
  border-radius: 100px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  margin-bottom: 30px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--fitc); box-shadow: 0 0 8px var(--fitc);
  animation: pulse 2s infinite;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 10.5vw, 8.4rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin-bottom: 30px;
}
h1 .line { display: block; }
h1 .accent {
  background: linear-gradient(100deg, var(--cy5), var(--dapi) 45%, var(--pe));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(56,189,248,0.25));
}

.tagline {
  max-width: 30ch;
  font-size: clamp(1rem, 1.45vw, 1.22rem);
  color: var(--text-dim);
  line-height: 1.75;
  margin-bottom: 32px;
}
.tagline .hl {
  color: var(--text);
  border-bottom: 1px dashed rgba(74,222,128,0.5);
}

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.hero-tags span {
  font-family: var(--font-mono);
  font-size: 0.7rem; letter-spacing: 0.06em;
  padding: 6px 13px;
  border: 1px solid var(--stroke-soft);
  border-radius: 6px;
  color: var(--text-faint);
  background: rgba(255,255,255,0.02);
  transition: all 0.3s var(--ease);
}
.hero-tags span:hover {
  color: var(--cy5);
  border-color: rgba(56,189,248,0.4);
  transform: translateY(-2px);
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-mono);
  font-size: 0.8rem; letter-spacing: 0.05em;
  padding: 14px 26px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.35s var(--ease);
  border: 1px solid transparent;
}
.btn.primary {
  background: var(--text);
  color: #05070d;
  font-weight: 500;
}
.btn.primary:hover {
  box-shadow: 0 0 0 1px var(--cy5), 0 10px 40px -8px rgba(56,189,248,0.55);
  transform: translateY(-2px);
}
.btn.ghost {
  border-color: var(--stroke);
  color: var(--text-dim);
  background: var(--surface);
}
.btn.ghost:hover {
  color: var(--text);
  border-color: var(--cy5);
  transform: translateY(-2px);
}

.scroll-hint {
  position: absolute; bottom: 34px; left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 36px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
}
.scroll-hint span {
  position: absolute; top: 7px; left: 50%;
  width: 3px; height: 6px; border-radius: 2px;
  background: var(--cy5);
  box-shadow: 0 0 8px var(--cy5);
  animation: scroll-dot 1.9s var(--ease) infinite;
}
@keyframes scroll-dot {
  0%   { transform: translate(-50%, 0);    opacity: 0; }
  25%  { opacity: 1; }
  75%  { transform: translate(-50%, 14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ── sections ──────────────────────────── */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(90px, 13vh, 150px) clamp(20px, 5vw, 56px);
}
.section-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: 56px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--stroke-soft);
}
.idx {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 2.9rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h3 { font-family: var(--font-display); font-weight: 600; }

/* ── about ─────────────────────────────── */
.about-grid { display: flex; flex-direction: column; gap: 26px; max-width: 78ch; }
.lede {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.6;
  color: var(--text);
  font-weight: 300;
}
.lede em { color: var(--cy5); font-style: normal; }
.about-grid p { color: var(--text-dim); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin-top: 28px;
  background: var(--stroke-soft);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  overflow: hidden;
}
.stat {
  background: var(--bg-2);
  padding: 26px 22px;
  transition: background 0.4s;
}
.stat:hover { background: #0c1220; }
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 700;
  line-height: 1;
  color: var(--fitc);
  margin-bottom: 8px;
  text-shadow: 0 0 24px rgba(74,222,128,0.35);
}
.stat span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ── skills ────────────────────────────── */
.skills-layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 34px;
  align-items: start;
}
@media (max-width: 940px) { .skills-layout { grid-template-columns: 1fr; } }

.skill-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--stroke-soft);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.008));
  overflow: hidden;
  transition: transform 0.45s var(--ease), border-color 0.45s, box-shadow 0.45s;
}
.card::after { /* cursor-follow sheen */
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(340px circle at var(--mx,50%) var(--my,50%), rgba(56,189,248,0.11), transparent 55%);
  opacity: 0; transition: opacity 0.4s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(56,189,248,0.32);
  box-shadow: 0 22px 50px -22px rgba(0,0,0,0.85), var(--glow);
}
.card:hover::after { opacity: 1; }
.card h3 { font-size: 1.03rem; margin-bottom: 10px; letter-spacing: -0.01em; }
.card p { font-size: 0.86rem; color: var(--text-dim); line-height: 1.65; }
.card-icon {
  width: 44px; height: 44px;
  margin-bottom: 18px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(56,189,248,0.06);
  position: relative;
  overflow: hidden;
}
.card-icon canvas { width: 100%; height: 100%; display: block; }

/* cytometry panel */
.cyto-panel {
  position: sticky; top: 96px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(6,9,16,0.7);
  backdrop-filter: blur(10px);
  overflow: hidden;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.9);
}
.panel-head, .panel-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--stroke-soft);
}
.panel-foot {
  border-bottom: none;
  border-top: 1px solid var(--stroke-soft);
  justify-content: space-between;
}
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pe); box-shadow: 0 0 9px var(--pe);
  animation: pulse 1.6s infinite;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}
#cyto-plot { display: block; width: 100%; height: 340px; }

/* ── timeline ──────────────────────────── */
.timeline { position: relative; padding-left: 34px; }
.timeline-spine {
  position: absolute; left: 5px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--stroke);
}
#spine-fill {
  display: block; width: 100%; height: 0%;
  background: linear-gradient(180deg, var(--dapi), var(--cy5), var(--fitc));
  box-shadow: 0 0 12px rgba(56,189,248,0.8);
  transition: height 0.2s linear;
}
.tl-item { position: relative; padding-bottom: 54px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute; left: -34px; top: 7px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--text-faint);
  transition: all 0.5s var(--ease);
}
.tl-item.in .tl-node {
  border-color: var(--cy5);
  background: var(--cy5);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.13), 0 0 16px var(--cy5);
}
.tl-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  margin-bottom: 10px;
}
.tl-year {
  font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.06em;
  color: var(--fitc);
}
.tl-place {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}
.tl-body h3 { font-size: 1.32rem; letter-spacing: -0.015em; margin-bottom: 3px; }
.tl-body h4 {
  font-family: var(--font-mono);
  font-weight: 400; font-size: 0.76rem;
  color: var(--dapi);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.tl-body ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.tl-body li {
  position: relative;
  padding-left: 20px;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.7;
}
.tl-body li::before {
  content: '';
  position: absolute; left: 2px; top: 11px;
  width: 5px; height: 1px;
  background: var(--text-faint);
  transition: all 0.4s var(--ease);
}
.tl-body li:hover { color: var(--text); }
.tl-body li:hover::before { width: 11px; background: var(--cy5); box-shadow: 0 0 6px var(--cy5); }

/* ── research ──────────────────────────── */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 860px) { .research-grid { grid-template-columns: 1fr; } }

.col-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--stroke-soft);
}
.pub {
  position: relative;
  padding: 18px 18px 18px 20px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.018);
  transition: all 0.4s var(--ease);
}
.pub::before {
  content: '';
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 2px; border-radius: 2px;
  background: var(--stroke);
  transition: all 0.4s var(--ease);
}
.pub:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--stroke-soft);
  transform: translateX(4px);
}
.pub:hover::before { background: var(--pe); box-shadow: 0 0 10px var(--pe); }
.pub-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--cy5);
  margin-bottom: 8px;
}
.pub p { font-size: 0.9rem; color: var(--text-dim); line-height: 1.65; }
.pub b { color: var(--text); font-weight: 600; }
.pub em { color: var(--text); font-style: italic; }
.pub a { color: var(--cy5); text-decoration: none; word-break: break-all; }
.pub a:hover { text-decoration: underline; }
.pub-authors {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}
.award {
  display: inline-block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #fbbf24;
  padding: 4px 10px;
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: 5px;
  background: rgba(251,191,36,0.07);
}
.pub.pending { opacity: 0.62; border-style: dashed; border-color: var(--stroke); }

.edu { margin-top: 56px; }
.edu-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.edu-item {
  padding: 22px;
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(255,255,255,0.006));
  transition: all 0.4s var(--ease);
}
.edu-item:hover { border-color: rgba(129,140,248,0.4); transform: translateY(-3px); }
.edu-item b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.06rem; font-weight: 600;
  margin-bottom: 6px;
}
.edu-item span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* ── contact ───────────────────────────── */
.contact { text-align: left; padding-bottom: 90px; }
.contact .idx { display: block; margin-bottom: 14px; }
.contact h2 {
  font-size: clamp(2rem, 5.2vw, 3.8rem);
  max-width: 16ch;
  margin-bottom: 18px;
}
.contact-lede {
  color: var(--text-dim);
  max-width: 52ch;
  margin-bottom: 44px;
}
.contact-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--stroke-soft);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  overflow: hidden;
}
.clink {
  padding: 24px;
  background: var(--bg-2);
  text-decoration: none;
  display: flex; flex-direction: column; gap: 7px;
  transition: background 0.4s var(--ease);
}
a.clink:hover { background: #0d1524; }
.clink span { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.clink b {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 500;
  color: var(--text);
  transition: color 0.3s;
}
a.clink:hover b { color: var(--cy5); }

footer {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px clamp(20px, 5vw, 56px) 44px;
  border-top: 1px solid var(--stroke-soft);
}

/* ── reveal animation ──────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.skill-cards .card:nth-child(2) { transition-delay: 0.06s; }
.skill-cards .card:nth-child(3) { transition-delay: 0.12s; }
.skill-cards .card:nth-child(4) { transition-delay: 0.18s; }
.skill-cards .card:nth-child(5) { transition-delay: 0.24s; }
.skill-cards .card:nth-child(6) { transition-delay: 0.30s; }

/* ═══════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════ */

/* Hover states are a lie on touch screens — they latch on tap and stay
   stuck. Only grant them to devices with a real pointer. */
@media (hover: none) {
  .card:hover, .edu-item:hover, .stat:hover {
    transform: none;
    box-shadow: none;
  }
  .card:hover::after { opacity: 0; }
  .pub:hover { transform: none; }
  .hero-tags span:hover, .btn:hover { transform: none; }
  .tl-body li:hover::before { width: 5px; box-shadow: none; background: var(--text-faint); }
}

/* iOS paints a grey box over tapped links */
a, button { -webkit-tap-highlight-color: rgba(56,189,248,0.15); }

@media (max-width: 940px) {
  /* sticking a 340px panel inside a stacked column just makes it hover
     awkwardly over the content below it */
  .cyto-panel { position: static; }
  #cyto-plot { height: 260px; }
}

@media (max-width: 780px) {
  :root { --maxw: 100%; }

  /* fixed nav would otherwise swallow the top of each anchored section */
  html { scroll-padding-top: 80px; }

  .section { padding: 72px 20px; }
  .section-head { margin-bottom: 38px; gap: 12px; }

  .hero { padding: 104px 20px 90px; min-height: 92svh; }
  .hero-inner { text-align: left; }

  h1 { font-size: clamp(3rem, 16vw, 5rem); }
  .tagline { max-width: 100%; font-size: 1rem; }
  .eyebrow { font-size: 0.66rem; margin-bottom: 22px; }

  /* full-width buttons are far easier to hit with a thumb */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { text-align: center; padding: 16px 24px; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 20px 16px; }
  .stat b { font-size: 1.9rem; }

  .skill-cards { grid-template-columns: 1fr; }

  .timeline { padding-left: 24px; }
  .tl-node { left: -24px; }
  .tl-item { padding-bottom: 40px; }
  .tl-body h3 { font-size: 1.15rem; }
  .tl-body li { font-size: 0.89rem; }

  .research-grid { gap: 30px; }

  .contact h2 { max-width: 100%; }
  .contact-links { grid-template-columns: 1fr; }

  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    /* clear the iPhone home-indicator bar */
    padding-bottom: max(40px, env(safe-area-inset-bottom));
  }

  /* long DOIs and emails must wrap, not force a horizontal scrollbar */
  .pub a, .clink b { word-break: break-word; overflow-wrap: anywhere; }
}

@media (max-width: 380px) {
  .stats { grid-template-columns: 1fr; }
  h1 { font-size: 2.7rem; }
  .section { padding: 60px 16px; }
}

/* landscape phone: the hero shouldn't demand a full tall screen */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 100px 20px 60px; }
  .scroll-hint { display: none; }
}

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