/* ali-zia.me — shared styles. Pages are generated by build.py. */
:root {
  --paper: #f5f7fa;
  --surface: #ffffff;
  --ink: #14202e;
  --ink-2: #4b596b;
  --line: #dbe1e9;
  --leaf: #0d6b58;
  --leaf-soft: #e3f1ec;
  --frame: #ffffff;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e141c; --surface: #141c26; --ink: #e5ebf2; --ink-2: #a3afbd;
    --line: #263241; --leaf: #63c9ad; --leaf-soft: #15302a; --frame: #141c26; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e141c; --surface: #141c26; --ink: #e5ebf2; --ink-2: #a3afbd;
  --line: #263241; --leaf: #63c9ad; --leaf-soft: #15302a; --frame: #141c26; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--leaf); text-decoration-thickness: .07em; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .14em; }
:focus-visible { outline: 2px solid var(--leaf); outline-offset: 3px; border-radius: 3px; }
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 12px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 14px; z-index: 9; }
.skip:focus { left: 8px; }
.muted { color: var(--ink-2); }
.measure { max-width: 68ch; }

/* ---------- layout: identity column + reading column ---------- */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .shell { grid-template-columns: 290px minmax(0, 1fr); gap: 64px; padding: 0 32px; } }

.id { padding: 28px 0 4px; min-width: 0; }
@media (min-width: 960px) { .id { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 56px 0 32px; } }
.id-top { display: flex; gap: 16px; align-items: center; }
@media (min-width: 960px) { .id-top { display: block; } }
.portrait { width: 72px; height: 72px; flex: none; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
@media (min-width: 960px) { .portrait { width: 132px; height: 132px; margin-bottom: 20px; } }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.id .name { font: 500 1.9rem/1.05 var(--serif); color: var(--ink); text-decoration: none; display: inline-block; }
@media (min-width: 960px) { .id .name { font-size: 2.35rem; } }
.role { margin: 6px 0 0; color: var(--ink-2); font-size: .92rem; line-height: 1.5; }
.role strong { color: var(--ink); font-weight: 500; }
.links { list-style: none; padding: 0; margin: 20px 0 0; display: none; gap: 6px; font-size: .95rem; }
@media (min-width: 960px) { .links { display: grid; } }
.links a { text-decoration: none; display: inline-flex; gap: 10px; align-items: center; }
.links a:hover { text-decoration: underline; }
.links svg { width: 16px; height: 16px; flex: none; fill: currentColor; opacity: .85; }
.metrics { margin: 20px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); display: none; }
@media (min-width: 960px) { .metrics { display: block; } }
.metrics b { color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.metrics p { margin: 0 0 2px; }

/* site menu: a row on phones, a list in the sidebar on desktop */
.menu { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 2px; border-bottom: 1px solid var(--line); }
.menu a { display: block; padding: 8px 7px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .92rem; white-space: nowrap; }
.menu a:hover { color: var(--ink); }
.menu a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--leaf); }
@media (min-width: 960px) {
  .menu { display: block; border-bottom: 0; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
  .menu a { padding: 4px 0; font-size: .97rem; }
  .menu a[aria-current="page"] { box-shadow: none; }
  .menu a[aria-current="page"]::before { content: ""; display: inline-block; width: 14px; height: 2px; background: var(--leaf); vertical-align: middle; margin: 0 8px 3px -22px; }
}

main { padding: 8px 0 72px; min-width: 0; }
@media (min-width: 960px) { main { padding-top: 56px; } }
section { padding: 44px 0 0; }
main > section:first-child { padding-top: 24px; }
@media (min-width: 960px) { main > section:first-child { padding-top: 0; } }
section > h2 { font-size: 1.75rem; margin-bottom: 18px; }
.page-title { font-size: clamp(2rem, 4vw, 2.6rem); margin-bottom: 12px; }
.intro-text { font-size: 1.05rem; color: var(--ink-2); max-width: 66ch; }
.more-link { display: inline-block; margin-top: 12px; font-weight: 500; text-decoration: none; font-size: .95rem; }
.more-link:hover { text-decoration: underline; }

/* ---------- home opening ---------- */
.lede { font: 400 clamp(1.45rem, 2.6vw, 1.95rem)/1.32 var(--serif); margin: 0 0 18px; max-width: 30ch; letter-spacing: -0.01em; }
.fig-hero { margin: 30px 0 0; }
.filtration { width: 100%; height: auto; }
.f-frame { fill: var(--frame); stroke: var(--line); }
.f-pt { fill: var(--ink); }
.f-lab { font: 400 16px var(--serif); font-style: italic; fill: var(--ink-2); }
figcaption { font-size: .85rem; color: var(--ink-2); margin-top: 8px; max-width: 70ch; }
@media (max-width: 640px) { .filtration-wrap { overflow-x: auto; } .filtration { min-width: 600px; } }

/* ---------- news ---------- */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.news li:first-child { border-top: 0; }
.news time { color: var(--ink-2); font-size: .9rem; padding-top: 1px; }
.news li.more { display: none; }
.news.open li.more { display: grid; }
.toggle { margin-top: 10px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font: 500 .88rem var(--sans); color: var(--ink); cursor: pointer; }
.toggle:hover { border-color: var(--leaf); color: var(--leaf); }

/* ---------- research themes ---------- */
.themes { display: grid; gap: 28px; }
.theme { display: grid; gap: 18px; align-items: center; }
@media (min-width: 720px) { .theme { grid-template-columns: .9fr 1.1fr; gap: 30px; } .theme:nth-child(even) .theme-fig { order: 2; } }
.theme h3 { font-size: 1.3rem; margin-bottom: 6px; }
.theme p { margin: 0 0 8px; color: var(--ink-2); }
.theme-fig { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.theme-fig img { border-radius: 4px; }
.pd, .spec { width: 100%; height: auto; max-height: 220px; }
.pd-diag { stroke: var(--ink-2); stroke-dasharray: 3 4; stroke-width: 1; }
.pd-axis { stroke: var(--line); stroke-width: 1.2; }
.pd-lab, .spec-lab { font: 400 12px var(--sans); fill: var(--ink-2); }
.spec-line { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.spec-mark { stroke: var(--ink-2); stroke-dasharray: 3 4; }
.spec-nir { fill: var(--ink-2); opacity: .35; }
.pd-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.pd-key { font-size: .82rem; color: var(--ink-2); line-height: 1.5; margin: 0; }
.pd-key i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; }

/* ---------- featured work ---------- */
.feat { display: grid; gap: 22px; padding: 26px 0; border-top: 1px solid var(--line); }
.feat:first-of-type { border-top: 0; padding-top: 4px; }
@media (min-width: 760px) { .feat { grid-template-columns: 300px minmax(0, 1fr); gap: 28px; } }
.feat-fig { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; align-self: start; }
.feat-fig.drawn { background: var(--surface); padding: 14px; }
.feat-fig img { border-radius: 3px; }
.venue { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--leaf); background: var(--leaf-soft); padding: 2px 9px; border-radius: 999px; margin-bottom: 8px; }
.feat h3 { font-size: 1.28rem; line-height: 1.3; margin-bottom: 6px; }
.authors { margin: 0 0 8px; color: var(--ink-2); font-size: .92rem; }
b.me { color: var(--ink); font-weight: 600; }
.feat .what { margin: 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions a { font-size: .86rem; font-weight: 500; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 11px; color: var(--ink); }
.actions a:hover { border-color: var(--leaf); color: var(--leaf); }
.actions a.code { border-color: var(--leaf); color: var(--leaf); }

/* ---------- full publications page ---------- */
.filters { position: sticky; top: 0; z-index: 5; background: var(--paper); padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; margin-top: 18px; }
.filters input[type="search"] { width: 100%; max-width: 420px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: 500 .95rem var(--sans); background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 3px 11px; font: 500 .84rem var(--sans); cursor: pointer; }
.chip:hover { color: var(--ink); border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--leaf); border-color: var(--leaf); color: var(--surface); }
.count { font-size: .88rem; color: var(--ink-2); }
.year-block h2 { font: 500 1.3rem var(--serif); color: var(--ink-2); margin: 28px 0 6px; }
.pubs { list-style: none; margin: 0; padding: 0; }
.pub { padding: 8px 0 8px 14px; border-left: 2px solid var(--line); margin-bottom: 8px; display: grid; gap: 2px; }
.pub:hover { border-left-color: var(--leaf); }
.pub .t { font-weight: 500; }
.pub .a { color: var(--ink-2); font-size: .92rem; }
.pub .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: .9rem; }
.pub .v { font-family: var(--serif); font-style: italic; font-size: 1.02rem; }
.tag { font-size: .75rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; }
.award { font-size: .8rem; font-weight: 600; color: var(--leaf); }
.pub[hidden], .year-block[hidden] { display: none; }

