/* =============================================================
   Serhii Dolhopolov - personal site
   Google Research-inspired: editorial type, quiet palette, single accent
   ============================================================= */

:root {
  /* surfaces */
  --bg:        #fbfbfa;
  --bg-elev:   #ffffff;
  --panel:     #f4f3f0;
  --ink:       #1a1a1a;
  --ink-soft:  #2d2d2d;
  --muted:     #6b6b6b;
  --muted-2:   #a3a3a0;
  --hairline:  #e6e5e2;
  --hairline-strong: #d6d5d2;
  --thumb-bg:  #f4f3f0;

  /* accent - overridden by tweaks */
  --accent:    #3b73d4;
  --accent-soft: color-mix(in oklab, var(--accent) 14%, transparent);

  /* type */
  --font-body:    'Inter Tight', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* scale */
  --maxw:      1120px;
  --rail-w:    240px;
  --gap:       56px;
  --radius:    10px;

  /* density */
  --sec-gap:   96px;
  --row-gap:   28px;
}

html[data-theme="dark"] {
  --bg:        #0e0f11;
  --bg-elev:   #131418;
  --panel:     #1a1c20;
  --ink:       #ececea;
  --ink-soft:  #d8d8d4;
  --muted:     #8a8a87;
  --muted-2:   #5c5e62;
  --hairline:  #23252a;
  --hairline-strong: #2c2e34;
  --thumb-bg:  #181a1e;
}

html[data-density="compact"]     { --sec-gap: 64px; --row-gap: 18px; }
html[data-density="spacious"]    { --sec-gap: 140px; --row-gap: 40px; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .02em; text-transform: uppercase; }

/* =============================================================
   Top bar
   ============================================================= */
.top-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-transform: lowercase; }
.brand-dot { display: none; }
.top-nav { display: flex; gap: 22px; }
.top-nav a {
  font-size: 13.5px; color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.top-nav a:hover { color: var(--ink); }
.top-nav a.on { color: var(--ink); border-bottom-color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 12px; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 8px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--hairline-strong); color: var(--ink); }
.toggle-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #ffd479 0% 50%, #0b1020 50% 100%);
  transition: transform .4s;
}
.toggle-dot.dark { transform: rotate(180deg); }
.toggle-label { font-size: 10.5px; }

@media (max-width: 780px) {
  .top-nav { display: none; }
}

/* ----- Hamburger button (mobile only) ----- */
.hamburger {
  display: none;
  position: relative;
  width: 32px; height: 32px;
  padding: 0;
  appearance: none;
  border: 1px solid var(--hairline);
  background: var(--bg-elev);
  border-radius: 999px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, background .15s;
}
.hamburger:hover { border-color: var(--hairline-strong); }
.hamburger span {
  position: absolute;
  left: 9px;
  width: 14px;
  height: 1.6px;
  border-radius: 1px;
  background: var(--ink);
  transition: top .25s, transform .25s, opacity .15s;
}
.hamburger span:nth-child(1) { top: 11px; }
.hamburger span:nth-child(2) { top: 15.2px; }
.hamburger span:nth-child(3) { top: 19.4px; }
.hamburger.open span:nth-child(1) { top: 15.2px; transform: rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { top: 15.2px; transform: rotate(-45deg); }

@media (max-width: 780px) {
  .hamburger { display: inline-flex; }
}

/* ----- Mobile nav drawer ----- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }

.mobile-nav-inner {
  width: min(420px, 100% - 40px);
  padding: 88px 4px 40px;
}
.mobile-nav ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.mobile-nav li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.mobile-nav.open li { opacity: 1; transform: translateY(0); }
.mobile-nav.open li:nth-child(1) { transition-delay: .04s; }
.mobile-nav.open li:nth-child(2) { transition-delay: .08s; }
.mobile-nav.open li:nth-child(3) { transition-delay: .12s; }
.mobile-nav.open li:nth-child(4) { transition-delay: .16s; }
.mobile-nav.open li:nth-child(5) { transition-delay: .20s; }
.mobile-nav.open li:nth-child(6) { transition-delay: .24s; }

.mobile-nav li a {
  display: flex; align-items: baseline; gap: 18px;
  padding: 16px 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  transition: color .15s;
  letter-spacing: -0.01em;
}
.mobile-nav li a:hover,
.mobile-nav li.on a { color: var(--ink); }
.mobile-nav li a .num {
  font-size: 11px;
  color: var(--muted-2);
  width: 22px; flex-shrink: 0;
  letter-spacing: .08em;
}
.mobile-nav li.on a .num { color: var(--accent); }

@media (min-width: 781px) {
  .mobile-nav { display: none !important; }
}

/* =============================================================
   Shell
   ============================================================= */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 32px 0;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  gap: var(--gap);
}
.main { min-width: 0; }

