/* ==========================================================================
   Cédric Pokam — site stylesheet
   Tokens first; components only ever read tokens.
   ========================================================================== */

:root {
  color-scheme: light;

  --paper: #f2f3f5;
  --surface: #ffffff;
  --ink: #12161c;
  --ink-2: #3a424e;
  --muted: #5d6673;
  --rule: #d8dce2;
  --rule-strong: #12161c;
  --accent: #2b45d4;
  --accent-ink: #ffffff;
  --accent-soft: #e4e8fb;
  --pass: #17804f;
  --code-bg: #161b22;
  --code-ink: #e6e9ee;
  --plate: #ffffff;
  --band: #12161c;
  --band-ink: #f2f3f5;
  --band-muted: #9aa3b0;
  --band-rule: #333b47;
  --band-accent: #93a3ff;

  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.5rem + 3vw, 3.75rem);
  --step-5: clamp(3rem, 1.2rem + 7.2vw, 7.25rem);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0e1116;
    --surface: #151a21;
    --ink: #e8ebef;
    --ink-2: #c3c9d1;
    --muted: #97a0ac;
    --rule: #262d37;
    --rule-strong: #e8ebef;
    --accent: #93a3ff;
    --accent-ink: #0e1116;
    --accent-soft: #1d2442;
    --pass: #4cc38a;
    --code-bg: #0a0d12;
    --code-ink: #e6e9ee;
    --plate: #f4f5f7;
    --band: #181e27;
    --band-rule: #2d3541;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e1116;
  --surface: #151a21;
  --ink: #e8ebef;
  --ink-2: #c3c9d1;
  --muted: #97a0ac;
  --rule: #262d37;
  --rule-strong: #e8ebef;
  --accent: #93a3ff;
  --accent-ink: #0e1116;
  --accent-soft: #1d2442;
  --pass: #4cc38a;
  --code-bg: #0a0d12;
  --code-ink: #e6e9ee;
  --plate: #f4f5f7;
  --band: #181e27;
  --band-rule: #2d3541;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: var(--step-0);
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

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

h1, h2, h3, h4 { margin: 0; line-height: 1.15; text-wrap: balance; font-weight: 700; }
p { margin: 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 10px 14px; border-radius: var(--radius); text-decoration: none;
}
.skip:focus { top: 12px; }

.label {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.01em;
  font-size: 1.0625rem;
  white-space: nowrap;
}
.wordmark .mark {
  display: inline-grid;
  place-items: center;
  width: 26px; height: 26px;
  align-self: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  font-size: 0.75rem;
  letter-spacing: 0;
}

.nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 28px); }
.nav a {
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  padding-block: 6px;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

@media (max-width: 520px) {
  .wordmark .name { display: none; }
  .nav { gap: 14px; }
  .nav a { font-size: 0.875rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  font: 600 0.9375rem/1 var(--f-display);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(40px, 7vw, 96px) clamp(32px, 5vw, 64px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: end;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.hero-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--pass);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pass) 20%, transparent);
}

.display {
  font-size: var(--step-5);
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.035em;
  line-height: 0.9;
  margin-left: -0.04em;
}
.display span { display: block; }
.display .accent { color: var(--accent); }

.lede {
  margin-top: 32px;
  max-width: 34em;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-2);
}
.lede strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.portrait { margin: 0; position: relative; }
.portrait .frame {
  position: relative;
  padding: 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
}
.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: contrast(1.04);
}
/* registration marks on the frame corners */
.portrait .frame::before,
.portrait .frame::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--ink);
  border-style: solid;
}
.portrait .frame::before { top: -6px; left: -6px; border-width: 1.5px 0 0 1.5px; }
.portrait .frame::after { bottom: -6px; right: -6px; border-width: 0 1.5px 1.5px 0; }
.portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

/* ---------- Datasheet strip ---------- */

