/* =====================================================================
   Andreea B. Alexandru — site styles
   Direction: "Pine & Sand" (deepened teal lineage + warm sand + warm paper)
   One stylesheet, shared by every page. Change a token below and it
   updates everywhere.
   ===================================================================== */

:root{
  /* palette — light */
  --bg:#F6F4EF;          /* warm paper ground        */
  --surface:#FDFCF9;     /* cards / raised surfaces   */
  --fg:#28312C;          /* body text                 */
  --heading:#16211C;     /* headings                  */
  --muted:#606B65;       /* secondary text            */
  --accent:#0F6E63;      /* pine (deepened teal)      */
  --accent-strong:#0B564E;
  --sand:#C79A5A;        /* warm secondary accent     */
  --sand-soft:#E7D9BF;   /* warm fill / highlight     */
  --line:#E4E1D8;        /* hairlines                 */
  --line-soft:#EDEBE3;
  --code-bg:#EDF1EC;

  --font-sans:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;

  --measure:66ch;        /* comfortable reading width */
  --page:900px;          /* content column            */
}

@media (prefers-color-scheme:dark){
  :root{
    --bg:#141917; --surface:#1B211D; --fg:#DDE3DE; --heading:#F1F4F1;
    --muted:#96A19A; --accent:#5FB6AA; --accent-strong:#84C8BE;
    --sand:#D8B98C; --sand-soft:#3A3524; --line:#28312C; --line-soft:#212824;
    --code-bg:#1E2622;
  }
}
:root[data-theme="dark"]{
  --bg:#141917; --surface:#1B211D; --fg:#DDE3DE; --heading:#F1F4F1;
  --muted:#96A19A; --accent:#5FB6AA; --accent-strong:#84C8BE;
  --sand:#D8B98C; --sand-soft:#3A3524; --line:#28312C; --line-soft:#212824;
  --code-bg:#1E2622;
}
:root[data-theme="light"]{
  --bg:#F6F4EF; --surface:#FDFCF9; --fg:#28312C; --heading:#16211C;
  --muted:#606B65; --accent:#0F6E63; --accent-strong:#0B564E;
  --sand:#C79A5A; --sand-soft:#E7D9BF; --line:#E4E1D8; --line-soft:#EDEBE3;
  --code-bg:#EDF1EC;
}

/* ---------- base ---------- */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:var(--font-sans); font-size:17px; line-height:1.65;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{ color:var(--heading); line-height:1.2; text-wrap:balance; }
p{ margin:0 0 1em; }
a{ color:var(--accent); text-decoration:none; }
a:hover{ color:var(--accent-strong); text-decoration:underline; text-underline-offset:2px; }
a:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; border-radius:2px; }
b,strong{ color:var(--heading); font-weight:600; }
hr{ border:0; border-top:1px solid var(--line); margin:2.4em 0; }
img{ max-width:100%; height:auto; }
::selection{ background:var(--sand-soft); }

