/* ==========================================================================
   Personal site of Oleg V. Egorov -- one stylesheet, no frameworks.
   Colours and fonts are set once in :root below; change them there.
   ========================================================================== */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --tint: #eef1f4;
  --text: #1b2029;
  --muted: #5d6674;
  --line: #e0e3e8;
  --accent: #1f5c99;          /* same blue as the CV */
  --accent-strong: #174a7c;
  --accent-soft: #e5edf6;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 6px 24px rgba(20, 30, 45, .06);
  --shadow-hover: 0 2px 4px rgba(20, 30, 45, .08), 0 12px 32px rgba(20, 30, 45, .12);
  --radius: 12px;
  --wrap: 1120px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --surface: #171c24;
    --tint: #141920;
    --text: #e6e9ee;
    --muted: #9ca6b4;
    --line: #29313c;
    --accent: #8dbbec;
    --accent-strong: #b2d2f5;
    --accent-soft: #1b2939;
    --on-accent: #0d1520;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 24px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

/* ---- base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16.5px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.005em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
sub, sup { font-size: .72em; line-height: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.icon { flex: none; vertical-align: -0.25em; }
.lead { font-size: 1.1rem; line-height: 1.7; }
/* emphasised words in the About text and on the Research page */
.lead strong, .theme-text strong, .approach strong { color: var(--accent); font-weight: 700; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ---- header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; color: var(--text); }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff5d6 0 14%, #f0a35e 26%, #c2445a 44%, #5a3a8c 62%, transparent 64%),
              radial-gradient(circle, transparent 58%, var(--accent) 60% 72%, transparent 74%);
  box-shadow: 0 0 0 1px var(--line);
}
img.brand-mark { width: 28px; height: 28px; background: none; box-shadow: none; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: .96rem; }
.site-nav a:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); cursor: pointer; }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .site-nav a { padding: 12px; }
}