.rail { position: relative; }
.side-nav {
  position: sticky; top: 96px;
  padding-right: 16px;
  border-right: 1px solid var(--hairline);
}
.nav-mono {
  font-family: var(--font-mono);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted-2);
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.side-nav ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.side-nav li a {
  display: flex; align-items: baseline; gap: 12px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 14px;
  transition: color .15s;
}
.side-nav li a .num {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted-2);
  width: 22px; flex-shrink: 0;
}
.side-nav li a:hover { color: var(--ink); }
.side-nav li.on a { color: var(--ink); }
.side-nav li.on a .num { color: var(--accent); }
.nav-foot {
  margin-top: 32px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
  font-size: 10px;
  display: flex; justify-content: space-between;
  color: var(--muted-2);
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding: 32px 20px 0; gap: 0; }
  .rail { display: none; }
}

/* =============================================================
   Hero
   ============================================================= */
.hero { padding: 40px 0 var(--sec-gap); }
.hero-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 48px;
  align-items: start;
}
.hero-photo {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 4px;
  background: var(--panel);
  filter: grayscale(0.15);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(44px, 5.4vw, 68px);
  line-height: 1.02;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: var(--ink);
}
.hero-sub {
  font-size: 19px;
  color: var(--ink-soft);
  margin: 0 0 30px;
  max-width: 58ch;
  line-height: 1.5;
}
.hero-affil { color: var(--ink); border-bottom: 1px solid var(--hairline-strong); }

.hero-about p {
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 0 14px;
  font-size: 15.5px;
  line-height: 1.6;
}

