/* tkudinova.com — one stylesheet. Tokens first; dark mode follows the system. */

@font-face {
  font-family: "Geist";
  src: url("/assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FBFBFA;
  --ink: #141414;
  --ink-2: #3A3A3A;
  --mute: #5C5C5C;
  --line: #E3E3E0;
  --rule: #141414;
  --accent: #2546C8;
  --wash: #EEEEEC;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --pad: clamp(20px, 4vw, 48px);
  --max: 1296px;
  --gap-section: clamp(72px, 9vw, 128px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    --paper: #0F0F10;
    --ink: #ECECEA;
    --ink-2: #CFCFCB;
    --mute: #A0A09C;
    --line: #2A2A2C;
    --rule: #ECECEA;
    --accent: #8FA3FF;
    --wash: #1A1A1C;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 10;
}
.skip:focus { left: var(--pad); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 0 32px; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; letter-spacing: -0.01em; text-decoration: none; padding: 12px 0; }
.site-id { display: flex; align-items: center; gap: 6px; }
.mode-toggle { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -10px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.mode-toggle[hidden] { display: none; }
.mode-toggle:hover { color: var(--accent); }
.mode-toggle svg { width: 28px; height: 28px; }
.mode-toggle .i-eclipse { display: block; transition: transform 0.4s ease; }
.mode-toggle:hover .i-eclipse { transform: rotate(-12deg); }
@media (prefers-reduced-motion: reduce) { .mode-toggle .i-eclipse { transition: none; } }
.nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-size: 14px; }
.nav a { text-decoration: none; padding: 12px 0; border-bottom: 1px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: currentColor; }

/* Type helpers */
.label {
  margin: 0; font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute);
}
.more { display: inline-block; font-size: 14px; color: var(--accent); text-decoration: none; padding: 12px 0; }
.more:hover { text-decoration: underline; }
.lede { margin: 20px 0 32px; max-width: 40em; font-size: 17px; color: var(--ink-2); }
.lede p { margin: 0 0 14px; }
.lede-wide { max-width: 46em; }
.caption { margin: 16px 0 0; max-width: 46em; font-size: 15px; color: var(--mute); }

/* Sections */
.section { padding-top: var(--gap-section); }
.section-tight { padding-top: clamp(48px, 6vw, 88px); }
.section-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
  gap: 8px 32px; border-bottom: 1px solid var(--rule);
}
.section-head h2 { margin: 0 0 10px; font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.section-head-filters { justify-content: flex-start; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 24px; margin-bottom: 8px; }
.end { display: flex; justify-content: flex-end; margin: 4px 0 0; }

/* Home hero: the portrait beside the text about Tati. From 700px up they sit side by side and
   share one height: the portrait runs from the cap line of the greeting to the baseline of the
   last line, never shorter than 270px; when the text is the shorter one, the highlights move
   down to the portrait's foot. Below 700px the portrait sits above the text. */
.hero {
  --hero-h1: clamp(28px, 3.3vw, 46px);
  display: flex; flex-direction: column; gap: 32px; padding-top: clamp(56px, 8vw, 112px);
}
.hero-text { display: flex; flex-direction: column; min-width: 0; max-width: 940px; }
.hero h1 { margin: 0; font-size: var(--hero-h1); line-height: 1.12; letter-spacing: -0.025em; font-weight: 400; text-wrap: pretty; }
.path { margin: 28px 0 0; font-family: var(--mono); font-size: 13px; letter-spacing: 0.02em; color: var(--mute); }
.hero-lede { margin: 24px 0 0; max-width: 34em; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.4; color: var(--ink-2); }
.highlights { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; margin: 28px 0 0; }
.highlights .label { margin-right: 4px; }
.hl-list { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 15px; color: var(--ink); }
.hl-list span:not(:last-child)::after { content: "·"; margin: 0 10px; color: var(--mute); }
.portrait-frame { position: relative; flex: 0 0 auto; width: 220px; height: 270px; }
.portrait { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; background: var(--wash); border-radius: 16px; }
@media (min-width: 700px) {
  .hero { flex-direction: row; align-items: stretch; }
  .hero-text { flex: 1 1 0%; }
  /* 0.19em of the greeting is the space above its capitals; 6px is what sits under the last baseline */
  .portrait-frame { height: auto; min-height: 270px; margin: calc(var(--hero-h1) * 0.19) 0 6px; }
  .highlights { margin-top: auto; padding-top: 28px; }
}
@media (min-width: 900px) { .hero { gap: 48px; } }

/* Thumbnails */
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.thumbs a { display: block; }
.thumbs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--wash); }
@media (max-width: 900px) { .thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Index rows */
.filters { display: flex; flex-wrap: wrap; gap: 0 22px; }
.filters button {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 12px 0 10px; min-height: 44px; cursor: pointer;
  font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute);
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.filters .n { margin-left: 6px; font-weight: 400; color: var(--mute); }

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) 96px; gap: 4px 24px;
  align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line);
}
.row-year { font-family: var(--mono); font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.row-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 2px 24px; }
.row-title { font-weight: 500; }
.row-title a { text-decoration: underline; text-decoration-color: var(--line); }
.row-title a:hover { text-decoration-color: currentColor; }
.row-text { color: var(--mute); }
.row-title .ext { font-size: 0.85em; color: var(--mute); }
.row-cat { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); text-align: right; }
.rows-plain .row { grid-template-columns: 88px minmax(0, 1fr); }
@media (max-width: 720px) {
  .row, .rows-plain .row { grid-template-columns: 64px minmax(0, 1fr); }
  .row-main { grid-template-columns: 1fr; }
  .row-cat { grid-column: 2; text-align: left; }
}

/* Cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.card { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.card img, .case img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--wash); }
.card-title { font-weight: 500; }
.card-text { font-size: 15px; color: var(--mute); }
.card:hover .card-title { color: var(--accent); }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; } }

/* Atlas volumes */
.vols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 24px; }
.vol { display: flex; flex-direction: column; gap: 10px; text-decoration: none; padding: 8px 0; }
.vol-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.vol-name { font-weight: 500; }
.vol-count { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.section-head .vol-count { margin-bottom: 12px; }
.vol:hover .vol-name { color: var(--accent); }
.pal { display: flex; height: 28px; outline: 1px solid var(--line); }
.pal span { display: block; min-width: 2px; }
.pal-thin { height: 14px; }
@media (max-width: 1100px) { .vols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .vols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Footer */
.site-footer {
  margin-top: var(--gap-section); padding: 40px 0 56px; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px;
}
.site-footer .mail { font-size: clamp(24px, 3vw, 40px); letter-spacing: -0.02em; text-decoration: none; padding: 4px 0; overflow-wrap: anywhere; }
.site-footer .links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; font-size: 14px; }
.site-footer .links a { text-decoration: none; padding: 12px 0; }
.copy { font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* Inner pages */
.page-head { padding-top: clamp(56px, 8vw, 112px); }
.page-head h1 { margin: 0; font-size: clamp(40px, 5.6vw, 72px); font-weight: 500; letter-spacing: -0.035em; line-height: 1; }
.page-head .lede { margin-top: 24px; margin-bottom: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 20px; font-size: 14px; }
.jump a { padding: 12px 0; color: var(--mute); text-decoration: none; }
.jump a:hover { color: var(--accent); }
.statement { max-width: 42em; padding-top: 24px; font-size: 17px; color: var(--ink-2); }
.statement p { margin: 0 0 16px; }

.series { padding-top: var(--gap-section); scroll-margin-top: 24px; }
.series-year { font-family: var(--mono); font-size: 13px; color: var(--mute); margin-bottom: 12px; }
.series-text { max-width: 42em; margin: 20px 0 32px; color: var(--ink-2); }
.series-text p { margin: 0 0 12px; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery a, .wide a { display: block; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--wash); }
.gallery a:hover img, .wide a:hover img { opacity: 0.9; }
.wide img { width: 100%; height: auto; background: var(--wash); }
@media (max-width: 960px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* Lightbox */
.lightbox {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100%; height: 100%; background: rgba(12, 12, 13, 0.97); color: #ECECEA;
}
.lightbox::backdrop { background: rgba(12, 12, 13, 0.97); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox figure { margin: 0; padding: 64px 72px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; }
.lightbox img { max-width: min(100%, 1600px); max-height: calc(100vh - 140px); width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: #A0A09C; text-align: center; }
.lightbox button {
  position: fixed; display: grid; place-items: center; width: 48px; height: 48px;
  background: none; border: 0; color: #ECECEA; cursor: pointer; border-radius: 0;
}
.lightbox button:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lightbox figure { padding: 64px 12px 72px; }
  .lb-prev, .lb-next { top: auto; bottom: 12px; transform: none; }
}

/* Design */
.cases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; padding-top: 32px; }
.case { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 24px; }
.case .card-title { font-size: 18px; }
.case .more { align-self: flex-start; padding: 4px 0; }
@media (max-width: 640px) { .cases { grid-template-columns: 1fr; } }
.nda {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px;
  margin-top: 40px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.nda p { margin: 0; max-width: 40em; color: var(--ink-2); }
.button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-size: 14px; font-weight: 500;
}
.button:hover { background: var(--accent); color: #FFFFFF; }
.skills { list-style: none; margin: 0; padding: 32px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.skills li { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 960px) { .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .skills { grid-template-columns: 1fr; } }

/* Atlas */
.vol-section { padding-top: var(--gap-section); scroll-margin-top: 24px; }
.board {
  display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 24px 56px;
  padding: 32px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 24px;
}
.vol-section .lede + .board { border-top: 1px solid var(--line); }
.board h3 { margin: 0 0 4px; font-size: 20px; font-weight: 500; letter-spacing: -0.01em; }
.board-meta { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.board-thesis { margin: 14px 0 6px; font-weight: 500; }
.board-body { margin: 0 0 16px; color: var(--ink-2); }
.board-hex { margin: 8px 0 4px; font-family: var(--mono); font-size: 11px; color: var(--mute); word-spacing: 2px; }
.board-embed { min-width: 0; overflow: hidden; }
.board.no-embed { grid-template-columns: minmax(0, 640px); }
.board.no-embed .board-embed { display: none; }
.foot-note { margin: 40px 0 0; max-width: 40em; font-size: 14px; color: var(--mute); }
@media (max-width: 820px) { .board { grid-template-columns: 1fr; } }

/* CV: the read.cv profile layout (one 560px column, year gutter, image strips), in this site's type and colour */
.cv { max-width: 560px; margin: 0 auto; padding-top: clamp(48px, 7vw, 96px); font-size: 15px; line-height: 1.6; }
.cv-head { display: flex; align-items: center; gap: 16px; }
.cv-photo { flex: 0 0 auto; width: 92px; height: 92px; border-radius: 50%; object-fit: cover; background: var(--wash); }
.cv-id { min-width: 0; }
.cv-head h1 { margin: 0; font-size: 20px; font-weight: 400; letter-spacing: -0.01em; line-height: 1.3; }
.cv-byline { margin: 0; color: var(--mute); }
.cv-site { color: var(--mute); text-decoration: none; }
.cv-site:hover { color: var(--accent); }
.cv-section { margin-top: 60px; }
.cv-section.cv-about { margin-top: 36px; }
.cv-section h2 { margin: 0 0 24px; font-size: inherit; font-weight: 500; letter-spacing: 0; line-height: inherit; }
.cv-about h2 { margin-bottom: 8px; }
.cv-prose p { margin: 0 0 12px; color: var(--ink-2); }
.cv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 32px; }
.cv-contact .cv-list { gap: 12px; }
.cv-item { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 2px 28px; }
.cv-year { padding-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cv-body { min-width: 0; }
.cv-title { font-weight: 500; }
.cv-title a { text-decoration: underline; text-decoration-color: var(--line); }
.cv-title a:hover { text-decoration-color: currentColor; }
.cv-arrow { margin-left: 2px; font-size: 0.85em; color: var(--mute); white-space: nowrap; }
.cv-text { margin: 2px 0 0; color: var(--mute); }
.cv-attachments { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.cv-attachments::-webkit-scrollbar { display: none; }
.cv-media { position: relative; flex: 0 0 auto; display: block; border-radius: 8px; overflow: hidden; background: var(--wash); cursor: zoom-in; }
.cv-media img { height: 132px; width: auto; max-width: none; }
.cv-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(127 127 127 / 0.16); pointer-events: none; }
.cv-media:hover img { opacity: 0.9; }
@media (max-width: 480px) {
  .cv-item { grid-template-columns: 1fr; }
  .cv-attachments { margin-right: calc(-1 * var(--pad)); padding-right: var(--pad); }
}

/* Two sections ------------------------------------------------------------------ */
.nav a[aria-current] { border-bottom-color: currentColor; }
.crumb { margin: 0 0 12px; font-size: 14px; }
.crumb a { color: var(--mute); text-decoration: none; padding: 10px 0; }
.crumb a:hover { color: var(--accent); }

/* Landing: the two doors */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 56px 24px; padding-top: clamp(56px, 7vw, 104px); }
.door { display: flex; flex-direction: column; gap: 14px; min-width: 0; color: inherit; text-decoration: none; }
.door-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.door-name { font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.door-go { font-size: clamp(20px, 2vw, 28px); line-height: 1; transition: transform 0.2s ease; }
.door:hover .door-name, .door:hover .door-go { color: var(--accent); }
.door:hover .door-go { transform: translateX(4px); }
.door-imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.door-imgs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--wash); }
.door:hover .door-imgs img { opacity: 0.92; }
.door-rows { display: flex; flex-direction: column; justify-content: space-between; }
.door-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 0 24px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.door-year { font-family: var(--mono); font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.door-title { font-weight: 500; }
.door-text { max-width: 36em; font-size: 15px; color: var(--mute); }
@media (min-width: 761px) { .door-rows { aspect-ratio: 3 / 1; } }
@media (max-width: 760px) { .doors { grid-template-columns: 1fr; } .door-row { grid-template-columns: 64px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .door-go { transition: none; } }

/* Design profile additions */
.cv-note { margin: 28px 0 0; color: var(--mute); }
.cv-note a { color: var(--ink); }
.cv-links { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 4px 0 0; }
.cv-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); padding: 4px 0; }
.cv-links a:hover { color: var(--accent); text-decoration-color: currentColor; }
.cv-case { cursor: pointer; }
.cv-title a[href^="/design/"] + .cv-arrow { color: var(--ink); }

/* Case study: the read.cv column, with media opening out wider than the text.
   (.study, not .case: .case still styles the old case cards above.) */
.study { padding-top: clamp(32px, 5vw, 72px); }
.case-crumb { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--ink); text-decoration: none; font-size: 15px; }
.case-crumb:hover .case-crumb-name { color: var(--accent); }
.case-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: var(--wash); }
.case-crumb-sub { color: var(--mute); }
.case-crumb-sub::before { content: "/"; margin-right: 10px; color: var(--line); }
.case-head { margin-top: 36px; }
.case-head h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.case-lead { margin: 8px 0 0; font-size: 17px; color: var(--ink-2); }
.case-meta { margin-top: 28px; gap: 4px; }
.case-meta .cv-item { grid-template-columns: 88px minmax(0, 1fr); }
.case-wide { --w: min(1040px, calc(100vw - 2 * var(--pad))); width: var(--w); margin-left: calc((100% - var(--w)) / 2); margin-right: calc((100% - var(--w)) / 2); }
.case-hero { margin-top: 44px; margin-bottom: 0; }
.case-hero a, .case-slider a { display: block; cursor: zoom-in; }
.case-hero img { width: 100%; height: auto; border-radius: 8px; background: var(--wash); }
.case-block { margin-top: 48px; }
.case-block h2 { margin: 0 0 8px; font-size: inherit; font-weight: 500; }
.case-block p { margin: 0 0 12px; color: var(--ink-2); }
.case-slider { display: flex; gap: 8px; margin-top: 28px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none; }
.case-slider::-webkit-scrollbar { display: none; }
.case-slider a { flex: 0 0 auto; scroll-snap-align: start; border-radius: 8px; overflow: hidden; }
.case-slider img { height: clamp(220px, 30vw, 380px); width: auto; max-width: none; }
.case-video, .case-embed { position: relative; border-radius: 8px; overflow: hidden; background: var(--wash); }
.case-video { aspect-ratio: 16 / 9; margin-top: 44px; }
.case-embed { height: min(85vh, 860px); margin-top: 20px; }
.case-video iframe, .case-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.case-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 32px; }
button.button { border: 0; border-radius: 0; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.case-link { font-weight: 500; }
.case-link a { text-decoration: underline; text-decoration-color: var(--line); }
.case-link a:hover { text-decoration-color: currentColor; }
.case-pager { display: flex; justify-content: space-between; gap: 24px; margin-top: 64px; padding-top: 16px; border-top: 1px solid var(--line); }
.case-pager a { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; text-decoration: none; font-weight: 500; }
.case-pager .next { text-align: right; margin-left: auto; }
.case-pager-label { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--mute); }
@media (max-width: 480px) { .case-meta .cv-item { grid-template-columns: 72px minmax(0, 1fr); } }

/* Work and CV pairs ------------------------------------------------------------- */
.door-wrap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.door-cv { align-self: flex-start; padding: 10px 0; font-size: 14px; font-weight: 500; text-decoration: none; }
.door-cv:hover { color: var(--accent); }
.cv-section.cv-first { margin-top: 36px; }
.cv-shot { position: relative; display: block; margin-top: 12px; border-radius: 8px; overflow: hidden; background: var(--wash); }
.cv-shot img { width: 100%; height: auto; }
.cv-shot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(127 127 127 / 0.16); pointer-events: none; }
.cv-shot:hover img { opacity: 0.92; }
.cv-site { padding: 2px 0; }
@media (max-width: 520px) { .nav { gap: 0 20px; } }