.datasheet {
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1.5px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.datasheet > div {
  padding: 18px 20px 20px 0;
  display: grid;
  gap: 6px;
  align-content: start;
}
.datasheet > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.datasheet dt { margin: 0; }
.datasheet dd { margin: 0; font-weight: 500; line-height: 1.45; }
.datasheet .cert { display: flex; align-items: baseline; gap: 8px; }
.datasheet .cert::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--pass);
  transform: translateY(-1px);
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 8vw, 112px); }
.section + .section { border-top: 1px solid var(--rule); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head h2 {
  font-size: var(--step-4);
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.025em;
  margin-top: 10px;
}
.section-head p:not(.label) { color: var(--ink-2); max-width: 40em; font-size: var(--step-1); line-height: 1.5; }

/* ---------- Capabilities ---------- */

.caps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 40px);
}
.cap { border-top: 1.5px solid var(--rule-strong); padding-top: 20px; display: grid; gap: 14px; align-content: start; }
.cap h3 { font-size: var(--step-2); font-weight: 700; font-variation-settings: "wdth" 108; letter-spacing: -0.015em; }
.cap p { color: var(--ink-2); }
.tools { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tools li {
  font-family: var(--f-mono);
  font-size: 0.78rem;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink-2);
  background: var(--surface);
}

/* ---------- Project index ---------- */

.projects { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--rule-strong); }

.project {
  position: relative;
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 1fr) 2rem;
  gap: 12px clamp(20px, 3vw, 40px);
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color .2s ease;
}
.project:hover { background: var(--surface); }
.project:hover .project-go { color: var(--accent); transform: translateX(4px); }

.project-date { font-family: var(--f-mono); font-size: var(--step--1); color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.project-kind { display: block; margin-top: 4px; color: var(--accent); }

.project h3 { font-size: var(--step-2); font-weight: 700; font-variation-settings: "wdth" 104; letter-spacing: -0.015em; line-height: 1.2; }
.project h3 a { text-decoration: none; }
.project h3 a::after { content: ""; position: absolute; inset: 0; }
.project p { margin-top: 8px; color: var(--ink-2); max-width: 36em; }

.project-meta { display: grid; gap: 14px; align-content: start; padding-top: 4px; }

.project-links { display: flex; gap: 16px; font-size: 0.875rem; }
.project-links a { position: relative; z-index: 1; color: var(--muted); text-decoration: none; }
.project-links a:hover { color: var(--ink); text-decoration: underline; }

.project-go {
  align-self: start;
  justify-self: end;
  padding-top: 2px;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}

@media (hover: hover) {
  .project { padding-inline: 12px; margin-inline: -12px; }
}

/* Architecture flow: Route 53 → CloudFront → S3 */
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
.flow li {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-mono);
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}
.flow li span {
  padding: 5px 8px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.project:hover .flow li span { background: var(--surface); }
.flow li + li::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--muted);
  margin-inline: 2px 4px;
  position: relative;
}
.flow li + li::after { content: none; }
.flow li + li span { position: relative; }
.flow li + li span::before {
  content: "";
  position: absolute;
  left: -5px; top: 50%;
  width: 0; height: 0;
  border-left: 4px solid var(--muted);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  transform: translateY(-50%);
}

/* ---------- About ---------- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(20px, 4vw, 56px);
}
.about-grid h2 {
  margin-top: 10px;
  font-size: var(--step-3);
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.02em;
}
.about-body { display: grid; gap: 18px; max-width: 42em; }
.about-body p { font-family: var(--f-serif); font-size: 1.1875rem; line-height: 1.7; color: var(--ink-2); }
.about-body p:first-child { font-size: var(--step-2); line-height: 1.45; color: var(--ink); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 20px 0 0; border-top: 1px solid var(--rule); }
.facts > div { padding: 16px 16px 16px 0; border-bottom: 1px solid var(--rule); display: grid; gap: 4px; }
.facts dt, .facts dd { margin: 0; }
.facts dd { font-weight: 500; }

/* ---------- Contact ---------- */

.contact { background: var(--band); color: var(--band-ink); }
.contact .label { color: var(--band-muted); }
.contact :focus-visible { outline-color: var(--band-accent); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}
.contact h2 {
  font-size: var(--step-4);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.03em;
  margin-top: 12px;
}
.contact p { margin-top: 18px; max-width: 32em; color: var(--band-ink); opacity: .82; font-size: var(--step-1); }

