/* ==========================================================================
   Cyprian Kimomo — portfolio
   Design system, layout, components, motion
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokens */
:root {
  /* Surface and ink */
  --paper:        #E8EBE3;
  --paper-2:      #E0E4DA;
  --paper-3:      #D4D9CC;
  --ink:          #101410;
  --ink-2:        #363C32;
  --muted:        #61675C;
  --line:         rgba(16, 20, 16, 0.16);
  --line-strong:  rgba(16, 20, 16, 0.3);
  --accent:       #0E5C55;
  --accent-soft:  rgba(14, 92, 85, 0.12);
  --moss:         #3E7A66;
  --overlay:      #101410;
  --overlay-ink:  #E8EBE3;
  --shadow:       0 1px 2px rgba(16,20,16,.05), 0 14px 44px -18px rgba(16,20,16,.34);
  --selection-bg: #0E5C55;
  --selection-fg: #E8EBE3;
  --plate-suffix: "light";

  /* Type */
  --sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --read: "Newsreader", Georgia, "Times New Roman", serif;

  --s--1: clamp(0.76rem, 0.73rem + 0.14vw, 0.84rem);
  --s-0:  clamp(0.97rem, 0.94rem + 0.16vw, 1.06rem);
  --s-1:  clamp(1.1rem, 1.02rem + 0.4vw, 1.32rem);
  --s-2:  clamp(1.32rem, 1.14rem + 0.9vw, 1.95rem);
  --s-3:  clamp(1.7rem, 1.32rem + 1.85vw, 2.9rem);
  --s-4:  clamp(2.15rem, 1.5rem + 3.1vw, 4.3rem);
  --s-5:  clamp(2.7rem, 1.4rem + 5.9vw, 6.6rem);
  --s-6:  clamp(3.1rem, 0.9rem + 9.6vw, 10rem);

  /* Space */
  --gutter: clamp(1.25rem, 4.2vw, 5rem);
  --maxw: 1580px;
  --section: clamp(4.5rem, 10vw, 11rem);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0.05, 0.36, 1);
  --dur: 0.7s;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper:        #0B0E0C;
  --paper-2:      #131813;
  --paper-3:      #1B211A;
  --ink:          #E8ECE2;
  --ink-2:        #C1C7BA;
  --muted:        #7F877C;
  --line:         rgba(232, 236, 226, 0.17);
  --line-strong:  rgba(232, 236, 226, 0.32);
  --accent:       #5FC4B2;
  --accent-soft:  rgba(95, 196, 178, 0.16);
  --moss:         #6FC0A2;
  --overlay:      #E8ECE2;
  --overlay-ink:  #0B0E0C;
  --shadow:       0 1px 2px rgba(0,0,0,.45), 0 18px 52px -20px rgba(0,0,0,.8);
  --selection-bg: #5FC4B2;
  --selection-fg: #0B0E0C;
  --plate-suffix: "dark";
  color-scheme: dark;
}

/* ------------------------------------------------------------- 2. Baseline */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--s-0);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}

body.is-locked { overflow: hidden; }

::selection { background: var(--selection-bg); color: var(--selection-fg); }

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

h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

.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;
}

.skip-link {
  position: fixed; top: 0; left: 50%; transform: translate(-50%, -140%);
  z-index: 300; background: var(--ink); color: var(--paper);
  padding: .75rem 1.25rem; font-size: var(--s--1); letter-spacing: .06em;
  text-transform: uppercase; transition: transform .3s var(--ease);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* ---------------------------------------------------------- 3. Typography */
.display, h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 350;
  line-height: 0.98;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.d-hero   { font-size: var(--s-6); line-height: 0.88; letter-spacing: -0.042em; }
.d-xl     { font-size: var(--s-5); line-height: 0.92; letter-spacing: -0.036em; }
.d-lg     { font-size: var(--s-4); line-height: 0.96; letter-spacing: -0.03em; }
.d-md     { font-size: var(--s-3); line-height: 1.02; letter-spacing: -0.024em; }
.d-sm     { font-size: var(--s-2); line-height: 1.12; letter-spacing: -0.018em; }

em, .ital { font-style: italic; }

.label {
  font-family: var(--sans);
  font-size: var(--s--1);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}
.label--ink { color: var(--ink); }
.label--accent { color: var(--accent); }

.num {
  font-family: var(--sans);
  font-size: var(--s--1);
  letter-spacing: 0.1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lead {
  font-size: var(--s-1);
  line-height: 1.5;
  color: var(--ink-2);
  font-weight: 350;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.prose p { color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.prose p + p { margin-top: 1.1em; }

/* --------------------------------------------------------------- 4. Layout */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 1120px; }

.section { padding-block: var(--section); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 6rem); }
.section--ink { background: var(--paper-2); }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 3rem); }
.g-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: clamp(1.8rem, 4vw, 3.4rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 4vw, 3.6rem);
  flex-wrap: wrap;
}
.sec-head__title { display: flex; align-items: baseline; gap: 1.1rem; }

