/* ==========================================================================
   Fei Wu: personal site
   ========================================================================== */

:root {
  /* Palette inspired by the pastel sky of ethereum.foundation */
  --bg: #c9d3dc;
  --bg-gradient: linear-gradient(180deg, #d5dae4 0%, #cad4dd 40%, #c2d3da 75%, #b8cfd6 100%);
  --nav-bg: rgba(204, 213, 222, 0.82);
  --surface: rgba(251, 248, 242, 0.78);
  --text: #2f2f45;
  --text-2: #45475e;
  --text-3: #575d72;
  --accent: #3a4797;
  --accent-strong: #283476;
  --accent-soft: rgba(107, 122, 186, 0.2);
  --mark: rgba(255, 235, 92, 0.75);
  --journal: #8a3f2c;
  --journal-soft: rgba(240, 138, 120, 0.28);
  --border: rgba(54, 54, 76, 0.14);
  --shadow: 0 1px 2px rgba(40, 45, 70, 0.06), 0 12px 30px rgba(40, 45, 70, 0.1);

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  --sidebar-w: 340px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1d33;
    --bg-gradient: linear-gradient(180deg, #1e1f37 0%, #1b2136 55%, #172832 100%);
    --nav-bg: rgba(28, 30, 52, 0.85);
    --surface: rgba(255, 255, 255, 0.05);
    --text: #e7e8f2;
    --text-2: #b9bcd0;
    --text-3: #9095ac;
    --accent: #a3b1ff;
    --accent-strong: #c3ccff;
    --accent-soft: rgba(107, 122, 186, 0.24);
    --mark: rgba(255, 235, 92, 0.24);
    --journal: #f3b09f;
    --journal-soft: rgba(240, 138, 120, 0.16);
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #1b1d33;
  --bg-gradient: linear-gradient(180deg, #1e1f37 0%, #1b2136 55%, #172832 100%);
  --nav-bg: rgba(28, 30, 52, 0.85);
  --surface: rgba(255, 255, 255, 0.05);
  --text: #e7e8f2;
  --text-2: #b9bcd0;
  --text-3: #9095ac;
  --accent: #a3b1ff;
  --accent-strong: #c3ccff;
  --accent-soft: rgba(107, 122, 186, 0.24);
  --mark: rgba(255, 235, 92, 0.24);
  --journal: #f3b09f;
  --journal-soft: rgba(240, 138, 120, 0.16);
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

html { background: var(--bg); }

body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-gradient);
  pointer-events: none;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }

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

p { margin: 0 0 14px; color: var(--text-2); }

sup { font-size: 0.7em; line-height: 0; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.page {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 44px 28px 32px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.photo {
  display: block;
  width: 100%;
  max-width: 284px;
  height: auto;
  aspect-ratio: 1058 / 1148;
  object-fit: cover;
  border-radius: 16px;
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border), var(--shadow);
  background: var(--accent-soft);
}

.name {
  margin: 20px 0 0;
  font-family: var(--serif);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--text);
}

.name-zh {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--text-3);
}

.role { margin: 16px 0 4px; font-size: 0.95rem; font-weight: 600; color: var(--text-2); }

.affil { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--text-3); }
.affil a { color: var(--text-2); text-decoration: none; }
.affil a:hover { color: var(--accent); text-decoration: underline; }

.loc { margin: 12px 0 0; font-size: 0.85rem; color: var(--text-3); }
.loc i { margin-right: 4px; color: var(--accent); }

.social {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
}

.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}
.social a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}
:root[data-theme="dark"] .social a:hover { color: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .social a:hover { color: var(--bg); }
}

/* ---------- Main ---------- */
.main {
  min-width: 0;
  padding: 0 64px 40px;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 -8px 44px;
  padding: 26px 8px 0;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
}