.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 32px; }
.email {
  font-size: clamp(1.25rem, 0.9rem + 1.6vw, 2rem);
  font-weight: 600;
  font-variation-settings: "wdth" 108;
  text-decoration: none;
  border-bottom: 2px solid var(--band-accent);
  overflow-wrap: anywhere;
}
.email:hover { color: var(--band-accent); }
.copy-btn {
  font: 500 0.8125rem/1 var(--f-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  background: transparent;
  border: 1px solid var(--band-rule);
  border-radius: 3px;
  padding: 8px 10px;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--band-ink); }

.channels { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--band-rule); }
.channels li { border-bottom: 1px solid var(--band-rule); }
.channels a, .channels .static {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  text-decoration: none;
}
.channels a:hover .val { color: var(--band-accent); }
.channels .val { font-weight: 500; transition: color .15s ease; }

/* ---------- Footer ---------- */

.site-footer { padding-block: 40px; border-top: 1px solid var(--rule); font-size: 0.875rem; color: var(--muted); }
.contact + .site-footer { border-top: 0; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--accent); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- Writing index ---------- */

.page-head { padding-block: clamp(48px, 7vw, 96px) clamp(28px, 4vw, 48px); }
.page-head h1 {
  font-size: var(--step-5);
  font-weight: 800;
  font-variation-settings: "wdth" 125;
  letter-spacing: -0.035em;
  line-height: 0.92;
  margin-top: 14px;
}
.page-head p { margin-top: 24px; max-width: 36em; font-size: var(--step-1); color: var(--ink-2); }

.year-group { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(16px, 4vw, 56px); border-top: 1.5px solid var(--rule-strong); padding-top: 24px; }
.year-group h2 { font-family: var(--f-mono); font-weight: 500; font-size: var(--step-1); color: var(--muted); font-variant-numeric: tabular-nums; }

.posts { list-style: none; margin: 0; padding: 0; }
.post { position: relative; padding: 0 0 32px; margin-bottom: 32px; border-bottom: 1px solid var(--rule); display: grid; gap: 10px; }
.post:last-child { border-bottom: 0; margin-bottom: 0; }
.post h3 { font-size: var(--step-3); font-weight: 700; font-variation-settings: "wdth" 104; letter-spacing: -0.02em; }
.post h3 a { text-decoration: none; }
.post h3 a::after { content: ""; position: absolute; inset: 0; }
.post:hover h3 a { color: var(--accent); }
.post p { font-family: var(--f-serif); font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); max-width: 40em; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---------- Article ---------- */

