/* ============================================================
   Zhaoxin Feng — personal site
   Soft humanist · paper-white · deep navy · Crimson Pro + Source Serif
   ============================================================ */

:root {
  /* LIGHT (default) — cool neutral, darker for stronger contrast */
  --bg: #ffffff;
  --bg-soft: #eef0f2;
  --ink: #111214;
  --ink-soft: #26292e;
  --ink-muted: #4e535a;
  --rule: #c8ccd1;
  --accent: oklch(42% 0.09 155);
  --accent-soft: oklch(52% 0.08 155);
  --accent-bg: oklch(96% 0.018 155);
  --highlight: oklch(94% 0.025 155);

  /* type */
  --f-display: "Lato", Calibri, Helvetica, Arial, sans-serif;
  --f-body: "Lato", Calibri, Helvetica, Arial, sans-serif;
  --f-mono: "Lato", Calibri, Helvetica, Arial, sans-serif;

  /* sizing */
  --col: 760px;
  --gutter: 32px;
  --radius: 3px;
  --lh: 1.62;
}

/* DARK theme */
html[data-theme="dark"] {
  --bg: #15171a;
  --bg-soft: #1e2125;
  --ink: #e8eaed;
  --ink-soft: #c4c8ce;
  --ink-muted: #8a8f97;
  --rule: #2e3238;
  --accent: oklch(80% 0.13 155);
  --accent-soft: oklch(70% 0.1 155);
  --accent-bg: oklch(38% 0.08 155);
  --highlight: oklch(33% 0.06 155);
}

/* reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: var(--lh);
  font-feature-settings: "onum", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* paper texture removed — pure white/dark backgrounds */
body::before { display: none; }

/* layout */
.wrap {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================================
   NAV
   ============================================================ */
.nav {
  padding: 38px 0 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-brand {
  font-family: var(--f-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  font-style: italic;
}
.nav-brand em {
  font-style: normal;
  color: var(--accent);
}
.nav-links {
  display: flex;
  gap: 22px;
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-links a:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}
.nav-links a.active {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================================
   HERO (index only)
   ============================================================ */
.hero {
  padding: 64px 0 32px;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { order: -1; justify-self: center; }
}

.hero h1 {
  font-family: var(--f-display);
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.hero h1 .nickname {
  color: var(--accent-soft);
  font-weight: 400;
}
.hero .role {
  font-family: var(--f-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 14px 0 20px;
}
.hero .affil {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}
.hero .affil a {
  color: var(--accent);
}

.hero-photo {
  width: 200px;
}
.hero-photo img,
.hero-photo .photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
  box-shadow:
    0 1px 0 oklch(80% 0.015 80),
    0 12px 28px -18px oklch(20% 0.02 60 / .35);
}
.photo-placeholder {
  background:
    repeating-linear-gradient(135deg,
      oklch(88% 0.02 85) 0 6px,
      oklch(92% 0.015 85) 6px 12px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
}
.photo-placeholder span {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 2px;
}
.hero-photo .caption {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 10px;
  text-align: right;
  letter-spacing: 0.04em;
}

/* contact chips */
.contacts {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  font-family: var(--f-mono);
  font-size: 13px;
}
.contacts a, .contacts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  background: var(--bg);
  transition: all .2s;
}
.contacts a:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-bg);
  transform: translateY(-1px);
}
.contacts .email-plain {
  cursor: text;
  user-select: all;
}
.contacts svg {
  width: 13px; height: 13px;
}

/* ============================================================
   SECTIONS
   ============================================================ */
section { padding: 36px 0; }
section + section { border-top: 1px dashed var(--rule); }

h2.sec {
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-muted);
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}
h2.sec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--rule), transparent);
}

p { margin: 0 0 14px; }
p a, .body-text a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-bg);
  transition: border-color .2s;
}
p a:hover, .body-text a:hover {
  border-color: var(--accent);
}
strong { color: var(--ink); font-weight: 600; }

/* drop cap (optional, opt-in) */
.dropcap::first-letter {
  font-family: var(--f-display);
  font-size: 58px;
  line-height: 0.9;
  float: left;
  padding: 6px 10px 0 0;
  color: var(--accent);
  font-weight: 500;
}

/* pulled quote */
.pull {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  padding: 8px 0 8px 22px;
  border-left: 2px solid var(--accent-soft);
  margin: 22px 0;
}

