/* Layout: maroon header + hero band carried over from the old site; content sits on a quiet light/dark ground in a single 72rem column. */
:root {
  --maroon-deep: #2E0B0E;
  --maroon: #6E1A20;
  --logo-red: #E1141C;
  --sun: #FDD323;
  --on-maroon: #FFF4EC;
  --on-maroon-muted: #E9CFC6;

  --bg: #F7F4F4;
  --surface: #FFFFFF;
  --ink: #1E1315;
  --muted: #5C4B4D;
  --line: #E5DADA;
  --accent: #9E1C26;
  --accent-soft: #F8E4E4;
  --tag-journal: #1F5A7A;
  --tag-conf: #6B3FA0;
  --tag-poster: #8A5A00;
  --focus: #1E1315;
  --focus-halo: #FDD323;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --radius: 14px;
  --wrap: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #150B0C; --surface: #211416; --ink: #F4EAE8; --muted: #C5B3B1; --line: #3B2A2C;
    --accent: #FFB0B5; --accent-soft: #3A1A1D;
    --tag-journal: #8FD0F0; --tag-conf: #CDB2F5; --tag-poster: #F3C76A; --focus: #FDD323; --focus-halo: #150B0C;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #150B0C; --surface: #211416; --ink: #F4EAE8; --muted: #C5B3B1; --line: #3B2A2C;
  --accent: #FFB0B5; --accent-soft: #3A1A1D;
  --tag-journal: #8FD0F0; --tag-conf: #CDB2F5; --tag-poster: #F3C76A; --focus: #FDD323; --focus-halo: #150B0C;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--font-body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus-halo); border-radius: 4px; }
.site-header :focus-visible, .band :focus-visible, .stats :focus-visible, .site-footer :focus-visible { outline-color: var(--sun); box-shadow: 0 0 0 6px var(--maroon-deep); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--sun); color: var(--maroon-deep); padding: .6rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip:focus { top: 12px; }

/* Header */
.site-header {
  background: var(--maroon-deep);
  color: var(--on-maroon);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
  padding-block: .75rem;
}
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; margin-right: auto; }
.brand img { width: 48px; height: 48px; }
.brand span { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.nav { display: flex; flex-wrap: wrap; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: .45rem .8rem; border-radius: 999px;
  color: var(--on-maroon); text-decoration: none; font-weight: 700; font-size: .98rem;
}
.nav a:hover { background: rgba(255,255,255,.1); }
.nav a[aria-current="page"] { background: var(--sun); color: var(--maroon-deep); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  border: 2px solid transparent; font-size: 1rem; line-height: 1.2; cursor: pointer; font-family: inherit;
}
.btn svg { width: 1.1em; height: 1.1em; flex: none; }
.btn-sun { background: var(--sun); color: var(--maroon-deep); }
.btn-sun:hover { background: #FFE15C; }
.btn-ghost { border-color: var(--on-maroon-muted); color: var(--on-maroon); }
.btn-ghost:hover { background: rgba(255,255,255,.08); }
.btn-line { border-color: var(--line); color: var(--ink); background: var(--surface); }
.btn-line:hover { border-color: var(--accent); color: var(--accent); }

/* Hero band (home) and page heads */
.band {
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(225,20,28,.35), transparent 60%),
    linear-gradient(160deg, var(--maroon) 0%, var(--maroon-deep) 75%);
  color: var(--on-maroon);
}
.hero .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: center;
  gap: 2rem 3rem; padding-block: clamp(2.5rem, 6vw, 5rem);
}
.hero-roles {
  font-family: var(--font-display); font-weight: 600; color: var(--sun);
  letter-spacing: .04em; font-size: 1rem; margin-bottom: .9rem;
}
.hero-roles .sep { opacity: .7; }
.hero p.lede { margin-top: 1.1rem; max-width: 40rem; font-size: 1.15rem; color: var(--on-maroon-muted); }
.hero .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-logo { width: clamp(150px, 22vw, 240px); filter: drop-shadow(0 18px 40px rgba(0,0,0,.35)); }