.tabs a {
  position: relative;
  padding: 10px 14px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 0 8px auto;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* Panels: all visible without JS; one at a time with JS. */
.panel { max-width: 780px; scroll-margin-top: 120px; }
.js .panel { display: none; }
.js .panel.is-active { display: block; animation: rise 0.35s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.block + .block { margin-top: 56px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 18px;
}
.section-head .section-title { margin-bottom: 0; }

.section-title {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.group-title {
  margin: 32px 0 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.section-head + .group-title,
.section-title + .group-title { margin-top: 8px; }
.group-sub { margin: -6px 0 12px; font-size: 0.9rem; color: var(--text-3); }
.group-title + .group-sub { margin-top: -4px; }

.more-link { font-size: 0.9rem; font-weight: 500; text-decoration: none; }
.more-link i { font-size: 0.8em; margin-left: 4px; transition: transform 0.15s; }
.more-link:hover i { transform: translateX(3px); }

.legend { font-size: 0.85rem; color: var(--text-3); }

.lead { font-size: 1.06rem; color: var(--text); }

.me {
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(transparent 60%, var(--mark) 60%);
  padding: 0 1px;
}

/* ---------- Research theme cards ---------- */
.themes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theme-card { display: flex; flex-direction: column; padding: 20px 20px 18px; }
.theme-card h3 { font-size: 1.08rem; }

.theme-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: auto 0 0;
  padding: 14px 0 0;
}
.theme-tags li {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 500;
}

.theme-card,
.fun-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.theme-card:hover,
.fun-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.theme-card h3,
.fun-card h3 { margin: 12px 0 6px; font-size: 1rem; font-weight: 600; color: var(--text); }
.theme-card p { margin: 0; font-size: 0.9rem; line-height: 1.55; color: var(--text-2); }

.theme-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.95rem;
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline > li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.timeline > li:first-child { border-top: 0; padding-top: 4px; }

.tl-date {
  padding-top: 2px;
  font-size: 0.85rem;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.tl-title { font-weight: 600; color: var(--text); line-height: 1.5; }
.tl-title + .tl-title { margin-top: 4px; }
.tl-org { font-weight: 500; color: var(--text-2); }
.tl-desc { margin-top: 3px; font-size: 0.92rem; color: var(--text-3); }

.code {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  vertical-align: 1px;
}

/* ---------- Publications ---------- */
.pubs { list-style: none; margin: 0; padding: 0; }

.pub {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 12px;
  margin: 0 -12px;
  border-top: 1px solid var(--border);
  border-radius: 10px;
  scroll-margin-top: 110px;
}
.pub:first-child { border-top-color: transparent; }

.pub.flash { animation: flash 1.8s ease; }
@keyframes flash {
  0%, 30% { background: var(--accent-soft); }
  100% { background: transparent; }
}

.badge {
  align-self: start;
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}
.badge-journal { background: var(--journal-soft); color: var(--journal); }
.badge-preprint {
  background: transparent;
  color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--border);
}

.pub-title { font-size: 1.02rem; font-weight: 600; line-height: 1.42; color: var(--text); }
.pub-title a { color: inherit; text-decoration: none; }
.pub-title a:hover { color: var(--accent); }

.pub-authors { margin-top: 5px; font-size: 0.92rem; color: var(--text-2); }
.alpha { font-size: 0.85em; color: var(--text-3); }
.pub-venue { margin-top: 2px; font-size: 0.88rem; font-style: italic; color: var(--text-3); }
.pub-note { margin-top: 3px; font-size: 0.84rem; color: var(--text-3); }

.pub-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.pub-links a:hover { color: var(--accent); border-color: var(--accent); }
.pub-links i { font-size: 0.85em; }

.year-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0 2px;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.year-head:first-child { margin-top: 0; }
.year-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Posts, data & code ---------- */
.outputs { list-style: none; margin: 0; padding: 0; }
.outputs li {
  position: relative;
  padding: 7px 0 7px 20px;
  color: var(--text-2);
  line-height: 1.5;
}
.outputs li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}
.outputs a { font-weight: 500; }
.out-meta { display: block; margin-top: 2px; font-size: 0.86rem; color: var(--text-3); }
.out-meta .me { font-weight: 500; }

/* ---------- Chips ---------- */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.chips li {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.88rem;
}

/* ---------- CV ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--accent-strong); color: #fff; transform: translateY(-1px); }
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .btn:hover { color: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn,
  :root:not([data-theme="light"]) .btn:hover { color: var(--bg); }
}
/* Outline button; selectors match the dark-mode .btn rules' weight so they win. */
:root .btn.btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
:root .btn.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Job market ---------- */
.job-banner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 780px;
  margin-bottom: 44px;
  padding: 20px 22px 20px 26px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 110px;
}
/* Stripe in the colours of the Ethereum Foundation logo */
.job-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, #f08a78, #ffeb5c, #58b36f, #18abd3, #6b7aba, #a566a6);
}
.job-banner.flash { animation: flash 1.8s ease; }