/* interest chips */
.interests {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}
.interests .chip {
  font-family: var(--f-mono);
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-soft);
}
.interests .chip.is-primary {
  background: var(--accent-bg);
  border-color: var(--accent-soft);
  color: var(--accent);
}

/* ============================================================
   PUBLICATIONS
   ============================================================ */
.year-group {
  margin-bottom: 40px;
}
.year-label {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--ink-muted);
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.pub {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid transparent;
  transition: background .25s, border-color .25s;
  position: relative;
}
.pub:hover {
  background: linear-gradient(to right, var(--accent-bg) 0%, transparent 60%);
  border-bottom-color: var(--rule);
}
.pub:hover .pub-emoji {
  transform: rotate(-4deg) scale(1.08);
}

.pub-emoji {
  width: 52px;
  height: 52px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  align-self: start;
  margin-top: 2px;
}

.pub-body {
  min-width: 0;
}
.pub-title {
  font-family: var(--f-display);
  font-size: 19px;
  line-height: 1.32;
  color: var(--ink);
  margin: 0 0 4px;
  font-weight: 500;
}
.pub-authors {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0 0 4px;
}
.pub-authors .me {
  color: var(--accent);
  font-weight: 700;
}
.pub-venue {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.pub-venue .tag {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: 2px;
}
.pub-venue .tag.review {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
}
.pub-venue .tag.cofirst {
  background: var(--ink);
}

.pub-links {
  display: flex;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 12px;
  flex-wrap: wrap;
}
.pub-links a {
  color: var(--accent);
  text-decoration: none;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--accent-bg);
  transition: border-color .15s;
}
.pub-links a:hover { border-color: var(--accent); }
.pub-links a::before { content: "["; color: var(--ink-muted); }
.pub-links a::after { content: "]"; color: var(--ink-muted); }

/* ============================================================
   CV / simple lists
   ============================================================ */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px dotted var(--rule);
}
.timeline li:last-child { border-bottom: none; }
.timeline .when {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  padding-top: 3px;
}
.timeline .what {
  color: var(--ink);
}
.timeline .what .sub {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 2px;
  line-height: 1.4;
}

/* award list — compact two-col */
.awards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.awards li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule);
}
.awards li:last-child { border-bottom: none; }
.awards .yr {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.awards .scope {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right: 6px;
}

/* coursework */
.course-group {
  margin-bottom: 18px;
}
.course-group h4 {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  margin: 0 0 8px;
}
.course-list {
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.65;
}
.course-list span {
  display: inline;
}
.course-list span:not(:last-child)::after {
  content: " · ";
  color: var(--rule);
}

/* ============================================================
   WHERE I WAS — timeline + map
   ============================================================ */
.travelmap {
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 20px 24px 16px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}
.travelmap svg {
  width: 100%;
  height: auto;
  display: block;
}
.travelmap .dot {
  fill: var(--accent);
  transition: r .25s, fill .25s;
}
.travelmap .dot.small { fill: var(--accent-soft); }
.travelmap .dot.future {
  fill: var(--bg);
  stroke: var(--accent);
  stroke-width: 2;
}
.travelmap .dot.home {
  fill: var(--accent);
  stroke: var(--bg);
  stroke-width: 2;
}
.travelmap .travel-dot {
  fill: var(--bg);
  stroke: var(--ink-muted);
  stroke-width: 1.5;
  opacity: 0.9;
  transition: opacity .2s, stroke .2s, r .2s;
}
.travelmap .travel-dot:hover {
  stroke: var(--accent);
  opacity: 1;
}
.travelmap .travel-label {
  fill: var(--ink-soft) !important;
  font-weight: 600;
}
.travelmap g.points > g:hover .dot { fill: oklch(25% 0.1 265); }
.travelmap .ring {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
  opacity: 0;
  animation: pulse 2.8s ease-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.travelmap .ring.home {
  stroke: var(--accent);
  stroke-width: 1.2;
}
@keyframes pulse {
  0% { opacity: 0.55; r: 4; }
  100% { opacity: 0; r: 22; }
}
.travelmap .label {
  font-family: var(--f-body);
  font-size: 11px;
  fill: var(--ink-soft);
  pointer-events: none;
  letter-spacing: 0.01em;
}
.travelmap .label.city { font-weight: 700; fill: var(--ink); font-size: 12px; }
.travelmap .label.year { font-size: 10px; fill: var(--ink-muted); font-style: italic; }
.travelmap .label.home-label { font-weight: 700; fill: var(--accent); font-size: 13px; }
.travelmap .label.home-sub { font-size: 10px; fill: var(--ink-muted); font-style: italic; }

.conf-legend {
  display: flex;
  gap: 20px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 12px;
  justify-content: center;
}
.conf-legend .swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 5px;
}
.conf-legend .swatch.past { background: var(--accent); }
.conf-legend .swatch.travel {
  background: var(--bg);
  border: 1.5px solid var(--ink-muted);
  box-sizing: border-box;
}
.conf-legend .swatch.future {
  background: var(--bg);
  border: 2px solid var(--accent);
  box-sizing: border-box;
}
.conf-legend .swatch.home {
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
  box-sizing: border-box;
}

.conf-timeline {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}
.conf-timeline li {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px dotted var(--rule);
  align-items: baseline;
}
.conf-timeline .yr {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  font-style: italic;
}
.conf-timeline .ev {
  font-family: var(--f-display);
  font-size: 17px;
  color: var(--ink);
}
.conf-timeline .ev .place {
  display: block;
  font-family: var(--f-body);
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 2px;
}
.conf-timeline .future-tag {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--accent);
  border: 1px dashed var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.1em;
}

