/* ==========================================================================
   Dheeraj Sharma: independent profile
   Newsreader (display) + Hanken Grotesk (text). Paper, ink, one oxblood accent.
   Scroll effects use native CSS scroll-driven animations (compositor-only
   properties: opacity, translate, scale, clip-path) with no scroll libraries.
   ========================================================================== */

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-var.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-italic-var.woff2") format("woff2");
  font-weight: 400 500; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("../assets/fonts/hanken-grotesk-var.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/source-serif-4-var.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("../assets/fonts/source-serif-4-italic-var.woff2") format("woff2");
  font-weight: 400 600; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-var.woff2") format("woff2");
  font-weight: 400 600; font-style: normal; font-display: swap;
}

:root {
  --paper: #F3EEE4;
  --paper-deep: #E9E2D3;
  --ink: #16130F;
  --ink-soft: #4A443B;
  --accent: #9E3B2A;
  --sand: #DDD5C5;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  /* Fonts the editor can choose */
  --ff-newsreader: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ff-source-serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ff-plex: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --ff-hanken: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;

  --step--1: clamp(0.8125rem, 0.79rem + 0.12vw, 0.875rem);
  --step-0:  clamp(1.0625rem, 1.02rem + 0.22vw, 1.1875rem);
  --step-1:  clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.15rem + 1.5vw, 2.4rem);
  --step-3:  clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);
  --step-4:  clamp(2.75rem, 1.5rem + 5vw, 6.5rem);
  --step-7:  clamp(4.25rem, 0.5rem + 17.5vw, 17rem);

  --margin: clamp(1.25rem, 5vw, 5.5rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --maxw: 1600px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.62 var(--f-body, var(--sans));
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
i { font-family: var(--f-body, var(--serif)); font-style: italic; }

a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  padding-bottom: 0.06em;
  transition: background-size 0.2s ease, color 0.2s ease;
}
a:hover { background-size: 100% 2px; color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 1px; }

.sc { font: 500 calc(var(--step--1) * 1.12)/1.3 var(--f-small, var(--sans)); font-variant-caps: all-small-caps; letter-spacing: 0.1em; }

.skip {
  position: absolute; left: var(--margin); top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; min-height: 44px;
}
.skip:focus { top: 0.75rem; }

/* ---------- layout primitives ---------- */
.wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  padding-inline: var(--margin);
  max-width: var(--maxw);
  margin-inline: auto;
}

/* ---------- masthead ---------- */
.mast {
  display: flex; align-items: center; justify-content: flex-end; gap: 1rem;
  padding: 0.5rem var(--margin); max-width: var(--maxw); margin-inline: auto; position: relative; z-index: 20;
  min-height: 3.25rem;
}
.mast__nav { position: relative; }
.mast__nav summary {
  list-style: none; cursor: pointer; min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: flex-end;
}
.mast__nav summary::-webkit-details-marker { display: none; }
.mast__nav summary::after { content: "(+)"; margin-left: 0.4em; font-size: var(--step--1); color: var(--accent); }
.mast__nav[open] summary::after { content: "(–)"; }
.mast__nav nav {
  position: absolute; right: 0; top: 100%; background: var(--paper); border: 1px solid var(--ink);
  min-width: 13rem; padding: 0.5rem 0;
}
.mast__nav nav a { display: flex; align-items: center; min-height: 44px; padding: 0 1rem; background: none; font-family: var(--f-small, var(--sans)); }
.mast__nav nav a:hover { background: var(--paper-deep); }
.mast__nav ol { counter-reset: s; }
.mast__nav li { counter-increment: s; }
.mast__nav li a::before { content: "0" counter(s); font-variant-numeric: tabular-nums; color: var(--accent); width: 2rem; font-size: var(--step--1); }