/* ------------------------------------------------ 5. Grain, cursor, chrome */
.grain {
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 250;
  opacity: 0.032;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  will-change: transform;
  animation: grainShift 8s steps(6) infinite;
}
@keyframes grainShift {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
}

.cursor {
  position: fixed; top: 0; left: 0; z-index: 280;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.cursor__dot {
  position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: #fff;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.cursor__ring {
  position: absolute; width: 42px; height: 42px; margin: -21px 0 0 -21px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.65);
  display: grid; place-items: center;
  transition: width .35s var(--ease), height .35s var(--ease),
              margin .35s var(--ease), background-color .35s var(--ease),
              border-color .35s var(--ease);
}
.cursor__label {
  font-family: var(--sans); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: #000; opacity: 0;
  transition: opacity .25s var(--ease);
  white-space: nowrap;
}
.cursor.is-active .cursor__ring {
  width: 88px; height: 88px; margin: -44px 0 0 -44px; background: #fff;
  border-color: transparent;
}
.cursor.is-active .cursor__dot { transform: scale(0); }
.cursor.is-active .cursor__label { opacity: 1; }
.cursor.is-link .cursor__ring { width: 62px; height: 62px; margin: -31px 0 0 -31px; }
body.has-cursor .cursor { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none !important; } }
body.has-cursor a, body.has-cursor button, body.has-cursor .row { cursor: none; }

/* Page transition curtain */
.curtain {
  position: fixed; inset: 0; z-index: 270;
  background: var(--overlay);
  transform: translateY(100%);
  pointer-events: none;
  display: grid; place-items: center;
}
.curtain__mark {
  font-family: var(--serif); font-size: clamp(2rem, 6vw, 4rem);
  color: var(--overlay-ink); opacity: 0; letter-spacing: -0.03em;
}
.curtain.is-out { animation: curtainOut .85s var(--ease-io) forwards; }
.curtain.is-in  { animation: curtainIn .85s var(--ease-io) forwards; }
@keyframes curtainOut { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes curtainIn  { from { transform: translateY(0); } to { transform: translateY(-100%); } }

/* Preloader */
.loader {
  position: fixed; inset: 0; z-index: 290;
  background: var(--paper);
  display: grid; place-items: center;
  padding: var(--gutter);
}
.loader__inner {
  width: 100%; max-width: var(--maxw);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 2rem;
}
.loader__name {
  font-family: var(--serif); font-size: var(--s-3); letter-spacing: -0.03em;
  overflow: hidden;
}
.loader__name span { display: block; transform: translateY(105%); }
.loader__count { font-variant-numeric: tabular-nums; font-size: var(--s-2); color: var(--muted); }
.loader__bar {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--gutter) + 2rem);
  height: 1px; background: var(--line);
}
.loader__bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.loader.is-done { animation: curtainIn .9s .15s var(--ease-io) forwards; }

/* ---------------------------------------------------------------- 6. Header */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  padding-block: clamp(1rem, 1.6vw, 1.5rem);
  transition: transform .5s var(--ease), background-color .4s var(--ease),
              backdrop-filter .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.header.is-stuck {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--line);
}
.header.is-hidden { transform: translateY(-105%); }

.header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

.brand { display: flex; align-items: center; gap: .7rem; }
.brand__mark {
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  font-family: var(--serif); font-size: .84rem; letter-spacing: -0.02em;
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.brand:hover .brand__mark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.brand__name { font-size: var(--s--1); letter-spacing: .04em; font-weight: 500; }
.brand__role { font-size: var(--s--1); color: var(--muted); letter-spacing: .04em; }

.nav { display: flex; align-items: center; gap: clamp(1.2rem, 2.4vw, 2.4rem); }
.nav__link {
  font-size: var(--s--1); letter-spacing: .04em; position: relative;
  padding-block: .2rem; color: var(--ink-2);
  transition: color .3s var(--ease);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease);
}
.nav__link:hover { color: var(--ink); }
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }
.nav__link[aria-current="page"] { color: var(--ink); }

.header__side { display: flex; align-items: center; gap: clamp(.8rem, 1.6vw, 1.4rem); }

