/* ==========================================================================
   Yuanhao Zhang — personal site
   ========================================================================== */

:root {
  --bg: #fbfaf7;
  --bg-soft: #f3f1ec;
  --surface: #ffffff;
  --ink: #16171d;
  --ink-2: #474a56;
  --ink-3: #7b7f8c;
  --line: #e6e3dc;
  --accent: #3b4bd8;
  --accent-soft: #eceefe;
  --accent-ink: #2a37b0;
  --warm: #d9622b;
  --warm-soft: #fdeee6;

  --t-dyad: #3b4bd8;
  --t-dyad-soft: #eceefe;
  --t-group: #0f8a6c;
  --t-group-soft: #e3f5ef;
  --t-comm: #c2410c;
  --t-comm-soft: #fdeee6;

  --shadow-sm: 0 1px 2px rgba(20, 22, 40, .05), 0 1px 1px rgba(20, 22, 40, .03);
  --shadow-md: 0 10px 30px -12px rgba(20, 22, 40, .18), 0 2px 6px rgba(20, 22, 40, .05);
  --radius: 16px;
  --maxw: 1080px;

  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1015; --bg-soft: #16171f; --surface: #181a22; --ink: #eceef4; --ink-2: #b4b8c6; --ink-3: #848899;
    --line: #2a2c37; --accent: #8b97ff; --accent-soft: #23264a; --accent-ink: #aab3ff; --warm: #ff935c; --warm-soft: #3a2418;
    --t-dyad: #8b97ff; --t-dyad-soft: #23264a; --t-group: #4fd1a8; --t-group-soft: #15332b; --t-comm: #ff935c; --t-comm-soft: #3a2418;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 14px 34px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1015; --bg-soft: #16171f; --surface: #181a22; --ink: #eceef4; --ink-2: #b4b8c6; --ink-3: #848899;
  --line: #2a2c37; --accent: #8b97ff; --accent-soft: #23264a; --accent-ink: #aab3ff; --warm: #ff935c; --warm-soft: #3a2418;
  --t-dyad: #8b97ff; --t-dyad-soft: #23264a; --t-group: #4fd1a8; --t-group-soft: #15332b; --t-comm: #ff935c; --t-comm-soft: #3a2418;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 14px 34px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

*, *::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(--ink);
  font: 400 16px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .sig { font-family: "Mrs Saint Delafield", var(--f-display); font-size: 38px; line-height: 1; padding-top: 6px; transition: color .2s; }
.brand:hover .sig { color: var(--accent-ink); }
.nav-links { display: flex; gap: 4px; margin-left: auto; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; }
.nav-links a { display: block; padding: 6px 12px; border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.nav-links a:hover { text-decoration: none; color: var(--ink); background: var(--bg-soft); }
.nav-links a.active { color: var(--accent-ink); background: var(--accent-soft); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; flex: none;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn .i-sun { display: none; }
:root[data-theme="dark"] .icon-btn .i-sun { display: block; }
:root[data-theme="dark"] .icon-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .icon-btn .i-moon { display: none; }
}
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 56px; }
.hero::before {
  content: ""; position: absolute; inset: -120px 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 300px at 85% 30%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(500px 260px at 10% 10%, color-mix(in srgb, var(--warm) 10%, transparent), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px/1 var(--f-mono); letter-spacing: .02em;
  color: var(--accent-ink); background: var(--accent-soft); padding: 8px 12px; border-radius: 999px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--t-group); box-shadow: 0 0 0 0 var(--t-group); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--t-group) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 {
  font-family: var(--f-display); font-weight: 500; font-size: clamp(42px, 6vw, 64px); line-height: 1.02;
  letter-spacing: -.025em; margin: 20px 0 6px;
}
.hero .role { font-size: 18px; color: var(--ink-2); margin: 0 0 22px; }
.hero .bio p { margin: 0 0 14px; color: var(--ink-2); font-size: 16.5px; max-width: 640px; }
.hero .bio a { font-weight: 500; }
.hero .bio strong { color: var(--ink); font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s;
}
.chip-link:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.chip-link i { font-size: 15px; color: var(--ink-2); width: 16px; text-align: center; }
.chip-link.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-link.primary i { color: var(--bg); }

.portrait { position: relative; justify-self: center; width: 280px; }
.portrait .ring {
  position: absolute; inset: -10px; border-radius: 36% 64% 58% 42% / 44% 40% 60% 56%;
  background: conic-gradient(from 200deg, var(--t-dyad), var(--t-group), var(--t-comm), var(--t-dyad));
  opacity: .9; animation: morph 14s ease-in-out infinite;
}
.portrait img {
  position: relative; width: 280px; height: 280px; object-fit: cover; border-radius: 36% 64% 58% 42% / 44% 40% 60% 56%;
  border: 6px solid var(--bg); animation: morph 14s ease-in-out infinite;
}
@keyframes morph {
  0%, 100% { border-radius: 36% 64% 58% 42% / 44% 40% 60% 56%; }
  50% { border-radius: 58% 42% 40% 60% / 56% 58% 42% 44%; }
}
.portrait .tag {
  position: absolute; left: -18px; bottom: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 12px; box-shadow: var(--shadow-md); font-size: 12.5px; line-height: 1.35;
}
.portrait .tag b { display: block; font-size: 13px; }
.portrait .tag span { color: var(--ink-3); }

/* quick facts */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 48px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fact { background: var(--surface); padding: 18px 20px; }
.fact .k { font: 500 11.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 8px; }
.fact .v { font-weight: 600; font-size: 15px; line-height: 1.35; }
.fact .v small { display: block; font-weight: 400; color: var(--ink-3); font-size: 13px; }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.sec-head .num { font: 500 13px/1 var(--f-mono); color: var(--accent); }
.sec-head h2 { font-family: var(--f-display); font-weight: 500; font-size: clamp(30px, 4vw, 40px); letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.sec-head p { flex-basis: 100%; margin: 6px 0 0; color: var(--ink-2); max-width: 720px; }

/* ---------- Research focus ---------- */
.thesis {
  font-family: var(--f-display); font-weight: 400; font-size: clamp(21px, 2.4vw, 26px); line-height: 1.4;
  letter-spacing: -.01em; max-width: 860px; margin: 0 0 40px;
}
.thesis em { font-style: italic; color: var(--accent-ink); }

.scale { position: relative; margin: 0 0 18px; padding: 0 4px; }
.scale-bar { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--t-dyad), var(--t-group), var(--t-comm)); }
.scale-labels { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 10px; font: 500 12px/1.3 var(--f-mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.scale-labels span:nth-child(2) { text-align: center; }
.scale-labels span:nth-child(3) { text-align: right; }

.thrusts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.thrust {
  --c: var(--t-dyad); --cs: var(--t-dyad-soft);
  position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s;
  overflow: hidden;
}
.thrust::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--c); }
.thrust:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.thrust.group { --c: var(--t-group); --cs: var(--t-group-soft); }
.thrust.comm { --c: var(--t-comm); --cs: var(--t-comm-soft); }
.thrust .glyph { width: 100%; height: 86px; margin: 4px 0 14px; border-radius: 12px; background: var(--cs); display: grid; place-items: center; color: var(--c); }
.thrust .glyph svg { height: 64px; width: auto; }
.thrust .lvl { font: 500 11.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.thrust h3 { font-family: var(--f-display); font-weight: 500; font-size: 22px; line-height: 1.2; letter-spacing: -.01em; margin: 8px 0 10px; }
.thrust .q { color: var(--ink-2); font-size: 15px; margin: 0 0 16px; }
.thrust .q b { color: var(--ink); font-weight: 600; }
.thrust ul.kw { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.thrust ul.kw li { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); }
.thrust .reps { font-size: 13.5px; color: var(--ink-3); margin: 0 0 18px; }
.thrust .reps b { color: var(--ink-2); font-weight: 600; }
.thrust .go {
  margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  font: 600 13.5px/1 var(--f-body); color: var(--c); background: var(--cs); border: 0; padding: 10px 14px; border-radius: 999px; cursor: pointer;
}
.thrust .go:hover { filter: brightness(.97); }
.thrust .go .n { font-family: var(--f-mono); font-weight: 500; opacity: .85; }

.methods { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; color: var(--ink-3); font-size: 14px; }
.methods b { color: var(--ink-2); font-weight: 600; margin-right: 4px; }
.methods span { padding: 4px 10px; border: 1px dashed var(--line); border-radius: 999px; color: var(--ink-2); }

.market {
  margin-top: 36px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 22px 26px; border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), color-mix(in srgb, var(--t-group-soft) 70%, var(--accent-soft)));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
}
.market h4 { margin: 0 0 4px; font-size: 17px; }
.market p { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 640px; }
.market .chip-link { flex: none; }
.market-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- News ---------- */
.news { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.news li { display: grid; grid-template-columns: 96px 28px 1fr; gap: 8px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.news li:last-child { border-bottom: 0; }
.news time { font: 500 13px/1.6 var(--f-mono); color: var(--ink-3); }
.news .em { font-size: 15px; text-align: center; }
.news p { margin: 0; color: var(--ink-2); }
.news p b { color: var(--ink); font-weight: 600; }
.news li.hidden { display: none; }
.news-more { margin-top: 14px; }
.text-btn { background: none; border: 0; color: var(--accent-ink); font: 600 14px var(--f-body); cursor: pointer; padding: 6px 0; }

/* ---------- Publications ---------- */
.pub-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 26px; position: sticky; top: 64px; z-index: 5; padding: 10px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  font: 500 13.5px/1 var(--f-body); padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.filter .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); }
.filter[data-f="dyad"] { --c: var(--t-dyad); }
.filter[data-f="group"] { --c: var(--t-group); }
.filter[data-f="comm"] { --c: var(--t-comm); }
.filter:hover { color: var(--ink); }
.filter.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.filter.on .sw { background: var(--bg); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; user-select: none; }
.toggle input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); }