@media (min-width: 900px) {
    .mast__nav summary { display: none; }
  .mast__nav nav { position: static; border: 0; min-width: 0; padding: 0; background: none; }
  .mast__nav::details-content { content-visibility: visible; display: block; }
  .mast__nav ol { display: flex; gap: 0.25rem 1.5rem; }
  .mast__nav li a { min-height: 44px; padding: 0; font-size: var(--step--1); }
  .mast__nav li a::before { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; padding-top: 1rem; padding-bottom: clamp(3rem, 6vw, 6rem); }
.hero__fig {
  position: relative; grid-column: 1 / -1; margin-inline: calc(-1 * var(--margin)); overflow: hidden; z-index: 0;
  background: var(--sand);
}
.hero__fig img { width: 100%; aspect-ratio: 4 / 4.2; max-height: 78svh; object-fit: cover; object-position: 50% 12%; height: auto; }
.hero__fig figcaption {
  position: absolute; right: 0.75rem; top: 0.75rem; font: italic 400 var(--step--1)/1 var(--f-small, var(--serif)); color: var(--paper);
  background: rgb(22 19 15 / 0.62); padding: 0.3rem 0.55rem;
}
.hero__role { grid-column: 1 / -1; color: var(--accent); margin-top: 0.5rem; margin-bottom: 0.9rem; order: -1; }
.hero__name {
  grid-column: 1 / -1; order: 1; position: relative; z-index: 2;
  font: 400 var(--step-7)/0.86 var(--f-name, var(--serif)); letter-spacing: -0.04em; font-optical-sizing: auto;
  margin-top: calc(var(--step-7) * -0.5);
  -webkit-text-stroke: 0.05em var(--paper); paint-order: stroke fill;
}
.hero__name .ln { display: block; overflow: hidden; padding: 0.16em 0.06em 0.12em 0; margin: -0.16em 0 -0.12em; }
.hero__name .ln > span { display: inline-block; }
.hero__name .hon { position: absolute; left: 0.04em; top: -1.9rem; font: italic 400 1.4rem/1 var(--f-small, var(--serif)); letter-spacing: 0; color: var(--paper); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.hero__name .ln:last-child { padding-left: 0.5em; }
.hero__line {
  grid-column: 1 / -1; order: 3; font: 400 var(--step-1)/1.4 var(--f-lead, var(--serif)); max-width: 30ch; margin-top: 1.5rem;
}
.hero__facts { grid-column: 1 / -1; order: 4; display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--ink); }
.hero__facts div { display: grid; gap: 0.2rem; }
.hero__facts dt { color: var(--ink-soft); }
.hero__facts dd { font-family: var(--f-small, var(--sans)); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }

@media (min-width: 900px) {
  .hero { padding-top: 2rem; grid-template-rows: auto auto auto auto 1fr; }
  .hero__fig { grid-column: 8 / -1; grid-row: 1 / 7; margin-inline: 0 calc(-1 * var(--margin)); align-self: start; }
  .hero__fig img { aspect-ratio: 604 / 740; max-height: 86vh; width: 100%; object-position: 50% 8%; }
  .hero__fig figcaption { top: auto; bottom: 0.75rem; }
  .hero__role { grid-column: 1 / 8; grid-row: 1; order: 0; margin-top: 0.1rem; margin-bottom: 4.15rem; align-self: start; }
  .hero__name { grid-column: 1 / -1; grid-row: 2 / 4; order: 0; margin-top: 0; align-self: start; font-size: min(15.2vw, 16rem); }
  .hero__name .ln:last-child { padding-left: 0.62em; }
  .hero__name .hon { top: -3.4rem; left: 0.02em; font-size: 1.75rem; color: var(--accent); -webkit-text-stroke: 0; }
  .hero__line { grid-column: 1 / 7; grid-row: 4; order: 0; margin-top: 2rem; max-width: 26ch; font-size: var(--step-2); line-height: 1.25; }
  .hero__facts { grid-column: 1 / 8; grid-row: 5; order: 0; align-self: end; margin-top: 2.5rem; }
}

/* ---------- section scaffolding ---------- */
.sec { padding-block: clamp(4rem, 9vw, 9rem); border-top: 1px solid var(--ink); }
.sec--deep { background: var(--paper-deep); }
.sec.wrap { align-content: start; }
.rail { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-start; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); min-width: 0; }
.rail__num { font: 400 var(--step-1)/1 var(--f-date, var(--serif)); color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.body { grid-column: 1 / -1; min-width: 0; }
.body > * + * { margin-top: 1.25rem; }
.h2 { font: 400 var(--step-4)/0.95 var(--f-heading, var(--serif)); letter-spacing: -0.035em; font-optical-sizing: auto; }
.h3 { font: 500 var(--step-3)/1.15 var(--f-subheading, var(--serif)); letter-spacing: -0.015em; }
.h3--rule { padding-top: 1rem; border-top: 1px solid var(--ink); margin-top: clamp(3rem, 6vw, 5rem) !important; }
.lead { font: 400 var(--step-2)/1.25 var(--f-lead, var(--serif)); letter-spacing: -0.01em; max-width: 30ch; text-wrap: pretty; }
.srcline, .src { font-family: var(--f-small, var(--sans)); font-size: var(--step--1); color: var(--ink-soft); line-height: 1.5; }
.srcline a, .src a { color: var(--ink); }
.body p { max-width: 64ch; text-wrap: pretty; }
.body p.lead { max-width: 30ch; }

@media (min-width: 900px) {
  .rail { grid-column: 1 / 4; gap: 0.6rem; margin-bottom: 0; position: sticky; top: 2rem; align-self: start; height: max-content; }
  .rail .h2 { font-size: clamp(1.75rem, 0.55rem + 2.1vw, 3.25rem); line-height: 1.04; letter-spacing: -0.025em; }
  .body { grid-column: 4 / 11; }
  .body--wide { grid-column: 4 / -1; }
  .body--wide p { max-width: 64ch; }
}

/* ---------- pull quote ---------- */
.quote { --qs: clamp(2.25rem, 1rem + 6.4vw, 7.25rem); --qgap: clamp(1rem, 2.5vw, 2rem); --qpad: calc(var(--qs) * 0.42 + var(--qgap)); padding-block: clamp(3.5rem, 8vw, 8rem); border-top: 1px solid var(--ink); }
.quote__fig { grid-column: 1 / -1; }
/* the opening ellipsis hangs into the margin by 0.42em; the padding keeps it clear of the bar */
.quote blockquote { border-left: 3px solid var(--accent); padding-left: var(--qpad); }
.quote blockquote p {
  font: 400 var(--qs)/0.98 var(--f-quote, var(--serif)); letter-spacing: -0.035em; text-wrap: balance;
  hanging-punctuation: first; text-indent: -0.42em;
}
.quote figcaption { margin: 1.75rem 0 0 calc(var(--qpad) + 3px); max-width: 54ch; font: italic 400 var(--step--1)/1.55 var(--f-small, var(--serif)); color: var(--ink-soft); }
.quote figcaption a { color: var(--ink); }
@media (min-width: 900px) {
  .quote__fig { grid-column: 2 / 12; }
}

/* ---------- timeline (vertical by default; pinned and horizontal on wide screens, see MOTION) ---------- */
.tl { border-top: 1px solid var(--ink); background: var(--paper-deep); }
.tl__intro { padding-top: clamp(4rem, 9vw, 9rem); }
.tl__intro .rail { grid-column: 1 / -1; position: static; }
.tl__list { padding-bottom: clamp(4rem, 9vw, 9rem); margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.timeline { grid-column: 1 / -1; counter-reset: t; }
.timeline li {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 0.25rem; padding: 1.5rem 0 1.75rem 1.5rem; border-top: 1px solid var(--ink);
}
.timeline li::before { content: ""; position: absolute; left: 0; top: 1.95rem; width: 0.55rem; height: 0.55rem; background: var(--accent); }
.timeline__when { font: 400 var(--step-2)/1 var(--f-date, var(--serif)); letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; color: var(--accent); }
.timeline .h3 { margin-top: 0.4rem; }
.timeline p + p { margin-top: 0.6rem; }
.timeline p { max-width: 52ch; }
.tl__bar { display: none; }

@media (min-width: 900px) {
  .tl__pin {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
    padding: clamp(4rem, 9vw, 9rem) var(--margin); max-width: var(--maxw); margin-inline: auto;
  }
  .tl__intro, .tl__list { display: contents; }
  .tl__intro .rail { grid-column: 1 / 4; position: sticky; }
  .timeline { grid-column: 4 / -1; }
  .timeline li { grid-template-columns: 11rem 1fr; gap: 2rem; padding-left: 0; }
  .timeline li::before { display: none; }
  .timeline__when { font-size: var(--step-1); padding-top: 0.15rem; }
  .timeline .h3 { margin-top: 0; }
}

/* ---------- research ---------- */
.research { display: grid; gap: 2.5rem; }
.areas { border-top: 1px solid var(--ink); margin-top: 2rem; }
.areas > div { display: grid; gap: 0.15rem; padding: 0.9rem 0; border-bottom: 1px solid var(--sand); }
.areas dt { font: 500 var(--step-1)/1.2 var(--f-subheading, var(--serif)); }
.areas dd { font-family: var(--f-small, var(--sans)); color: var(--ink-soft); font-size: var(--step--1); line-height: 1.5; }
.areas dd:empty { display: none; }
.research__side > * + * { margin-top: 0.75rem; }
.research__side .h3:not(:first-child) { margin-top: 2rem; }
.pubs { counter-reset: p; margin-top: 1.25rem; border-top: 1px solid var(--sand); }
.pubs li { display: grid; grid-template-columns: 3.25rem 1fr; gap: 0.5rem; padding: 1rem 0; border-bottom: 1px solid var(--sand); }
.pubs__yr { font: 400 var(--step-1)/1.2 var(--f-date, var(--serif)); color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.pubs a { font: 500 var(--step-1)/1.25 var(--f-subheading, var(--serif)); letter-spacing: -0.01em; background-position: 0 100%; }
.pubs i { font-family: var(--f-small, var(--serif)); font-size: var(--step--1); color: var(--ink-soft); }
.pubs li > span:last-child { font-family: var(--f-small, var(--sans)); font-size: var(--step--1); color: var(--ink-soft); line-height: 1.55; }
.pubs li > span:last-child a { color: var(--ink); display: inline; }
@media (min-width: 900px) {
  .research { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); }
  .pubs li { grid-template-columns: 5rem 1fr; }
}

/* ---------- ledger (institute) ---------- */
.ledger { container-type: inline-size; margin-top: clamp(2rem, 4vw, 3.5rem) !important; }
.ledger__head { color: var(--accent); padding-bottom: 0.6rem; }
.ledger dl { border-top: 1px solid var(--ink); }
.ledger dl > div { display: grid; grid-template-columns: 1fr; gap: 0.25rem; padding: 1rem 0; border-bottom: 1px solid var(--sand); align-items: baseline; }
.ledger dt { font: 500 var(--step-1)/1.2 var(--f-date, var(--serif)); font-variant-numeric: lining-nums tabular-nums; }
.ledger dd { max-width: 60ch; }
.ledger .src { margin: 0; }
@container (min-width: 44rem) {
  .ledger dl > div { grid-template-columns: 9rem minmax(0, 1fr) 11rem; gap: 1.5rem; }
  .ledger dd:not(.src) { grid-column: 2; }
  .ledger .src { grid-column: 3; text-align: right; }
}

/* ---------- roles ---------- */
.roles dl { border-top: 1px solid var(--ink); }
.roles dl > div { display: grid; gap: 0.3rem; padding: 1.1rem 0; border-bottom: 1px solid var(--sand); }
.roles dt { font: 500 var(--step-1)/1.2 var(--f-subheading, var(--serif)); }
.roles .srcline { margin-top: 1rem; }
@media (min-width: 700px) { .roles dl > div { grid-template-columns: 10rem 1fr; gap: 2rem; } }

/* ---------- gallery ---------- */
.gallery { row-gap: clamp(2rem, 4vw, 3.5rem); }
.gallery .rail { grid-column: 1 / -1; }
.gallery__intro { grid-column: 1 / -1; max-width: 60ch; color: var(--ink-soft); }
.g { grid-column: 1 / -1; position: relative; }
.g img { width: 100%; object-fit: cover; background: var(--sand); object-position: var(--fx, 50%) var(--fy, 30%); }
/* Position and zoom set in the editor ("Position in frame"). Zoom grows the photo around
   the chosen point, so that point stays put. Without a setting, the upper part stays in view. */
.g img { transform-origin: var(--fx, 50%) var(--fy, 30%); scale: var(--z, 1); }
.g.fx-0 img { --fx: 0%; } .g.fx-1 img { --fx: 1%; } .g.fx-2 img { --fx: 2%; } .g.fx-3 img { --fx: 3%; } .g.fx-4 img { --fx: 4%; } .g.fx-5 img { --fx: 5%; } .g.fx-6 img { --fx: 6%; } .g.fx-7 img { --fx: 7%; } .g.fx-8 img { --fx: 8%; } .g.fx-9 img { --fx: 9%; } .g.fx-10 img { --fx: 10%; } .g.fx-11 img { --fx: 11%; } .g.fx-12 img { --fx: 12%; } .g.fx-13 img { --fx: 13%; } .g.fx-14 img { --fx: 14%; } .g.fx-15 img { --fx: 15%; } .g.fx-16 img { --fx: 16%; } .g.fx-17 img { --fx: 17%; } .g.fx-18 img { --fx: 18%; } .g.fx-19 img { --fx: 19%; } .g.fx-20 img { --fx: 20%; } .g.fx-21 img { --fx: 21%; } .g.fx-22 img { --fx: 22%; } .g.fx-23 img { --fx: 23%; } .g.fx-24 img { --fx: 24%; } .g.fx-25 img { --fx: 25%; } .g.fx-26 img { --fx: 26%; } .g.fx-27 img { --fx: 27%; } .g.fx-28 img { --fx: 28%; } .g.fx-29 img { --fx: 29%; } .g.fx-30 img { --fx: 30%; } .g.fx-31 img { --fx: 31%; } .g.fx-32 img { --fx: 32%; } .g.fx-33 img { --fx: 33%; } .g.fx-34 img { --fx: 34%; } .g.fx-35 img { --fx: 35%; } .g.fx-36 img { --fx: 36%; } .g.fx-37 img { --fx: 37%; } .g.fx-38 img { --fx: 38%; } .g.fx-39 img { --fx: 39%; } .g.fx-40 img { --fx: 40%; } .g.fx-41 img { --fx: 41%; } .g.fx-42 img { --fx: 42%; } .g.fx-43 img { --fx: 43%; } .g.fx-44 img { --fx: 44%; } .g.fx-45 img { --fx: 45%; } .g.fx-46 img { --fx: 46%; } .g.fx-47 img { --fx: 47%; } .g.fx-48 img { --fx: 48%; } .g.fx-49 img { --fx: 49%; } .g.fx-50 img { --fx: 50%; } .g.fx-51 img { --fx: 51%; } .g.fx-52 img { --fx: 52%; } .g.fx-53 img { --fx: 53%; } .g.fx-54 img { --fx: 54%; } .g.fx-55 img { --fx: 55%; } .g.fx-56 img { --fx: 56%; } .g.fx-57 img { --fx: 57%; } .g.fx-58 img { --fx: 58%; } .g.fx-59 img { --fx: 59%; } .g.fx-60 img { --fx: 60%; } .g.fx-61 img { --fx: 61%; } .g.fx-62 img { --fx: 62%; } .g.fx-63 img { --fx: 63%; } .g.fx-64 img { --fx: 64%; } .g.fx-65 img { --fx: 65%; } .g.fx-66 img { --fx: 66%; } .g.fx-67 img { --fx: 67%; } .g.fx-68 img { --fx: 68%; } .g.fx-69 img { --fx: 69%; } .g.fx-70 img { --fx: 70%; } .g.fx-71 img { --fx: 71%; } .g.fx-72 img { --fx: 72%; } .g.fx-73 img { --fx: 73%; } .g.fx-74 img { --fx: 74%; } .g.fx-75 img { --fx: 75%; } .g.fx-76 img { --fx: 76%; } .g.fx-77 img { --fx: 77%; } .g.fx-78 img { --fx: 78%; } .g.fx-79 img { --fx: 79%; } .g.fx-80 img { --fx: 80%; } .g.fx-81 img { --fx: 81%; } .g.fx-82 img { --fx: 82%; } .g.fx-83 img { --fx: 83%; } .g.fx-84 img { --fx: 84%; } .g.fx-85 img { --fx: 85%; } .g.fx-86 img { --fx: 86%; } .g.fx-87 img { --fx: 87%; } .g.fx-88 img { --fx: 88%; } .g.fx-89 img { --fx: 89%; } .g.fx-90 img { --fx: 90%; } .g.fx-91 img { --fx: 91%; } .g.fx-92 img { --fx: 92%; } .g.fx-93 img { --fx: 93%; } .g.fx-94 img { --fx: 94%; } .g.fx-95 img { --fx: 95%; } .g.fx-96 img { --fx: 96%; } .g.fx-97 img { --fx: 97%; } .g.fx-98 img { --fx: 98%; } .g.fx-99 img { --fx: 99%; } .g.fx-100 img { --fx: 100%; }
.g.fy-0 img { --fy: 0%; } .g.fy-1 img { --fy: 1%; } .g.fy-2 img { --fy: 2%; } .g.fy-3 img { --fy: 3%; } .g.fy-4 img { --fy: 4%; } .g.fy-5 img { --fy: 5%; } .g.fy-6 img { --fy: 6%; } .g.fy-7 img { --fy: 7%; } .g.fy-8 img { --fy: 8%; } .g.fy-9 img { --fy: 9%; } .g.fy-10 img { --fy: 10%; } .g.fy-11 img { --fy: 11%; } .g.fy-12 img { --fy: 12%; } .g.fy-13 img { --fy: 13%; } .g.fy-14 img { --fy: 14%; } .g.fy-15 img { --fy: 15%; } .g.fy-16 img { --fy: 16%; } .g.fy-17 img { --fy: 17%; } .g.fy-18 img { --fy: 18%; } .g.fy-19 img { --fy: 19%; } .g.fy-20 img { --fy: 20%; } .g.fy-21 img { --fy: 21%; } .g.fy-22 img { --fy: 22%; } .g.fy-23 img { --fy: 23%; } .g.fy-24 img { --fy: 24%; } .g.fy-25 img { --fy: 25%; } .g.fy-26 img { --fy: 26%; } .g.fy-27 img { --fy: 27%; } .g.fy-28 img { --fy: 28%; } .g.fy-29 img { --fy: 29%; } .g.fy-30 img { --fy: 30%; } .g.fy-31 img { --fy: 31%; } .g.fy-32 img { --fy: 32%; } .g.fy-33 img { --fy: 33%; } .g.fy-34 img { --fy: 34%; } .g.fy-35 img { --fy: 35%; } .g.fy-36 img { --fy: 36%; } .g.fy-37 img { --fy: 37%; } .g.fy-38 img { --fy: 38%; } .g.fy-39 img { --fy: 39%; } .g.fy-40 img { --fy: 40%; } .g.fy-41 img { --fy: 41%; } .g.fy-42 img { --fy: 42%; } .g.fy-43 img { --fy: 43%; } .g.fy-44 img { --fy: 44%; } .g.fy-45 img { --fy: 45%; } .g.fy-46 img { --fy: 46%; } .g.fy-47 img { --fy: 47%; } .g.fy-48 img { --fy: 48%; } .g.fy-49 img { --fy: 49%; } .g.fy-50 img { --fy: 50%; } .g.fy-51 img { --fy: 51%; } .g.fy-52 img { --fy: 52%; } .g.fy-53 img { --fy: 53%; } .g.fy-54 img { --fy: 54%; } .g.fy-55 img { --fy: 55%; } .g.fy-56 img { --fy: 56%; } .g.fy-57 img { --fy: 57%; } .g.fy-58 img { --fy: 58%; } .g.fy-59 img { --fy: 59%; } .g.fy-60 img { --fy: 60%; } .g.fy-61 img { --fy: 61%; } .g.fy-62 img { --fy: 62%; } .g.fy-63 img { --fy: 63%; } .g.fy-64 img { --fy: 64%; } .g.fy-65 img { --fy: 65%; } .g.fy-66 img { --fy: 66%; } .g.fy-67 img { --fy: 67%; } .g.fy-68 img { --fy: 68%; } .g.fy-69 img { --fy: 69%; } .g.fy-70 img { --fy: 70%; } .g.fy-71 img { --fy: 71%; } .g.fy-72 img { --fy: 72%; } .g.fy-73 img { --fy: 73%; } .g.fy-74 img { --fy: 74%; } .g.fy-75 img { --fy: 75%; } .g.fy-76 img { --fy: 76%; } .g.fy-77 img { --fy: 77%; } .g.fy-78 img { --fy: 78%; } .g.fy-79 img { --fy: 79%; } .g.fy-80 img { --fy: 80%; } .g.fy-81 img { --fy: 81%; } .g.fy-82 img { --fy: 82%; } .g.fy-83 img { --fy: 83%; } .g.fy-84 img { --fy: 84%; } .g.fy-85 img { --fy: 85%; } .g.fy-86 img { --fy: 86%; } .g.fy-87 img { --fy: 87%; } .g.fy-88 img { --fy: 88%; } .g.fy-89 img { --fy: 89%; } .g.fy-90 img { --fy: 90%; } .g.fy-91 img { --fy: 91%; } .g.fy-92 img { --fy: 92%; } .g.fy-93 img { --fy: 93%; } .g.fy-94 img { --fy: 94%; } .g.fy-95 img { --fy: 95%; } .g.fy-96 img { --fy: 96%; } .g.fy-97 img { --fy: 97%; } .g.fy-98 img { --fy: 98%; } .g.fy-99 img { --fy: 99%; } .g.fy-100 img { --fy: 100%; }
.g.z-105 img { --z: 1.05; } .g.z-110 img { --z: 1.1; } .g.z-115 img { --z: 1.15; } .g.z-120 img { --z: 1.2; } .g.z-125 img { --z: 1.25; } .g.z-130 img { --z: 1.3; } .g.z-135 img { --z: 1.35; } .g.z-140 img { --z: 1.4; } .g.z-145 img { --z: 1.45; } .g.z-150 img { --z: 1.5; } .g.z-155 img { --z: 1.55; } .g.z-160 img { --z: 1.6; } .g.z-165 img { --z: 1.65; } .g.z-170 img { --z: 1.7; } .g.z-175 img { --z: 1.75; } .g.z-180 img { --z: 1.8; } .g.z-185 img { --z: 1.85; } .g.z-190 img { --z: 1.9; } .g.z-195 img { --z: 1.95; } .g.z-200 img { --z: 2; } .g.z-205 img { --z: 2.05; } .g.z-210 img { --z: 2.1; } .g.z-215 img { --z: 2.15; } .g.z-220 img { --z: 2.2; } .g.z-225 img { --z: 2.25; } .g.z-230 img { --z: 2.3; } .g.z-235 img { --z: 2.35; } .g.z-240 img { --z: 2.4; } .g.z-245 img { --z: 2.45; } .g.z-250 img { --z: 2.5; }
.g figcaption { font: italic 400 var(--step--1)/1.5 var(--f-small, var(--serif)); color: var(--ink-soft); margin-top: 0.6rem; max-width: 48ch; }
.g .credit { font: 500 var(--step--1)/1 var(--f-small, var(--sans)); font-style: normal; font-variant-caps: all-small-caps; letter-spacing: 0.08em; color: var(--accent); margin-left: 0.35em; white-space: nowrap; }
.g .frame { overflow: hidden; background: var(--sand); }
.g--a img { aspect-ratio: 16 / 9; }
.g--b img { aspect-ratio: 4 / 5; --fx: 22%; }
.g--c img { aspect-ratio: 16 / 7; }
.g--d img { aspect-ratio: 4 / 3; --fx: 30%; }
.g--e img { aspect-ratio: 1 / 1; --fx: 62%; }
.g--f img { aspect-ratio: 2.1 / 1; }
.g--g img { aspect-ratio: 4 / 5; --fx: 60%; }

@media (min-width: 900px) {
  .gallery .rail { grid-column: 1 / -1; position: static; }
  .g--a { grid-column: 1 / 9; }
  .g--b { grid-column: 9 / -1; align-self: end; }
  .g--c { grid-column: 1 / -1; }
  .g--c img { aspect-ratio: 1200 / 271; }
  .g--d { grid-column: 2 / 8; }
  .g--e { grid-column: 8 / -1; margin-top: -2.25rem; margin-left: 5px; }
  .g--f { grid-column: 1 / 9; }
  .g--g { grid-column: 9 / -1; align-self: start; }
}

/* ---------- contact ---------- */
.contact { display: grid; gap: 2.5rem; border-top: 1px solid var(--ink); padding-top: 1.5rem; }
.contact h3 { color: var(--accent); margin-bottom: 0.75rem; }
.contact ul { display: grid; gap: 0.15rem; }
.contact li { display: grid; grid-template-columns: 5rem 1fr; gap: 0.5rem; align-items: baseline; min-height: 44px; align-content: center; }
.contact .k { font: 500 var(--step--1)/1 var(--f-small, var(--sans)); font-variant-caps: all-small-caps; letter-spacing: 0.1em; color: var(--ink-soft); }
.contact .src { margin-top: 0.75rem; }
.contact li a { display: inline-block; padding-block: 0.5rem; }
.official { margin-top: clamp(2rem, 4vw, 3rem) !important; }
.official__link {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 1.4rem; background: var(--ink); color: var(--paper);
  font: 500 var(--step-0)/1 var(--f-body, var(--sans)); transition: background-color 0.2s ease;
}
.official__link:hover { background: var(--accent); color: var(--paper); background-size: 0 0; }
@media (min-width: 700px) { .contact { grid-template-columns: 1fr 1fr; gap: 3rem; } }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: var(--paper); padding-block: clamp(3rem, 7vw, 6rem); }
.foot a { color: var(--paper); }
.foot a:hover { color: #E7B9AE; }
.foot__grid { gap: 3rem var(--gutter); }
.foot__notice, .foot__src { grid-column: 1 / -1; }
.foot h2 { color: #E7B9AE; margin-bottom: 1rem; }
.foot p { font-family: var(--f-small, var(--sans)); max-width: 58ch; font-size: var(--step--1); line-height: 1.65; }
.foot p + p { margin-top: 0.8rem; }
.foot__date { margin-top: 1.5rem !important; font-variant-numeric: tabular-nums; }
.foot ol { font-family: var(--f-small, var(--sans)); counter-reset: s; columns: 1; font-size: var(--step--1); line-height: 1.5; }
.foot li { counter-increment: s; padding: 0.35rem 0 0.35rem 2.25rem; position: relative; break-inside: avoid; }
.foot li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; color: #E7B9AE; font-variant-numeric: tabular-nums; }
.foot li a { display: inline-block; padding-block: 0.2rem; }
@media (min-width: 900px) {
  .foot__notice { grid-column: 1 / 6; }
  .foot__src { grid-column: 7 / -1; }
  .foot ol { columns: 2; column-gap: 2rem; }
}

/* ---------- when a text is deleted, what is left keeps its column or uses the free space ---------- */
.timeline li > div, .pubs li > span:last-child, .roles dd { grid-column: -2 / -1; }
.research > :only-child, .contact > :only-child { grid-column: 1 / -1; }

/* ---------- fonts chosen in the CMS ---------- */
html[data-font-name="Newsreader"] { --f-name: var(--ff-newsreader); }
html[data-font-name="Source Serif 4"] { --f-name: var(--ff-source-serif); }
html[data-font-name="IBM Plex Sans"] { --f-name: var(--ff-plex); }
html[data-font-name="Hanken Grotesk"] { --f-name: var(--ff-hanken); }
html[data-font-heading="Newsreader"] { --f-heading: var(--ff-newsreader); }
html[data-font-heading="Source Serif 4"] { --f-heading: var(--ff-source-serif); }
html[data-font-heading="IBM Plex Sans"] { --f-heading: var(--ff-plex); }
html[data-font-heading="Hanken Grotesk"] { --f-heading: var(--ff-hanken); }
html[data-font-lead="Newsreader"] { --f-lead: var(--ff-newsreader); }
html[data-font-lead="Source Serif 4"] { --f-lead: var(--ff-source-serif); }
html[data-font-lead="IBM Plex Sans"] { --f-lead: var(--ff-plex); }
html[data-font-lead="Hanken Grotesk"] { --f-lead: var(--ff-hanken); }
html[data-font-subheading="Newsreader"] { --f-subheading: var(--ff-newsreader); }
html[data-font-subheading="Source Serif 4"] { --f-subheading: var(--ff-source-serif); }
html[data-font-subheading="IBM Plex Sans"] { --f-subheading: var(--ff-plex); }
html[data-font-subheading="Hanken Grotesk"] { --f-subheading: var(--ff-hanken); }
html[data-font-body="Newsreader"] { --f-body: var(--ff-newsreader); }
html[data-font-body="Source Serif 4"] { --f-body: var(--ff-source-serif); }
html[data-font-body="IBM Plex Sans"] { --f-body: var(--ff-plex); }
html[data-font-body="Hanken Grotesk"] { --f-body: var(--ff-hanken); }
html[data-font-quote="Newsreader"] { --f-quote: var(--ff-newsreader); }
html[data-font-quote="Source Serif 4"] { --f-quote: var(--ff-source-serif); }
html[data-font-quote="IBM Plex Sans"] { --f-quote: var(--ff-plex); }
html[data-font-quote="Hanken Grotesk"] { --f-quote: var(--ff-hanken); }
html[data-font-date="Newsreader"] { --f-date: var(--ff-newsreader); }
html[data-font-date="Source Serif 4"] { --f-date: var(--ff-source-serif); }
html[data-font-date="IBM Plex Sans"] { --f-date: var(--ff-plex); }
html[data-font-date="Hanken Grotesk"] { --f-date: var(--ff-hanken); }
html[data-font-small="Newsreader"] { --f-small: var(--ff-newsreader); }
html[data-font-small="Source Serif 4"] { --f-small: var(--ff-source-serif); }
html[data-font-small="IBM Plex Sans"] { --f-small: var(--ff-plex); }
html[data-font-small="Hanken Grotesk"] { --f-small: var(--ff-hanken); }
[data-font="Newsreader"] { font-family: var(--ff-newsreader) !important; }
[data-font="Source Serif 4"] { font-family: var(--ff-source-serif) !important; }
[data-font="IBM Plex Sans"] { font-family: var(--ff-plex) !important; }
[data-font="Hanken Grotesk"] { font-family: var(--ff-hanken) !important; }
[data-font]:not([data-font="Site default"]) i { font-family: inherit; }

/* One text can keep its original font while its kind uses another. */
[data-font="Site default"] {
  --f-name: initial; --f-heading: initial; --f-lead: initial; --f-subheading: initial;
  --f-body: initial; --f-quote: initial; --f-date: initial; --f-small: initial;
}
:where([data-font="Site default"]) { font-family: var(--f-body, var(--sans)); }
:where(.hero__name, .hero__fig figcaption, .quote figcaption, .g figcaption) :where([data-font="Site default"]) { font-family: var(--serif); }

/* ==========================================================================
   MOTION
   Time-based hero entrance + scroll-driven (CSS timelines) everywhere else.
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
  /* hero entrance: runs once at load, never hides the LCP image */
  .hero__name .ln > span { animation: line-up 0.9s var(--ease) both; }
  .hero__name .ln:nth-child(2) > span { animation-delay: 0.08s; }
  .hero__fig img { animation: unveil 1.1s var(--ease) both; }
  .hero__role, .hero__line, .hero__facts { animation: fade-up 0.8s var(--ease) 0.1s both; }
  .hero__line { animation-delay: 0.18s; }
  .hero__facts { animation-delay: 0.26s; }
}
@keyframes line-up { from { translate: 0 62%; } to { translate: 0 0; } }
@keyframes unveil { from { clip-path: inset(7% 0 0 0); scale: 1.06; } to { clip-path: inset(0); scale: 1; } }
@keyframes fade-up { from { translate: 0 18px; } to { translate: 0 0; } }

/* Scroll-driven layer: only where the browser supports it. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {

    .progress {
      position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--accent); z-index: 90; transform-origin: 0 50%;
      animation: grow linear both; animation-timeline: scroll(root);
    }
    @keyframes grow { from { scale: 0 1; } to { scale: 1 1; } }

    /* generic rise-in, applied to blocks and to the children of .body.reveal */
    .reveal:not(.body):not(.h2):not(.g), .body.reveal > * {
      animation: rise linear both; animation-timeline: view(); animation-range: entry 0px entry 280px;
    }
    .body.reveal { animation: none; }
    @keyframes rise { from { opacity: 0; translate: 0 34px; } to { opacity: 1; translate: 0 0; } }

    /* headings unmask */
    .h2.reveal { animation: mask linear both; animation-timeline: view(); animation-range: entry 0px entry 200px; }
    @keyframes mask { from { clip-path: inset(0 0 100% 0); translate: 0 0.35em; } to { clip-path: inset(-0.1em 0 -0.15em 0); translate: 0 0; } }

    /* lead paragraphs fill word by word (words wrapped by main.js) */
    .fill .w { animation: lit linear both; animation-timeline: view(); animation-range: cover calc(18% + var(--i) * 0.18%) cover calc(34% + var(--i) * 0.18%); }
    @keyframes lit { from { opacity: 0.16; } to { opacity: 1; } }

    /* hero: portrait and name drift apart a little as you leave */
    .hero__fig { animation: hero-fig linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .hero__name { animation: hero-name linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    @keyframes hero-fig { to { translate: 0 6vh; } }
    @keyframes hero-name { to { translate: 0 -5vh; } }

    /* timeline entries (vertical layout) */
    .timeline li { animation: rise linear both; animation-timeline: view(); animation-range: entry 0px entry 240px; }

    /* gallery: image drifts inside its frame; the wide strip opens up from the sides */
    .g .pan { animation: drift linear both; animation-timeline: view(); scale: 1.14; }
    @keyframes drift { from { translate: 0 -5%; } to { translate: 0 5%; } }
    .g.reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0px entry 320px; }
    .g--c .frame { animation: open linear both; animation-timeline: view(); animation-range: entry 0% cover 42%; }
    @keyframes open { from { clip-path: inset(0 16% 0 16%); } to { clip-path: inset(0 0 0 0); } }
  }

  /* ----- pinned horizontal timeline: wide screens with scroll timelines ----- */
  @media (min-width: 1100px) {
    @supports (animation-timeline: view()) {
      .tl { view-timeline: --tl block; height: 320vh; }
      .tl__pin { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: clamp(1.5rem, 4vh, 3rem); overflow: clip; position: sticky; padding: 0; max-width: none; margin-inline: 0; }
      .tl__intro { display: grid; padding-top: 0; width: 100%; max-width: var(--maxw); margin-inline: auto; }
      .tl__intro .rail { grid-column: 1 / -1; position: static; margin-bottom: 0.75rem; }
      .tl__intro .h2 { font-size: clamp(2.5rem, 1rem + 4.5vw, 5.5rem); }
      .tl__list { display: block; max-width: none; padding: 0; margin: 0; }
      .timeline {
        display: flex; gap: clamp(2rem, 4vw, 4rem); width: max-content; padding: 0 var(--margin);
        animation: slide linear both; animation-timeline: --tl; animation-range: cover 100vh cover calc(100% - 100vh);
      }
      .timeline li { display: block; width: min(34rem, 36vw); flex: none; padding: 1.75rem 0 0; animation: none; }
      .timeline li::before { display: block; left: 0; top: -0.3rem; }
      .timeline__when { display: block; font-size: clamp(3rem, 1rem + 5.2vw, 7.25rem); line-height: 0.95; letter-spacing: -0.045em; margin-bottom: 1.25rem; padding: 0; }
      .timeline .h3 { font-size: var(--step-3); }
      .timeline p { max-width: 40ch; font-size: var(--step-0); }
      @keyframes slide { from { translate: 0 0; } to { translate: min(0px, calc(-100% + 100vw)) 0; } }
      /* Fewer entries need less sideways scrolling. */
      .tl:not(:has(.timeline li:nth-child(5))) { height: 200vh; }
      .tl:not(:has(.timeline li:nth-child(3))) { height: 100vh; }
      .tl__bar { display: block; position: absolute; left: var(--margin); right: var(--margin); bottom: clamp(1.25rem, 4vh, 2.5rem); height: 2px; background: var(--sand); }
      .tl__bar span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; animation: grow linear both; animation-timeline: --tl; animation-range: cover 100vh cover calc(100% - 100vh); }
    }
  }
}

/* Fallback for browsers without scroll timelines: gentle reveal via IntersectionObserver (js/main.js). */
@media (prefers-reduced-motion: no-preference) {
  @supports not (animation-timeline: view()) {
    .js .reveal:not(.body), .js .body.reveal > * { opacity: 0; translate: 0 22px; transition: opacity 0.7s var(--ease), translate 0.7s var(--ease); }
    .js .reveal.is-in:not(.body), .js .body.reveal.is-in > * { opacity: 1; translate: 0 0; }
    .progress { display: none; }
  }
}

@media print {
  .progress, .mast__nav { display: none; }
  body { background: #fff; }
}