.status {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--s--1); color: var(--muted); letter-spacing: .04em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
@media (max-width: 719px) { .header .status { display: none; } }
.menu__clock { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: var(--s--1); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.status__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--moss);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--moss) 60%, transparent);
  animation: pulse 2.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--moss) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.theme-toggle {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); flex: none;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.theme-toggle:hover { border-color: var(--line-strong); background: var(--paper-2); }
.theme-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.3; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }

.burger {
  display: none; width: 40px; height: 34px; position: relative; flex: none;
}
.burger i {
  position: absolute; left: 6px; right: 6px; height: 1px; background: var(--ink);
  transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.burger i:nth-child(1) { top: 13px; }
.burger i:nth-child(2) { bottom: 13px; }
.menu-open .burger i:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-open .burger i:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* Mobile menu */
.menu {
  position: fixed; inset: 0; z-index: 190;
  background: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(var(--gutter) + 4rem) var(--gutter) var(--gutter);
  clip-path: inset(0 0 100% 0);
  transition: clip-path .8s var(--ease-io);
  visibility: hidden;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; }
.menu__list li { overflow: hidden; border-bottom: 1px solid var(--line); }
.menu__list a {
  display: flex; align-items: baseline; gap: 1rem;
  font-family: var(--serif); font-size: clamp(2rem, 11vw, 3.6rem);
  line-height: 1.25; letter-spacing: -0.035em; padding-block: .3rem;
  transform: translateY(110%);
  transition: transform .8s var(--ease), color .3s var(--ease);
}
.menu.is-open .menu__list a { transform: translateY(0); }
.menu__list li:nth-child(1) a { transition-delay: .1s; }
.menu__list li:nth-child(2) a { transition-delay: .16s; }
.menu__list li:nth-child(3) a { transition-delay: .22s; }
.menu__list li:nth-child(4) a { transition-delay: .28s; }
.menu__list li:nth-child(5) a { transition-delay: .34s; }
.menu__list li:nth-child(6) a { transition-delay: .4s; }
.menu__list a span { font-family: var(--sans); font-size: var(--s--1); color: var(--muted); letter-spacing: .1em; }
.menu__foot { margin-top: auto; padding-top: 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; }

/* ---------------------------------------------------------------- 7. Links */
.link {
  position: relative; display: inline-block; color: var(--ink);
  padding-bottom: 2px;
}
.link::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  background: currentColor; transform: scaleX(1); transform-origin: right;
  transition: transform .5s var(--ease);
}
.link:hover::after { transform: scaleX(0); }

.btn {
  display: inline-flex; align-items: center; gap: .85rem;
  padding: 1.05rem 1.9rem;
  border: 1px solid var(--ink);
  font-size: var(--s--1); letter-spacing: .08em; text-transform: uppercase;
  font-weight: 500;
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--ink);
  transition: color .45s var(--ease), border-color .45s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: translateY(101%); transition: transform .55s var(--ease);
}
.btn:hover { color: var(--paper); }
.btn:hover::before { transform: translateY(0); }
.btn__arrow { transition: transform .45s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid::before { background: var(--accent); }
.btn--solid:hover { color: #fff; border-color: var(--accent); }

.arrow-link {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: var(--s--1); letter-spacing: .08em; text-transform: uppercase;
  font-weight: 500; position: relative; padding-bottom: .35rem;
}
.arrow-link::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform-origin: left;
  transition: transform .5s var(--ease);
}
.arrow-link:hover::after { animation: underlineSwipe .6s var(--ease); }
@keyframes underlineSwipe {
  0% { transform: scaleX(1); transform-origin: right; }
  49% { transform: scaleX(0); transform-origin: right; }
  50% { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}
.arrow-link svg { width: 14px; height: 14px; transition: transform .45s var(--ease); }
.arrow-link:hover svg { transform: translateX(4px); }

/* ------------------------------------------------------------------ 8. Hero */
.hero {
  min-height: 100svh;
  padding-top: clamp(7rem, 14vh, 11rem);
  padding-bottom: clamp(2rem, 5vh, 4rem);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
}
.hero__top { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.hero__kicker { max-width: 34ch; }
@media (min-width: 900px) { .hero__kicker { max-width: none; } }
.hero__title { margin-top: clamp(1.5rem, 4vw, 3rem); }
.hero__title .ital { color: var(--accent); }

.hero__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: end;
  margin-top: clamp(2.5rem, 6vw, 5rem);
}
@media (min-width: 900px) {
  .hero__body { grid-template-columns: minmax(0, 1.05fr) minmax(300px, .72fr) minmax(0, .85fr); }
}
.hero__portrait {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--paper-2);
}
.hero__portrait img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.06);
  transition: transform 1.4s var(--ease);
}
.hero__portrait:hover img { transform: scale(1.01); }
.hero__portrait figcaption {
  position: absolute; left: 0; bottom: 0; right: 0; z-index: 4;
  padding: .8rem 1rem; font-size: var(--s--1); letter-spacing: .06em;
  color: var(--paper); background: linear-gradient(to top, rgba(10,11,8,.72), transparent);
  text-transform: uppercase;
}
.hero__meta { display: grid; gap: 1.6rem; }
.hero__stat { border-top: 1px solid var(--line); padding-top: .8rem; }
.hero__stat b { display: block; font-family: var(--serif); font-size: var(--s-2); font-weight: 350; letter-spacing: -.02em; line-height: 1.1; }
.hero__stat span { font-size: var(--s--1); color: var(--muted); letter-spacing: .04em; }

