/* ==========================================================================
   Ali ElSheikh — site styles
   Plain CSS, no build step. Edit tokens in :root before adding one-off values.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts (self-hosted, trimmed to the weights the site uses)
   Newsreader: body, metadata, navigation.  Cormorant Garamond: titles.
   EB Garamond semibold italic: emphasis and accent text.
   Newsreader Display (optical size 72): the name only — the file contains just the
   letters in "Ali ElSheikh".
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/newsreader-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/cormorant-garamond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/eb-garamond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/eb-garamond-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader Display";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/newsreader-display-name.woff2") format("woff2");
  unicode-range: U+20, U+41, U+45, U+53, U+65, U+68-69, U+6B-6C;
}

/* --------------------------------------------------------------------------
   Tokens
   -------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Dark-only screen palette: warm charcoal, cream ink, vermilion and apricot. */
  --paper: #1d1b16;
  --ink: #ece5d6;
  --ink-soft: #ccc3b2;
  --muted: #a39b8b;
  --accent: #ef8a6c;
  --accent-deep: #f7a68d;
  --accent-2: #e8b17e;
  --accent-2-deep: #f2ccaa;
  --hairline: color-mix(in srgb, var(--ink) 18%, transparent);
  --selection: color-mix(in srgb, var(--accent-2) 20%, transparent);
  --accent-line: var(--accent);
  --leaf-opacity: .13;

  /* Families */
  --font-body: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-display: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --font-accent: "EB Garamond", "Cormorant Garamond", Garamond, Georgia, serif;
  --font-name: "Newsreader Display", "Newsreader", Georgia, serif;

  /* Type scale.
     Text sizes step by ~1.2 (15 → 18). Display sizes step by 4:3 from the body:
     18 → 24 (paper titles) → 32 (section titles) → 42.7 (page titles) → name. */
  --fs-meta: 0.9375rem;                      /* 15px   authors, dates               */
  --fs-small: 1.0625rem;                     /* 17px   navigation, “More about me”  */
  --fs-body: 1.125rem;                       /* 18px   body, subtitle, venue        */
  --fs-title: 1.5rem;                        /* 24px   paper titles (Cormorant)     */
  --fs-section: 2rem;                        /* 32px   "Selected research"          */
  --fs-page: clamp(2.25rem, 1.6rem + 2vw, 2.667rem); /* ≤ 42.7px  page titles     */
  --fs-name: clamp(2.4rem, 4.2vw, 3.4rem);   /* name                                */

  --lh-body: 1.65;
  --lh-tight: 1.2;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.75rem;
  --space-8: 4rem;
  --space-9: 5.5rem;

  /* Layout */
  --shell: 70rem;          /* 1120px page width               */
  --gutter: 2.5rem;        /* side margin on desktop          */
  --column-gap: clamp(3rem, 7vw, 7rem);
  --measure: 40rem;        /* comfortable prose width (640px) */
  --list-measure: 46rem;   /* publication lists on inner pages */
}

/* --------------------------------------------------------------------------
   Base and paper surface
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Subtle lit relief on warm charcoal paper. */
  background-color: var(--paper);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.64' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeDiffuseLighting surfaceScale='2.1' diffuseConstant='1.05' lighting-color='%23fff'%3E%3CfeDistantLight azimuth='235' elevation='42'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.09'/%3E%3C/svg%3E");
  background-size: 260px 260px;
  background-blend-mode: soft-light;
}

/* Soft light falling across the sheet: warm upper left, deeper lower-right shadow.
   Fixed to the viewport so it reads as lighting rather than as part of the paper. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 236, 210, 0.045), rgba(255, 236, 210, 0) 60%),
    radial-gradient(90% 80% at 100% 100%, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0) 70%);
}

/* Royal Poinciana: a robotic gripper holding the flower, reaching in from the lower-right
   corner of the viewport. Fixed, so it never moves when content expands or the page scrolls. */
body::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: -1;
  width: min(40vw, 34rem);
  aspect-ratio: 1291 / 1051;
  pointer-events: none;
  background: url("assets/royal-poinciana.png") right bottom / contain no-repeat;
  background-image: image-set(
    url("assets/royal-poinciana.webp") type("image/webp"),
    url("assets/royal-poinciana.png") type("image/png")
  );
  opacity: 0.10;
  mix-blend-mode: screen;
}