/* ---------- top navigation ---------- */
.topbar{
  position:sticky; top:0; z-index:20;
  background:#14302A;                       /* dark pine banner (both themes) */
  border-bottom:1px solid rgba(255,255,255,.10);
}
.topbar .inner{
  max-width:var(--page); margin:0 auto; padding:15px 22px;
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
}
.brand{ display:inline-flex; align-items:center; gap:18px; color:#F1F4F0; font-weight:600; font-size:16px; letter-spacing:-.01em; }
.brand:hover{ text-decoration:none; color:#ffffff; }
.brand .mark{
  position:relative; overflow:hidden;
  display:grid; place-items:center; width:40px; height:40px;
  clip-path:polygon(50% 0%, 93.3% 25%, 93.3% 75%, 50% 100%, 6.7% 75%, 6.7% 25%);
  background:var(--accent); color:#fff; font-size:14px; font-weight:700; letter-spacing:.02em;
}
/* masking motif: the second initial dissolves under a speckled random mask */
.brand .mark::after{
  content:""; position:absolute; inset:0;
  background:var(--sand); opacity:.7;
  background-image:radial-gradient(rgba(0,0,0,.30) 1px, transparent 1.5px);
  background-size:4px 4px;
  -webkit-mask-image:linear-gradient(90deg, transparent 46%, #000 78%);
          mask-image:linear-gradient(90deg, transparent 46%, #000 78%);
}
@media (prefers-color-scheme:dark){ .brand .mark{ color:#10201C; } }
:root[data-theme="dark"] .brand .mark{ color:#10201C; }
:root[data-theme="light"] .brand .mark{ color:#fff; }

.nav{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.nav a{
  color:#C3CCC6; font-size:15px; padding:7px 11px; border-radius:8px;
}
.nav a:hover{ color:#ffffff; background:rgba(255,255,255,.09); text-decoration:none; }
.nav a.active{ color:var(--sand); font-weight:600; }
.nav a.active:hover{ background:transparent; color:var(--sand); }

/* ---------- page shell ---------- */
main{ max-width:var(--page); margin:0 auto; padding:0 22px 80px; }

.masthead{ padding:46px 0 26px; border-bottom:1px solid var(--line); margin-bottom:34px; }
.masthead h1{ font-size:clamp(30px,5vw,40px); font-weight:700; letter-spacing:-.022em; margin:0; }
.hook{
  margin:12px 0 0; font-size:12.5px; font-weight:600; text-transform:uppercase;
  letter-spacing:.24em; color:var(--accent);
}
.hook::before{ content:""; display:inline-block; width:26px; height:2px; background:var(--sand);
  vertical-align:middle; margin-right:12px; transform:translateY(-3px); }
/* motto card: inverted colors — white card, dark pine text like the boxes below,
   typography matching the chip labels (ROLE / INTERESTS / LOCATION) */
.glance > div.tagline{
  background:#FDFCF9; border-color:#14302A;
  color:#0F6E63; align-content:center;
  font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
  line-height:1.6;
  grid-column:1 / -1; margin-bottom:40px;
}

/* home masthead variant: bio + contact card */
.home-top{ display:grid; grid-template-columns:minmax(0,1fr) 260px; gap:38px; align-items:start;
  padding:0 0 12px; }
.home-top h1{ font-size:clamp(30px,5vw,42px); font-weight:700; letter-spacing:-.022em; margin:0 0 12px; }
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  padding:20px; box-shadow:0 18px 40px -34px rgba(0,0,0,.4);
}
.card img{ width:100%; border-radius:12px; display:block; margin-bottom:16px; }
.card .row{ font-size:14px; margin:0 0 8px; color:var(--fg); }
.card .row:last-child{ margin-bottom:0; }
.card .k{ display:block; font-size:11px; text-transform:uppercase; letter-spacing:.14em;
  color:var(--muted); margin-bottom:1px; }

/* home "at a glance": a band above the content by default; on wide screens it
   floats as a vertical strip in the left margin, beside the centered column */
.glance{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:10px; margin:0 0 28px; }
.glance > div{ background:#14302A; border:1px solid rgba(255,255,255,.12); border-radius:12px;
  padding:12px 14px; font-size:14px; line-height:1.45; }
.glance .v{ margin:7px 0 0; color:#E7EAE6; }
@media (min-width:1300px){
  /* pinned in the left margin, starting at the line under the hook (like the TOC) */
  .glance{ position:fixed; top:210px; left:calc(50% - var(--page)/2 - 192px); width:164px;
    grid-template-columns:1fr; gap:10px; margin:0; }
}

/* ---------- sections & headings ---------- */
section{ margin:40px 0; }
h2.section{
  font-size:22px; font-weight:650; letter-spacing:-.01em; margin:0 0 4px;
  display:flex; align-items:center; gap:12px;
}
h2.section::after{ content:""; flex:1; height:1px; background:var(--line); }
.section-note{ color:var(--muted); font-size:14px; margin:0 0 18px; }

/* full-bleed sections: text spans the whole content column (e.g. under the photo) */
section.wide p{ max-width:none; }
section.wide ul.news{ max-width:none; }

h3.sub{ font-size:18px; font-weight:650; margin:34px 0 8px; color:var(--heading); }
.sublabel{
  font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.16em;
  color:var(--accent); margin:26px 0 10px;
}

/* ---------- content lists ---------- */
main ul{ padding-left:1.15em; }
main li{ margin:0 0 .5em; }
.plain{ list-style:none; padding-left:0; }

/* publications */
ul.pubs{ list-style:none; padding-left:0; }
ul.pubs > li{
  padding:12px 0 12px 16px; border-left:2px solid var(--line);
  margin:0 0 6px;
}
ul.pubs > li:hover{ border-left-color:var(--sand); }
ul.pubs i{ color:var(--heading); font-style:italic; }
ul.pubs a{ font-size:14px; }
.award{ color:var(--accent); font-weight:600; }

/* news / highlights */
ul.news{ list-style:none; padding-left:0; }
ul.news > li{ display:flex; gap:16px; padding:11px 0; border-bottom:1px solid var(--line-soft); }
ul.news .when{
  flex:0 0 108px; font-family:var(--font-mono); font-size:12.5px; color:var(--accent);
  padding-top:2px; font-variant-numeric:tabular-nums;
}
ul.news .what{ margin:0; }
details.archive{ margin-top:16px; }
details.archive > summary{
  cursor:pointer; color:var(--accent); font-size:14px; font-weight:600;
  list-style:none; padding:8px 0;
}
details.archive > summary::-webkit-details-marker{ display:none; }
details.archive > summary::before{ content:"▸ "; }
details.archive[open] > summary::before{ content:"▾ "; }

/* talks */
ul.talks{ list-style:none; padding-left:0; }
ul.talks > li{ padding:9px 0; border-bottom:1px solid var(--line-soft); }
/* co-presenter line: the <i>With ...</i> inside a talk becomes a muted sub-line */
ul.talks i{ display:block; font-size:13.5px; color:var(--muted); margin-top:2px; }

/* ---------- figures ---------- */
/* presented as "plates": a fixed light card so the artwork reads the same
   in light and dark themes */
figure.fig{
  margin:30px auto; text-align:center; width:fit-content; max-width:100%;
  background:#FBFAF7; border:1px solid #E4E1D8; border-radius:14px;
  padding:20px 18px 12px;
}
figure.fig img{ display:inline-block; }
figure.fig figcaption{
  color:#606B65; font-size:13px; margin:10px auto 0; max-width:56ch;
}

/* ---------- footer ---------- */
footer{
  max-width:var(--page); margin:0 auto; padding:26px 22px 48px;
  border-top:1px solid var(--line); color:var(--muted); font-size:13.5px;
  display:flex; justify-content:space-between; gap:16px; flex-wrap:wrap;
}
footer a{ color:var(--muted); }
footer a:hover{ color:var(--accent); }

/* ---------- responsive ---------- */
@media (max-width:760px){
  body{ font-size:16px; }
  .home-top{ grid-template-columns:1fr; gap:24px; }
  .home-top .card{ max-width:320px; }
  ul.news > li{ flex-direction:column; gap:2px; }
  ul.news .when{ flex-basis:auto; }
}

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto; }
}

/* ---------- professional touches: chips, selected-pub cards ---------- */
.chip{
  display:inline-block; font-size:11px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color:var(--accent);
  background:var(--code-bg); border:1px solid var(--line);
  padding:2px 9px; border-radius:999px; white-space:nowrap;
}

/* subsection label rendered as a chip (matches publication venue chips) */
.chip-label{ margin:24px 0 8px; scroll-margin-top:82px; }

.selpubs{ display:grid; gap:10px; margin:4px 0 10px; }
.selpub{
  background:var(--surface); border:1px solid var(--line); border-radius:12px;
  padding:11px 16px; box-shadow:0 12px 28px -30px rgba(0,0,0,.5);
}
.selpub .top{ line-height:1.45; }
.selpub .top .chip{ margin-right:10px; }
.selpub .title{ font-size:15px; font-weight:600; color:var(--heading); }
.selpub .why{ color:var(--muted); font-size:13px; margin:4px 0 0; }
.selpub .chip a{ color:inherit; text-decoration:none; }
.selpub .chip:hover{ border-color:var(--accent); }

/* representative papers listed after each research-line paragraph */
.line-pubs{ display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 8px; margin:-4px 0 30px; }
.line-pubs .lbl{
  font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase;
  color:var(--muted); margin-right:2px;
}
.line-pubs a{
  font-size:12.5px; color:var(--accent); background:var(--surface);
  border:1px solid var(--line); border-radius:999px; padding:2px 10px;
}
.line-pubs a:hover{ border-color:var(--accent); background:var(--code-bg); text-decoration:none; }

/* table of contents (jump links) */
.toc{ display:flex; flex-wrap:wrap; gap:8px 16px; margin:0 0 34px; font-size:14px; }
.toc a{ color:var(--muted); border-bottom:1px solid transparent; padding-bottom:1px; }
.toc a:hover{ color:var(--accent); border-bottom-color:var(--accent); text-decoration:none; }

/* on wide screens, pin the toc into the empty left margin */
@media (min-width:1300px){
  .toc{
    position:fixed; top:212px; margin:0; z-index:10;
    left:calc(50% - (var(--page) / 2) - 28px);
    transform:translateX(-100%);
    width:160px; flex-direction:column; flex-wrap:nowrap;
    gap:11px; text-align:right; align-items:flex-end;
  }
  .toc a{ border-bottom:none; }
  .toc a:hover{ border-bottom:none; }
}

h2.section{ scroll-margin-top:82px; }

/* trailing publication links become small tag-links */
ul.pubs a{
  display:inline-block; font-size:12px; color:var(--accent);
  border:1px solid var(--line); border-radius:6px; padding:1px 8px; margin:3px 5px 0 0;
}
ul.pubs a:hover{ background:var(--code-bg); text-decoration:none; }