.scrollcue {
  display: inline-flex; align-items: center; gap: .7rem;
  font-size: var(--s--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.scrollcue i {
  width: 1px; height: 34px; background: var(--line-strong); position: relative; overflow: hidden;
}
.scrollcue i::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  animation: cue 2.2s var(--ease-io) infinite;
}
@keyframes cue {
  0% { transform: translateY(-100%); } 50% { transform: translateY(0); } 100% { transform: translateY(100%); }
}

/* --------------------------------------------------------------- 9. Marquee */
.marquee {
  border-block: 1px solid var(--line);
  padding-block: clamp(1rem, 2vw, 1.6rem);
  overflow: hidden; white-space: nowrap;
  background: var(--paper);
}
.marquee__track { display: inline-flex; gap: 0; will-change: transform; animation: slide 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex; align-items: center; gap: clamp(1.5rem, 3vw, 3rem);
  padding-inline: clamp(1rem, 2vw, 2rem);
  font-family: var(--serif); font-size: var(--s-2); font-weight: 350; letter-spacing: -.02em;
  color: var(--ink-2);
}
.marquee__item i { display: inline-block; width: 6px; height: 6px; background: var(--accent); flex: none; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ----------------------------------------------------------- 10. Index rows */
.rows { border-top: 1px solid var(--line); }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 0 1rem;
  align-items: start;
  padding-block: clamp(1.4rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--line);
  transition: padding-inline .6s var(--ease);
}
@media (min-width: 900px) {
  .row {
    grid-template-columns: 3.6rem minmax(0, 2.1fr) minmax(0, 1.35fr) 9rem 2rem;
    align-items: center;
    gap: 0 clamp(1rem, 2.5vw, 2.5rem);
  }

  .row:hover { padding-inline: 1.2rem; }
}
@media (max-width: 899px) {
  .row__title, .row__desc, .row__tag { grid-column: 2; }
}
.row::before {
  content: ""; position: absolute; inset: 0; background: var(--paper-2);
  transform: scaleY(0); transform-origin: bottom; z-index: -1;
  transition: transform .55s var(--ease);
}
.row:hover::before { transform: scaleY(1); transform-origin: top; }
.row__num { color: var(--muted); font-size: var(--s--1); letter-spacing: .1em; padding-top: .35em; }
.row__title {
  font-family: var(--serif); font-size: var(--s-3); font-weight: 350;
  letter-spacing: -.028em; line-height: 1.04;
  transition: transform .55s var(--ease);
}
@media (min-width: 900px) { .row:hover .row__title { transform: translateX(6px); } }
.row__desc { color: var(--muted); font-size: var(--s--1); margin-top: .6rem; max-width: 52ch; line-height: 1.55; }
@media (min-width: 900px) { .row__desc { margin-top: 0; } }
.row__tag {
  font-size: var(--s--1); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  margin-top: .8rem;
}
@media (min-width: 900px) { .row__tag { margin-top: 0; text-align: right; } }
.row__arrow { display: none; }
@media (min-width: 900px) {
  .row__arrow {
    display: grid; place-items: center; width: 2rem; height: 2rem;
    opacity: 0; transform: translateX(-8px);
    transition: opacity .45s var(--ease), transform .45s var(--ease);
  }
  .row:hover .row__arrow { opacity: 1; transform: translateX(0); }
}
.row__arrow svg { width: 16px; height: 16px; }

/* Floating hover preview */
.preview {
  position: fixed; top: 0; left: 0; z-index: 150;
  width: 340px; aspect-ratio: 16 / 10;
  pointer-events: none; overflow: hidden;
  opacity: 0; transform: translate(-50%, -50%) scale(.9);
  transition: opacity .4s var(--ease), transform .55s var(--ease);
  box-shadow: var(--shadow);
}
.preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.preview img { width: 100%; height: 100%; object-fit: cover; display: none; }
.preview img.is-on { display: block; }
@media (max-width: 1099px) { .preview { display: none; } }

/* ----------------------------------------------------------- 11. Card grids */
.cards { display: grid; gap: clamp(1.6rem, 3vw, 2.6rem); }
@media (min-width: 720px) { .cards--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .cards--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards--4 { grid-template-columns: repeat(4, 1fr); } }

.card {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-strong);
  padding-top: 1.2rem;
  position: relative;
}
.card__num { color: var(--accent); font-size: var(--s--1); letter-spacing: .1em; }
.card__title { font-family: var(--serif); font-size: var(--s-2); font-weight: 350; letter-spacing: -.02em; line-height: 1.1; margin-top: .9rem; }
.card__text { color: var(--muted); margin-top: .8rem; font-size: var(--s-0); line-height: 1.6; }
.card__list { margin-top: 1.1rem; display: grid; gap: .45rem; }
.card__list li { font-size: var(--s--1); color: var(--ink-2); position: relative; padding-left: 1.05rem; line-height: 1.55; }
.card__list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; background: var(--accent); }

