/* =============================================================
   Shakil Ahmed — portfolio
   Type: Switzer and Gambetta by Indian Type Foundry (Fontshare,
   ITF Free Font License), self-hosted from assets/fonts.
   ============================================================= */

@font-face { font-family: 'Switzer'; src: url('../assets/fonts/Switzer-Variable.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('../assets/fonts/Switzer-VariableItalic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('../assets/fonts/Gambetta-Variable.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gambetta'; src: url('../assets/fonts/Gambetta-VariableItalic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --paper: oklch(96.8% 0.006 85);
  --paper-2: oklch(93.6% 0.007 85);
  --ink: oklch(19% 0.006 260);
  --ink-2: oklch(38% 0.008 260);
  --ink-3: oklch(54% 0.008 260);
  --rule: oklch(19% 0.006 260 / 0.13);
  --rule-2: oklch(19% 0.006 260 / 0.3);
  --accent: oklch(47% 0.16 252);
  --plate-filter: none;

  --sans: 'Switzer', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --serif: 'Gambetta', Georgia, 'Times New Roman', serif;
  --gutter: clamp(20px, 4vw, 64px);
  --nav-h: 64px;
  --maxw: 1520px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: oklch(14.5% 0.004 260);
    --paper-2: oklch(19% 0.005 260);
    --ink: oklch(94% 0.006 85);
    --ink-2: oklch(78% 0.006 85);
    --ink-3: oklch(62% 0.006 85);
    --rule: oklch(94% 0.006 85 / 0.12);
    --rule-2: oklch(94% 0.006 85 / 0.28);
    --accent: oklch(78% 0.11 232);
    --plate-filter: brightness(0.88);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: oklch(14.5% 0.004 260);
  --paper-2: oklch(19% 0.005 260);
  --ink: oklch(94% 0.006 85);
  --ink-2: oklch(78% 0.006 85);
  --ink-3: oklch(62% 0.006 85);
  --rule: oklch(94% 0.006 85 / 0.12);
  --rule-2: oklch(94% 0.006 85 / 0.28);
  --accent: oklch(78% 0.11 232);
  --plate-filter: brightness(0.88);
}

/* ---------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  font: 400 1rem/1.5 var(--sans);
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01' on;
}
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--rule-2);
  transition: color 0.3s, text-decoration-color 0.3s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: 12px; z-index: 100; padding: 8px 14px; background: var(--ink); color: var(--paper); transform: translateY(-200%); }
.skip:focus { transform: none; }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------------------------------------------------------- layers */
.field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
html.no-gl .field { display: none; }
/* the page's tone: a faint glow from two corners, over the points and under the content;
   it tints the paper in the light theme and lights the graphite in the dark one */
.tone {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; mix-blend-mode: multiply;
  background: radial-gradient(90% 70% at 8% 0%, oklch(99% 0.025 75) 0%, transparent 65%),
              radial-gradient(80% 70% at 100% 100%, oklch(91% 0.03 215) 0%, transparent 70%);
}
:root[data-theme="dark"] .tone {
  mix-blend-mode: screen;
  background: radial-gradient(90% 70% at 8% 0%, oklch(25% 0.04 205) 0%, transparent 65%),
              radial-gradient(80% 70% at 100% 100%, oklch(24% 0.05 260) 0%, transparent 70%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tone {
    mix-blend-mode: screen;
    background: radial-gradient(90% 70% at 8% 0%, oklch(25% 0.04 205) 0%, transparent 65%),
                radial-gradient(80% 70% at 100% 100%, oklch(24% 0.05 260) 0%, transparent 70%);
  }
}
main { position: relative; z-index: 1; }
.overlay { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.overlay > * { position: absolute; inset: 0; opacity: 0; }

.stage { position: relative; }
/* the finished hero photo: same box the generator renders into, so the hand-over is invisible */
.hero__photo { position: absolute; left: 2%; top: 3%; width: 96%; height: 94%; object-fit: contain; }
.js .hero__photo { opacity: 0; transition: opacity 0.5s; }
.js .hero__photo.is-ready { opacity: 1; }

/* overlays that sit on the points: tracking boxes, plate years, species names, network names */
.trk { position: absolute; left: 0; top: 0; border: 1px solid var(--accent); will-change: transform; }
.trk::after { content: ''; position: absolute; inset: -5px; border: 1px dashed color-mix(in oklch, var(--accent) 50%, transparent); transition: opacity 0.4s; }
.trk { transition: border-color 0.4s; }
.trk.is-unsure { border-color: color-mix(in oklch, var(--accent) 45%, transparent); }
.trk.is-unsure::after { opacity: 0.35; }

.tri-label { position: absolute; left: 0; top: 0; font: 500 12px/1 var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; will-change: transform; }
.taxon { position: absolute; left: 0; top: 0; display: grid; justify-items: center; gap: 3px; white-space: nowrap; text-align: center; will-change: transform; }
.taxon i { font: italic 400 16px/1.15 var(--serif); color: var(--ink); }
.taxon span { font: 400 11.5px/1.2 var(--sans); color: var(--ink-3); letter-spacing: 0.01em; }
.taxon > * { opacity: 0; transform: translateY(6px); transition: opacity 0.6s, transform 0.8s var(--ease); transition-delay: calc(var(--i) * 80ms); }
.ov-taxa.is-on .taxon > * { opacity: 1; transform: none; }


.node { position: absolute; left: 0; top: 0; white-space: nowrap; transform-origin: 0 0; will-change: transform; font: 400 12px/1.2 var(--sans); color: var(--ink-2); transition: opacity 0.3s; text-shadow: 0 0 2px var(--paper), 0 0 5px var(--paper), 0 0 9px var(--paper); }
.node.is-hidden { opacity: 0; }
.node--paper { font: italic 400 15px/1.2 var(--serif); color: var(--ink); }
.node--me { font: 600 13px/1.2 var(--sans); color: var(--ink); }
.node.is-dim { opacity: 0.25; }
.node.is-hot { color: var(--accent); font-weight: 600; }

/* cursor: a 3 × 3 convolution kernel → four focus corners on a link → a lamp in the light trap */
.kern { position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.kern__box { position: absolute; left: 0; top: 0; width: 20px; height: 20px; color: var(--ink); will-change: transform; transition: opacity 0.3s; }
.kern__box i { position: absolute; width: 5px; height: 5px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%); box-sizing: border-box; transition: width 0.35s var(--ease), height 0.35s var(--ease), background-color 0.3s, opacity 0.25s; }
.kern.is-locked .kern__box i { width: 11px; height: 11px; border-radius: 0; background: transparent; border: 0 solid var(--accent); }
.kern.is-locked .kern__box i:nth-of-type(1) { border-width: 1.5px 0 0 1.5px; transform: none; }
.kern.is-locked .kern__box i:nth-of-type(3) { border-width: 1.5px 1.5px 0 0; transform: translateX(-100%); }
.kern.is-locked .kern__box i:nth-of-type(7) { border-width: 0 0 1.5px 1.5px; transform: translateY(-100%); }
.kern.is-locked .kern__box i:nth-of-type(9) { border-width: 0 1.5px 1.5px 0; transform: translate(-100%, -100%); }
.kern__dot { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); will-change: transform; transition: width 0.3s, height 0.3s, left 0.3s, top 0.3s, box-shadow 0.3s, background-color 0.3s; }
.kern.is-light .kern__box { opacity: 0; }
.kern.is-light .kern__dot { width: 12px; height: 12px; left: -6px; top: -6px; background: color-mix(in oklch, var(--accent) 30%, var(--paper)); box-shadow: 0 0 0 1.5px var(--accent), 0 0 22px 6px color-mix(in oklch, var(--accent) 40%, transparent); }
html.has-kern, html.has-kern * { cursor: none !important; }
@media (hover: none), (pointer: coarse) { .kern { display: none; } }

/* ---------------------------------------------------------- navigation */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding-inline: var(--gutter);
  transition: transform 0.6s var(--ease), background-color 0.4s, box-shadow 0.4s;
}
.nav.is-scrolled { background: color-mix(in oklch, var(--paper) 95%, transparent); box-shadow: 0 1px 0 var(--rule); }
.nav.is-hidden { transform: translateY(-100%); }
.nav a { text-decoration: none; }
.nav__name { font-weight: 600; letter-spacing: -0.01em; }
.nav__links { display: flex; gap: clamp(18px, 2.4vw, 36px); font-size: 0.95rem; }
.nav__links a { color: var(--ink-2); position: relative; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.nav__links a:hover, .nav__links a.is-active { color: var(--ink); }
.nav__links a.is-active::after { transform: scaleX(1); }
.nav__end { display: flex; align-items: center; gap: 20px; font-size: 0.95rem; }
.theme { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink); position: relative; overflow: hidden; transition: transform 0.6s var(--ease); }
.theme span { position: absolute; inset: 0 50% 0 0; background: var(--ink); }
:root[data-theme="dark"] .theme { transform: rotate(180deg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme { transform: rotate(180deg); } }
.nav__menu { display: none; }

.menu { position: fixed; inset: 0; z-index: 45; background: var(--paper); padding: calc(var(--nav-h) + 6vh) var(--gutter) var(--gutter); display: flex; flex-direction: column; justify-content: space-between; }
.menu[hidden] { display: none; }
.menu nav { display: grid; gap: 6px; }
.menu nav a { font: 400 clamp(2.4rem, 11vw, 3.6rem)/1.1 var(--serif); text-decoration: none; }
.menu p { color: var(--ink-2); line-height: 1.8; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.4s; }
.vt-theme::view-transition-old(root), .vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------------------------------------------------------- shared type */
.section-title { font: 600 clamp(2.8rem, 6.4vw, 6.6rem)/0.92 var(--sans); letter-spacing: -0.048em; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--rule-2); }
.section-note { color: var(--ink-3); font-size: 1rem; font-variant-numeric: tabular-nums; }
.lead { font: 400 clamp(1.3rem, 1.85vw, 1.78rem)/1.36 var(--serif); letter-spacing: -0.006em; text-wrap: pretty; }
.split-line { padding-bottom: 0.06em; }
/* SplitText masks clip at the advance width; with tight tracking the last glyph's ink
   reaches past it (the "s" in Publications), so give the mask room on the right */
:is(.section-title, .hero__name) > div { padding-right: 0.14em; margin-right: -0.14em; }

/* ---------------------------------------------------------- hero */
.hero {
  max-width: var(--maxw); margin-inline: auto;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 3vh) var(--gutter) 5vh;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gutter);
}
.hero__text { display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; padding-bottom: 1vh; }
.hero__name { font: 600 clamp(3.8rem, 9.4vw, 10.4rem)/0.84 var(--sans); letter-spacing: -0.058em; margin-left: -0.04em; }
.hero__name .line { display: block; }
.hero__lede { font: 400 clamp(1.2rem, 1.55vw, 1.55rem)/1.4 var(--serif); max-width: 32ch; text-wrap: pretty; }
.hero__links { display: flex; flex-wrap: wrap; gap: 6px; margin-left: -9px; }
.hero__links a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); text-decoration: none; transition: color 0.3s, background-color 0.3s; }
.hero__links a:hover { color: var(--ink); background: var(--paper-2); }
.hero__links svg { width: 21px; height: 21px; display: block; }
.hero__where { color: var(--ink-3); font-size: 0.875rem; line-height: 1.6; font-variant-numeric: tabular-nums; }
.hero__stage { min-height: min(86svh, 920px); }