/* Ginkgo gripper reaches down from the upper-right viewport corner. */
.leaf-illustration { position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:-1; }
.leaf-illustration::after {
  content:"";
  position:absolute;
  top:-.5rem;
  right:-1.5rem;
  width:min(30vw,25rem);
  aspect-ratio:1392 / 1136;
  background:url("assets/robot-ginkgo.png") center / contain no-repeat;
  transform:scaleY(-1);
  opacity:var(--leaf-opacity);
  mix-blend-mode:screen;
}
@media(max-width:860px){.leaf-illustration::after{width:34vw;right:-2rem}}
@media(max-width:560px){:root{--leaf-opacity:.085}.leaf-illustration::after{width:46vw;right:-2rem;top:-.75rem}}
@media print{.leaf-illustration{display:none}}

::selection { background: var(--selection); }

img, svg { display: block; }

p { margin: 0; }

h1, h2, h3 { margin: 0; font-weight: 600; }

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  padding: var(--space-1) var(--space-3);
  background: var(--paper);
  color: var(--accent-deep);
  font-size: var(--fs-meta);
}
.skip-link:focus { top: var(--space-4); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Page shell and header
   -------------------------------------------------------------------------- */

.shell {
  width: min(100% - 2 * var(--gutter), var(--shell));
  margin-inline: auto;
  padding-block: var(--space-8) var(--space-9);
}

/* Header: one left-aligned block — name, subtitle, then a single line of profile
   icons and pages. Nothing floats on the right. */
.masthead {
  margin-bottom: var(--space-8);
}

/* The name: Newsreader at its display optical size — sharper and higher-contrast than
   the same family at body size, so it is related to the text but clearly set apart. */
.name {
  margin: 0;
  font-family: var(--font-name);
  font-size: var(--fs-name);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.name a:hover { color: var(--ink); }

/* Subtitle block: one line today; add lines (honours, affiliation) as separate <span>s. */
.subtitle {
  margin-top: var(--space-3);
  color: var(--muted);
  font-size: var(--fs-body);
  line-height: 1.45;
}
.subtitle span { display: block; }
.subtitle em { font-style: italic; }

/* Profile icons — glyphs only, no boxes, in the accent colour. Hit area is 44px; the
   negative margin keeps the first glyph flush with the name. */
.profile-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 0 0 -0.6875rem;
  padding: 0;
  list-style: none;
}
.profile-links a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--accent-2);
}
.profile-links a:hover { color: var(--accent-2-deep); }
.profile-links svg {
  width: 1.375rem;
  height: 1.375rem;
  fill: currentColor;
}

/* The line under the subtitle: icons, a hairline, then the pages. The name links home,
   so there is no "Home" item. */
.masthead-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-top: var(--space-4);
}
.bar-rule {
  width: 1px;
  height: 1.25rem;
  background: var(--hairline);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-small);
}
.site-nav a { color: var(--ink-soft); }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-color: color-mix(in srgb, var(--accent-2) 55%, transparent);
  text-underline-offset: 0.35em;
}

/* --------------------------------------------------------------------------
   Homepage: biography | selected research
   Row 1 holds the "Selected research" heading; the biography starts in row 2,
   so the left cell beside the heading is simply empty — no spacer element.
   Row 2 aligns on the first baseline, so the bio's first line sits level with
   the first paper title.
   -------------------------------------------------------------------------- */

.home {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  grid-template-rows: auto auto;
  column-gap: var(--column-gap);
  align-items: baseline;
}

.home .bio { grid-column: 1; grid-row: 2; }
.home .section-title { grid-column: 2; grid-row: 1; }
.home .research { grid-column: 2; grid-row: 2; }

.bio p + p { margin-top: 1em; }

/* Emphasis and accent text: EB Garamond semibold italic.
   Sized up 10% because Garamond's small x-height reads smaller than Newsreader at the
   same size; line-height 1 stops the larger glyphs from opening up the line spacing. */