/* Writing cards (index page) */
.piece {
  display: grid; gap: 1.1rem; position: relative;
}
.piece__media {
  aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2);
  position: relative;
}
.piece__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.piece:hover .piece__media img { transform: scale(1.045); }
.piece__cat { display: flex; align-items: center; gap: .7rem; }
.piece__cat i { width: 6px; height: 6px; background: var(--accent); }
.piece__title {
  font-family: var(--serif); font-size: var(--s-2); font-weight: 350;
  letter-spacing: -.022em; line-height: 1.08;
}
.piece__desc { color: var(--muted); font-size: var(--s-0); line-height: 1.58; max-width: 48ch; }
.piece__meta { display: flex; gap: 1.2rem; align-items: center; color: var(--muted); font-size: var(--s--1); letter-spacing: .06em; }
.piece a.piece__hit { position: absolute; inset: 0; z-index: 2; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: 0.68rem; letter-spacing: .12em; text-transform: uppercase;
  padding: .32rem .6rem; border: 1px solid var(--line-strong); color: var(--muted);
  line-height: 1;
}
.badge--accent { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------- 12. Accordion */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__head { margin: 0; font: inherit; letter-spacing: normal; line-height: inherit; }
.acc__btn {
  width: 100%; display: grid; grid-template-columns: 3rem 1fr 2rem; align-items: center;
  gap: 1rem; padding-block: clamp(1.2rem, 2.4vw, 1.9rem); text-align: left;
}
.acc__btn:hover .acc__title { color: var(--accent); }
.acc__num { color: var(--muted); font-size: var(--s--1); letter-spacing: .1em; }
.acc__title { font-family: var(--serif); font-size: var(--s-3); font-weight: 350; letter-spacing: -.026em; line-height: 1.05; transition: color .4s var(--ease); }
.acc__icon { position: relative; width: 18px; height: 18px; justify-self: end; }
.acc__icon::before, .acc__icon::after {
  content: ""; position: absolute; background: var(--ink); transition: transform .5s var(--ease);
}
.acc__icon::before { left: 0; right: 0; top: 50%; height: 1px; margin-top: -.5px; }
.acc__icon::after { top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -.5px; }
.acc__item.is-open .acc__icon::after { transform: scaleY(0); }
.acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .6s var(--ease); }
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__panelInner { overflow: hidden; }
.acc__content {
  padding: 0 0 clamp(1.4rem, 3vw, 2.2rem) 0;
  display: grid; gap: 1.6rem;
}
@media (min-width: 900px) {
  .acc__content { grid-template-columns: 3rem minmax(0, 1.2fr) minmax(0, 1fr); gap: 2.5rem; }
  .acc__content > :first-child { grid-column: 2; }
}

/* ------------------------------------------------------------ 13. Callouts */
.pull {
  border-left: 2px solid var(--accent);
  padding: .4rem 0 .4rem 1.6rem;
  font-family: var(--serif); font-weight: 350; font-size: var(--s-2);
  line-height: 1.22; letter-spacing: -.02em; color: var(--ink);
}

.note {
  border: 1px solid var(--line); padding: clamp(1.1rem, 2.4vw, 1.6rem);
  background: var(--paper-2); display: grid; gap: .6rem;
}
.note p { font-size: var(--s--1); color: var(--ink-2); line-height: 1.6; max-width: none; }

.kv { display: grid; gap: 0; border-top: 1px solid var(--line); }
.kv div {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr);
  gap: 1rem; padding-block: .95rem; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.kv dt { font-size: var(--s--1); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font-size: var(--s-0); color: var(--ink); }

