/* =====================================================================
   fattaccioli.github.io — site stylesheet (plain CSS, no build step)
   Colours and fonts are defined once below; change them here.
   ===================================================================== */
:root {
  --bg: #ffffff;
  --bg-alt: #f4f3ef;        /* footer, alternate bands */
  --surface: #ffffff;
  --text: #101417;
  --muted: #3f484e;
  --line: #d3d6d4;
  --accent: #075a5e;        /* teal — links, buttons */
  --accent-strong: #043f42;
  --accent-soft: #dcefed;
  --highlight: #a3361f;     /* small accents (numbers) */
  --radius: 10px;
  --wrap: 1080px;
  --measure: 720px;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1316;
    --bg-alt: #161b1f;
    --surface: #171c20;
    --text: #f1f3f2;
    --muted: #b4bdc2;
    --line: #353d43;
    --accent: #6fd3ce;
    --accent-strong: #9ce3df;
    --accent-soft: #173b3c;
    --highlight: #f39a82;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 .5em; }
h2 { font-size: 1.6rem; margin: 2.2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.6em 0 .4em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; }
.brand { text-decoration: none; color: var(--text); display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; }
.brand-sub { font-size: .75rem; color: var(--muted); letter-spacing: .04em; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 500;
  padding: 6px 10px; border-radius: 6px;
}
.site-nav a:hover { background: var(--accent-soft); color: var(--accent-strong); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 820px) {
  .nav-burger {
    display: block; width: 40px; height: 40px; cursor: pointer; position: relative;
  }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    content: ""; position: absolute; left: 9px; width: 22px; height: 2px; background: var(--text);
  }
  .nav-burger span { top: 19px; }
  .nav-burger span::before { top: -7px; left: 0; }
  .nav-burger span::after { top: 7px; left: 0; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 8px 20px 16px;
  }
  .site-nav a { padding: 10px 6px; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  background: var(--accent); color: #fff; text-decoration: none; border: 1px solid var(--accent); cursor: pointer;
  font-family: var(--sans);
}
.btn:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .btn { color: #0d1214; } .btn:hover { color: #0d1214; } .btn-ghost { color: var(--accent); } }
.linklike { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

/* ---------- home ---------- */
.hero { padding: 56px 0 32px; }
.hero-inner { display: grid; grid-template-columns: 1fr 220px; gap: 48px; align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 600; color: var(--accent); margin-bottom: .8em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-portrait { margin: 0; }
.hero-portrait img { border-radius: 14px; display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.hero-portrait figcaption { display: none; }
.hero-band { max-width: var(--wrap); margin: 8px auto 0; padding: 0 20px; }
.hero-band img { width: 100%; height: 260px; object-fit: cover; border-radius: var(--radius); display: block; }
@media (max-width: 720px) {
  .hero { padding-top: 32px; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-portrait { order: -1; width: 120px; }
  .hero-band img { height: 160px; }
}
.section { padding: 24px 20px; }
.section-title { font-size: 1.35rem; margin: 1.4em 0 .8em; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.card h3 { margin: .2em 0 .5em; font-size: 1.12rem; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }
.card-num { font-family: var(--serif); color: var(--highlight); font-weight: 600; }
.card-more { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; font-size: .93rem; }
.home .prose { max-width: var(--measure); }
.home .prose h2 { font-size: 1.35rem; margin-top: 1em; }

/* ---------- pages ---------- */
.page { padding-top: 40px; padding-bottom: 56px; }
.page-head { max-width: var(--measure); margin-bottom: 8px; }
.page-head .lead { max-width: none; }
.prose { max-width: var(--measure); }
.prose ul { padding-left: 1.2em; }
.prose li { margin: .25em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.toc a {
  font-size: .85rem; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--text); background: var(--surface);
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.callout {
  background: var(--accent-soft); border-radius: var(--radius); padding: 4px 24px 12px; margin: 48px 0 0;
}
.callout h2 { margin-top: .9em; font-size: 1.35rem; }
.logo-inline { float: left; margin: 4px 16px 8px 0; border-radius: 8px; }
details { margin: 1em 0; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 560px) { .address-grid { grid-template-columns: 1fr; } }

/* ---------- research ---------- */
figure.band { margin: 28px 0; }
figure.band img { width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius); display: block; }
figure.band figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.axis { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--line); }
.axis h2 { margin-top: .1em; }
.axis-short { color: var(--muted); }
.topic { display: grid; grid-template-columns: 120px 1fr; gap: 24px; margin: 28px 0; }
.topic-img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.topic h3 { margin-top: 0; }
.funding { font-size: .92rem; }
.label {
  display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; margin-right: 4px;
}
.related summary { font-size: .92rem; }
@media (max-width: 560px) { .topic { grid-template-columns: 1fr; } .topic-img { width: 100%; height: 140px; } }

/* ---------- publications ---------- */
.pubs, .prose .pubs { list-style: none; padding: 0; margin: 0 0 1em; }
.pub { position: relative; padding: 12px 0 12px 0; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.5; }
.pub-num + .pub-title { }
.pubs .pub:has(.pub-num) { padding-left: 52px; }
.pub-num { position: absolute; left: 0; top: 13px; font-family: var(--serif); color: var(--highlight); font-weight: 600; font-size: .9rem; }
.pub-title { display: block; font-weight: 600; color: var(--text); }
.pub-authors { display: block; color: var(--muted); }
.pub-title { font-size: 1rem; }
.pub-authors .me { color: var(--text); font-weight: 600; }
.pub-venue { display: block; }
.pub-venue em { font-style: italic; font-weight: 500; }
.pub-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 4px; align-items: center; font-size: .85rem; }
.tag-link {
  font-size: .75rem; font-weight: 600; text-decoration: none; padding: 1px 8px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-strong);
}
.pub-note { display: block; font-size: .85rem; color: var(--muted); }
h3.year { font-size: 1rem; font-family: var(--sans); color: var(--muted); margin: 1.6em 0 .2em; letter-spacing: .04em; }

/* ---------- team ---------- */
.pi { display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: start; margin-top: 24px; }
.pi img { border-radius: var(--radius); width: 140px; aspect-ratio: 3/4; object-fit: cover; }
.pi h2 { margin: 0 0 .3em; }
.cv { max-width: var(--measure); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.person p { margin: 0 0 .3em; font-size: .92rem; }
.person-name { font-weight: 600; font-size: 1rem !important; }
.person-role { color: var(--accent); }
.person-project { color: var(--text); }
.person-links { display: inline-flex; gap: 10px; font-size: .85rem; }
.alumni { padding-left: 1.1em; }
.alumni li { margin: .35em 0; }
.alumni.compact li { margin: .15em 0; font-size: .93rem; }
@media (max-width: 560px) { .pi { grid-template-columns: 96px 1fr; } .pi img { width: 96px; } }

/* ---------- footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); margin-top: 48px; padding: 32px 0 24px; font-size: .9rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.footer-name { font-family: var(--serif); font-weight: 600; color: var(--text); font-size: 1.05rem; margin-bottom: .3em; }
.footer-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 8px; font-size: .82rem; }
@media (max-width: 640px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- consent banner ---------- */
.consent {
  position: fixed; z-index: 20; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12); font-size: .9rem;
}
.consent[hidden] { display: none; }
.consent p { margin: 0 0 12px; }
.consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
.consent .btn { padding: 7px 16px; font-size: .88rem; }

/* ---------- justified text ----------
   Paragraphs and list items are justified with automatic hyphenation
   (avoids large gaps between words). Headings, publication entries,
   buttons and navigation stay left-aligned.
   To revert: delete this block. */
p, li, dd, figcaption, .lead, .topic-body, .callout {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  text-wrap: pretty;
}
.pub, .pub *, .site-nav, .footer-meta, .footer-grid p, .person p,
.hero-actions, .consent p, .toc, .alumni.compact li, .card p {
  text-align: left;
  hyphens: manual;
  -webkit-hyphens: manual;
}
/* Narrow screens: justified lines this short leave large gaps, so
   fall back to left alignment on phones. */
@media (max-width: 600px) {
  p, li, dd, figcaption, .lead, .topic-body, .callout { text-align: left; }
}

/* ---------- research topics: question / key result ---------- */
.topic.no-img { grid-template-columns: 1fr; }
.question {
  font-family: var(--serif); font-size: 1.08rem; font-style: italic; color: var(--text);
  border-left: 3px solid var(--accent); padding-left: 12px; margin-bottom: .8em;
}
.highlight { font-size: .93rem; background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; }
.highlight a { font-weight: 600; }
.topic .eyebrow { margin-bottom: .3em; }

/* ---------- homepage news + newsletter ---------- */
.news-wrap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 860px) { .news-wrap { grid-template-columns: 1fr; } }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: .95rem; text-align: left;
}
.news-list time { color: var(--highlight); font-weight: 600; font-size: .85rem; padding-top: 2px; }
.newsletter {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-top: 1.4em;
}
.newsletter h3 { margin: 0 0 .4em; }
.newsletter p:not(.eyebrow) { font-size: .95rem; color: var(--muted); text-align: left; }

/* ---------- alumni outcomes ---------- */
.now { color: var(--accent); font-weight: 500; }