.year { display: flex; align-items: center; gap: 14px; margin: 34px 0 14px; font: 500 14px/1 var(--f-mono); color: var(--ink-3); }
.year:first-of-type { margin-top: 0; }
.year::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.year.hidden { display: none; }

.pub {
  display: grid; grid-template-columns: 220px 1fr; gap: 24px; padding: 18px; margin: 0 -18px; border-radius: var(--radius);
  transition: background .2s;
}
.pub:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.pub.hidden { display: none; }
.pub .fig {
  position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--line);
}
.pub .fig img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.pub .fig.ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--ph1, var(--accent-soft)), var(--ph2, var(--bg-soft))); }
.pub .fig.ph > span:not(.venue) { font-family: var(--f-display); font-size: 22px; font-weight: 500; color: var(--ph-ink, var(--accent-ink)); letter-spacing: -.01em; text-align: center; padding: 0 12px; line-height: 1.15; }
.pub .fig.ph small { display: block; font: 500 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin-top: 8px; }
.pub[data-t~="dyad"] .fig.ph { --ph1: var(--t-dyad-soft); --ph-ink: var(--t-dyad); }
.pub[data-t~="group"] .fig.ph { --ph1: var(--t-group-soft); --ph-ink: var(--t-group); }
.pub[data-t~="comm"]:not([data-t~="group"]):not([data-t~="dyad"]) .fig.ph { --ph1: var(--t-comm-soft); --ph-ink: var(--t-comm); }
.venue {
  position: absolute; left: 8px; top: 8px; font: 600 11px/1 var(--f-mono); letter-spacing: .02em; padding: 5px 8px; border-radius: 6px;
  background: var(--ink); color: var(--bg);
}
.pub h3 { font-size: 17px; font-weight: 600; line-height: 1.4; margin: 0 0 6px; letter-spacing: -.005em; }
.pub h3 a { color: var(--ink); }
.pub h3 a:hover { color: var(--accent-ink); }
.pub .authors { font-size: 14.5px; color: var(--ink-2); margin: 0 0 4px; }
.pub .authors b { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); text-underline-offset: 3px; }
.pub .where { font-size: 14px; color: var(--ink-3); font-style: italic; margin: 0 0 8px; }
.pub .tldr { font-size: 14.5px; color: var(--ink-2); margin: 0 0 10px; }
.pub .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { font: 500 12px/1 var(--f-body); padding: 5px 9px; border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; }
a.pill:hover { text-decoration: none; border-color: var(--line); color: var(--ink); }
.pill.award { background: var(--warm-soft); color: var(--warm); font-weight: 600; }
.pill.status { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.pill.t { padding: 5px 8px; }
.pill.t::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.pill.t-dyad { --c: var(--t-dyad); }
.pill.t-group { --c: var(--t-group); }
.pill.t-comm { --c: var(--t-comm); }
.pub-empty { display: none; color: var(--ink-3); padding: 24px 0; }

/* ---------- Two column blocks ---------- */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding: 0 0 26px 34px; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.timeline li.now::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.timeline .when { font: 500 12.5px/1.4 var(--f-mono); color: var(--ink-3); }
.timeline .what { font-weight: 600; margin: 2px 0 0; }
.timeline .where { color: var(--ink-2); font-size: 14.5px; }

.list-awards { list-style: none; margin: 0; padding: 0; }
.list-awards li { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.list-awards li:last-child { border-bottom: 0; }
.list-awards .a { font-weight: 500; }
.list-awards .a small { display: block; color: var(--ink-3); font-weight: 400; font-size: 13.5px; }
.list-awards .y { font: 500 13px/1 var(--f-mono); color: var(--ink-3); white-space: nowrap; }
.list-awards li.star .a::before { content: "★"; color: var(--warm); margin-right: 8px; }

h3.sub { font: 500 12.5px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 0 0 18px; }

.service { display: grid; gap: 18px; }
.svc { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: baseline; }
.svc .r { font-weight: 600; }
.svc .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.svc .tags span { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.svc .tags span b { font-weight: 600; color: var(--ink); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--ink-3); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .portrait img, .portrait .ring, .eyebrow .dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .thrusts { grid-template-columns: 1fr; }
  .scale { display: none; }
  .cols { grid-template-columns: 1fr; gap: 48px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav-links.open { display: flex; }
  .menu-btn { display: inline-grid; }
  #themeBtn { margin-left: auto; }
  .nav .wrap { gap: 10px; }
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .portrait { order: -1; width: 200px; justify-self: start; }
  .portrait img { width: 200px; height: 200px; }
  .portrait .tag { left: auto; right: -150px; bottom: 30px; }
  .pub { grid-template-columns: 1fr; gap: 14px; }
  .pub .fig { max-width: 420px; }
  .pub .fig.ph { aspect-ratio: 3 / 1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  section.block { padding: 56px 0; }
  .facts { grid-template-columns: 1fr; }
  .news li { grid-template-columns: 74px 1fr; }
  .news .em { display: none; }
  .svc { grid-template-columns: 1fr; gap: 8px; }
  .portrait .tag { right: -140px; }
  .pub-toolbar { position: static; }
}
@media (max-width: 400px) {
  .portrait .tag { display: none; }
}
