/* Self-hosted fonts (served from output/assets/fonts.css) */
/* fonts.css inlined at build time */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Fraunces[opsz,wght].woff2') format('woff2-variations'),
       url('/fonts/Fraunces[opsz,wght].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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Fraunces-Italic[opsz,wght].woff2') format('woff2-variations'),
       url('/fonts/Fraunces-Italic[opsz,wght].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+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/InterTight[wght].woff2') format('woff2-variations'),
       url('/fonts/InterTight[wght].woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/JetBrainsMono[wght].woff2') format('woff2-variations'),
       url('/fonts/JetBrainsMono[wght].woff2') format('woff2');
}


/* ═══════════════════════════════════════════════════════════════
   Dr. BADAWI Abdalsalam — Site stylesheet
   Editorial monograph aesthetic · fully responsive
   Fraunces (display) + Inter Tight (text) + JetBrains Mono (data)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tokens ─────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --paper:       #FAFAF7;
  --paper-2:     #F1F0EA;
  --paper-3:     #E5E3DA;
  --ink:         #1A1A1A;
  --ink-2:       #3D3833;
  --ink-3:       #6B645B;
  /* ink-4 and terracotta carry small text (.eyebrow, .roman, .cv-yr, .ulink),
     so both are tuned to clear WCAG AA 4.5:1 against BOTH paper tones — the
     footer and newsletter blocks sit on --paper-2, which is the harder case.
     ink-4: 5.12 on paper / 4.69 on paper-2. terracotta: 5.05 / 4.63. */
  --ink-4:       #706A61;
  --ink-5:       #9C9388; /* decorative only — rules, dividers, never text */
  --rule:        #2C2620;
  --rule-soft:   rgba(26,26,26,0.12);
  --rule-faint:  rgba(26,26,26,0.06);
  --navy:        #0E1A2B;
  --terracotta:  #BC4329;
  --terracotta-2:#A33B24;
  --ochre:       #B8893A;
  --moss:        #4A6741;
  --terracotta-wash: rgba(188,67,41,0.12);

  --font-serif:  'Fraunces', 'Times New Roman', serif;
  --font-grot:   'Inter Tight', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', ui-monospace, monospace;

  /* Fluid type scale — uses clamp(min, viewport, max) */
  --fs-display-xl: clamp(48px, 8.2vw, 104px);
  --fs-display-lg: clamp(40px, 6.4vw, 84px);
  --fs-display-md: clamp(32px, 4.6vw, 56px);
  --fs-display-sm: clamp(26px, 3.4vw, 40px);
  --fs-h3:         clamp(22px, 2.6vw, 32px);
  --fs-lede:       clamp(17px, 1.6vw, 22px);
  --fs-body:       16px;
  --fs-numeral:    clamp(72px, 9vw, 120px);

  --container:     1200px;
  --container-narrow: 920px;
  --pad-x:         clamp(20px, 4vw, 56px);
  --section-y:     clamp(56px, 8vw, 96px);
  --section-y-sm:  clamp(40px, 5vw, 64px);
}

/* ─── Dark mode ──────────────────────────────────────────────── */
html.dark {
  color-scheme: dark;
  --paper:       #0E1A2B;
  --paper-2:     #15243A;
  --paper-3:     #1D2F4A;
  --ink:         #F1EBE0;
  --ink-2:       #C8C0B0;
  --ink-3:       #958B7B; /* 4.65:1 on --paper-2, where the footer sits */
  --ink-4:       #9A9280; /* 5.66:1 on dark paper */
  --ink-5:       #6E6655;
  --rule:        rgba(241,235,224,0.28);
  --rule-soft:   rgba(241,235,224,0.16);
  --rule-faint:  rgba(241,235,224,0.08);
  --navy:        #F1EBE0;
  --terracotta:  #E07A5F;
  --terracotta-2:#C25A3F;
  --ochre:       #D4A85F;
  --moss:        #9DB87F;
  --terracotta-wash: rgba(224,122,95,0.16);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  font-family: var(--font-grot);
  font-size: var(--fs-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
}
::selection { background: var(--terracotta); color: var(--paper); }

/* Paper grain — SVG noise, very subtle */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.07 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: multiply;
}
html.dark body::before { mix-blend-mode: screen; opacity: 0.3; }
body > * { position: relative; z-index: 1; }

/* ─── Containers ─────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--pad-x); }
.container-wide { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad-x); }

/* ─── Type primitives ────────────────────────────────────────── */
.serif { font-family: var(--font-serif); }
.mono { font-family: var(--font-mono); }
em { font-style: italic; }