.hero-links { margin-top: 30px; display: flex; flex-direction: column; gap: 10px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  font-size: 12.5px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--bg-elev);
  transition: all .15s;
  white-space: nowrap;
}
.btn-link:hover { border-color: var(--ink); color: var(--ink); }
.btn-link .arr { font-size: 10px; color: var(--muted); transition: transform .2s; }
.btn-link:hover .arr { transform: translate(2px, -2px); color: var(--ink); }
.btn-link.primary {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.btn-link.primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-link.primary .arr { color: rgba(255,255,255,.7); }
html[data-theme="dark"] .btn-link.primary { background: var(--ink); color: #0e0f11; border-color: var(--ink); }
html[data-theme="dark"] .btn-link.primary .arr { color: rgba(14,15,17,.6); }
html[data-theme="dark"] .btn-link.primary:hover { color: #fff; }
html[data-theme="dark"] .btn-link.primary:hover .arr { color: rgba(255,255,255,.7); }

/* Hero email line */
.hero-email {
  display: flex; align-items: baseline; gap: 14px;
  margin: 24px 0 4px;
  flex-wrap: wrap;
}
.eyebrow-inline {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: .12em;
}
.email-link {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.email-link:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 680px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-photo { max-width: 200px; }
}

/* =============================================================
   Section header
   ============================================================= */
.sec { padding: 0 0 var(--sec-gap); }
.sec-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 6px 20px;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.sec-head .eyebrow { grid-column: 1; grid-row: 1; margin-bottom: 0; }
.sec-head .sec-title { grid-column: 1; grid-row: 2; }
.sec-head .sec-extra { grid-column: 2; grid-row: 1 / span 2; align-self: end; }
@media (max-width: 560px) {
  .sec-head { grid-template-columns: 1fr; }
  .sec-head .sec-extra { grid-column: 1; grid-row: 3; }
}
.sec-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.sec-extra { font-size: 13px; color: var(--muted); }
.quiet-link {
  color: var(--muted);
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 1px;
}
.quiet-link:hover { color: var(--accent); border-color: var(--accent); }

/* =============================================================
   Publications
   ============================================================= */
.pub-controls {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.tabs { display: flex; gap: 2px; background: var(--panel); padding: 3px; border-radius: 10px; }
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 7px 14px; border-radius: 8px;
  font: inherit; font-size: 13.5px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab.on { background: var(--bg-elev); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tab-count {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--muted-2);
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--muted-2) 14%, transparent);
}
.tab.on .tab-count { color: var(--accent); background: var(--accent-soft); }

.filters { display: flex; gap: 12px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid var(--hairline); background: transparent;
  font: inherit; font-size: 12px; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--ink); border-color: var(--hairline-strong); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  padding: var(--row-gap) 0;
  border-bottom: 1px solid var(--hairline);
}
.pub-item:last-child { border-bottom: 0; }

.thumb {
  width: 160px; height: 100px;
  background: var(--thumb-bg);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}
.thumb-svg { display: block; width: 100%; height: 100%; }

.pub-meta-top {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 8px;
}
.pub-meta-top .dot { opacity: .5; }
.sel-chip {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em;
  margin-left: 4px;
}

.award-chip {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .08em;
  margin-left: 4px;
  font-weight: 600;
  color: #7a4a12;
  border: 1px solid #d7b783;
  background: color-mix(in oklab, #c8932b 14%, var(--bg-elev));
}
html[data-theme="dark"] .award-chip {
  color: #f1c97a;
  border-color: #6b4f1f;
  background: color-mix(in oklab, #c8932b 28%, var(--bg-elev));
}

.q-chip {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .08em;
  margin-left: 2px;
  font-weight: 600;
  border: 1px solid transparent;
}
.q-q1 { color: #1a6b3a; border-color: #9cc8ac; background: color-mix(in oklab, #1a6b3a 10%, var(--bg-elev)); }
.q-q2 { color: #0d5a8c; border-color: #a7c4db; background: color-mix(in oklab, #0d5a8c 10%, var(--bg-elev)); }
.q-q3 { color: #7a4a12; border-color: #d7b783; background: color-mix(in oklab, #7a4a12 10%, var(--bg-elev)); }
.q-q4 { color: #8a2a2a; border-color: #d4a6a6; background: color-mix(in oklab, #8a2a2a 10%, var(--bg-elev)); }
html[data-theme="dark"] .q-q1 { color: #8edba9; border-color: #2f5640; background: color-mix(in oklab, #1a6b3a 28%, var(--bg-elev)); }
html[data-theme="dark"] .q-q2 { color: #9cc9ea; border-color: #2b4a63; background: color-mix(in oklab, #0d5a8c 28%, var(--bg-elev)); }
html[data-theme="dark"] .q-q3 { color: #e8c48a; border-color: #5f4a28; background: color-mix(in oklab, #7a4a12 28%, var(--bg-elev)); }
html[data-theme="dark"] .q-q4 { color: #e8a8a8; border-color: #5f3535; background: color-mix(in oklab, #8a2a2a 28%, var(--bg-elev)); }

.pub-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--ink);
  text-wrap: pretty;
}
.pub-authors {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.pub-authors .me { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; }
.pub-venue em { font-style: italic; color: var(--ink-soft); }

.pub-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  transition: all .15s;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.ghost { background: transparent; color: var(--muted); }

@media (max-width: 700px) {
  .pub-item { grid-template-columns: 1fr; gap: 14px; }
  .thumb { width: 100%; aspect-ratio: 160 / 100; height: auto; max-height: 240px; }
}

/* =============================================================
   Experience
   ============================================================= */
.exp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 28px; }
.exp-company { border-top: 1px solid var(--hairline); padding-top: 24px; }
.exp-company:first-child { border-top: 0; padding-top: 0; }

.exp-company-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}
.exp-company-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 2px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.exp-company-dates { color: var(--muted); margin: 0; font-size: 11px; }

.logo-block {
  width: 52px; height: 52px;
  border-radius: 10px;
  background: var(--panel);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  border: 1px solid var(--hairline);
  overflow: hidden;
}
.logo-block.logo-img { padding: 0; }
.logo-block.logo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-block.logo-dark { background: #000; border-color: #000; }

.exp-roles {
  list-style: none; padding: 0;
  margin: 0 0 0 18px;
  border-left: 1px solid var(--hairline);
  display: flex; flex-direction: column;
  gap: 12px;
}
.exp-role {
  position: relative;
  padding: 2px 0 2px 22px;
  display: block;
}
.exp-role-dot {
  position: absolute;
  left: -4px; top: 9px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--muted-2);
}
.exp-role:first-child .exp-role-dot { border-color: var(--accent); background: var(--accent); }

.exp-role-top {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 3px;
}
.exp-role-title {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.exp-role-type {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted-2);
  padding: 2px 7px;
  border: 1px solid var(--hairline);
  border-radius: 4px;
}
.exp-role-meta { font-size: 11px; color: var(--muted); margin: 1px 0 0; }
.exp-role-note { font-size: 13.5px; color: var(--ink-soft); margin: 6px 0 0; line-height: 1.55; max-width: 62ch; }
.role-icon { display: inline-flex; align-items: center; flex-shrink: 0; transform: translateY(2px); }

/* =============================================================
   Projects
   ============================================================= */
.proj-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.proj-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--hairline);
}
.proj-item:last-child { border-bottom: 0; }

.proj-thumb-wrap { position: relative; }
.proj-thumb-wrap .thumb { width: 200px; height: 140px; }
.proj-thumb-wrap .thumb-svg { width: 200px; height: 140px; }
.status-pill {
  position: absolute; top: 8px; left: 8px;
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 2px 7px; border-radius: 999px;
  background: var(--bg-elev); color: var(--muted);
  border: 1px solid var(--hairline);
  text-transform: uppercase; letter-spacing: .08em;
}
.status-pill.active { color: var(--accent); border-color: var(--accent); }
.status-pill.approved { color: #b07400; border-color: #d9a84e; background: color-mix(in oklab, #f3b73a 16%, var(--bg-elev)); }
html[data-theme="dark"] .status-pill.approved { color: #e8b66a; border-color: #7a5c21; background: color-mix(in oklab, #b07400 24%, var(--bg-elev)); }

.proj-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 4px;
}
.proj-title {
  font-family: var(--font-display); font-size: 24px; font-weight: 500;
  margin: 0; letter-spacing: -0.01em;
}
.proj-dates { font-size: 11px; color: var(--muted); }
.proj-sub { margin: 0 0 14px; color: var(--ink-soft); font-size: 14.5px; }
.proj-desc { margin: 0 0 16px; font-size: 14.5px; color: var(--ink-soft); max-width: 68ch; line-height: 1.6; }

.proj-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 0 0 16px;
  font-size: 13px;
  max-width: 68ch;
}
.proj-meta > div { display: contents; }
.proj-meta dt {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding-top: 3px;
}
.proj-meta dd { margin: 0; color: var(--ink-soft); }
.proj-meta .mono-dd { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.proj-sponsor {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 10px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.proj-sponsor > svg { flex-shrink: 0; }
.proj-links { display: flex; flex-wrap: wrap; gap: 6px; }

.proj-thumb-wrap .thumb-svg { width: 200px !important; height: 140px !important; }

@media (max-width: 700px) {
  .proj-item { grid-template-columns: 1fr; gap: 14px; }
  .proj-thumb-wrap .thumb { width: 100%; aspect-ratio: 160 / 100; height: auto; max-height: 240px; }
  .proj-thumb-wrap .thumb-svg { width: 100% !important; height: 100% !important; }
}

/* =============================================================
   Awards
   ============================================================= */
.award-list { list-style: none; padding: 0; margin: 0; }
.award-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 28px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hairline);
  align-items: baseline;
}
.award-item:last-child { border-bottom: 0; }
.award-date { color: var(--muted); font-size: 11px; }
.award-body { display: flex; flex-direction: column; gap: 2px; }
.award-title { font-size: 16px; color: var(--ink); font-weight: 500; }
.award-org { font-size: 13px; color: var(--muted); }

/* =============================================================
   Secondary
   ============================================================= */
.sec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 56px;
}
.sec-col {}
.col-title {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
  display: flex; align-items: baseline; gap: 10px;
}
.col-title-count {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.plain-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.row-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.row-title { font-size: 15px; font-weight: 500; color: var(--ink); }
.row-title-sub {
  display: block;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 1px;
}
.row-date { font-size: 11px; color: var(--muted); }
.row-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.row-note { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

.news-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.news-list li { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: baseline; }
.news-date { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.news-text { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.news-link {
  display: inline-block;
  margin-left: 4px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline-strong);
  font-size: 12.5px;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.news-link:hover { color: var(--accent); border-color: var(--accent); }

.news-wrap { position: relative; }
.news-scroll {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 10px;
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 36px), transparent);
  mask-image: linear-gradient(to bottom, black calc(100% - 36px), transparent);
  scrollbar-width: thin;
  scrollbar-color: var(--muted-2) transparent;
  outline: none;
}
.news-scroll::-webkit-scrollbar { width: 6px; }
.news-scroll::-webkit-scrollbar-track { background: transparent; }
.news-scroll::-webkit-scrollbar-thumb {
  background: var(--muted-2);
  border-radius: 3px;
  opacity: 0.5;
}
.news-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.news-toggle {
  margin-top: 14px;
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.news-toggle:hover { color: var(--ink); border-color: var(--hairline-strong); }
.news-toggle-arr { transition: transform .2s; display: inline-block; }
.news-toggle-arr.up { transform: rotate(180deg); }

/* Teaching - compact two-column list */
.teach-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.teach-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.teach-list li:last-child { border-bottom: 0; }
.teach-course { font-size: 14.5px; color: var(--ink); }
.teach-date { font-size: 11px; color: var(--muted); text-align: right; }
.teach-date-row { display: block; white-space: nowrap; }

/* Service & Volunteering extras */
.row-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 1px;
  font-family: var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
  transition: color .15s, border-color .15s;
  word-break: break-all;
}
.row-link:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 820px) {
  .sec-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* =============================================================
   Footer
   ============================================================= */
.site-foot {
  margin-top: 40px;
  padding: 48px 0 40px;
  border-top: 1px solid var(--hairline);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.foot-lead { font-size: 18px; color: var(--ink-soft); max-width: 44ch; margin: 14px 0 18px; line-height: 1.45; }
.foot-email {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--ink);
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 2px;
  transition: color .15s, border-color .15s;
}
.foot-email:hover { color: var(--accent); border-color: var(--accent); }

.foot-links {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  align-content: start;
  padding-top: 22px;
}
.foot-links a {
  font-size: 13px; color: var(--muted);
  padding: 2px 0;
  transition: color .15s;
}
.foot-links a:hover { color: var(--ink); }

.foot-base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 10px;
  color: var(--muted-2);
}

@media (max-width: 700px) {
  .foot-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* =============================================================
   Tweaks extras
   ============================================================= */
.swatch-row { display: flex; gap: 6px; margin-top: 4px; }
.swatch {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.15); cursor: pointer; padding: 0;
}

/* =============================================================
   Subtle entrance animation
   ============================================================= */
.hero, .sec { animation: fadeUp .6s ease both; }
.sec:nth-of-type(2) { animation-delay: .05s; }
.sec:nth-of-type(3) { animation-delay: .1s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* =============================================================
   Mobile responsiveness - refinements layered on top of existing
   single-column breakpoints (900px / 700px / 680px / 560px).
   ============================================================= */

/* Tighten top bar + hide theme-toggle label on phones */
@media (max-width: 600px) {
  .top-bar { padding: 12px 16px; }
  .brand { font-size: 12.5px; }
  .theme-toggle { padding: 6px 8px; gap: 6px; }
  .toggle-label { display: none; }
}

/* Compress section gaps and shell padding on phones */
@media (max-width: 600px) {
  :root { --sec-gap: 64px; --row-gap: 22px; }
  .shell { padding: 24px 16px 0; }
  .sec-head { margin-bottom: 24px; padding-bottom: 14px; }
}

/* Hero - smaller display name, tighter photo, looser link rows */
@media (max-width: 560px) {
  .hero { padding: 24px 0 var(--sec-gap); }
  .hero-name { font-size: clamp(34px, 9vw, 50px); }
  .hero-sub { font-size: 17px; margin-bottom: 22px; }
  .hero-about p { font-size: 15px; }
  .hero-photo { max-width: 168px; }
  .hero-links { gap: 8px; margin-top: 22px; }
  .btn-link { padding: 6px 10px; font-size: 12px; }
}

/* Section titles a touch smaller on tiny screens */
@media (max-width: 480px) {
  .sec-title { font-size: clamp(26px, 7vw, 32px); }
  .pub-title { font-size: 17px; line-height: 1.3; }
  .proj-title { font-size: 20px; }
}

/* Publication thumbnail tweaks on small screens (aspect-ratio kept above) */
@media (max-width: 480px) {
  .pub-meta-top { flex-wrap: wrap; row-gap: 4px; }
}

/* Experience - keep logo column but allow long company names to breathe */
@media (max-width: 560px) {
  .exp-company-head { gap: 12px; margin-bottom: 14px; }
  .exp-company-name { font-size: 18px; line-height: 1.25; }
  .exp-roles { margin-left: 14px; }
  .exp-role { padding-left: 18px; }
  .exp-role-title { font-size: 14.5px; }
  .exp-role-note { font-size: 13px; }
}

/* Projects - stack proj-meta dl on narrow, smaller status pill */
@media (max-width: 560px) {
  .proj-desc { font-size: 14px; line-height: 1.55; }
  .proj-meta { grid-template-columns: 1fr; gap: 4px 0; }
  .proj-meta dt { padding-top: 10px; }
  .proj-meta dt:first-of-type { padding-top: 0; }
  .proj-sponsor { font-size: 11px; padding: 5px 10px 5px 8px; }
}

/* Awards - stack the 160px date column under the body on phones */
@media (max-width: 560px) {
  .award-item { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; align-items: stretch; }
  .award-body { order: 1; }
  .award-date { order: 2; }
  .award-title { font-size: 15.5px; }
}

/* Secondary section refinements */
@media (max-width: 560px) {
  .sec-grid { gap: 32px; }
  .news-scroll { max-height: 340px; }
  .news-list li { grid-template-columns: 78px 1fr; gap: 10px; }
  .news-text { font-size: 13.5px; }
  .row-link { word-break: break-word; }
  .teach-list li { grid-template-columns: 1fr auto; gap: 10px; }
  .teach-course { font-size: 14px; }
}

/* Side scroll prevention - keep long URLs/strings wrapping on narrow */
@media (max-width: 480px) {
  .pub-authors, .pub-venue, .row-note, .exp-role-meta { word-break: break-word; }
}

/* Footer - smaller email + tighter base on phones */
@media (max-width: 480px) {
  .site-foot { padding: 36px 0 28px; }
  .foot-lead { font-size: 16px; }
  .foot-email { font-size: 20px; }
  .foot-base { font-size: 9.5px; }
}