.article-head { padding-block: clamp(40px, 6vw, 80px) clamp(28px, 4vw, 44px); }
.crumbs { display: flex; gap: 8px; align-items: center; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.article-head h1 {
  margin-top: 20px;
  font-size: var(--step-4);
  font-weight: 800;
  font-variation-settings: "wdth" 112;
  letter-spacing: -0.03em;
  line-height: 1.02;
  max-width: 20ch;
}
.article-head .standfirst { margin-top: 22px; max-width: 38em; font-size: var(--step-1); color: var(--ink-2); line-height: 1.5; }

.article-meta {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, auto) 1fr;
  gap: 8px 32px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.article-meta > div { display: grid; gap: 4px; }
.article-meta dd, .article-meta dt { margin: 0; }
.article-meta dd { font-weight: 500; font-variant-numeric: tabular-nums; }
.article-meta .flow-cell { justify-self: end; }

.figure { margin: 0 0 clamp(32px, 5vw, 56px); }
.figure .plate {
  background: var(--plate);
  border: 1px solid var(--rule);
  padding: clamp(12px, 3vw, 32px);
  display: grid;
  place-items: center;
}
.figure .plate img { max-height: 560px; width: auto; }
.figure figcaption { margin-top: 10px; display: flex; gap: 10px; }
.figure figcaption .label { color: var(--ink); }
.figure-trio .plate { grid-template-columns: 3fr 1.2fr 0.8fr; align-items: end; gap: clamp(8px, 2vw, 24px); }
.figure-trio .plate img { max-height: 420px; }

.prose {
  font-family: var(--f-serif);
  font-size: 1.1875rem;
  line-height: 1.72;
  color: var(--ink);
  max-width: 68ch;
  margin-inline: auto;
}
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--f-display); letter-spacing: -0.015em; }
.prose h2 { font-size: var(--step-3); font-weight: 800; font-variation-settings: "wdth" 108; margin-top: 3rem; }
.prose h3 { font-size: var(--step-2); font-weight: 700; margin-top: 2.25rem; }
.prose h4 { font-size: var(--step-1); font-weight: 700; margin-top: 1.75rem; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose a { color: var(--accent); }
.prose strong { font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--muted); }
.prose :not(pre) > code {
  font-family: var(--f-mono);
  font-size: 0.84em;
  padding: 0.12em 0.36em;
  background: var(--accent-soft);
  border-radius: 3px;
}
.prose pre {
  font-family: var(--f-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 20px 22px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-inline: calc(-1 * min(22px, var(--gutter)));
  tab-size: 4;
}
.prose pre code { font: inherit; background: none; padding: 0; }

.hljs-comment, .hljs-quote { color: #8b949e; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in { color: #ff9e8a; }
.hljs-type, .hljs-class .hljs-title, .hljs-title.class_ { color: #9ecbff; }
.hljs-title, .hljs-title.function_ { color: #d2b8ff; }
.hljs-string, .hljs-meta .hljs-string { color: #a8e2b4; }
.hljs-number, .hljs-literal { color: #ffc98a; }
.hljs-meta, .hljs-meta .hljs-keyword { color: #89ddff; }
.hljs-params { color: var(--code-ink); }

.note {
  font-family: var(--f-display);
  font-size: 0.9375rem;
  line-height: 1.55;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--ink-2);
}

.counter {
  font-family: var(--f-display);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 20px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius);
}
.counter .num {
  grid-row: span 2;
  font-size: 2.5rem;
  font-weight: 800;
  font-variation-settings: "wdth" 115;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}
.counter p { font-size: 0.9375rem; line-height: 1.45; color: var(--ink-2); margin: 0; }

.source-panel {
  margin-top: clamp(48px, 6vw, 72px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  border-top: 1.5px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}
.source-panel .path { font-family: var(--f-mono); font-size: 0.875rem; color: var(--ink-2); overflow-wrap: anywhere; margin-top: 6px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.pager a {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
}
.pager a:hover { border-color: var(--ink); }
.pager .t { font-weight: 600; line-height: 1.3; }
.pager .next { text-align: right; grid-column: 2; }

.article-body { padding-bottom: clamp(56px, 8vw, 104px); }

/* ---------- Load-in (visible at rest; motion only enhances) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .display span { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .display span:nth-child(2) { animation-delay: .08s; }
  .lede, .hero-actions, .hero-status { animation: fade .8s ease .25s both; }
  .portrait { animation: fade .9s ease .15s both; }
  @keyframes rise { from { transform: translateY(0.18em); opacity: .001; } to { transform: none; opacity: 1; } }
  @keyframes fade { from { opacity: .001; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

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

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .portrait { max-width: 300px; }
  .datasheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .datasheet > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .datasheet > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .caps { grid-template-columns: minmax(0, 1fr); }
  .section-head, .about-grid, .contact-grid, .year-group { grid-template-columns: minmax(0, 1fr); }
  .project { grid-template-columns: minmax(0, 1fr) 2rem; }
  .project-date { grid-column: 1 / -1; display: flex; gap: 12px; padding-top: 0; }
  .project-kind { margin-top: 0; }
  .project > div:nth-child(2) { grid-column: 1; }
  .project-go { grid-column: 2; grid-row: 2; }
  .project-meta { grid-column: 1 / -1; }
  .article-meta { grid-template-columns: repeat(3, auto); }
  .article-meta .flow-cell { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
}

@media (max-width: 560px) {
  .datasheet { grid-template-columns: minmax(0, 1fr); }
  .datasheet > div, .datasheet > div + div { padding-left: 0; border-left: 0; padding-right: 0; }
  .datasheet > div + div { border-top: 1px solid var(--rule); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .figure-trio .plate { grid-template-columns: minmax(0, 1fr); }
  .figure-trio .plate img:not(:first-child) { display: none; }
  .article-meta { grid-template-columns: repeat(2, auto); }
}