.bio strong,
.paper-authors strong,
.text-link,
.prose a,
.lede a:not(.eyebrow) {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 600;
  font-size: 1.1em;
  line-height: 1;
}
.bio strong,
.text-link { white-space: nowrap; }

/* The advisor's name keeps its emphasis in an upright body face. */
.bio strong.upright {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 1em;
  line-height: inherit;
}

.text-link {
  color: var(--accent);
}
.text-link:hover {
  color: var(--accent-deep);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-line);
}

/* "More about me" — a quiet continuation of the paragraph, not an accordion widget */
.more {
  margin-top: var(--space-5);
}
.more summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  color: var(--accent-2);
  font-family: var(--font-accent);
  font-size: var(--fs-small);
  font-style: italic;
  font-weight: 600;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::marker { content: ""; }
.more summary::after {
  content: "+";
  content: "+" / "";
  display: inline-block;
  margin-left: 0.4em;
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
}
.more[open] summary::after {
  content: "\2212";
  content: "\2212" / "";
}
.more summary:hover { color: var(--accent-2-deep); }
.more-body {
  padding-top: var(--space-4);
}
.more-body p + p { margin-top: 1em; }

@media (prefers-reduced-motion: no-preference) {
  .more[open] .more-body { animation: settle 0.22s ease-out both; }
  @keyframes settle { from { opacity: 0; } to { opacity: 1; } }
}

/* --------------------------------------------------------------------------
   Section and page titles
   -------------------------------------------------------------------------- */

/* Cormorant defaults to old-style figures, which turn "SO-100" into "SO-1oo". */
.section-title,
.page-title,
.paper-title,
.entry-title,
.statement .closing { font-variant-numeric: lining-nums; }

/* Neither text face has Greek; keep the fallback glyph from looking heavy in titles. */
.greek { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 0.9em; }

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-section);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: var(--space-6);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-page);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-6);
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
  color: var(--muted);
  font-size: var(--fs-meta);
}
.eyebrow:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   Publication entries
   Title (Cormorant) leads; authors and year sit quietly beneath; the venue sits on
   the right in italic, sharing the title's baseline.
   -------------------------------------------------------------------------- */

.papers {
  display: grid;
  gap: var(--space-7);
  margin: 0;
  padding: 0;
  list-style: none;
}

.paper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-6);
  align-items: baseline;
}

.paper-title {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.paper-title a:hover {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-line);
}

.paper-venue {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: var(--lh-tight);
  white-space: nowrap;
}
.paper-venue a { color: var(--accent); }
.paper-venue a:hover { color: var(--accent-deep); }

.paper-authors,
.paper-date,
.paper-links,
.paper-note {
  grid-column: 1;
  font-size: var(--fs-meta);
  line-height: 1.5;
  color: var(--muted);
}
.paper-authors { margin-top: var(--space-2); text-wrap: pretty; }
.paper-authors strong { color: var(--ink); white-space: nowrap; }
.paper-date { margin-top: 0.125rem; font-variant-numeric: lining-nums; }

.paper-note {
  margin-top: var(--space-2);
  color: var(--ink-soft);
  font-size: var(--fs-meta);
  max-width: 38rem;
}

/* Small secondary links on the Research page: PDF · Code · Video */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
}
.paper-links a { color: var(--accent-2); }
.paper-links a:hover {
  color: var(--accent-2-deep);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-line);
}

.more-research {
  margin-top: var(--space-7);
  font-size: var(--fs-meta);
}
.more-research a { color: var(--muted); }
.more-research a:hover { color: var(--accent); }