/* Places visited — grouped by year */
.places-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}
.places-list li {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dotted var(--rule);
  align-items: baseline;
}
.places-list li:last-child { border-bottom: none; }
.places-list .yr {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--accent);
  font-style: italic;
}
.places-list .cities {
  font-family: var(--f-display);
  font-size: 16px;
  color: var(--ink);
  line-height: 1.6;
  text-wrap: pretty;
}
.places-list .country {
  font-family: var(--f-body);
  font-size: 13px;
  font-style: italic;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  padding: 40px 0 60px;
  border-top: 1px dashed var(--rule);
  margin-top: 40px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.05em;
}
footer .sig {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* ============================================================
   MISC / simple content
   ============================================================ */
.misc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.misc-list li {
  padding: 10px 0;
  border-bottom: 1px dotted var(--rule);
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.misc-list li:last-child { border-bottom: none; }
.misc-list .ico {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

/* ============================================================
   TWEAKS PANEL
   ============================================================ */
.tweaks-toggle-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-muted);
  opacity: 0.5;
  pointer-events: none;
}
#tweaks-panel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 280px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  font-family: var(--f-body);
  font-size: 14px;
  box-shadow: 0 10px 32px -14px oklch(20% 0.02 60 / .3);
  z-index: 9999;
  display: none;
}
#tweaks-panel.on { display: block; }
#tweaks-panel h3 {
  margin: 0 0 12px;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
#tweaks-panel h3 small {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tweak-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--rule);
}
.tweak-row:last-child { border-bottom: none; }
.tweak-row label {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tweak-swatches { display: flex; gap: 6px; }
.tweak-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  cursor: pointer;
  padding: 0;
  transition: transform .15s;
}
.tweak-swatch:hover { transform: scale(1.1); }
.tweak-swatch.active { border-color: var(--ink); }
.tweak-select {
  font-family: var(--f-mono);
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  color: var(--ink);
}
.tweak-slider {
  width: 110px;
  accent-color: var(--accent);
}

/* tweak font variants */
body[data-font="classic"] {
  --f-display: "Lato", Calibri, Helvetica, Arial, sans-serif;
  --f-body: "Lato", Calibri, Helvetica, Arial, sans-serif;
  --f-mono: "Lato", Calibri, Helvetica, Arial, sans-serif;
}
body[data-font="serif"] {
  --f-display: "Source Serif 4", Georgia, serif;
  --f-body: "Source Serif 4", Georgia, serif;
  --f-mono: "Source Serif 4", Georgia, serif;
}
body[data-font="mixed"] {
  --f-display: "Lato", Calibri, sans-serif;
  --f-body: "Lato", Calibri, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}
body[data-font="mono"] {
  --f-display: "JetBrains Mono", ui-monospace, monospace;
  --f-body: "JetBrains Mono", ui-monospace, monospace;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
}

/* tweak accent variants */
body[data-accent="navy"] { --accent: oklch(35% 0.09 265); --accent-soft: oklch(55% 0.06 265); --accent-bg: oklch(94% 0.022 265); }
body[data-accent="oxblood"] { --accent: oklch(38% 0.11 20); --accent-soft: oklch(55% 0.08 20); --accent-bg: oklch(95% 0.02 20); }
body[data-accent="forest"] { --accent: oklch(42% 0.09 155); --accent-soft: oklch(58% 0.06 155); --accent-bg: oklch(95% 0.02 155); }
body[data-accent="violet"] { --accent: oklch(42% 0.09 300); --accent-soft: oklch(58% 0.06 300); --accent-bg: oklch(95% 0.02 300); }
body[data-accent="ochre"] { --accent: oklch(55% 0.09 70); --accent-soft: oklch(68% 0.07 70); --accent-bg: oklch(95% 0.025 70); }

