/* ---------- Tokens ----------
   Palette chosen to stay distinct under protanopia, deuteranopia, and
   tritanopia (checked with color-vision-deficiency simulations).
   Base:      #F2C83F  PERG yellow (backgrounds and large shapes, with dark text)
   Secondary: #2E3A47  slate (links, buttons, focus rings)
   Tertiary:  #D55E00  vermillion (graphic highlights only, not body text) */
:root {
  --base: #F2C83F;
  --base-ink: #1D2330;      /* text placed on the yellow */
  --secondary: #2E3A47;
  --secondary-ink: #FFFFFF;
  --tertiary: #D55E00;

  --paper: #FFFFFF;
  --surface: #F6F6F3;
  --ink: #1D2330;
  --muted: #545B69;
  --rule: #D9D9D2;
  --grid: #E7E4D8;
  --vector: #7C8494;

  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-head: var(--font-body);
  --measure: 68ch;
  --wrap: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --secondary: #C9D3DE;
    --secondary-ink: #12161E;
    --tertiary: #F07B3F;
    --paper: #12161E;
    --surface: #1B2029;
    --ink: #ECEEF2;
    --muted: #A6ADBA;
    --rule: #2E3440;
    --grid: #262C37;
    --vector: #8A93A3;
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: var(--secondary); font-weight: 600; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--secondary); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.25rem); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; max-width: var(--measure); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; color: var(--ink); text-decoration: none; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; line-height: 1.2; }
.brand-logo { width: auto; height: 3rem; }
.brand-name { max-width: 16rem; }
nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; }
nav a { color: var(--ink); font-weight: 500; text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
nav a:hover { border-bottom-color: var(--rule); }
nav a[aria-current="page"] { border-bottom-color: var(--secondary); }

/* ---------- Hero (the one bold element) ---------- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem); background: var(--base); color: var(--base-ink); }
.hero-inner { max-width: var(--wrap); }
.hero h1, .hero .lede { max-width: none; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 52ch; }
.hero .lede { color: var(--base-ink); }
.hero a:not(.button) { color: var(--base-ink); }
.hero .button { background: #2E3A47; color: #FFFFFF; }
.hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.5rem; }
.button { display: inline-block; background: var(--secondary); color: var(--secondary-ink); text-decoration: none; font-weight: 700; padding: 0.7rem 1.2rem; border-radius: 4px; }
.button:hover { filter: brightness(1.08); }
.text-link { font-weight: 700; }


/* ---------- Sections ---------- */
.section { padding-block: clamp(2.5rem, 5vw, 4rem); border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.section-tight { margin-top: 3rem; }

.areas { list-style: none; margin: 1.5rem 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; }
.areas li { border-top: 4px solid var(--base); padding-top: 1rem; }
.areas p { color: var(--muted); }

.news { list-style: none; margin: 1rem 0 0; padding: 0; }
.news li { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding-block: 0.75rem; border-top: 1px solid var(--rule); }
.news time { color: var(--muted); font-size: 0.95rem; padding-top: 0.1rem; }
.news p { margin: 0; }

.join { border-left: 6px solid var(--tertiary); padding-left: clamp(1rem, 3vw, 2rem); margin-block: clamp(2.5rem, 5vw, 4rem); border-bottom: 0; padding-block: 0.25rem; }
.join p { font-size: 1.1rem; }

/* ---------- Inner pages ---------- */
.page { padding-block: clamp(2.5rem, 5vw, 4rem); }
.page-header { margin-bottom: 2.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--rule); }

.research-area { margin-bottom: 2.5rem; max-width: var(--measure); }

.pub-year { display: grid; grid-template-columns: 7rem 1fr; gap: 1.5rem; padding-block: 1.25rem; border-top: 1px solid var(--rule); }
.pub-year h2 { font-size: 1.5rem; color: var(--ink); }
.pub-year h2::after { content: ""; display: block; width: 2rem; height: 4px; margin-top: 0.4rem; background: var(--tertiary); }
.pubs { list-style: none; margin: 0; padding: 0; }
.pubs li { margin-bottom: 1.25rem; max-width: var(--measure); }
.pubs span, .pubs a { display: block; }
.pub-title { font-weight: 700; }
.pub-authors, .pub-venue { color: var(--muted); font-size: 0.97rem; }
.pub-venue { font-style: italic; }

/* People */
.avatar { width: 5rem; height: 5rem; border-radius: 50%; overflow: hidden; flex: none; background: var(--base); border: 0; display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-family: var(--font-head); font-weight: 600; font-size: 1.5rem; color: var(--base-ink); }
.avatar-lg { width: 8rem; height: 8rem; }
.avatar-lg span { font-size: 2.4rem; }

.pi { display: flex; gap: 2rem; align-items: flex-start; }
.role { color: var(--muted); margin-bottom: 0.5rem; }

.people { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 2rem 2.5rem; }
.person { display: flex; gap: 1.25rem; align-items: flex-start; }
.person h3 { margin-bottom: 0.15rem; }
.person p:last-child { margin-bottom: 0; }

.alumni { list-style: none; margin: 1rem 0 0; padding: 0; }
.alumni li { padding-block: 0.75rem; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
.alumni .role, .alumni .now { margin: 0; color: var(--muted); }
.alumni .now { flex-basis: 100%; font-size: 0.97rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--surface); margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 2rem; color: var(--muted); font-size: 0.95rem; }
.footer-inner strong { color: var(--ink); }
.site-footer { border-top: 6px solid var(--base); }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .brand-name { font-size: 1rem; max-width: 12rem; }
  .pub-year { grid-template-columns: 1fr; gap: 0.5rem; }
  .news li { grid-template-columns: 1fr; gap: 0.15rem; }
  .pi { flex-direction: column; gap: 1rem; }
}