/* Homepage News: selected layout D, below the papers. */
.news { margin-top: 3.5rem; }
.news-title { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-title); line-height: 1.1; margin: 0 0 1.5rem; font-variant-numeric: lining-nums; }
.news-scroll { max-height: 18rem; overflow-y: auto; scrollbar-gutter: stable; padding: .2rem .75rem .2rem .2rem; min-width: 0; }
/* Selected scrollbar C: rounded apricot thumb, transparent track. */
.news-scroll { scrollbar-width: thin; scrollbar-color: var(--accent-2) transparent; }
@supports selector(::-webkit-scrollbar) {
  .news-scroll { scrollbar-width: auto; scrollbar-color: auto; }
  .news-scroll::-webkit-scrollbar { width: 14px; }
  .news-scroll::-webkit-scrollbar-track { background: transparent; }
  .news-scroll::-webkit-scrollbar-thumb { background-color: var(--accent-2); background-clip: padding-box; border: 4px solid transparent; border-radius: 999px; min-height: 36px; }
  .news-scroll::-webkit-scrollbar-thumb:hover { background-color: var(--accent-2-deep); }
  .news-scroll::-webkit-scrollbar-button { display: none; }
}
@media(forced-colors:active) { .news-scroll { scrollbar-width: auto; scrollbar-color: auto; } }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 5rem minmax(0,1fr); gap: 1rem; align-items: baseline; margin: 0; }
.news-list li + li { margin-top: 1.25rem; }
.news-list time { color: var(--ink-soft); font-size: var(--fs-meta); white-space: nowrap; font-variant-numeric: lining-nums; }
.news-list p { font-size: var(--fs-small); line-height: 1.55; }
.news-list a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: .15em; }
.news-list a:hover { color: var(--accent-deep); }
@media (max-width: 560px) {
  .news-list li { grid-template-columns: 4.7rem minmax(0, 1fr); gap: .75rem; }
}
@media print { .news-scroll { max-height: none; overflow: visible; } }

/* --------------------------------------------------------------------------
   Inner pages
   -------------------------------------------------------------------------- */

.page {
  max-width: var(--list-measure);
}

.lede {
  max-width: var(--measure);
}
.lede p + p { margin-top: 1em; }

.page-section {
  margin-top: var(--space-9);
}
.page-section > .section-title { margin-bottom: var(--space-6); }
.page-section > p,
.page-section > .prose { max-width: var(--measure); }
.page-section > p + p { margin-top: 1em; }

.prose p + p { margin-top: 1.1em; }
.prose a,
.lede a:not(.eyebrow) { color: var(--accent); }
.prose a:hover,
.lede a:not(.eyebrow):hover {
  color: var(--accent-deep);
  text-decoration-line: underline;
  text-decoration-color: var(--accent-line);
}

/* A plain list with a short dash, used for research directions and project areas */
.dash-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: var(--measure);
}
.dash-list li {
  position: relative;
  padding-left: 1.4em;
}
.dash-list li + li { margin-top: var(--space-3); }
.dash-list li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: var(--accent-2);
}

/* Short definition-style entries (mentorship areas) */
.entries {
  display: grid;
  gap: var(--space-6);
  max-width: var(--measure);
  margin: 0;
  padding: 0;
  list-style: none;
}
.entry-title {
  font-family: var(--font-display);
  font-size: var(--fs-title);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-2);
}

/* Research statement: a single reading column */
.statement {
  max-width: 42rem;
}
.statement .prose {
  font-size: 1.1875rem;   /* 19px — slightly larger for long-form reading */
  line-height: 1.7;
}
.statement .prose p + p { margin-top: 1.25em; }
.statement .closing {
  margin-top: var(--space-7);
  font-family: var(--font-display);
  font-size: var(--fs-title);
  line-height: 1.35;
  color: var(--ink);
  text-wrap: pretty;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  body::after { width: min(44vw, 30rem); }
}

/* Stack the homepage columns. The empty cell beside the heading disappears
   because the biography simply comes first. */