/* ---- hero (home page banner) ------------------------------------------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background: #0c1017 center 40% / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(8, 12, 20, .92) 0%, rgba(8, 12, 20, .78) 42%, rgba(8, 12, 20, .35) 100%);
}
.hero-inner { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 44px; align-items: center; padding-top: 72px; padding-bottom: 64px; }
.portrait { width: 210px; height: 210px; object-fit: cover; object-position: 50% 25%; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 40px rgba(0, 0, 0, .45); }
.hero h1 { color: #fff; margin-bottom: .25em; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: .8rem; font-weight: 600; color: #b9d3f0; margin-bottom: .6em; }
.hero .tagline { font-size: 1.18rem; max-width: 40em; color: rgba(255, 255, 255, .88); margin-bottom: 1.4em; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.hero-links a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 11px; border-radius: 999px;
  color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); font-size: .92rem; font-weight: 500;
}
.hero-links a:hover { background: rgba(255, 255, 255, .22); text-decoration: none; color: #fff; }
.hero-credit { position: relative; font-size: .72rem; color: rgba(255, 255, 255, .55); text-align: right; margin: 0 auto; padding-bottom: 10px; }

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; gap: 24px; padding-top: 44px; padding-bottom: 40px; text-align: left; }
  .portrait { width: 140px; height: 140px; }
  .hero::before { background: linear-gradient(180deg, rgba(8, 12, 20, .75), rgba(8, 12, 20, .9)); }
}

/* ---- stats strip -------------------------------------------------------- */
.stats { background: var(--surface); border-bottom: 1px solid var(--line); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 22px 12px 8px; text-align: center; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-num { display: block; font-family: var(--font-serif); font-size: 2.1rem; font-weight: 600; color: var(--accent); line-height: 1.1; font-variant-numeric: lining-nums; }
.stat-lbl { display: block; color: var(--muted); font-size: .88rem; margin-top: 4px; }
.stats-src { text-align: center; color: var(--muted); font-size: .76rem; margin: 6px 0 12px; }
@media (max-width: 600px) { .stat:nth-child(2n) { border-right: 0; } .stat { border-bottom: 1px solid var(--line); } .stat-num { font-size: 1.7rem; } }

/* ---- sections ----------------------------------------------------------- */
.section { padding: 56px 0; }
.section-tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head .section-title { margin: 0; }
.section-title { position: relative; padding-bottom: .35em; margin-bottom: .9em; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: 0; width: 42px; height: 3px; border-radius: 2px; background: var(--accent); }
.small-title { font-family: var(--font-sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
.more { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.two-col { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 40px; } }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: .95rem; border: 1px solid var(--accent); margin: 0 6px 6px 0;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* ---- about / roles ------------------------------------------------------ */
.about-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; gap: 32px; } }
.roles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.role { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; column-gap: 12px; }
.role-org { font-weight: 700; grid-column: 1 / -1; grid-row: 1; }
.role-org a { color: var(--text); }
/* "since" sits on the same line as the role title, so it dates the role, not the membership */
.role-since { grid-column: 2; grid-row: 2; align-self: center; font-size: .78rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.role-title { grid-column: 1; grid-row: 2; color: var(--accent); font-weight: 600; font-size: .95rem; }
.role-note { grid-column: 1 / -1; grid-row: 3; color: var(--muted); font-size: .9rem; margin-top: 2px; }

/* ---- cards and grids ---------------------------------------------------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 196px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-3 .theme-card .card-img { aspect-ratio: 16 / 9; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.card-body { padding: 16px 18px 18px; }
.card-body h3 { margin-bottom: .4em; }

.theme-card { display: flex; flex-direction: column; color: var(--text); }
.theme-card:hover { text-decoration: none; color: var(--text); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.theme-card .card-img { aspect-ratio: 4 / 3; overflow: hidden; background: #0c1017; }
.theme-card .card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.theme-card:hover .card-img img { transform: scale(1.04); }
.theme-card h3 { font-size: 1.05rem; }
.theme-card p { font-size: .9rem; color: var(--muted); margin: 0; }
@media (max-width: 560px) {
  .theme-card { flex-direction: row; }
  .theme-card .card-img { flex: 0 0 38%; aspect-ratio: auto; min-height: 120px; }
  .theme-card .card-body { padding: 12px 14px; }
  .grid-5, .grid-3 { gap: 12px; }
}

.paper-card { display: grid; grid-template-columns: 42% 1fr; }
.paper-card { align-items: start; }
.paper-card .card-img { background: #fff; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-right-radius: 8px; }
.paper-card .card-img a { display: block; width: 100%; padding: 10px; cursor: zoom-in; }
.paper-card .card-img img { width: 100%; height: auto; }
.paper-card h3 { font-size: 1.05rem; line-height: 1.3; }
.paper-card h3 a { color: var(--text); }
.paper-card h3 a:hover { color: var(--accent); }
.paper-venue { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; margin-bottom: .4em; }
.paper-venue b { font-weight: 600; }
.paper-summary { font-size: .92rem; margin: .6em 0; }
.paper-card .pub-links { font-size: .85rem; margin: .6em 0 0; }
.paper-card:only-child { max-width: 620px; }
@media (max-width: 560px) {
  .paper-card { grid-template-columns: 1fr; }
  .paper-card .card-img { border-right: 0; border-radius: 0; }
  .paper-card .card-img img { max-height: 320px; object-fit: contain; }
}
details { font-size: .9rem; margin: .4em 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .85rem; list-style: none; display: inline-flex; align-items: center; gap: 4px; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸"; transition: transform .15s; display: inline-block; }
details[open] summary::before { transform: rotate(90deg); }
details p { margin: .5em 0 0; color: var(--muted); }

.mini-card { padding: 18px 20px; }
.mini-card h3 { font-size: 1.08rem; display: flex; align-items: center; gap: 8px; }
.mini-card h3 a { color: var(--text); display: inline-flex; align-items: center; gap: 8px; }
.mini-card h3 a:hover { color: var(--accent); }
.mini-card p { font-size: .92rem; color: var(--muted); margin: 0; }

/* ---- publication lists -------------------------------------------------- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 12px 0 12px 14px; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-lead { border-left-color: var(--accent); }
.pub-title { display: block; color: var(--text); font-weight: 600; line-height: 1.35; }
.pub-title:hover { color: var(--accent); }
.pub-authors { color: var(--muted); font-size: .88rem; margin: 3px 0 0; }
.pub-authors .me { color: var(--text); font-weight: 700; }
.n-auth { white-space: nowrap; }
.pub-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: .84rem; margin-top: 3px; }
.pub-venue { color: var(--text); }
.pub-venue b { font-weight: 600; }
.pub-links a { font-weight: 500; }
.pub-links { color: var(--muted); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag-submitted { background: #fdf0d9; color: #8a5a00; }
@media (prefers-color-scheme: dark) { .tag-submitted { background: #3a2c10; color: #f0c674; } }
.compact .pub { padding: 10px 0 10px 12px; }
.compact .pub-title { font-size: .97rem; }

.year-group { display: grid; grid-template-columns: 90px 1fr; gap: 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.year { font-size: 1.5rem; color: var(--muted); margin: 10px 0 0; position: sticky; top: 76px; align-self: start; }
@media (max-width: 640px) { .year-group { grid-template-columns: 1fr; gap: 0; } .year { position: static; font-size: 1.25rem; } }

.pub-controls { position: sticky; top: 64px; z-index: 5; background: var(--bg); padding: 12px 0; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { font: inherit; font-size: .88rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-n { opacity: .7; font-variant-numeric: tabular-nums; margin-left: 2px; }
.pub-controls-row { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.search input { font: inherit; font-size: .95rem; width: min(360px, 80vw); padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.check { font-size: .92rem; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.pub-count { color: var(--muted); font-size: .88rem; }
.pub-years mark { background: #fff1a8; color: inherit; border-radius: 2px; }
@media (prefers-color-scheme: dark) { .pub-years mark { background: #5b4d10; } }
@media (max-width: 640px) { .pub-controls { position: static; } }

/* ---- recent papers (home) ------------------------------------------------ */
.recent .pub-list { columns: 2 440px; column-gap: 40px; }
.recent .pub { break-inside: avoid; }

/* ---- contact ------------------------------------------------------------ */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .icon { color: var(--accent); margin-top: 3px; }
.contact-note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; align-self: start; }
.contact-note p { margin: 0; font-size: .95rem; }

/* ---- inner pages -------------------------------------------------------- */
.page-head { padding: 56px 0 36px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent 85%); }
.page-head .lead { max-width: 52em; }
.actions { margin: 18px 0 0; }
.toc { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { display: inline-block; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; color: var(--text); }
.toc a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.themes { padding: 16px 24px 32px; }
.theme { padding: 48px 0; border-bottom: 1px solid var(--line); }
.theme:last-child { border-bottom: 0; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.theme-alt .theme-grid > figure { order: -1; }
.theme-text p { font-size: 1.02rem; }
.theme figure { margin: 0; }
.theme figure a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); cursor: zoom-in; }
.theme figure img { border-radius: 4px; margin: 0 auto; max-height: 460px; width: auto; }
.theme figcaption { font-size: .84rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.theme .small-title { margin-top: 28px; }
.theme .pub-list { columns: 2 380px; column-gap: 32px; }
.theme .pub { break-inside: avoid; padding-left: 0; border-left: 0; }
@media (max-width: 900px) { .theme-grid { grid-template-columns: 1fr; gap: 24px; } .theme-alt .theme-grid > figure { order: 0; } }

.approach { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: .97rem; }
.approach-lbl { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent); margin-bottom: 2px; }