.display {
  font-family: var(--font-serif);
  font-weight: 350;
  letter-spacing: -0.022em;
  line-height: 0.98;
  text-wrap: balance;
  font-variation-settings: 'opsz' 96, 'SOFT' 30;
}
.display em { font-style: italic; color: var(--terracotta); font-weight: 350; }
h1.display { font-size: var(--fs-display-xl); font-weight: 300; letter-spacing: -0.028em; }
h2.display { font-size: var(--fs-display-md); }
h3.display { font-size: var(--fs-h3); }

.lede {
  font-family: var(--font-serif);
  font-size: var(--fs-lede);
  line-height: 1.5;
  font-weight: 350;
  color: var(--ink-2);
  max-width: 60ch;
  font-variation-settings: 'opsz' 24;
  text-wrap: pretty;
}
.body { font-size: 16px; line-height: 1.7; color: var(--ink-2); max-width: 65ch; text-wrap: pretty; }
.body strong { color: var(--ink); font-weight: 600; }

.kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 10px;
}
.kicker .num { color: var(--terracotta); font-weight: 600; }
.kicker::before {
  content: ''; width: 24px; height: 1px;
  background: var(--rule);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.roman {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

.dropcap::first-letter {
  font-family: var(--font-serif);
  font-weight: 300;
  float: left;
  font-size: clamp(64px, 8vw, 96px);
  line-height: 0.85;
  padding: 8px 14px 0 0;
  color: var(--terracotta);
  font-style: italic;
  font-variation-settings: 'opsz' 144;
}

.numeral {
  font-family: var(--font-serif);
  font-weight: 300;
  font-feature-settings: 'lnum', 'tnum';
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.04em;
  line-height: 0.9;
  color: var(--ink);
}
.numeral em { font-style: italic; color: var(--terracotta); font-weight: 300; }

.pullquote {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 36px);
  line-height: 1.32;
  font-weight: 350;
  font-style: italic;
  color: var(--ink);
  border-left: 2px solid var(--terracotta);
  padding-left: 28px;
  font-variation-settings: 'opsz' 48;
  max-width: 56ch;
  text-wrap: pretty;
}
.pullquote.center { border: none; padding: 0; text-align: center; max-width: 100%; margin-inline: auto; }

.margin-note {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.5;
  font-variation-settings: 'opsz' 14;
}
.margin-note .num {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  color: var(--terracotta);
  letter-spacing: 0.1em;
  margin-right: 6px;
}

/* ─── Rules ──────────────────────────────────────────────────── */
.rule { height: 1px; background: var(--rule); border: 0; }
.rule-soft { height: 1px; background: var(--rule-soft); border: 0; }
.rule-double {
  height: 5px; border: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
}

/* Scroll progress indicator under header */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  width: var(--p, 0%);
  height: 2px;
  background: var(--terracotta);
  z-index: 110;
  transition: width 0.08s linear;
  pointer-events: none;
}
.site-header .inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 18px 0;
  gap: 32px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.brand .logomark {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.brand-text {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: -0.005em;
  font-variation-settings: 'opsz' 48;
  color: var(--ink);
}
.brand-name em { font-style: italic; color: var(--terracotta); font-weight: 400; }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.nav { display: inline-flex; justify-content: center; gap: 2px; }
.nav a {
  position: relative;
  padding: 8px 12px;
  font-family: var(--font-grot);
  font-size: 13.5px;
  font-weight: 450;
  color: var(--ink-2);
  letter-spacing: 0.005em;
  transition: color 0.15s ease;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 550; }
.nav a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px;
  background: var(--terracotta);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.nav a.active::after, .nav a:hover::after { transform: scaleX(1); }
.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.theme-toggle, .menu-toggle {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border: 1px solid var(--rule-soft);
  color: var(--ink-2);
  transition: all 0.15s;
}
.theme-toggle:hover, .menu-toggle:hover {
  border-color: var(--ink); color: var(--ink);
}
.theme-toggle .icon-sun { display: none; }
html.dark .theme-toggle .icon-sun { display: inline-block; }
html.dark .theme-toggle .icon-moon { display: none; }
.menu-toggle { display: none; }
.nav-cta {
  background: var(--ink);
  color: var(--paper);
  padding: 0 18px;
  height: 38px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-grot);
  font-size: 13px; font-weight: 550;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  transition: all 0.18s;
}
.nav-cta:hover { background: var(--paper); color: var(--ink); }

