:root {
  color-scheme: light;
  --bg: #EDF3EF;
  --surface: #FAFCFA;
  --ink: #221C3D;
  --muted: #59587A;
  --line: #CCDAD3;
  --accent: #6A3FA3;
  --accent-soft: #E4DAF3;
  --teal: #12797C;
  --turq: #2BB5B0;
  --green: #2E8A57;
  --mint: #BFE6D2;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, serif;
  --wrap: 1200px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #161229;
    --surface: #201A39;
    --ink: #ECEAF5;
    --muted: #A9A4C6;
    --line: #332B56;
    --accent: #B592F5;
    --accent-soft: #3A2D63;
    --teal: #5FD6D0;
    --turq: #3FC7C0;
    --green: #67CF93;
    --mint: #1F4A3B;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 1.125rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 2.5rem); }
p { margin: 0 0 1rem; }
.prose { max-width: 64ch; }
.prose p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); }

/* Header */
.site-header { position: relative; z-index: 5; }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1.25rem; padding-bottom: 1.1rem; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.1rem; text-decoration: none; letter-spacing: -0.01em; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(.8rem, 1.8vw, 1.5rem); flex-wrap: wrap; }
.nav a { font-family: var(--display); font-size: 1rem; text-decoration: none; color: var(--muted); padding: .25rem 0; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.menu-btn { display: none; font-family: var(--display); font-size: 1rem; background: none; border: 2px solid var(--ink); color: var(--ink); padding: .35rem .8rem; cursor: pointer; }
@media (max-width: 900px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; gap: 0; padding: .5rem clamp(1.25rem, 4vw, 2.5rem) 1rem; }
  .nav a { display: block; padding: .6rem 0; font-size: 1.15rem; }
}
.selvedge { display: block; width: 100%; height: 12px; image-rendering: pixelated; }

/* Type */
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
.page-title { font-weight: 750; font-stretch: 82%; font-size: clamp(2.8rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -0.035em; margin-bottom: 1.25rem; }
h2 { font-weight: 700; font-stretch: 85%; font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.02; }
h3 { font-weight: 650; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: .4rem; }
h4 { font-weight: 650; font-size: 1.15rem; line-height: 1.25; letter-spacing: -0.005em; margin: 1.75rem 0 .6rem; color: var(--teal); }
.lede { font-family: var(--display); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.35; max-width: 40ch; }

/* Layout */
.page-head { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
section.block { padding: clamp(2.75rem, 6vw, 4.75rem) 0; border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr 2.3fr; gap: 2rem 3rem; }
.split > .side h2 { position: sticky; top: 1.5rem; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 1.5rem; } .split > .side h2 { position: static; } }

/* Home hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: end; padding: clamp(2rem, 5vw, 4rem) 0 clamp(3rem, 7vw, 5rem); }
.hero h1 { font-weight: 750; font-stretch: 80%; font-size: clamp(3.4rem, 9vw, 7.2rem); line-height: .9; letter-spacing: -0.035em; margin-bottom: 1.75rem; }
.hero h1 span { display: block; }
.hero .roles { font-family: var(--display); font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.35; max-width: 32ch; margin-bottom: 1.25rem; }
.hero .intro { color: var(--muted); max-width: 48ch; margin: 0; }
.portrait { margin: 0; }
.portrait canvas { display: block; width: 100%; height: 48px; image-rendering: pixelated; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; align-items: start; } .portrait { max-width: 460px; } }

/* Buttons and link rows */
.links { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; font-family: var(--display); font-size: 1.02rem; margin: 0; padding: 0; list-style: none; }
.btn { display: inline-block; font-family: var(--display); font-weight: 600; font-size: 1rem; text-decoration: none; background: var(--ink); color: var(--bg); padding: .6rem 1.1rem; border: 2px solid var(--ink); }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 0; }

/* Work grid */
.group + .group { margin-top: 3.5rem; }
.group > h3 { margin-bottom: 1.25rem; }
.works { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2.25rem 1.75rem; }
.work a.cover { display: block; text-decoration: none; }
.work h4 { margin: .9rem 0 .2rem; color: var(--ink); font-size: 1.25rem; }
.work h4 a { text-decoration: none; }
.work h4 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.work .meta { font-family: var(--display); font-size: .95rem; color: var(--teal); margin: 0 0 .5rem; }
.work p.desc { font-size: 1rem; line-height: 1.55; color: var(--muted); margin: 0; }