/* ---------------------------------------------------------- research */
.research { padding-top: clamp(40px, 8vh, 100px); }
.research__grid { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gutter); }
.research__aside { position: relative; }
.research__stage { position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h)); }
.step { min-height: 92svh; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding-block: 8vh; }
.step--intro { min-height: 100svh; gap: 36px; }
.step__stage { display: none; }
.step__when { font-weight: 500; font-size: 0.9rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.step__title { font: 400 clamp(2.1rem, 3.5vw, 3.5rem)/1.02 var(--serif); letter-spacing: -0.02em; text-wrap: balance; }
.step p:not(.step__when):not(.step__ref):not(.lead) { font: 400 clamp(1.1rem, 1.3vw, 1.27rem)/1.52 var(--serif); color: var(--ink-2); max-width: 36em; text-wrap: pretty; }
.step__ref { font-size: 0.9rem; color: var(--ink-3); max-width: 38em; }

/* ---------------------------------------------------------- publications */
.pubs, .coauthors, .about { max-width: var(--maxw); margin-inline: auto; padding: clamp(110px, 16vh, 180px) var(--gutter) 0; }
.pub { display: grid; grid-template-columns: 7rem minmax(0, 1fr) minmax(0, 17rem); gap: 0 var(--gutter); padding-block: 44px; border-bottom: 1px solid var(--rule); }
.pub[hidden] { display: none; }
.pub__when { display: grid; align-content: start; gap: 4px; padding-top: 0.35em; }
.pub__year { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pub__kind { font-size: 0.82rem; line-height: 1.3; color: var(--ink-3); }
.pub__title { font: 400 clamp(1.4rem, 2vw, 1.95rem)/1.16 var(--serif); letter-spacing: -0.012em; text-wrap: pretty; }
.pub__title a { text-decoration: none; }
.pub__title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.pub__authors { margin-top: 14px; font-size: 0.95rem; color: var(--ink-2); }
.pub__authors b { color: var(--ink); font-weight: 600; }
.pub__meta { margin-top: 4px; font-size: 0.875rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pub__story { margin-top: 18px; font: 400 1.12rem/1.55 var(--serif); color: var(--ink-2); max-width: 40em; text-wrap: pretty; }
.pub__fig { align-self: start; display: grid; place-items: center; background: #fff; border: 1px solid var(--rule); border-radius: 10px; aspect-ratio: 4 / 3; padding: 10px; overflow: hidden; }
.pub__fig canvas { display: block; max-width: 100%; max-height: 100%; filter: var(--plate-filter); }
.pubs__filter { position: relative; display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 26px; padding-bottom: 8px; }
.pubs__filter button { font: 400 1rem/1.5 var(--sans); color: var(--ink-3); padding: 2px 0; transition: color 0.3s; }
.pubs__filter button sup { font-size: 0.66em; margin-left: 3px; font-variant-numeric: tabular-nums; }
.pubs__filter button:hover, .pubs__filter button[aria-pressed="true"] { color: var(--ink); }
.pubs__ink { position: absolute; left: 0; top: 0; width: 0; height: 1.5px; background: var(--ink); transition: transform 0.5s var(--ease), width 0.5s var(--ease); }
::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.2, 0.7, 0.1, 1); }
.pub__fig img { width: 100%; height: 100%; object-fit: contain; filter: var(--plate-filter); transition: transform 0.8s var(--ease); }
.pub:hover .pub__fig img { transform: scale(1.04); }
.pubs__source { margin-top: 26px; font-size: 0.875rem; color: var(--ink-3); }

.pubs__head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--gutter); align-items: end; }
.pubs__intro { display: grid; gap: 18px; }
.pubs__plot { height: clamp(230px, 30vh, 330px); }
.plot-label { position: absolute; left: 0; top: 0; font: 500 12px/1 var(--sans); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; will-change: transform; }
.plot-label--count { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------- co-authors */
.coauthors__stage { height: min(82svh, 820px); border-bottom: 1px solid var(--rule); }
.coauthors__detail {
  position: absolute; left: 0; bottom: 28px; z-index: 3;
  width: min(25rem, 100%); padding: 18px 20px 20px;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.35);
  font-size: 0.92rem; line-height: 1.5; color: var(--ink-2);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.3s, transform 0.5s var(--ease);
}
.coauthors__detail.is-on { opacity: 1; transform: none; pointer-events: auto; }
.nd__kicker { font-size: 0.8rem; color: var(--ink-3); margin-bottom: 6px; }
.nd__title { font: 400 1.32rem/1.2 var(--serif); color: var(--ink); text-wrap: pretty; }
.nd__title a { text-decoration: none; }
.nd__title a:hover { text-decoration: underline; }
.nd__people { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nd__people a, .nd__people span { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--rule); font-size: 0.82rem; color: var(--ink-2); text-decoration: none; transition: border-color 0.3s, color 0.3s; }
.nd__people a:hover { border-color: var(--ink-2); color: var(--ink); }
.nd__people .is-me { color: var(--ink); border-color: var(--ink-3); }
.nd__list { margin-top: 12px; display: grid; gap: 8px; }
.nd__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--rule); }
.nd__list a { font: 400 1rem/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.nd__list a:hover { text-decoration: underline; }
.nd__list span { font-size: 0.8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.nd__more { display: inline-block; margin-top: 14px; font-size: 0.85rem; }

/* ---------------------------------------------------------- about */
.about__map { height: clamp(230px, 28vw, 400px); margin-top: 36px; }
.map-label { position: absolute; left: 0; top: 0; font: italic 400 18px/1 var(--serif); color: var(--ink); white-space: nowrap; will-change: transform; text-shadow: 0 0 3px var(--paper), 0 0 8px var(--paper), 0 0 14px var(--paper); }
/* the closing illustration: from seeing to understanding, a band across the page
   (its proportions are the scene's extent, fields.js visionScene) */
.contact__vision { width: 100%; aspect-ratio: 3.2 / 1.16; margin-top: clamp(24px, 4vh, 48px); pointer-events: none; }
@media (max-width: 639px) { .contact__vision { aspect-ratio: 1.38 / 2.78; max-width: 400px; margin-inline: auto; } }
html.no-gl .pubs__plot, html.no-gl .about__map, html.no-gl .contact__vision { display: none; }
.about__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: calc(var(--gutter) * 1.4); margin-top: 52px; }
.about__story p { font: 400 clamp(1.15rem, 1.42vw, 1.36rem)/1.55 var(--serif); color: var(--ink-2); max-width: 38em; text-wrap: pretty; }
.about__story p:first-child { color: var(--ink); }
.about__story p + p { margin-top: 1em; }
.about__record dl > div { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 12px; padding-block: 13px; border-top: 1px solid var(--rule); font-size: 0.95rem; }
.about__record dl > div:last-child { border-bottom: 1px solid var(--rule); }
.about__record dt { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.honours { margin-top: clamp(80px, 12vh, 140px); }
.honours__title { font: 400 clamp(1.6rem, 2.4vw, 2.3rem)/1.1 var(--serif); letter-spacing: -0.01em; }
.honours__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 28px 20px; margin-top: 30px; }
.honours button { display: grid; gap: 12px; width: 100%; text-align: left; }
.honours__img { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--paper-2); }
.honours__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s var(--ease); }
.honours button:hover img { transform: scale(1.05); }
.honours__cap { font-size: 0.92rem; line-height: 1.35; }
.honours__cap em { display: block; font-style: normal; color: var(--ink-3); font-size: 0.85rem; margin-top: 2px; }