/* Mobile menu drawer.
   The closed drawer is marked `inert` by site.js, which removes its links from
   the tab order and the accessibility tree — a drawer that is merely
   translated off-screen stays focusable and sends keyboard focus somewhere
   invisible. Deliberately not done with visibility:hidden: a transitioned
   visibility change leaves the element unfocusable for the length of the
   transition, so focus-on-open silently fails. */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--paper);
  padding: 88px var(--pad-x) 40px;
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mobile-menu[inert] { pointer-events: none; }
.mobile-menu.open { transform: translateY(0); }
.mobile-menu .mm-link {
  display: block;
  padding: 18px 0;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-soft);
  font-variation-settings: 'opsz' 36;
  letter-spacing: -0.01em;
}
.mobile-menu .mm-link .num {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 11px;
  color: var(--terracotta);
  letter-spacing: 0.15em;
  margin-right: 14px;
  vertical-align: middle;
}
.mobile-menu .mm-link em { font-style: italic; color: var(--terracotta); }
.mobile-menu .mm-link.active {
  color: var(--terracotta);
  font-style: italic;
  padding-left: 10px;
  border-left: 2px solid var(--terracotta);
}
.mobile-menu .mm-link.active .num { color: var(--ink-3); }
.mobile-menu .mm-footer {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px;
  font-family: var(--font-grot);
  font-weight: 550;
  font-size: 14px;
  letter-spacing: 0.01em;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  transition: all 0.18s;
  white-space: nowrap;
  min-height: 44px;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn .arr { font-family: var(--font-serif); font-style: italic; font-size: 16px; transition: transform 0.2s; }
.btn:hover .arr { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--navy); border-color: var(--navy); }
.btn-accent { background: var(--terracotta); color: var(--paper); border-color: var(--terracotta); }
.btn-accent:hover { background: var(--terracotta-2); border-color: var(--terracotta-2); }
.btn-sm { padding: 9px 16px; font-size: 12px; min-height: 36px; }
.btn-block { width: 100%; justify-content: center; }

/* ─── Sections ───────────────────────────────────────────────── */
.section { padding: var(--section-y) 0; }
.section-tight { padding: var(--section-y-sm) 0; }
.section-head {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  margin-bottom: clamp(28px, 4vw, 48px);
  align-items: baseline;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}
.section-head .roman { padding-top: 14px; }
.section-head h2 { margin: 0; }

/* ─── Chips ──────────────────────────────────────────────────── */
.chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--rule-soft);
  background: var(--paper-2);
  color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.chip.terra { color: var(--terracotta); border-color: rgba(200,75,49,0.3); background: rgba(200,75,49,0.06); }
.chip.navy  { color: var(--navy); border-color: rgba(14,26,43,0.2); background: rgba(14,26,43,0.04); }
.chip.moss  { color: var(--moss); border-color: rgba(74,103,65,0.25); background: rgba(74,103,65,0.06); }
.chip.ghost { background: transparent; }
html.dark .chip.terra { background: rgba(224,122,95,0.08); border-color: rgba(224,122,95,0.4); }
html.dark .chip.moss { color: var(--moss); background: rgba(157,184,127,0.08); border-color: rgba(157,184,127,0.4); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--moss); display: inline-block; }
.dot.live { background: var(--moss); box-shadow: 0 0 0 3px rgba(74,103,65,0.18); animation: pulse 2.2s ease-in-out infinite; }
.dot.terra { background: var(--terracotta); }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(74,103,65,0.18); }
  50% { box-shadow: 0 0 0 6px rgba(74,103,65,0.06); }
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card { background: var(--paper-2); border: 1px solid var(--rule-soft); padding: 28px; position: relative; }
.card-bare { background: transparent; border: 1px solid var(--rule-soft); padding: 28px; }
.card-link { transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; }
.card-link:hover { transform: translateY(-2px); border-color: var(--ink); }

/* ─── Index rows ─────────────────────────────────────────────── */
.index-row {
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 32px;
  align-items: baseline;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.2s;
}
.index-row:hover { background: var(--paper-2); }
.index-row .idx { font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); letter-spacing: 0.08em; }
.index-row .ttl {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 400;
  color: var(--ink);
  font-variation-settings: 'opsz' 24;
  letter-spacing: -0.01em;
}
.index-row .ttl em { font-style: italic; color: var(--terracotta); }
.index-row .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Annotation pill */
.ann {
  position: absolute; top: -11px; left: 16px;
  background: var(--terracotta); color: var(--paper);
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 10px;
  z-index: 5;
}