/* ---------- research projects ---------- */
.projects { display: grid; gap: 28px; }
@media (min-width: 700px) { .projects { grid-template-columns: 1fr 1fr; } }
.project { display: flex; flex-direction: column; }
.project img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.project h3 { font-size: 1.2rem; margin: 14px 0 2px; }
.project .partners { font-size: .85rem; color: var(--ink-2); margin-bottom: 6px; }
.project p { font-size: .95rem; margin-bottom: 6px; }
.project .refs { font-size: .88rem; margin: 0; padding: 0; list-style: none; }
.plain { margin: 0; padding-left: 1.1rem; }
.plain li { margin: 0 0 8px; }
.plain li::marker { color: var(--ink-2); }

/* ---------- statistics strip ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 22px 0 8px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { padding: 16px 16px 14px 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 16px; }
@media (max-width: 719px) { .stat:nth-child(3) { border-left: 0; padding-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }
.stat b { display: block; font: 500 2rem/1.1 var(--serif); color: var(--ink); }
.stat span { font-size: .88rem; color: var(--ink-2); }

/* ---------- entries, timelines, grants ---------- */
.two { display: grid; gap: 32px; }
@media (min-width: 760px) { .two { grid-template-columns: 1fr 1fr; gap: 40px; } }
.block-title { font-size: 1.25rem; margin: 0 0 10px; }
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { padding: 10px 0; border-top: 1px solid var(--line); }
.entries li:first-child { border-top: 0; padding-top: 0; }
.entries .h { font-weight: 500; }
.entries .s { color: var(--ink-2); font-size: .92rem; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 3.6rem 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .y { color: var(--ink-2); font-size: .9rem; }
.grants { width: 100%; border-collapse: collapse; font-size: .95rem; margin-top: 8px; }
.grants th { text-align: left; font-weight: 600; font-size: .84rem; color: var(--ink-2); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
.grants td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.grants .amt { white-space: nowrap; text-align: right; padding-right: 0; }
.grants .what { font-weight: 500; }
.grants .who { color: var(--ink-2); font-size: .88rem; }
@media (max-width: 600px) {
  .grants thead { display: none; }
  .grants tr { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; gap: 0 10px; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .grants td { border: 0; padding: 0; }
}
.downloads { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.downloads a { display: inline-block; padding: 8px 15px; border-radius: 8px; border: 1px solid var(--leaf); color: var(--leaf); text-decoration: none; font-weight: 500; }
.downloads a.primary { background: var(--leaf); color: var(--surface); }

/* ---------- code list ---------- */
.repo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.repo:first-child { border-top: 0; }
.repo a.name { font-weight: 600; text-decoration: none; }
.repo a.name:hover { text-decoration: underline; }
.repo p { grid-column: 1 / -1; margin: 0; color: var(--ink-2); font-size: .93rem; }
.repo .tag2 { font-size: .8rem; color: var(--ink-2); align-self: center; }

footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .88rem; }
footer p { margin: 0 0 6px; }
.theme-switch { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--ink-2); font: 500 .82rem var(--sans); cursor: pointer; margin-top: 8px; }