/* Detail page */
.detail-meta { font-family: var(--display); color: var(--teal); font-size: 1.05rem; margin: 0 0 1.5rem; }
.backlink { font-family: var(--display); font-size: 1rem; display: inline-block; margin-bottom: 1.5rem; }
.note { border-left: 3px solid var(--accent); padding: .25rem 0 .25rem 1.1rem; margin: 1.75rem 0; max-width: 64ch; }
.note strong { font-family: var(--display); }
.credits p { font-size: 1rem; }

/* Video */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.video button { all: unset; cursor: pointer; position: absolute; inset: 0; display: block; }
.video button img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.video button span { position: absolute; left: 1rem; bottom: 1rem; font-family: var(--display); font-weight: 650; background: var(--surface); color: var(--ink); padding: .4rem .8rem; }
.video button:hover span, .video button:focus-visible span { background: var(--accent); color: var(--surface); }
.video button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.single-video { max-width: 860px; margin-top: 2rem; }

/* News */
.news { list-style: none; margin: 0; padding: 0; }
.news li { display: grid; grid-template-columns: 180px 1fr; gap: 1.5rem; padding: 1.75rem 0; border-bottom: 1px solid var(--line); }
.news li:first-child { padding-top: 0; }
.news li:last-child { border-bottom: 0; }
.news time { font-family: var(--display); font-size: .95rem; color: var(--teal); display: block; margin-bottom: .2rem; }
.news h3 { font-size: 1.3rem; }
.news p { font-size: 1.02rem; color: var(--muted); max-width: 64ch; margin: .4rem 0 0; }
.news .more { font-family: var(--display); font-size: .98rem; margin-top: .5rem; display: inline-block; }
@media (max-width: 600px) { .news li { grid-template-columns: 96px 1fr; gap: 1rem; } }

/* Entries (CV, publications, events) */
.entries { list-style: none; margin: 0; padding: 0; }
.entries li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.25rem; padding: .8rem 0; border-top: 1px solid var(--line); font-size: 1.02rem; line-height: 1.5; }
.entries li:first-child { border-top: 0; }
.entries .yr { font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 1rem; }
.entries strong { font-family: var(--display); font-weight: 650; font-size: 1.05rem; }
.entries .rest { color: var(--muted); }
@media (max-width: 520px) { .entries li { grid-template-columns: 1fr; gap: .1rem; } }
.subsection + .subsection { margin-top: 3rem; }
.subsection > h3 { margin-bottom: 1rem; }

/* Teams */
.teams { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.25rem; }
.teams li { display: grid; grid-template-columns: 200px 1fr; gap: 1.5rem; align-items: start; }
.teams p { font-size: 1.02rem; color: var(--muted); }
@media (max-width: 520px) { .teams li { grid-template-columns: 1fr; gap: .75rem; } .teams .frame { max-width: 220px; } }

/* Feature rows (research projects) */
.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.75rem; }
.features li { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.75rem; align-items: start; }
.features p { font-size: 1.02rem; }
@media (max-width: 760px) { .features li { grid-template-columns: 1fr; } }

/* Interests */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.tags li { font-family: var(--display); font-size: .98rem; border: 1.5px solid var(--ink); padding: .3rem .75rem; }

/* Courses */
.courses { display: grid; gap: 2rem; }
.course-group h4 { margin-top: 0; }
.course-group ul { margin: .4rem 0 0; padding-left: 1.1rem; font-size: 1rem; }
.course-group li { margin: .15rem 0; }
.course-group .where { color: var(--muted); font-size: 1rem; margin: 0; }

/* Voices */
.voices { list-style: none; margin: 0; padding: 0; display: grid; gap: 3rem; }
.voice blockquote { margin: 0 0 1.1rem; font-size: 1.08rem; max-width: 66ch; }
.voice blockquote p:first-child::before { content: "\201C"; color: var(--accent); font-family: var(--display); font-weight: 800; font-size: 1.6em; line-height: 0; vertical-align: -.25em; margin-right: .1em; }
.voice figcaption { display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: center; max-width: 66ch; }
.voice figcaption img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.voice .who { font-family: var(--display); font-weight: 650; }
.voice .bio { font-size: .95rem; color: var(--muted); margin: .2rem 0 0; }
.voice .bio a { font-family: var(--display); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem 3rem; align-items: start; }
.email { font-family: var(--display); font-weight: 700; font-stretch: 85%; font-size: clamp(1.25rem, 2.4vw, 1.9rem); line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; display: inline-block; margin: .25rem 0 1.5rem; }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2.5rem 0 3rem; margin-top: 2rem; color: var(--muted); font-size: .98rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; font-family: var(--display); }