/* ------------------------------------------------------------- 14. Contact */
.cta {
  background: var(--ink); color: var(--paper);
  padding-block: clamp(4rem, 9vw, 9rem);
  position: relative; overflow: hidden;
}
:root[data-theme="dark"] .cta { background: var(--paper-2); color: var(--ink); }
.cta .label { color: color-mix(in srgb, currentColor 58%, transparent); }
.cta__mail {
  display: inline-block; font-family: var(--serif); font-weight: 350;
  font-size: clamp(1.6rem, 6.4vw, 5rem); letter-spacing: -.04em; line-height: 1;
  position: relative; overflow: hidden; padding-bottom: .08em;
  word-break: break-word;
}
.cta__mail::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.cta__mail:hover::after { transform: scaleX(1); }

.footer { padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line); }
.footer__grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: repeat(4, 1fr); } }
.footer__col h2 { font-family: var(--sans); font-size: var(--s--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 1rem; }
.footer__col li + li { margin-top: .5rem; }
.footer__col a { font-size: var(--s-0); color: var(--ink-2); transition: color .3s var(--ease); }
.footer__col a:hover { color: var(--accent); }
.footer__base {
  margin-top: clamp(2.5rem, 5vw, 4rem); padding-top: 1.4rem; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: var(--s--1); color: var(--muted);
}

/* ------------------------------------------------------- 15. Page headers */
.phead { padding-top: clamp(8rem, 18vh, 13rem); padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.phead__title { margin-top: clamp(1rem, 2.4vw, 2rem); }
.phead__lead { margin-top: clamp(1.4rem, 3vw, 2.4rem); max-width: 58ch; }

/* ------------------------------------------------------------ 16. Article */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 210;
  background: transparent;
}
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

.article { padding-top: clamp(7.5rem, 16vh, 11rem); }
.article__head { max-width: 1000px; }
.article__kicker { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.article__title { margin-top: clamp(1.2rem, 3vw, 2.2rem); }
.article__deck {
  margin-top: clamp(1.2rem, 2.6vw, 2rem);
  font-family: var(--read); font-size: var(--s-1); line-height: 1.5;
  color: var(--ink-2); max-width: 56ch; font-weight: 300;
}
.article__meta {
  margin-top: clamp(1.8rem, 4vw, 3rem); padding-top: 1.2rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1.2rem 2.4rem; align-items: center;
}
.article__author { display: flex; align-items: center; gap: .8rem; }
.article__author img { width: 40px; height: 40px; object-fit: cover; border-radius: 50%; }
.article__author b { font-weight: 500; font-size: var(--s--1); display: block; letter-spacing: .02em; }
.article__author span { font-size: var(--s--1); color: var(--muted); }

.article__plate {
  margin-block: clamp(2.5rem, 5vw, 4.5rem);
  aspect-ratio: 1500 / 940; overflow: hidden; background: var(--paper-2);
}
.article__plate img { width: 100%; height: 100%; object-fit: cover; }
.article__plateCap { margin-top: .7rem; font-size: var(--s--1); color: var(--muted); }

.article__body {
  display: grid; gap: clamp(2rem, 4vw, 4rem);
}
.article__body > * { min-width: 0; }
@media (min-width: 1040px) {
  .article__body { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) minmax(0, 13rem); }
}

.toc { display: none; }
@media (min-width: 1040px) {
  .toc { display: block; position: sticky; top: 8rem; align-self: start; }
  .toc h2 { font-size: var(--s--1); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 1rem; }
  .toc li + li { margin-top: .55rem; }
  .toc a { font-size: var(--s--1); color: var(--muted); line-height: 1.4; display: block; transition: color .3s var(--ease); border-left: 1px solid var(--line); padding-left: .8rem; }
  .toc a:hover, .toc a.is-active { color: var(--ink); border-left-color: var(--accent); }
}

.copy {
  font-family: var(--read);
  font-size: clamp(1.06rem, 0.98rem + 0.34vw, 1.24rem);
  line-height: 1.68;
  color: var(--ink-2);
  font-weight: 300;
  max-width: 68ch;
}
.copy p { text-wrap: pretty; }
.copy > * + * { margin-top: 1.35em; }
.copy h2 {
  font-family: var(--serif); font-size: var(--s-3); font-weight: 350; color: var(--ink);
  letter-spacing: -.026em; line-height: 1.05; margin-top: 2.2em; scroll-margin-top: 7rem;
}
.copy h3 {
  font-family: var(--serif); font-size: var(--s-2); font-weight: 400; color: var(--ink);
  letter-spacing: -.02em; line-height: 1.15; margin-top: 1.9em;
}
.copy a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .3s var(--ease); }
.copy a:hover { color: var(--accent); }
.copy strong { font-weight: 600; color: var(--ink); }
.copy ul, .copy ol { display: grid; gap: .7rem; padding-left: 0; }
.copy ul li { position: relative; padding-left: 1.5rem; }
.copy ul li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 6px; background: var(--accent); }
.copy ol { counter-reset: n; }
.copy ol li { position: relative; padding-left: 2.4rem; counter-increment: n; }
.copy ol li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: .32em; color: var(--accent); font-family: var(--sans); font-size: .78em; letter-spacing: .06em; }
.copy > p:first-of-type::first-letter {
  font-family: var(--serif); float: left; font-size: 3.5em; line-height: .78;
  padding-right: .09em; padding-top: .06em; font-weight: 350; color: var(--ink);
}
.copy blockquote {
  margin: 2em 0; padding-left: 1.6rem; border-left: 2px solid var(--accent);
  font-family: var(--serif); font-size: var(--s-2); font-weight: 350;
  line-height: 1.24; letter-spacing: -.018em; color: var(--ink);
}
.copy figure { margin: 2.2em 0; }
.copy figcaption { font-family: var(--sans); font-size: var(--s--1); color: var(--muted); margin-top: .7rem; }
.copy .stat-strip {
  display: grid; gap: 1.2rem; border-block: 1px solid var(--line); padding-block: 1.6rem; margin-block: 2.2em;
  font-family: var(--sans);
}
@media (min-width: 700px) { .copy .stat-strip { grid-template-columns: repeat(3, 1fr); } }
.copy .stat-strip b { display: block; font-family: var(--serif); font-size: var(--s-3); font-weight: 350; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.copy .stat-strip span { display: block; font-size: var(--s--1); color: var(--muted); margin-top: .5rem; line-height: 1.45; }

.aside-notes { display: none; }
@media (min-width: 1040px) {
  .aside-notes { display: grid; gap: 1.6rem; position: sticky; top: 8rem; align-self: start; }
}
.aside-note { border-top: 1px solid var(--line-strong); padding-top: .9rem; }
.aside-note h3 { font-size: var(--s--1); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 500; margin-bottom: .5rem; }
.aside-note p { font-size: var(--s--1); color: var(--muted); line-height: 1.55; }

.sources { margin-top: clamp(3rem, 6vw, 5rem); padding-top: 1.6rem; border-top: 1px solid var(--line-strong); }
.sources ol { counter-reset: s; display: grid; gap: .8rem; margin-top: 1.2rem; }
.sources li { counter-increment: s; position: relative; padding-left: 2.1rem; font-size: var(--s--1); color: var(--muted); line-height: 1.55; }
.sources li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 0; color: var(--accent); }
.sources a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.sources a:hover { color: var(--accent); }