/* ─── Layout primitives — responsive grids ───────────────────── */
.grid { display: grid; gap: var(--gap, 32px); }
.grid-2  { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: 1fr 1fr; }
.grid-3  { display: grid; gap: clamp(24px, 3vw, 32px); grid-template-columns: repeat(3, 1fr); }
.grid-4  { display: grid; gap: clamp(16px, 2vw, 24px); grid-template-columns: repeat(4, 1fr); }
.grid-5  { display: grid; gap: 0; grid-template-columns: repeat(5, 1fr); }

.hero-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: stretch;
}
.split-side {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(40px, 6vw, 80px);
  align-items: end;
}
.with-aside {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.with-aside-left {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}
.three-col-row {
  display: grid;
  grid-template-columns: 160px 1fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

/* ─── Plate (photo with caption + label) ─────────────────────── */
.plate {
  position: relative;
  background: var(--paper-3);
  overflow: hidden;
}
.plate img { width: 100%; height: 100%; object-fit: cover; display: block; }
.plate-label {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255,255,255,0.95);
  mix-blend-mode: difference;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  z-index: 2;
}
.plate-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 22px 18px;
  background: linear-gradient(to top, rgba(14,26,43,0.85), transparent);
  color: rgba(241,235,224,0.95);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
}
.plate-caption .ts {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: rgba(224,122,95,0.95);
}
.plate-4x5 { aspect-ratio: 4/5; }
.plate-3x4 { aspect-ratio: 3/4; }
.plate-1x1 { aspect-ratio: 1/1; }
.plate-16x9 { aspect-ratio: 16/9; }
.plate-16x10 { aspect-ratio: 16/10; }

/* Floating "Currently" note */
.currently-note {
  position: absolute; right: -8px; top: -16px;
  transform: rotate(2deg);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 14px 18px;
  width: 240px;
  box-shadow: 6px 6px 0 var(--paper-3);
  z-index: 3;
}
.currently-note .eyebrow {
  color: var(--terracotta);
  margin-bottom: 8px;
  display: block;
}
.currently-note .text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  font-variation-settings: 'opsz' 18;
}
.currently-note .text strong { font-style: normal; color: var(--terracotta); font-weight: 500; }

/* ─── Stat ribbon ────────────────────────────────────────────── */
.stat-ribbon {
  margin-top: clamp(40px, 6vw, 64px);
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.stat-ribbon .cell {
  padding: clamp(18px, 2.4vw, 24px) clamp(16px, 2vw, 22px);
  border-right: 1px solid var(--rule);
}
.stat-ribbon .cell:last-child { border-right: none; }
.stat-ribbon .num {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1;
  margin-bottom: 8px;
  font-feature-settings: 'lnum';
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.03em;
}
.stat-ribbon .num em { font-style: italic; color: var(--terracotta); font-weight: 300; }
.stat-ribbon .lbl { font-family: var(--font-serif); font-size: 16px; color: var(--ink); margin-bottom: 2px; }
.stat-ribbon .sub { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--ink-3); text-transform: uppercase; }

/* ─── Links — animated underline ─────────────────────────────── */
.ulink {
  position: relative;
  color: var(--terracotta);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 16px;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.ulink::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: currentColor;
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.7, 0, 0.3, 1);
}
.ulink:hover::after { transform-origin: left; }
.ulink .arr { transition: transform 0.2s; }
.ulink:hover .arr { transform: translateX(3px); }

/* ─── Marquee strip ──────────────────────────────────────────── */
.marquee-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 0 var(--pad-x);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: clamp(56px, 8vw, 96px);
  padding: clamp(40px, 6vw, 64px) 0 28px;
  background: var(--paper-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: clamp(24px, 3vw, 48px);
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule-soft);
}
.footer-grid h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
  font-weight: 500;
}
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: var(--ink-2); font-size: 14px; transition: color 0.15s; }
.footer-grid a:hover { color: var(--terracotta); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}

/* ─── Reveal-on-scroll ───────────────────────────────────────── */
/* Default visible — no FOUC if JS fails. JS-enabled pages get .js on <html>
   which switches base to invisible, then .in fades in. */
.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--reveal-delay, 0s);
}
html.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, html.js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── Skip link ──────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  font-family: var(--font-grot);
  font-size: 14px;
  font-weight: 550;
  transition: top 0.18s ease;
}
.skip-link:focus-visible { top: 12px; outline-offset: 2px; }