/* tweak density */
body[data-density="tight"] { --lh: 1.5; }
body[data-density="normal"] { --lh: 1.62; }
body[data-density="airy"] { --lh: 1.8; }

/* theme toggle button */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color .2s, border-color .2s, background .2s, transform .2s;
  padding: 0;
  margin-left: 4px;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  transform: rotate(-12deg);
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

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

/* ============================================================
   MOBILE / NARROW — unified responsive polish
   ============================================================ */
@media (max-width: 720px) {
  :root {
    --gutter: 22px;
  }
  /* nav: tighter, don't wrap brand away from links */
  .nav { padding: 22px 0 0; }
  .nav-inner { gap: 14px; }
  .nav-brand { font-size: 17px; }
  .nav-links { gap: 14px; font-size: 12px; }
  .nav-right { gap: 10px; }

  /* hero: single column, photo sized down, name scales */
  .hero { padding: 36px 0 24px; gap: 24px; }
  .hero-photo { width: 62%; max-width: 260px; margin: 0 auto; }
  .hero h1 { font-size: 34px; line-height: 1.08; }
  .hero h1 .nickname { display: inline; }
  .hero .role { font-size: 12px; margin: 12px 0 16px; }
  .hero .affil { font-size: 16px; }

  /* contacts: stack cleanly, allow long email to sit alone on its row */
  .contacts { gap: 8px; }
  .contacts a, .contacts span {
    font-size: 12px;
    padding: 5px 10px;
  }
  .contacts .email-plain {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  /* body text + headings */
  .body-text { font-size: 16px; }
  h2.sec { font-size: 13px; }
  .pull { font-size: 18px; padding-left: 16px; }

  /* publications */
  .pub-item { grid-template-columns: 36px 1fr; gap: 14px; }
  .pub-emoji { font-size: 24px; }
  .pub-title { font-size: 16px; }
  .pub-year-header { font-size: 40px; }

  /* CV-style timeline: stack when/what vertically */
  .timeline li {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 0;
  }
  .timeline .when { padding-top: 0; }

  /* conference travel timeline */
  .conf-timeline li {
    grid-template-columns: 60px 1fr;
    gap: 8px 12px;
  }
  .conf-timeline .yr { font-size: 18px; }
  .conf-timeline .ev { font-size: 15px; }
  .conf-timeline .future-tag {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
  }

  /* travelmap: allow horizontal scroll if it gets too cramped */
  .travelmap { padding: 12px; }
  .conf-legend { gap: 10px 16px; font-size: 11px; }

  /* tweaks panel: don't overlap content on small screens */
  #tweaks-panel {
    right: 12px !important;
    left: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
  }

  footer { font-size: 12px; padding: 40px 0 32px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 28px; }
  .nav-links { gap: 10px; font-size: 11.5px; }
  .pub-year-header { font-size: 32px; }
}

/* ============================================================
   SITE LOADER (intro animation — Idea Swap)
   ============================================================ */
#site-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.8s ease-out;
}
#site-loader.is-done {
  opacity: 0;
  pointer-events: none;
}
#site-loader.is-hidden {
  display: none;
}
#site-loader .loader-stage {
  width: min(520px, 88vw);
  aspect-ratio: 300 / 180;
  position: relative;
}
#site-loader svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
/* total timeline ≈ 10s: 0-2 intro, 2-7.5 swap (with shimmer hold), 7.5-8.5 arrival, 8-10 thread+caption */

#site-loader .loader-caption {
  position: absolute;
  left: 0; right: 0;
  bottom: -40px;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
  opacity: 0;
  animation: loader-caption 10s ease-in-out forwards;
}
@keyframes loader-caption {
  0%, 38%  { opacity: 0; transform: translateY(4px); letter-spacing: 0.28em; filter: blur(1.5px); }
  50%      { opacity: 0.95; transform: translateY(0); letter-spacing: 0.1em; filter: blur(0); }
  100%     { opacity: 0.95; transform: translateY(0); letter-spacing: 0.1em; filter: blur(0); }
}