/* software */
.sw-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.sw-row { display: grid; grid-template-columns: 240px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.sw-project { font-weight: 600; }
.sw-pkgs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sw-pkgs a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sw-pkgs .icon { width: 16px; height: 16px; }
.sw-note { color: var(--muted); font-size: .88rem; }
@media (max-width: 640px) { .sw-row { grid-template-columns: 1fr; gap: 6px; } }

/* CV */
.cv { padding-top: 16px; padding-bottom: 48px; }
.cv-section { padding-top: 28px; }
.cv-section h2 { font-family: var(--font-sans); font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.cv-row { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 8px 0; }
.cv-when { color: var(--muted); font-size: .92rem; }
.cv-org { color: var(--muted); }
.cv-org::before { content: "·"; margin: 0 6px 0 2px; color: var(--line); }
.cv-head strong + .cv-org::before { color: var(--muted); }
.cv-detail { color: var(--muted); font-size: .93rem; }
.cv-what ul { margin: 2px 0 0; padding-left: 1.1em; }
.cv-what li { margin: 3px 0; }
@media (max-width: 640px) { .cv-row { grid-template-columns: 1fr; gap: 2px; } .cv-when { font-weight: 600; } }

/* ---- footer ------------------------------------------------------------- */
.site-footer { background: var(--tint); border-top: 1px solid var(--line); padding: 32px 0 20px; margin-top: 0; font-size: .92rem; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-name { font-family: var(--font-serif); font-size: 1.1rem; color: var(--text); font-weight: 600; }
.footer-links { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.footer-links a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; color: var(--muted); border: 1px solid var(--line); background: var(--surface); }
.footer-links a:hover { color: var(--accent); border-color: var(--accent); }
.footer-small { margin-top: 18px; font-size: .78rem; }
.footer-small p { margin: 0; }

/* ---- lightbox ----------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(6, 9, 14, .9); display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 96vw; }
.lightbox img { max-width: 94vw; max-height: 84vh; width: auto; background: #fff; border-radius: 6px; margin: 0 auto; }
.lightbox figcaption { color: #d8dde5; font-size: .9rem; text-align: center; margin-top: 12px; max-width: 70em; }
.lightbox-close { position: absolute; top: 12px; right: 16px; font-size: 2rem; line-height: 1; background: none; border: 0; color: #fff; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .site-footer, .hero-links, .pub-controls, .lightbox { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---- additions: role tags, explanations, CV sub-headings ---------------- */
.tag-role { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 600; text-transform: none; letter-spacing: 0; font-size: .74rem; cursor: help; }
.stud { color: var(--accent); font-weight: 700; margin-left: 1px; cursor: help; }
.chip-info { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; color: var(--muted); padding: 6px 4px; }
.chip-info .icon { width: 17px; height: 17px; }
.chip-info:hover { color: var(--accent); }
.lead-def { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 8px 14px; margin: 0 0 10px; font-size: .92rem; }
.lead-def summary { font-size: .88rem; }
.lead-def p { color: var(--text); margin: .5em 0 .3em; }
.lead-def p.muted { color: var(--muted); font-size: .86rem; }
.lead-def:target, .lead-def[open] { box-shadow: var(--shadow); }
.stat-lbl a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.stat-lbl a:hover { color: var(--accent); }
.cv-tagline { color: var(--accent); font-weight: 600; margin: -.2em 0 .8em; }
.cv-sub { font-family: var(--font-sans); font-size: .95rem; font-weight: 700; color: var(--text); margin: 14px 0 2px; }
.cv-text { margin: 0; }
.cv-text + .cv-text { margin-top: .5em; }
.cv-section .cv-row:has(.cv-when:empty) { grid-template-columns: 0 1fr; gap: 0; }
.sw-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sw-pkgs .sw-name .icon { width: 16px; height: 16px; opacity: .5; }

/* ---- hover/focus hints, reversed e-mail fallback, consent banner -------- */
.hint { position: relative; cursor: help; text-decoration: underline dotted; text-underline-offset: 3px; }
.chip-info.hint { text-decoration: none; }
.hint::after {
  content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(320px, 80vw); padding: 8px 10px; border-radius: 8px;
  background: var(--text); color: var(--bg); font-size: .8rem; font-weight: 400; line-height: 1.4;
  text-align: left; text-transform: none; letter-spacing: 0; white-space: normal;
  box-shadow: var(--shadow-hover); opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 30; pointer-events: none;
}
.hint:hover::after, .hint:focus::after { opacity: 1; visibility: visible; }
.chip-info.hint::after { left: 0; transform: none; }
.rev { unicode-bidi: bidi-override; direction: rtl; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 560px; margin-left: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: 14px 18px; font-size: .9rem; }
.consent[hidden] { display: none; }
.consent p { margin: 0 0 10px; }
.consent .consent-btns { margin: 0; }
.consent .btn { padding: 6px 14px; font-size: .88rem; }