/* ─── Live availability (public/availability.js) ─────────────── */
.availability { display: inline-flex; align-items: baseline; gap: 8px; }
.availability-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-4);
  flex: none;
  transform: translateY(-1px);
}
[data-availability-status][data-open='true'] .availability-dot {
  background: var(--moss);
  box-shadow: 0 0 0 3px rgba(74,103,65,0.18);
  animation: pulse 2.2s ease-in-out infinite;
}
/* Header CTA carries the same signal as a small dot before its label. */
.nav-cta .cta-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  flex: none;
}
.nav-cta[data-open='true'] .cta-dot {
  background: var(--moss);
  opacity: 1;
  animation: pulse 2.2s ease-in-out infinite;
}

/* ─── Gallery lightbox (public/site.js) ──────────────────────── */
.lightbox {
  border: none;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(14,26,43,0.92); }
.lightbox-inner {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: clamp(16px, 4vw, 48px);
  place-items: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  object-fit: contain;
  background: var(--paper-3);
}
.lightbox figcaption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: rgba(241,235,224,0.95);
  text-align: center;
  max-width: 60ch;
}
.lightbox figcaption .lb-index {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(224,122,95,0.95);
  text-transform: uppercase;
}
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(250,250,247,0.1);
  border: 1px solid rgba(241,235,224,0.35);
  color: #F1EBE0;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.lightbox-close:hover, .lightbox-nav:hover {
  background: rgba(250,250,247,0.2);
  border-color: rgba(241,235,224,0.7);
}
.lightbox-close { top: 16px; right: 16px; }
.lightbox-nav.prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 560px) {
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   1180px — compact desktop (hide some labels)
   980px  — tablet (single-col layouts)
   720px  — small tablet (hide nav, show hamburger)
   560px  — phone
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1180px) {
  .brand-sub { display: none; }
  .site-header .inner { gap: 20px; }
  .nav a { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 980px) {
  /* Layout grids — stack */
  .hero-split,
  .split-side,
  .with-aside,
  .with-aside-left,
  .three-col-row {
    grid-template-columns: 1fr;
  }
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat-ribbon .cell:nth-child(3n) { border-right: none; }
  .stat-ribbon .cell:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .marquee-row { grid-template-columns: repeat(2, 1fr); }

  /* Section heads — stack */
  .section-head {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-bottom: 18px;
    margin-bottom: 32px;
  }
  .section-head .roman { padding-top: 0; }

  /* Aside sticky off on mobile */
  .with-aside aside,
  .with-aside-left aside { position: static !important; }

  .currently-note {
    position: static;
    transform: none;
    width: auto;
    max-width: 320px;
    margin: 18px auto 0;
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .site-header .inner {
    grid-template-columns: auto 1fr;
    gap: 12px;
    padding: 14px 0;
  }
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .nav-cta {
    height: 36px;
    padding: 0 14px;
    font-size: 12px;
  }
  .mobile-menu { display: block; }
  .brand-name { font-size: 17px; }
  .brand .logomark { width: 34px; height: 34px; }

  /* type — already fluid via clamp, just tighten line heights */
  h1.display { line-height: 0.96; }

  /* Stat ribbon — 2 columns on phone */
  .stat-ribbon { grid-template-columns: repeat(2, 1fr); }
  .stat-ribbon .cell { border-right: 1px solid var(--rule); }
  .stat-ribbon .cell:nth-child(2n) { border-right: none; }
  .stat-ribbon .cell:nth-child(n+3) { border-top: 1px solid var(--rule); }

  /* Index rows — denser */
  .index-row {
    grid-template-columns: 40px 1fr;
    gap: 14px;
    padding: 18px 0;
  }
  .index-row > *:nth-child(n+3) {
    grid-column: 2;
    margin-top: 4px;
  }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }

  /* Cards & spacing */
  .card, .card-bare { padding: 22px; }

  /* Buttons stack tightly */
  .btn { padding: 12px 18px; font-size: 13px; }

  /* Less dramatic dropcap on phone */
  .dropcap::first-letter { font-size: 64px; }
}

@media (max-width: 480px) {
  .grid-3, .grid-4, .grid-2, .marquee-row {
    grid-template-columns: 1fr;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > div:first-child { grid-column: auto; }
  .pullquote { padding-left: 18px; }
}

/* Print — for /cv */
@media print {
  body::before, .site-header, .site-footer, .mobile-menu, .menu-toggle,
  .theme-toggle, .nav-cta, .skip-link, .lightbox { display: none !important; }
  /* .reveal is the wrapper around every content block, including the whole CV.
     It must be forced VISIBLE for print, never hidden — hiding it printed
     blank pages and produced an empty generated PDF. */
  .reveal, html.js .reveal {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  body { background: white; color: black; }
  .container, .container-narrow { padding: 0; }
}