/* ---------------------------------------------------------- contact */
.contact { max-width: var(--maxw); margin-inline: auto; padding: clamp(110px, 16vh, 180px) var(--gutter) clamp(36px, 6vh, 72px); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: calc(var(--gutter) * 1.4); margin-top: 52px; align-items: start; }
.contact__list { margin-top: 6px; }
/* the links in two columns, so the details and the closing band fit on one screen */
@media (min-width: 1100px) {
  .contact__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(var(--gutter) * 1.1); }
  .contact__list li:nth-last-child(2) a { border-bottom: 1px solid var(--rule); }
}
.contact__text .lead { max-width: 30ch; }
.contact__list a { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-block: 14px; border-top: 1px solid var(--rule); text-decoration: none; transition: padding 0.4s var(--ease), color 0.3s; }
.contact__list li:last-child a { border-bottom: 1px solid var(--rule); }
.contact__list a span:first-child { font: 400 1.3rem/1.2 var(--serif); }
.contact__list a span:last-child { font-size: 0.9rem; color: var(--ink-3); text-align: right; }
.contact__list a:hover { padding-inline: 8px; }
.contact__mail { display: inline-block; margin-top: 36px; font: 500 clamp(1.5rem, 3.2vw, 3rem)/1.1 var(--sans); letter-spacing: -0.035em; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }

