/* alexeygalda.com: executive, light-first; dark follows the device. Print styles produce the CV PDF. */
:root {
  --bg: #ffffff; --soft: #f5f7fb; --card: #ffffff; --ink: #0d1424; --muted: #5a6478; --line: #e4e8f0;
  --navy: #0f1b3d; --accent: #2453d6; --accent-soft: #e9efff;
  --serif: "Newsreader", Georgia, serif; --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0b0f19; --soft: #111727; --card: #141b2d; --ink: #e9edf5; --muted: #9aa5ba; --line: #222b40; --accent: #8fb0ff; --accent-soft: #18233f; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16.5px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.015em; line-height: 1.12; margin: 0 0 .45em; }
h1 { font-size: clamp(44px, 6.4vw, 80px); }
h2 { font-size: clamp(28px, 3.2vw, 40px); }
h3 { font-size: 21px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font: 600 12px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 18px; }
.eyebrow.light { color: #a9c0ff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); flex: none; }
.lead { font: 400 clamp(19px, 2vw, 23px)/1.45 var(--serif); color: var(--ink); max-width: 640px; }
.btn { display: inline-flex; align-items: center; padding: 12px 20px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); background: #1b2d63; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.sm { padding: 8px 14px; font-size: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.ghost) { background: var(--accent); color: #0b0f19; } }
.arrow { font-weight: 600; text-decoration: none; display: inline-block; margin-top: 18px; }
.arrow.light { color: #a9c0ff; }
.section-head { margin-bottom: 36px; max-width: 720px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; height: 66px; gap: 28px; }
.name { font: 600 21px var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; margin-right: auto; }
.nav { display: flex; gap: 26px; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); }
.nav a[aria-current] { box-shadow: 0 2px 0 var(--accent); }
.actions { display: flex; align-items: center; gap: 8px; }
.soc { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; color: var(--muted); }
.soc:hover { color: var(--ink); background: var(--soft); }
.soc svg { width: 18px; height: 18px; fill: currentColor; }
.soc.lg { width: 48px; height: 48px; box-shadow: inset 0 0 0 1.5px var(--line); }
.soc.lg svg { width: 22px; height: 22px; }
@media (max-width: 820px) { .nav { gap: 16px; } .actions .soc { display: none; } }
@media (max-width: 560px) { .bar { gap: 14px; } .nav a:nth-child(3) { display: none; } .actions .btn { padding: 7px 12px; } }

/* hero */
.hero { padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 88px); background:
  radial-gradient(700px 360px at 92% 8%, var(--accent-soft), transparent 70%),
  radial-gradient(500px 300px at 0% 100%, color-mix(in srgb, var(--accent-soft) 60%, transparent), transparent 70%); }
.hero-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: clamp(36px, 7vw, 96px); align-items: center; }
.hero h1 { margin-bottom: 18px; }
.bio { color: var(--muted); max-width: 620px; margin: 22px 0 32px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.portrait { margin: 0; justify-self: end; position: relative; width: 100%; max-width: 400px; }
.portrait::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border-radius: 28px; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.portrait img { position: relative; border-radius: 28px; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 20%; width: 100%; box-shadow: 0 40px 80px -40px rgba(15,27,61,.5); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .portrait { justify-self: start; max-width: 240px; order: -1; } .portrait::before { display: none; } .portrait img { aspect-ratio: 1; } }

/* credibility strip */
.creds { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.creds .wrap { display: flex; align-items: center; gap: 28px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.creds p { margin: 0; font: 600 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.creds ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 34px; margin: 0; padding: 0; }
.creds li { font: 500 19px var(--serif); color: var(--ink); opacity: .82; }

/* numbers */
.numbers { padding: 56px 0; }
.numbers .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.numbers .wrap > div { padding: 0 28px; border-left: 1px solid var(--line); }
.numbers .wrap > div:first-child { border-left: 0; padding-left: 0; }
.numbers b { display: block; font: 500 52px/1 var(--serif); color: var(--navy); margin-bottom: 12px; letter-spacing: -.02em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .numbers b { color: var(--accent); } }
.numbers span { color: var(--muted); font-size: 15px; display: block; max-width: 240px; }
@media (max-width: 860px) { .numbers .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 0; } .numbers .wrap > div { padding: 0 16px; } .numbers .wrap > div:nth-child(odd) { border-left: 0; padding-left: 0; } }

/* bands */
.band { padding: clamp(64px, 9vw, 112px) 0; }
.band.alt { background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.themes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.theme { padding: 22px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; display: block; }
.theme:hover h3 { color: var(--accent); }
.theme h3 { font-size: 21px; }
.theme p { color: var(--muted); font-size: 15px; margin: 0; }
@media (max-width: 760px) { .themes { grid-template-columns: 1fr; } }
.theme span { color: var(--accent); font-weight: 600; font-size: 14px; }
.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(36px, 6vw, 80px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.selected { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.selected li { padding: 20px 0; border-top: 1px solid var(--line); }
.selected li:first-child { border-top: 0; padding-top: 0; }
.venue { font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.selected h3 { font-size: 20px; margin: 6px 0 6px; }
.selected h3 a { color: var(--ink); text-decoration: none; }
.selected h3 a:hover { color: var(--accent); }
.selected p { margin: 0; color: var(--muted); font-size: 14px; }
.selected b { color: var(--ink); font-weight: 600; }
.news { list-style: none; margin: 0; padding: 0; }
.news li { padding: 16px 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; padding-top: 0; }
.news time { font: 600 12px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.news p { margin: 4px 0 0; font-size: 15px; }

/* beyond the lab */
.beyond { background: var(--navy); color: #e7ecf7; padding: clamp(56px, 8vw, 96px) 0; }
.beyond-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(36px, 6vw, 80px); align-items: center; }
.beyond img { border-radius: 20px; aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.beyond .eyebrow { color: #a9c0ff; }
.beyond p { color: #b9c3db; }
@media (max-width: 860px) { .beyond-grid { grid-template-columns: 1fr; } }

/* contact */
.contact { padding: 56px 0; }
.contact-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.contact h2 { margin: 0; }

/* inner heads */
.head { padding: clamp(52px, 8vw, 96px) 0 40px; border-bottom: 1px solid var(--line); background: radial-gradient(700px 300px at 95% 0%, var(--accent-soft), transparent 70%); }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.chip { font: 500 14px var(--sans); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.on { background: var(--accent); color: #0b0f19; border-color: var(--accent); } }

/* research */
.papers { padding-bottom: 96px; }
.year { margin: 64px 0 4px; font-size: 44px; color: var(--accent); scroll-margin-top: 90px; }
.paper { display: grid; grid-template-columns: 280px 1fr; gap: 32px; padding: 30px 0; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.paper figure { margin: 0; }
.paper figure img { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 10px; width: 100%; }
.paper figure.empty { display: none; }
.tag { font: 600 11.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.paper h3 { font-size: 23px; }
.cap { color: var(--muted); font-size: 14.5px; margin: 0 0 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.pill { font-size: 13.5px; font-weight: 500; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); text-decoration: none; }
.paper details summary { cursor: pointer; font-weight: 600; color: var(--accent); font-size: 14.5px; }
.paper details p { color: var(--muted); font-size: 15px; }
.more-pubs { margin-top: 48px; color: var(--muted); }
@media (max-width: 760px) { .paper { grid-template-columns: 1fr; } .paper figure { max-width: 420px; } }

/* cv */
.cv { padding-bottom: 96px; }
.cv-sec { max-width: 880px; padding: 40px 0 12px; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.cv-sec h2 { font-size: 28px; }
.cv-sec li { margin: .5em 0; }
.jobs { list-style: none; padding: 0; margin: 0; }
.jobs > li { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 10px 0; border-top: 1px dashed var(--line); }
.jobs > li:first-child { border-top: 0; }
.when { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 15px; }
.what b { font-weight: 600; }
.what ul { margin: 4px 0 2px; padding-left: 18px; color: var(--muted); font-size: 15px; }
.what ul li { margin: 2px 0; }
@media (max-width: 600px) { .jobs > li { grid-template-columns: 1fr; gap: 0; } }
.pubs { padding-left: 2.8em; }
.pubs li { font-size: 15px; color: var(--muted); padding-left: 4px; }
.pubs li b { color: var(--ink); font-weight: 600; }
.print-only { display: none; }
.summary { font-weight: 600; margin: 0 0 6px; }

/* beyond the lab page */
.wing-hero { position: relative; color: #fff; min-height: 56vh; display: flex; align-items: flex-end; overflow: hidden; background: var(--navy); }
.wing-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wing-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(10,16,36,.88)); }
.wing-hero .wrap { position: relative; z-index: 1; padding-bottom: 44px; width: 100%; }
.prose { max-width: 780px; padding-top: 44px; padding-bottom: 96px; font-size: 18px; }
.medals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 36px 0; }
.medals div { border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.medals b { display: block; font: 500 44px/1 var(--serif); color: var(--accent); margin-bottom: 10px; }
.medals span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 640px) { .medals { grid-template-columns: 1fr; } }
.photo { margin: 24px 0 0; }
.photo img { border-radius: 18px; }
.photo figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot p { margin: 0; }
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }

/* print: the CV page becomes the downloadable PDF */
@page { size: Letter; margin: 14mm 15mm 14mm; }
@media print {
  :root { --bg: #fff; --ink: #111; --muted: #444; --line: #ddd; --accent: #1d3fa8; }
  body { font-size: 10.5pt; line-height: 1.45; background: #fff; }
  .top, .foot, .head .btn, .head-row > a { display: none !important; }
  .head { padding: 0 0 8pt; background: none; border-bottom: 1.5pt solid #111; }
  .head h1 { font-size: 26pt; margin: 0; }
  .head .eyebrow { display: none; }
  .head .lead { font-size: 12.5pt; margin: 2pt 0 0; }
  .wrap { padding: 0; max-width: none; }
  .print-only { display: block; }
  .contact-line { font-size: 9pt; color: #444; margin: 6pt 0 0; }
  .cv { padding: 0; }
  .cv-sec { padding: 10pt 0 2pt; max-width: none; border-bottom: 0; break-inside: auto; }
  .cv-sec h2 { font-size: 13pt; text-transform: uppercase; letter-spacing: .06em; font-family: var(--sans); font-weight: 600; border-bottom: .75pt solid #bbb; padding-bottom: 2pt; margin-bottom: 4pt; }
  .cv-sec li { margin: 2pt 0; }
  .cv-sec h2 { break-after: avoid; page-break-after: avoid; }
  .cv-sec > ul, .cv-sec > p, .jobs > li:first-child, .pubs > li:first-child { break-before: avoid; }
  .cv-sec:not(#publications) { break-inside: avoid; }
  .jobs > li { grid-template-columns: 110pt 1fr; padding: 3pt 0; border: 0; break-inside: avoid; }
  .what ul { font-size: 9.5pt; color: #333; margin: 1pt 0; }
  .when { font-size: 10pt; }
  .pubs li { font-size: 9.2pt; line-height: 1.38; margin: 1.5pt 0; color: #222; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}

/* home: updates list */
.updates-band { border-top: 1px solid var(--line); }
.updates { list-style: none; margin: 0; padding: 0; max-width: 880px; }
.updates li { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.updates time { font: 600 12.5px/1.9 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.updates p { margin: 0; font-size: 16px; }
@media (max-width: 640px) { .updates li { grid-template-columns: 1fr; gap: 2px; } }
.foot p a { color: var(--muted); text-decoration: none; }
.foot p a:hover { color: var(--ink); }