/* Art in the read.cv layout */
.cv-attachments-lg .cv-media img { height: clamp(150px, 18vw, 220px); }
/* On wider screens the art strips run out past the text column, toward the page edge. */
@media (min-width: 900px) {
  .cv-attachments-lg { margin-right: calc(-1 * min(368px, (100vw - 560px) / 2 - var(--pad))); }
}
.cv-body > .cv-text + .cv-text { margin-top: 8px; }
.cv-lead { color: var(--ink-2); }
.cv-item[id] { scroll-margin-top: 24px; }

/* Modes ------------------------------------------------------------------------- */
/* Design is night, Art is day, In Rainbows is rainbow. Pages without a mode follow the system.
   A mode can also be set on any element (the landing page's doors) to paint just that part. */
[data-mode="day"] {
  --paper: #FBFBFA; --ink: #141414; --ink-2: #3A3A3A; --mute: #5C5C5C;
  --line: #E3E3E0; --rule: #141414; --accent: #2546C8; --wash: #EEEEEC;
  color-scheme: light;
}
[data-mode="night"] {
  --paper: #0F0F10; --ink: #ECECEA; --ink-2: #CFCFCB; --mute: #A0A09C;
  --line: #2A2A2C; --rule: #ECECEA; --accent: #8FA3FF; --wash: #1A1A1C;
  color-scheme: dark;
}
[data-mode="rainbow"] {
  --paper: #FFFFFF; --ink: #141414; --ink-2: #3A3A3A; --mute: #5C5C5C;
  --line: #E6E6E6; --rule: #141414; --accent: #7E22CE; --wash: #F4F4F6;
  --spectrum: linear-gradient(90deg, #FF3B30, #FF9500, #FFCC00, #34C759, #00C7BE, #007AFF, #AF52DE);
  --spectrum-ink: linear-gradient(90deg, #D7263D, #E36414, #2A9D8F, #1D4ED8, #7E22CE);
  color-scheme: light;
}
[data-mode="rainbow"] .site-header { border-bottom-color: transparent; background: var(--spectrum) bottom / 100% 2px no-repeat; }
[data-mode="rainbow"] .site-footer { border-top-color: transparent; background: var(--spectrum) top / 100% 2px no-repeat; }

/* In Rainbows */
.rb-band { height: clamp(96px, 14vw, 180px); margin-top: clamp(24px, 4vw, 48px); background: var(--spectrum); filter: saturate(1.05); }
.rb { padding-top: clamp(32px, 5vw, 64px); }
.rb-title {
  margin: 0; font-size: clamp(44px, 7vw, 88px); font-weight: 500; letter-spacing: -0.04em; line-height: 1;
  background: var(--spectrum-ink); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rb-lede { margin: 20px 0 0; font-size: 19px; line-height: 1.5; color: var(--ink-2); }
.rb-book { margin-top: 48px; }
.rb .button { background: var(--ink); color: var(--paper); }
.rb .button:hover { background: var(--accent); color: #FFFFFF; }

/* Landing: one door per section, each painted in its own mode; one column per door */
.doors { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; }
.door-wrap { padding: 20px 20px 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.door-band { display: block; aspect-ratio: 3 / 1; background: var(--spectrum); }
@media (max-width: 900px) { .doors { grid-auto-flow: row; grid-template-columns: 1fr; } }

/* Rounded corners everywhere (2026-11-17) ---------------------------------------- */
:root { --r: 12px; --r-s: 8px; }
img:not(.cv-photo):not(.case-avatar) { border-radius: var(--r-s); }
.portrait { border-radius: 16px; }
.cv-media, .cv-shot, .case-hero img, .case-slider a, .case-video, .case-embed { border-radius: var(--r); }
.door-wrap { border-radius: 16px; overflow: hidden; }
.button, button.button { border-radius: 999px; }
.lightbox img { border-radius: var(--r); }

/* Education: the last section of the home page */
.home-edu { padding-top: clamp(56px, 7vw, 104px); }
.edu-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.edu-list li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 0 16px; align-items: baseline; font-size: 15px; }
.edu-year { font-family: var(--mono); font-size: 13px; color: var(--mute); font-variant-numeric: tabular-nums; }
.edu-title { color: var(--ink); }
.edu-text { color: var(--mute); }
.edu-text::before { content: "· "; }

/* Art as a pin board */
.pins-head { max-width: 760px; padding-top: clamp(40px, 6vw, 80px); }
.pins-head h1 { margin: 0; font-size: clamp(36px, 4.6vw, 60px); font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.pins-statement { margin-top: 24px; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.55; color: var(--ink-2); }
.pins-statement p { margin: 0 0 14px; }
.pins-statement p:first-child { font-size: clamp(19px, 1.7vw, 23px); line-height: 1.4; color: var(--ink); }
.pins-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.pins-jump a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none; }
.pins-jump a:hover { border-color: var(--ink); color: var(--ink); }
.pins-section { padding-top: clamp(56px, 7vw, 104px); scroll-margin-top: 16px; }
.pins-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.pins-section-head h2 { margin: 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.pins-year { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.pins-section-text { max-width: 42em; margin: 18px 0 24px; color: var(--ink-2); }
.pins-section-head + .pins { margin-top: 24px; }
.pins-section-text p { margin: 0 0 12px; }
.pins { columns: 4 220px; column-gap: 16px; }
.pins-single { columns: auto; }
.pins-cards { columns: 3 260px; margin-top: 24px; }
.pin { break-inside: avoid; display: block; margin: 0 0 20px; }
.pin a { display: block; cursor: zoom-in; }
.pin img { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--wash); transition: opacity 0.2s ease; }
.pin { position: relative; transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s ease; border-radius: 16px; }
.pin:hover, .pin:focus-within { transform: scale(1.045); z-index: 2; }
.pin:hover img, .pin:focus-within img { box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.45); }
.pin-card:hover, .pin-card:focus-within { box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.3); }
.pin img { transition: box-shadow 0.35s ease; }
.pin-tall img { aspect-ratio: 4 / 5; object-fit: cover; }
.pin-xtall img { aspect-ratio: 2 / 3; object-fit: cover; }
.pin figcaption { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px 0; }
.pin-title { font-size: 14px; line-height: 1.35; }
.pin-series { font-size: 12px; color: var(--mute); }
.pin-card { padding: 20px; border-radius: 16px; background: var(--wash); }
.pin-year { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.pin-card-title { display: block; margin: 6px 0 8px; font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.pin-card-title a { display: inline; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); }
.pin-card-title a:hover { text-decoration-color: currentColor; }
.pin-card p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.pins-more { margin: 8px 0 0; font-size: 15px; color: var(--mute); }
@media (max-width: 600px) { .pins, .pins-cards { columns: 2; column-gap: 10px; } .pin { margin-bottom: 14px; } .pin-card { padding: 14px; } .pin-card-title { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .pin, .pin img { transition: none; } .pin:hover, .pin:focus-within { transform: none; } html { scroll-behavior: auto; } }

/* CV image cards, after LinkedIn's media attachments (2026-11-17) */
.cv-card { display: flex; align-items: center; gap: 14px; max-width: 520px; margin-top: 12px; color: inherit; text-decoration: none; }
.cv-card-img { position: relative; flex: 0 0 auto; width: 128px; aspect-ratio: 16 / 9; border-radius: var(--r-s, 8px); overflow: hidden; background: var(--wash); }
.cv-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: opacity 120ms ease; }
.cv-card-img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(127 127 127 / 0.16); pointer-events: none; }
.cv-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cv-card-title { font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.cv-card-text { color: var(--mute); font-size: 14px; line-height: 1.45; }
.cv-card:hover .cv-card-title { text-decoration-color: currentColor; }
.cv-card:hover img { opacity: 0.9; }
.cv-card.lb { cursor: zoom-in; }
@media (max-width: 480px) { .cv-card-img { width: 104px; } }

/* Link previews: a rounded card shown on hover or keyboard focus (2026-11-17) */
.pv { position: fixed; top: 0; left: 0; z-index: 60; width: min(320px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--r, 12px); overflow: hidden; background: var(--paper); color: var(--ink); box-shadow: 0 12px 32px rgb(0 0 0 / 0.14), 0 2px 6px rgb(0 0 0 / 0.08); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity 120ms ease, transform 120ms ease, visibility 0s linear 120ms; pointer-events: none; }
.pv.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 120ms ease, transform 120ms ease; }
.pv-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--wash); }
.pv-body { padding: 12px 14px 14px; }
.pv-site { display: block; font-family: var(--mono); font-size: 12px; color: var(--mute); }
.pv-title { display: block; margin-top: 4px; font-weight: 500; line-height: 1.35; }
.pv-text { margin: 4px 0 0; color: var(--mute); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .pv, .pv.is-on { transition: none; transform: none; } }
@media (hover: none) { .pv { display: none; } }

/* Case study as a rail (2026-11-17): every word in one column that stays put, one picture per screen beside it.
   One type size: weight and tone carry the hierarchy. Chosen per case study with "layout": "rail".
   The --rail-* values are optional: a look sets them to put the rail on its own grid and under its own header. */
.rail-study {
  --gap: var(--rail-gap, 28px);
  --stick: calc(var(--rail-top, 0px) + var(--gap));
  --stop-h: calc(100vh - var(--stick) - var(--gap));
  --pair: var(--rail-pair, 12px);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px var(--rail-gutter, clamp(28px, 3.4vw, 48px));
  padding-top: var(--gap); font-size: var(--rail-type, 16px); line-height: 1.45;
}
@supports (height: 100svh) { .rail-study { --stop-h: calc(100svh - var(--stick) - var(--gap)); } }
.rail-words { max-width: 30em; }
.rail-words h1 { margin: 0; font-size: inherit; font-weight: 500; line-height: inherit; letter-spacing: 0; }
.rail-when { margin: 0; }
.rail-text { margin: 18px 0 0; }
.rail-list { list-style: none; margin: 14px 0 0; padding: 0; color: var(--mute); }
.rail-list a { color: inherit; text-decoration: none; }
.rail-list a:hover { color: var(--ink); }
.rail-list .cv-arrow { color: inherit; }
.rail-note { margin: 14px 0 0; color: var(--mute); }
.stream { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.stop { margin: 0; display: flex; justify-content: center; }
.stop-media { display: block; width: min(100%, var(--w), calc(var(--stop-h) * var(--ar))); aspect-ratio: var(--ar); border-radius: var(--r); overflow: hidden; background: var(--wash); }
a.stop-media { cursor: zoom-in; }
.stream .stop-media img, .stream video.stop-media { display: block; width: 100%; height: 100%; object-fit: cover; }
.stream .stop-media img { border-radius: 0; }
.stop-mat { --mat: clamp(20px, 5vw, 64px); padding: var(--mat); border-radius: var(--r); background: var(--wash); }
.stop-mat .stop-media { width: min(100%, var(--w), calc((var(--stop-h) - 2 * var(--mat)) * var(--ar))); border-radius: var(--r-s); }
.stop-pair { display: flex; align-items: flex-start; gap: var(--pair); width: min(100%, calc(var(--stop-h) * var(--sum) + var(--pair))); }
.stop-pair .stop-media { flex: var(--ar) 1 0%; width: auto; min-width: 0; }
.stream-notes { max-width: 34em; padding-top: 20px; scroll-margin-top: var(--stick); }
.notes-block + .notes-block { margin-top: 28px; }
.notes-block h2 { margin: 0 0 6px; font-size: inherit; font-weight: 500; }
.notes-block p { margin: 0 0 10px; color: var(--ink-2); }
.rail-study .case-pager { margin-top: 36px; }
@media (min-width: 900px) {
  .rail-study { grid-template-columns: var(--rail-cols, clamp(250px, 28%, 340px) minmax(0, 1fr)); align-items: start; }
  .rail { grid-column: var(--rail-words, auto); position: sticky; top: var(--stick); max-height: var(--stop-h); overflow-y: auto; scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .stream { grid-column: var(--rail-stream, auto); }
}