#site-loader .loader-skip {
  position: absolute;
  bottom: 32px;
  left: 0; right: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink);
  opacity: 0;
  animation: loader-skip-fade 10s ease forwards;
  cursor: pointer;
}
@keyframes loader-skip-fade {
  0%, 3%   { opacity: 0; }
  8%       { opacity: 0.45; }
  85%      { opacity: 0.45; }
  100%     { opacity: 0; }
}

/* floor line — draws in at start */
.ldr-floor {
  stroke: var(--ink);
  stroke-width: 0.8;
  opacity: 0;
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: ldr-floor 10s ease-out forwards;
}
@keyframes ldr-floor {
  0%   { opacity: 0; stroke-dashoffset: 260; }
  6%   { opacity: 0.18; }
  18%  { opacity: 0.18; stroke-dashoffset: 0; }
  100% { opacity: 0.18; stroke-dashoffset: 0; }
}

/* shared loader primitives */
.ldr-line {
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ldr-fill { fill: var(--ink); }
.ldr-acc-stroke {
  stroke: var(--accent);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ldr-acc-fill { fill: var(--accent); }

/* actors fade in gently at start */
.ldr-human-group {
  animation: ldr-enter 10s ease-out forwards, ldr-breathe 4.5s ease-in-out 1.5s infinite;
  transform-origin: 75px 150px;
  opacity: 0;
}
.ldr-robot-group {
  animation: ldr-enter 10s ease-out 0.35s forwards, ldr-breathe 4.5s ease-in-out 1.7s infinite;
  transform-origin: 225px 150px;
  opacity: 0;
}
@keyframes ldr-enter {
  0%   { opacity: 0; transform: translateY(4px); }
  9%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes ldr-breathe {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.6px); }
}

/* gentle idle tilt on both — subtle "thinking" micro-movement */
.ldr-tilt-h {
  animation: ldr-tilt-h 5.5s ease-in-out 1.5s infinite;
  transform-origin: 75px 97px;
}
.ldr-tilt-r {
  animation: ldr-tilt-r 5.5s ease-in-out 1.6s infinite;
  transform-origin: 225px 97px;
}
@keyframes ldr-tilt-h {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(-1deg); }
}
@keyframes ldr-tilt-r {
  0%, 100% { transform: rotate(0); }
  50%      { transform: rotate(1deg); }
}

/* antenna pulse — robot "listens" throughout */
.ldr-antenna-pulse {
  transform-box: fill-box;
  transform-origin: center;
  animation: ldr-antenna 10s ease-in-out forwards;
}
@keyframes ldr-antenna {
  0%   { transform: scale(1); opacity: 0.35; }
  6%   { transform: scale(1.6); opacity: 0.6; }
  12%  { transform: scale(1); opacity: 0.35; }
  18%  { transform: scale(1.6); opacity: 0.6; }
  24%  { transform: scale(1); opacity: 0.35; }
  100% { transform: scale(1); opacity: 0.35; }
}

/* human brow lift — "curious" beat before idea forms */
.ldr-brow-lift {
  transform-box: fill-box;
  transform-origin: center;
  animation: ldr-brow 10s ease-in-out forwards;
}
@keyframes ldr-brow {
  0%, 4%   { transform: translateY(0); }
  7%       { transform: translateY(-0.9px); }
  10%      { transform: translateY(-1.2px); }
  16%      { transform: translateY(0); }
  100%     { transform: translateY(0); }
}

/* arrival glows — dual ring ripple */
.ldr-glow-h,
.ldr-glow-r {
  opacity: 0;
  animation: ldr-glow 10s cubic-bezier(.2,.7,.3,1) forwards;
  transform-box: fill-box;
  transform-origin: center;
}
.ldr-glow-h.delay2,
.ldr-glow-r.delay2 {
  animation-name: ldr-glow-2;
}
@keyframes ldr-glow {
  0%, 36%  { opacity: 0; transform: scale(0.75); }
  40%      { opacity: 0.85; transform: scale(1); }
  48%      { opacity: 0.25; transform: scale(1.4); }
  55%, 100%{ opacity: 0; transform: scale(1.55); }
}
@keyframes ldr-glow-2 {
  0%, 38%  { opacity: 0; transform: scale(0.7); }
  42%      { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 0.18; transform: scale(1.6); }
  57%, 100%{ opacity: 0; transform: scale(1.8); }
}