/* ---------- Image frames: show the whole picture ---------- */
.frame { position: relative; display: block; overflow: hidden; background: var(--accent-soft); width: 100%; }
.frame .bg { position: absolute; inset: -24px; background-size: cover; background-position: center; filter: blur(22px) saturate(1.25); opacity: .6; transform: scale(1.08); }
.frame img { position: relative; width: 100%; height: 100%; }
.frame.cover img { object-fit: cover; }
.frame.fit img { object-fit: contain; }
.work .cover { transition: transform .2s ease; }
.work .cover:hover .frame { outline: 3px solid var(--accent); outline-offset: -3px; }
.hero-frame { position: relative; overflow: hidden; display: flex; justify-content: center; background: var(--accent-soft); }
.hero-frame .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2); opacity: .55; transform: scale(1.1); }
.hero-frame img { position: relative; width: auto; max-width: 100%; max-height: 74vh; }
.portrait img { width: 100%; }
.contact-grid figure img { width: 100%; max-height: 520px; object-fit: contain; object-position: left top; width: auto; max-width: 100%; }

/* Gallery: natural proportions, click to enlarge */
.gallery { columns: 3 240px; column-gap: 1rem; margin-top: 2rem; }
.g-item { display: block; break-inside: avoid; margin-bottom: 1rem; }
.g-item img { width: 100%; }
.g-item:hover img { outline: 3px solid var(--accent); outline-offset: -3px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 94vh; }
.lightbox::backdrop { background: rgba(18, 14, 36, .88); }
.lightbox img { max-width: 94vw; max-height: 86vh; width: auto; height: auto; display: block; }
.lightbox button { position: fixed; top: 1rem; right: 1rem; font-family: var(--display); font-weight: 650; font-size: 1rem; background: var(--surface); color: var(--ink); border: 0; padding: .5rem 1rem; cursor: pointer; }

/* ---------- Color accents ---------- */
.hero h1 { color: var(--ink); }
.page-title { color: var(--ink); }
.btn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:hover { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.ghost { color: var(--accent); border-color: var(--accent); background: transparent; }
.btn.ghost:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (prefers-color-scheme: dark) {
  .btn, .btn:hover, .btn.ghost:hover, .video button span, .video button:hover span { color: #161229; }
}
.tags li { border-color: var(--green); background: color-mix(in srgb, var(--mint) 45%, transparent); }
.entries .yr { color: var(--accent); }
h4 { color: var(--green); }
.note { border-left-color: var(--turq); background: color-mix(in srgb, var(--mint) 35%, transparent); padding: .9rem 1.1rem; }
.video button span { background: var(--accent); color: #fff; }
.video button:hover span, .video button:focus-visible span { background: var(--teal); color: #fff; }
section.block:nth-of-type(even) { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.gallery.two { columns: 2 260px; }

/* Featured conference */
.conf { background: #35257E; color: #E6E3FA; padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.conf-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
.conf-img img { width: 100%; aspect-ratio: 1200 / 630; }
.conf-img:hover img { outline: 3px solid #F2A0E0; outline-offset: 4px; }
.conf h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.05; margin-bottom: 1rem; color: #fff; }
.conf h2 a { text-decoration: none; }
.conf h2 a:hover { text-decoration: underline; text-decoration-color: #F2A0E0; color: #fff; }
.conf-role { font-family: var(--display); font-weight: 650; font-size: 1rem; color: #35257E; background: #F9B27C; display: inline-block; padding: .25rem .7rem; margin-bottom: 1rem; }
.conf-dates { font-family: var(--display); font-size: 1.05rem; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; color: #F2A0E0; }
.conf p { max-width: 52ch; }
.conf-btn, .conf-btn:hover { color: #35257E; }
.conf-btn { background: #E6E3FA; border-color: #E6E3FA; }
.conf-btn:hover { background: #F9B27C; border-color: #F9B27C; }
.conf a:focus-visible { outline-color: #F9B27C; }
@media (max-width: 860px) { .conf-grid { grid-template-columns: 1fr; } }