.footer { position: relative; z-index: 1; max-width: var(--maxw); margin-inline: auto; padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.footer__visitors img { height: 46px; width: auto; opacity: 0.85; mix-blend-mode: multiply; }
:root[data-theme="dark"] .footer__visitors img { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .footer__visitors img { filter: invert(1) hue-rotate(180deg); mix-blend-mode: screen; } }

/* ---------------------------------------------------------- lightbox */
.lightbox { margin: auto; border: 0; border-radius: 14px; padding: clamp(16px, 2vw, 28px); width: min(1080px, calc(100vw - 2 * var(--gutter))); max-height: calc(100svh - 2 * var(--gutter)); background: var(--paper); color: var(--ink); display: none; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(20px, 3vw, 40px); align-items: center; }
.lightbox[open] { display: grid; animation: lb-in 0.5s var(--ease); }
.lightbox::backdrop { background: color-mix(in oklch, var(--paper) 70%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
@keyframes lb-in { from { opacity: 0; transform: translateY(20px); } }
.lightbox__fig img { max-height: 76svh; width: 100%; object-fit: contain; border-radius: 8px; }
.lightbox__text { display: grid; gap: 12px; align-content: center; }
.lightbox__date { color: var(--ink-3); font-size: 0.9rem; }
.lightbox__text h3 { font: 400 clamp(1.6rem, 2.6vw, 2.4rem)/1.08 var(--serif); }
.lightbox__text p:not(.lightbox__date) { color: var(--ink-2); }
.lightbox__close { position: absolute; top: 14px; right: 18px; font-size: 0.9rem; text-decoration: underline; text-underline-offset: 0.22em; }

/* ---------------------------------------------------------- small screens */
@media (max-width: 899px) {
  .nav__links, .nav__cv { display: none; }
  .nav__menu { display: inline; font-size: 0.95rem; }
  .hero { grid-template-columns: 1fr; padding-top: var(--nav-h); gap: 0; }
  .hero__stage { order: -1; min-height: 64svh; }
  .hero__text { gap: 22px; padding-bottom: 4vh; }
  .research__grid { grid-template-columns: 1fr; }
  .research__aside { display: none; }
  .step, .step--intro { min-height: auto; padding-block: 7vh; }
  .step__stage { display: block; height: 82vw; max-height: 520px; margin-bottom: 8px; }
  .step[data-state="7"] .step__stage { height: 150vw; max-height: 780px; }
  .step[data-state="4"] .step__stage { height: 112vw; max-height: 660px; }
  .taxon i { font-size: 13.5px; }
  .taxon span { font-size: 10.5px; }
  .step--intro .step__stage { order: 3; }
  .pub { grid-template-columns: 1fr; gap: 10px; padding-block: 36px; }
  .pub__fig { max-width: 420px; margin-top: 16px; }
  .coauthors__stage { height: 200vw; max-height: 1000px; }
  .pubs__head { grid-template-columns: 1fr; }
  .pubs__plot { height: 60vw; max-height: 340px; }
  .about__map { height: 62vw; }
  .map-label { font-size: 15px; }
  .coauthors__detail { left: 0; right: 0; bottom: 0; width: auto; padding: 14px 16px 16px; }
  .node--person { display: none; }
  .node--person.is-hot { display: block; }
  .about__grid { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; gap: clamp(32px, 5vh, 52px); }
  .pub__when { display: flex; gap: 12px; align-items: baseline; }
  .lightbox[open] { grid-template-columns: 1fr; overflow: auto; }
}

/* ---------------------------------------------------------- concepts under test */
[data-concept]:not([data-concept="points"]) .ov-tri, [data-concept]:not([data-concept="points"]) .ov-tracks { display: none; }
[data-concept="ink"] .ov-taxa, [data-concept="lens"] .ov-taxa { display: none; }
.lab { position: fixed; left: 16px; bottom: 16px; z-index: 70; display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in oklch, var(--paper) 92%, transparent); border: 1px solid var(--rule-2); box-shadow: 0 10px 30px -18px rgb(0 0 0 / 0.4); font-size: 0.8rem; }
.lab__row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lab__row span { width: 4.4rem; color: var(--ink-3); }
.lab button { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); }
.lab button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lab__status { font-style: normal; color: var(--ink-2); margin-right: 6px; max-width: 22rem; }
.lab__status.is-bad { color: oklch(55% 0.2 25); }
.lab__go { margin-left: auto; }

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