/* ------------------------------------------------------------ 17. Motion */
[data-reveal] { opacity: 0; transform: translateY(26px); }
[data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0s);
}

.split { display: block; }
.split .line { display: block; overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.split .line > span { display: block; transform: translateY(102%); }
.split.is-in .line > span {
  transform: translateY(0);
  transition: transform 1.05s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.075s + var(--d, 0s));
}

.mask { overflow: hidden; display: block; }
.mask > * { transform: translateY(102%); }
.mask.is-in > * { transform: none; transition: transform .95s var(--ease); transition-delay: var(--d, 0s); }

.reveal-img { overflow: hidden; position: relative; }
.reveal-img::after {
  content: ""; position: absolute; inset: 0; background: var(--paper); z-index: 3;
  transform-origin: bottom;
}
.reveal-img.is-in::after { animation: wipe 1.05s var(--ease-io) forwards; }
@keyframes wipe { from { transform: scaleY(1); } to { transform: scaleY(0); } }

.parallax { will-change: transform; }

/* ------------------------------------------------------- 18. Responsive nav */
@media (max-width: 1000px) {
  .nav { display: none; }
  .burger { display: block; }
  .brand__role { display: none; }
}

@media (max-width: 640px) {
  .hero { min-height: auto; padding-bottom: 3rem; }
  .hero__portrait { max-width: 320px; }
  .row { grid-template-columns: 2.4rem minmax(0, 1fr); }
}