.profiles { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1.75rem 0 0; }
.profiles a {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .8rem; border-radius: 999px; font-size: .95rem; font-weight: 700;
  color: var(--on-maroon); text-decoration: none; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
}
.profiles a:hover { background: rgba(255,255,255,.16); }
.profiles svg { width: 1rem; height: 1rem; fill: currentColor; }

.page-head .wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-head p { margin-top: .75rem; max-width: 44rem; color: var(--on-maroon-muted); font-size: 1.1rem; }
.page-head a { color: var(--sun); }

/* Stats strip */
.stats { background: linear-gradient(100deg, #C81E26, var(--maroon) 90%); color: var(--on-maroon); }
.stats ul {
  list-style: none; margin: 0; padding-block: 1.5rem; padding-inline: clamp(16px, 4vw, 32px);
  max-width: var(--wrap); margin-inline: auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem;
}
.stats li { display: flex; flex-direction: column; }
.stats strong { font-family: var(--font-display); font-size: clamp(1.8rem, 1.4rem + 1.5vw, 2.6rem); color: var(--sun); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats span { font-size: .95rem; }

/* Sections */
main { display: block; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1.5rem; }
.section-head p { color: var(--muted); max-width: 44rem; }
.eyebrow { font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0;
}
.card p { color: var(--muted); }
.card .more { margin-top: auto; padding-top: .5rem; font-weight: 700; }

.latest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.latest .card { flex-direction: row; gap: 1.25rem; align-items: flex-start; }
.latest img { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.latest .card > div { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.doc-mark {
  width: 72px; height: 72px; flex: none; border-radius: 16px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
}

/* Publications */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filters button {
  font: inherit; font-weight: 700; font-size: .95rem; padding: .5rem 1rem; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink); border: 2px solid var(--line);
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters .count { font-weight: 400; opacity: .8; }
.year-group { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 1rem 2rem; padding-block: 1.75rem; border-top: 1px solid var(--line); }
.year-group > h2 { font-size: 1.6rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pubs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.75rem; }
.pub { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.pub h3 { font-size: 1.2rem; }
.pub h3 a { color: var(--ink); text-decoration-color: var(--line); }
.pub h3 a:hover { color: var(--accent); text-decoration-color: currentColor; }
.pub .authors { color: var(--muted); font-size: .98rem; }
.pub .authors b { color: var(--ink); }
.pub .venue { font-style: italic; }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .15rem .55rem; border-radius: 6px; border: 1.5px solid currentColor; }
.tag-journal { color: var(--tag-journal); }
.tag-conference { color: var(--tag-conf); }
.tag-poster { color: var(--tag-poster); }
.pub-actions { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; font-size: .95rem; }
.pub details summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.pub details[open] summary { margin-bottom: .5rem; }
.pub details p { max-width: 46rem; color: var(--ink); }
.linkbtn { font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.note { font-size: .9rem; color: var(--tag-poster); border: 1.5px dashed currentColor; border-radius: 8px; padding: .4rem .7rem; align-self: flex-start; }

/* Books */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11rem, 42%), 1fr)); gap: 1.75rem 1.25rem; list-style: none; padding: 0; margin: 0; }
.shelf figure { margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.shelf img { aspect-ratio: 791 / 1024; object-fit: cover; width: 100%; border-radius: 4px 10px 10px 4px; box-shadow: 0 1px 0 var(--line), 0 12px 24px -12px rgba(30, 10, 12, .45); }
.shelf figcaption { font-weight: 700; line-height: 1.3; }
.shelf figcaption small { display: block; font-weight: 400; color: var(--muted); }
.placeholder-cover {
  aspect-ratio: 791 / 1024; border: 2px dashed var(--line); border-radius: 4px 10px 10px 4px;
  display: grid; place-items: center; text-align: center; padding: 1rem; color: var(--muted); font-size: .9rem; background: var(--surface);
}

/* Apps */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.app { flex-direction: row; gap: 1.1rem; align-items: flex-start; height: 100%; }
.app img { width: 76px; height: 76px; border-radius: 18px; flex: none; border: 1px solid var(--line); }
.app > div { display: flex; flex-direction: column; gap: .45rem; min-width: 0; flex: 1; height: 100%; }
.app .stores { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; padding-top: .5rem; }
.store { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 700; padding: .35rem .75rem; border-radius: 999px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; }
.store:hover { border-color: var(--accent); color: var(--accent); }
.store svg { width: .95rem; height: .95rem; fill: currentColor; }
.app-cat { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.prose { display: flex; flex-direction: column; gap: 1rem; max-width: 42rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1rem; border-top: 1px solid var(--line); }
.timeline time, .timeline .when { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.timeline p { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.chips li { font-size: .9rem; padding: .25rem .65rem; border-radius: 999px; background: var(--accent-soft); color: var(--ink); }
.side { display: flex; flex-direction: column; gap: 1.75rem; }
.side h2 { font-size: 1.25rem; margin-bottom: .75rem; }

/* Contact */
.contact-card { max-width: 40rem; display: flex; flex-direction: column; gap: 1rem; padding: clamp(1.5rem, 4vw, 2.5rem); }
.email { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.15rem, 0.9rem + 1.6vw, 1.9rem); overflow-wrap: anywhere; color: var(--ink); text-decoration-color: var(--accent); }
.copy-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.status { color: var(--muted); font-size: .95rem; min-height: 1.5em; }

/* Footer */
.site-footer { background: var(--maroon-deep); color: var(--on-maroon-muted); margin-top: 2rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 2rem; font-size: .95rem; }
.site-footer a { color: var(--on-maroon); }

@media (max-width: 860px) {
  .grid-3, .latest { grid-template-columns: minmax(0, 1fr); }
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .stats ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-logo { order: -1; width: 120px; }
  .year-group { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .brand span { display: none; }
  .nav a { padding: .4rem .65rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
h2.h3 { font-size: 1.2rem; }
.timeline.edu li { grid-template-columns: minmax(0, 1fr); gap: .15rem; padding-block: .75rem; }
.timeline.edu h3 { font-size: 1.05rem; }
.tag-thesis { color: var(--muted); }
.mini-cover { width: 72px; height: auto !important; border-radius: 3px 6px 6px 3px !important; box-shadow: 0 8px 16px -8px rgba(30,10,12,.5); }
.feature-book { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.feature-book > img { width: 100%; border-radius: 4px 10px 10px 4px; box-shadow: 0 1px 0 var(--line), 0 18px 32px -14px rgba(30, 10, 12, .55); }
.feature-body { display: flex; flex-direction: column; gap: 1rem; max-width: 42rem; min-width: 0; }
.feature-body h3 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); }
.feature-body .tagline { color: var(--muted); font-weight: 700; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.5rem; }
.ticks li { padding-left: 1.5rem; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: .7rem; height: .7rem; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px var(--maroon); }
.feature-body summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.chapters { margin: .75rem 0 0; padding-left: 1.5rem; columns: 2; column-gap: 2rem; }
.chapters li { break-inside: avoid; padding-block: .1rem; }
@media (max-width: 720px) {
  .feature-book { grid-template-columns: minmax(0, 1fr); }
  .feature-book > img { max-width: 15rem; }
  .ticks, .chapters { grid-template-columns: minmax(0, 1fr); columns: 1; }
}
.abstract { display: flex; flex-direction: column; gap: .6rem; max-width: 46rem; }
.abstract p { color: var(--ink); }
.retired { font-size: .88rem; color: var(--muted); font-style: italic; }
.spaced { margin-top: 1.5rem; }
.awards { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.filetype { font-weight: 400; }
/* Minimum 24px targets for small inline controls (WCAG 2.2) */
.linkbtn, .pub details summary, .feature-body summary { min-height: 24px; display: inline-flex; align-items: center; }
.pub details summary { display: list-item; }
@media (forced-colors: active) {
  .btn, .store, .filters button, .nav a, .profiles a { border: 2px solid ButtonText; }
  .nav a[aria-current="page"] { outline: 2px solid Highlight; }
}