@media (max-width: 860px) {
  :root {
    --gutter: 1.5rem;
    --space-9: 4rem;
  }

  .shell { padding-top: var(--space-6); }

  .home {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .home .bio,
  .home .section-title,
  .home .research { grid-column: 1; grid-row: auto; max-width: 38rem; }
  .home .section-title { margin-top: var(--space-8); }

  body::after {
    width: min(78vw, 30rem);
    right: -8vw;
    bottom: -4vw;
    opacity: 0.09;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 1rem;
    --fs-body: 1.0625rem;     /* 17px */
    --fs-section: 1.875rem;   /* 30px */
    --fs-title: 1.4375rem;    /* 23px */
  }

  /* Icons and pages no longer fit on one line: stack them, drop the hairline */
  .masthead-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
  }
  .bar-rule { display: none; }
  .site-nav { gap: var(--space-1) var(--space-4); }

  /* Venue moves under the title, still italic and still a link */
  .paper { grid-template-columns: minmax(0, 1fr); }
  .paper-venue {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
    margin-top: var(--space-1);
    font-size: var(--fs-small);
  }

  body::after {
    width: 92vw;
    right: -22vw;
    bottom: -6vw;
    opacity: 0.08;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Printing uses dark ink on white paper, independently of the screen theme. */
@media print {
  :root {
    color-scheme: light;
    --paper: #f6f0e4;
    --ink: #29261f;
    --ink-soft: #48433a;
    --muted: #645d51;
    --accent: #a63a24;
    --accent-deep: #862c1a;
    --accent-2: #92501f;
    --accent-2-deep: #703b16;
    --hairline: color-mix(in srgb, var(--ink) 18%, transparent);
    --selection: color-mix(in srgb, var(--accent-2) 20%, transparent);
    --accent-line: var(--accent);
  }
  body { background: #fff; }
  body::before, body::after, .masthead-bar, .skip-link { display: none; }
  .home { display: block; }
}


/* Selected Research layout J: introduction, two-column lists and section links. */
.research-surface { --leaf-opacity: .10; }
.research-surface::after { opacity: .08; }
.research-page { max-width: none; }
.research-nav { display: flex; flex-wrap: wrap; gap: .8rem 1.8rem; margin-top: 2.5rem; font-size: var(--fs-small); }
.research-nav a { color: var(--ink-soft); padding: .2rem 0; }
.research-nav a:hover { color: var(--accent); }
.research-nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-2); text-underline-offset: .4em; }
.research-page > .page-section, .research-page > .project-section { margin-top: 2.5rem; }
.research-page .papers, .project-index { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: var(--column-gap); align-items: start; }
.project-index { list-style: none; padding: 0; margin: 0; row-gap: 2rem; }
.project-record { min-width: 0; }
.project-disclosure > summary { list-style: none; display: flex; gap: .75rem; align-items: baseline; cursor: pointer; }
.project-disclosure > summary::-webkit-details-marker { display: none; }
.project-disclosure .paper-title { font-size: var(--fs-title); text-wrap: pretty; }
.project-disclosure > summary::after { content: '+'; color: var(--accent-2); font-size: var(--fs-meta); flex: none; margin-left: auto; }
.project-disclosure[open] > summary::after { content: '−'; }
.project-disclosure > .paper-note { margin-top: .7rem; }
.project-record > .paper-links { margin-top: .35rem; }
.research-overview { max-width: var(--list-measure); }
.research-overview > .lede { max-width: none; }
.lede .statement-link { display: inline-flex; align-items: center; gap: .35em; line-height: 1.2; }
.statement-link svg { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
@media(max-width:860px) {
 .research-page .papers, .project-index { grid-template-columns: minmax(0,1fr); }
 .research-page .page-section, .research-page .project-section, .research-overview { max-width: 38rem; }
}
@media(max-width:560px) { .research-surface { --leaf-opacity: .085; } }

/* Publication search: progressive enhancement over the static paper list. */
.publication-search { margin: 0 0 2rem; }
.publication-search [hidden], .papers > [hidden], .no-results[hidden] { display: none; }
.publication-heading .section-title { margin: 0; }
.publication-search label { display: grid; gap: .5rem; color: var(--ink-soft); font-size: var(--fs-meta); }
.publication-search input, .publication-search select { width: 100%; min-width: 0; font: inherit; font-size: var(--fs-small); color: var(--ink); background: var(--paper); border: 0; border-bottom: 1px solid var(--muted); border-radius: 0; padding: .55rem .15rem; min-height: 44px; }
.publication-search input::placeholder { color: var(--ink-soft); opacity: 1; }
.publication-fields { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 1.5rem; margin-top: 1.25rem; }
.search-status { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: .65rem; }
.search-status .result-count { color: var(--ink-soft); font-size: var(--fs-meta); margin: 0; }
.search-status button, .filter-actions button { border: 0; background: transparent; font: inherit; font-size: var(--fs-meta); color: var(--accent-2); padding: .5rem 0; cursor: pointer; min-height: 44px; }
.filter-actions { text-align: right; }
.publication-search .publication-heading { display: grid; grid-template-columns: minmax(max-content,1fr) auto minmax(0,24rem); gap: 2rem; }
.publication-search .publication-heading .query-label { width: 100%; max-width: 24rem; }
.publication-search .query-label input { background: transparent; border: 1px solid var(--muted); border-radius: 3px; padding: .65rem 1rem; font-style: italic; }
.publication-search .query-label input::placeholder { font-style: italic; }
.filter-toggle { border: 0; padding: .55rem 0; min-height: 44px; background: transparent; color: var(--accent-2); font: inherit; font-size: var(--fs-small); cursor: pointer; white-space: nowrap; }
.filter-toggle::before { content: '+'; margin-right: .4rem; }
.filter-toggle[aria-expanded="true"]::before { content: '−'; }
.active-filter-count { font-size: var(--fs-meta); }
.no-results { color: var(--ink-soft); margin-bottom: 3rem; }
@media(max-width:860px) { .publication-search .publication-heading { grid-template-columns: auto minmax(0,1fr); gap: .75rem; } .publication-search .publication-heading .section-title { grid-column: 1 / -1; } }
@media(max-width:560px) { .publication-fields { grid-template-columns: 1fr 1fr; gap: 1rem; } }
@media print { .query-label, .filter-toggle, .search-controls, .no-results { display: none; } .papers > [hidden] { display: grid; } }

/* Coming-soon statement remains visible without a navigation target. */
.lede .statement-link[aria-disabled="true"] { cursor: default; }
.lede .statement-link[aria-disabled="true"]:hover { color: var(--accent); text-decoration: none; }

/* Selected dedicated project video viewers. Native controls remain the no-JS fallback. */
.video-player { margin-top: 1rem; background: var(--paper); color: var(--ink); }
.video-player video { display: block; width: 100%; max-height: 65vh; object-fit: contain; background: var(--paper); }
.video-player.portrait video { max-height: 60vh; }
.player-controls { display: grid; grid-template-columns: auto minmax(3rem,1fr) auto auto; align-items: center; gap: .6rem 1rem; padding: .4rem .75rem; }
.player-controls[hidden], .player-controls [hidden] { display: none; }
.player-controls button { min-width: 44px; min-height: 44px; padding: .4rem; font: inherit; font-size: var(--fs-meta); border: 0; background: transparent; color: var(--accent-2); cursor: pointer; }
.player-controls input { width: 100%; min-width: 0; accent-color: var(--accent-2); cursor: pointer; min-height: 44px; }
.player-controls .time { color: var(--ink-soft); font-size: var(--fs-meta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-controls .secondary { display: flex; align-items: center; gap: .2rem; }
.player-error { font-size: var(--fs-meta); padding: .75rem; }
.player-error[hidden] { display: none; }
.viewer-page { max-width: 60rem; margin: 0 auto; }
.viewer-page .viewer-back { margin: 0 0 1rem; font-size: var(--fs-meta); }
.viewer-page .page-title { font-size: var(--fs-section); }
.viewer-page .paper-note { max-width: 42rem; margin-top: 1rem; }
.viewer-page .video-player { margin-top: 1.5rem; }
.viewer-page .source-link { font-size: var(--fs-meta); margin-top: 1rem; }
.video-player:fullscreen { display: flex; flex-direction: column; justify-content: center; }
.video-player:fullscreen video { flex: 1; min-height: 0; max-height: none; }
.video-player:fullscreen .player-controls { flex: none; }
@media(max-width:560px) {
 .player-controls { grid-template-columns: auto minmax(2rem,1fr) auto; gap: .3rem .5rem; padding: .35rem .5rem; }
 .player-controls .secondary { grid-column: 1/-1; justify-content: flex-end; }
 .video-player video { max-height: 55vh; }
}
@media print { .player-controls { display:none; } }

/* Selected compact Collaborations layout: introduction followed by contact. */
.collaboration-page { max-width: none; }
.collaboration-page > .page-section { margin-top: 2rem; }
.collaboration-page > .page-section > .section-title {
  font-size: var(--fs-title);
  margin-bottom: 1rem;
}
.collaboration-page .lede strong { font-weight: 600; }