/* final connecting thread — draws after swap, stays visible */
.ldr-thread {
  stroke-dasharray: 180;
  stroke-dashoffset: 180;
  opacity: 0;
  animation: ldr-thread 10s cubic-bezier(.4,.1,.3,1) forwards;
}
@keyframes ldr-thread {
  0%, 37%  { opacity: 0; stroke-dashoffset: 180; }
  44%      { opacity: 0.9; stroke-dashoffset: 90; }
  52%      { opacity: 0.9; stroke-dashoffset: 0; }
  100%     { opacity: 0.9; stroke-dashoffset: 0; }
}

/* bulb trajectory (human → robot) — more relaxed pacing, shimmer hold mid-arc */
.ldr-bulb {
  animation: ldr-bulb 10s cubic-bezier(.4,.05,.55,.95) forwards;
  transform-box: view-box;
}
@keyframes ldr-bulb {
  0%, 8%   { transform: translate(0, 0) scale(0.6);            opacity: 0; }
  9%       { transform: translate(0, -2px) scale(0.85);        opacity: 0.6; }
  11%      { transform: translate(0, -6px) scale(1.1);         opacity: 1; }
  13%      { transform: translate(-3px, -5px) scale(1);        opacity: 1; }
  17%      { transform: translate(25px, -16px) scale(1);       opacity: 1; }
  22%      { transform: translate(62px, -26px) scale(1.03);    opacity: 1; }
  27%      { transform: translate(95px, -20px) scale(1);       opacity: 1; }
  32%      { transform: translate(125px, -4px) scale(1);       opacity: 1; }
  34%      { transform: translate(125px, 0) scale(0.88);       opacity: 0.8; }
  36%      { transform: translate(125px, 0) scale(0.6);        opacity: 0; }
  100%     { transform: translate(125px, 0) scale(0.6);        opacity: 0; }
}

/* bulb sparkle trail */
.ldr-bulb-trail {
  animation: ldr-bulb-trail 10s ease-in-out forwards;
  transform-box: fill-box;
  opacity: 0;
}
@keyframes ldr-bulb-trail {
  0%, 12%  { opacity: 0; }
  18%      { opacity: 0.55; }
  30%      { opacity: 0.55; }
  36%, 100%{ opacity: 0; }
}

/* bulb filament flicker — ignites then glows steady, flares at hand-off */
.ldr-filament {
  animation: ldr-filament 10s ease-in-out forwards;
}
@keyframes ldr-filament {
  0%, 8%       { opacity: 0; }
  10%, 12%     { opacity: 1; }
  13%          { opacity: 0.5; }
  15%, 30%     { opacity: 1; }
  32%          { opacity: 0.7; }
  33%, 35%     { opacity: 1; }
  36%, 100%    { opacity: 0; }
}

/* gear trajectory (robot → human) — mirror */
.ldr-gear {
  animation: ldr-gear 10s cubic-bezier(.4,.05,.55,.95) forwards;
  transform-box: view-box;
}
@keyframes ldr-gear {
  0%, 8%   { transform: translate(0, 0) rotate(0deg) scale(0.6);         opacity: 0; }
  9%       { transform: translate(0, -2px) rotate(15deg) scale(0.85);    opacity: 0.6; }
  11%      { transform: translate(0, -6px) rotate(30deg) scale(1.1);     opacity: 1; }
  13%      { transform: translate(3px, -5px) rotate(50deg) scale(1);     opacity: 1; }
  17%      { transform: translate(-25px, -16px) rotate(120deg) scale(1);  opacity: 1; }
  22%      { transform: translate(-62px, -26px) rotate(210deg) scale(1.03); opacity: 1; }
  27%      { transform: translate(-95px, -20px) rotate(300deg) scale(1);opacity: 1; }
  32%      { transform: translate(-125px, -4px) rotate(370deg) scale(1); opacity: 1; }
  34%      { transform: translate(-125px, 0) rotate(380deg) scale(0.88); opacity: 0.8; }
  36%      { transform: translate(-125px, 0) rotate(380deg) scale(0.6);  opacity: 0; }
  100%     { transform: translate(-125px, 0) rotate(380deg) scale(0.6);  opacity: 0; }
}

/* spotlight under actors */
.ldr-spot {
  animation: ldr-spot 6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes ldr-spot {
  0%, 100% { opacity: 0.25; }
  50%      { opacity: 0.55; }
}

/* reduced motion: skip animation entirely */
@media (prefers-reduced-motion: reduce) {
  #site-loader { display: none !important; }
}

/* print — basic */
@media print {
  .nav, #tweaks-panel, .tweaks-toggle-hint, footer { display: none; }
  body { background: white; }
}