/* --------------------------------------------------- 20. White paper document */
.wp-cover { padding-top: clamp(7.5rem, 16vh, 11rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
.wp-cover__label { color: var(--accent); letter-spacing: .2em; }
.wp-cover__title { margin-top: clamp(1.2rem, 3vw, 2.2rem); max-width: 18ch; }
.wp-cover__sub {
  margin-top: clamp(1rem, 2.4vw, 1.6rem);
  font-family: var(--serif); font-weight: 350; font-style: italic;
  font-size: var(--s-2); line-height: 1.22; letter-spacing: -.015em;
  color: var(--ink-2); max-width: 30ch;
}
.wp-cover__topics { margin-top: clamp(1.4rem, 3vw, 2rem); }
.wp-cover__meta {
  margin-top: 1.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center;
}
.wp-cover__plate {
  margin: clamp(2rem, 4vw, 3.5rem) 0 0; aspect-ratio: 1500 / 940;
  overflow: hidden; background: var(--paper-2);
}
.wp-cover__plate img { width: 100%; height: 100%; object-fit: cover; }

.wp-summary { padding-block: clamp(2.5rem, 5vw, 4rem); }
.wp-summary__grid { display: grid; gap: clamp(2rem, 4vw, 3.5rem); }
@media (min-width: 940px) {
  .wp-summary__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
.wp-abstract, .wp-findings {
  border-top: 2px solid var(--ink); padding-top: 1.2rem;
}
.wp-abstract p {
  margin-top: 1rem; font-family: var(--read); font-weight: 300;
  font-size: clamp(1rem, .95rem + .25vw, 1.12rem); line-height: 1.62; color: var(--ink-2);
  text-wrap: pretty;
}
.wp-findings ol { counter-reset: kf; margin-top: 1rem; display: grid; gap: 1.1rem; }
.wp-findings li { counter-increment: kf; position: relative; padding-left: 2.4rem; }
.wp-findings li::before {
  content: counter(kf, decimal-leading-zero); position: absolute; left: 0; top: .15em;
  color: var(--accent); font-size: var(--s--1); letter-spacing: .08em;
}
.wp-findings h3 {
  font-family: var(--serif); font-weight: 400; font-size: var(--s-1);
  line-height: 1.2; letter-spacing: -.015em; color: var(--ink);
}
.wp-findings p { margin-top: .4rem; font-size: var(--s--1); line-height: 1.6; color: var(--muted); }

.wp-body { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 5vw, 4rem); }
.wp-copy > h2:first-child { margin-top: 0; }
.wp-copy h2 {
  padding-bottom: .4rem; border-bottom: 1px solid var(--line);
}

.wp-table-wrap { margin-block: 2.4em; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.wp-table {
  width: 100%; min-width: 46rem; border-collapse: collapse;
  font-family: var(--sans); font-size: var(--s--1); line-height: 1.5;
}
.wp-table caption {
  caption-side: bottom; text-align: left; padding-top: .9rem;
  font-size: var(--s--1); color: var(--muted);
}
.wp-table th, .wp-table td {
  text-align: left; vertical-align: top; padding: .85rem 1rem .85rem 0;
  border-bottom: 1px solid var(--line);
}
.wp-table thead th {
  border-bottom: 1px solid var(--line-strong); color: var(--ink);
  font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  font-size: 0.72rem;
}
.wp-table tbody td { color: var(--ink-2); }
.wp-table tbody tr td:first-child { color: var(--ink); font-weight: 500; }

.wp-method {
  margin-top: clamp(3rem, 6vw, 5rem); padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--paper-2); border: 1px solid var(--line);
}
.wp-method h2 { font-size: var(--s-2); border: 0; padding: 0; }
.wp-method p { font-size: var(--s--1); color: var(--ink-2); line-height: 1.65; max-width: none; }
.wp-method p + p { margin-top: 1rem; }

/* Backstop: the head script sets .js, main.js sets .js-ready. If the script file
   fails to load or throws before boot, the page must still become readable. */
@keyframes failsafeIn { to { opacity: 1; transform: none; } }
html.js:not(.js-ready) [data-reveal] { animation: failsafeIn .5s 2.5s ease forwards; }
html.js:not(.js-ready) .loader { animation: curtainIn .7s 2.5s var(--ease-io) forwards; }
html.js:not(.js-ready) .reveal-img::after { animation: wipe .7s 2.5s var(--ease-io) forwards; }

/* ------------------------------------------------- 19. Reduced motion, print */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .split .line > span, .mask > * { transform: none !important; }
  .reveal-img::after { display: none; }
  .grain { animation: none; }
  .cursor { display: none; }
  .loader { display: none; }
}

@media print {
  .header, .menu, .cursor, .grain, .curtain, .loader, .progress, .marquee, .cta, .preview { display: none !important; }
  .wp-table { min-width: 0; font-size: 9pt; }
  body { background: #fff; color: #000; }
  .copy { max-width: none; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