.job-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.05rem;
}
.job-title {
  margin: 2px 0 6px;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
.job-text p { margin: 0 0 14px; color: var(--text-2); }
.job-text strong { color: var(--text); font-weight: 600; }
.job-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.job-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.job-pill:hover { border-color: var(--accent); color: var(--accent); }
.job-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2fa66a;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 166, 106, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(47, 166, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 166, 106, 0); }
}

.facts {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px 20px;
  margin: 0;
}
.facts dt { font-size: 0.85rem; color: var(--text-3); padding-top: 1px; }
.facts dd { margin: 0; color: var(--text-2); }

/* ---------- Fun ---------- */
.features { display: grid; gap: 16px; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}
.feature-flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.feature-flip .feature-media { order: 2; }
.feature-text { grid-template-columns: minmax(0, 1fr); padding: 20px; }

.feature-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--accent-soft);
}
.caption { margin: 8px 2px 0; font-size: 0.8rem; color: var(--text-3); }

.feature-body h3 { margin: 12px 0 6px; font-size: 1.08rem; font-weight: 600; color: var(--text); }
.feature-body p { margin: 0 0 10px; font-size: 0.92rem; color: var(--text-2); }
.feature-body p:last-child { margin-bottom: 0; }

.mini-title {
  margin: 14px 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.video {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}
.video img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform 0.3s ease; }
.video:hover img { transform: scale(1.03); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video .play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 64px;
  height: 44px;
  margin: auto;
  border-radius: 12px;
  background: rgba(15, 18, 24, 0.72);
  color: #fff;
  font-size: 1.05rem;
  transition: background 0.15s;
}
.video:hover .play,
.video:focus-visible .play { background: #e3261d; }

.gear,
.events { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; color: var(--text-2); }
.gear li,
.events li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 3px 0; }
.events li { grid-template-columns: 96px minmax(0, 1fr); }
.gear span,
.events span { color: var(--text-3); font-size: 0.8rem; padding-top: 1px; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  max-width: 780px;
  margin-top: 80px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .main { padding: 0 40px 40px; }
  :root { --sidebar-w: 300px; }
}

@media (max-width: 900px) {
  .page { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 40px 20px 28px;
    border-right: 0;
  }

  .photo { max-width: 260px; }
  .name { margin-top: 18px; font-size: 1.85rem; }

  .main { padding: 0 20px 32px; }
  .panel, .footer { max-width: none; }

  .tabs {
    margin: 0 -20px 32px;
    padding: 8px 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--border);
  }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 10px 12px 13px; }
  .tabs a[aria-current="page"]::after { left: 12px; right: 12px; }
  .theme-toggle { margin-bottom: 6px; }
}

@media (max-width: 640px) {
  .sidebar { padding: 28px 20px 24px; }
  .photo { max-width: min(280px, 100%); border-width: 3px; }
  .name { font-size: 1.7rem; }
  .role { margin-top: 12px; font-size: 0.9rem; }
  .affil { font-size: 0.85rem; }
  .social { margin-top: 18px; gap: 8px; }
  .social a { width: 38px; height: 38px; }

  .tabs { padding: 8px 10px 0; }
  .tabs a { padding: 10px 9px 13px; }
  .tabs a[aria-current="page"]::after { left: 9px; right: 9px; }

  .section-title { font-size: 1.45rem; }
  .job-banner { flex-direction: column; gap: 12px; margin-bottom: 36px; padding: 18px 18px 18px 22px; }
  .job-title { font-size: 1.25rem; }
  .block + .block { margin-top: 44px; }

  .themes,
  .feature { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; }
  .feature-flip .feature-media { order: 0; }
  .feature-body { padding: 0 4px 4px; }

  .timeline > li,
  .facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .facts dd { margin-bottom: 8px; }

  .pub { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .badge { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .tabs, .skip-link, .theme-toggle { display: none; }
  .page { display: block; }
  .sidebar { position: static; height: auto; border: 0; }
  .js .panel { display: block; }
}
