/* Octave Dardar
   Layout concept: one continuous surface whose ground colour changes with
   each proof. Gold hairlines taken from the paintings act as the grid;
   everything bends while it moves and returns to its own shape. */

@property --bg     { syntax: "<color>"; inherits: true; initial-value: #08161f; }
@property --fg     { syntax: "<color>"; inherits: true; initial-value: #ece3d0; }
@property --accent { syntax: "<color>"; inherits: true; initial-value: #e6bd80; }

:root {
  /* Colour: every value is sampled from the paintings. */
  --ink:  #08161f;   /* night ground of Second Line */
  --lake: #0f2a2c;   /* Pontchartrain water */
  --mint: #a7ccb4;   /* the housedress */
  --bone: #e8dcc5;   /* rice, raw linen */
  --red:  #96280f;   /* red beans, red ground */
  --gold: #c79b49;   /* leaf */
  --leaf: #f1c488;   /* the bright hairline */

  --bg: var(--ink);
  --fg: #ece3d0;
  --accent: #e6bd80;
  --muted: color-mix(in oklab, var(--fg) 62%, var(--bg));
  --line: color-mix(in oklab, var(--fg) 20%, transparent);
  --hair: color-mix(in oklab, var(--accent) 70%, transparent);

  /* Type: a soft, wonky serif for the voice; a plain sans for reading;
     a mono for proof notation, numbers and prices. */
  --f-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --f-text: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --t-mono: 0.72rem;
  --t-body: 1.0625rem;
  --t-lede: clamp(1.15rem, 1.5vw, 1.45rem);
  --t-h3: clamp(1.5rem, 2.4vw, 2.3rem);
  --t-h2: clamp(2.1rem, 4.6vw, 4.6rem);
  --t-h1: clamp(3.2rem, 9.4vw, 10rem);

  --gutter: clamp(16px, 3.4vw, 56px);
  --gap: clamp(16px, 2.4vw, 40px);
  --nav-h: 68px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

[data-tone="ink"]  { --bg: #08161f; --fg: #ece3d0; --accent: #e6bd80; }
[data-tone="lake"] { --bg: #0f2a2c; --fg: #ebe4d1; --accent: #e9c489; }
[data-tone="mint"] { --bg: #a7ccb4; --fg: #0c211c; --accent: #86230f; }
[data-tone="bone"] { --bg: #e8dcc5; --fg: #19140f; --accent: #9c2a11; }
[data-tone="red"]  { --bg: #96280f; --fg: #f4e8d3; --accent: #f2cb8e; }
[data-tone="gold"] { --bg: #c79b49; --fg: #0a1620; --accent: #5c160a; }
[data-tone="river"] { --bg: #2a251f; --fg: #efe6d4; --accent: #f0a868; } /* brown river, sundown: the 1890 pastels */

/* Derived colours are worked out again wherever a ground is set, so a
   viewer or cart with its own ground gets its own muted and line tones. */
:root, [data-tone], .cart__sheet {
  --muted: color-mix(in oklab, var(--fg) 62%, var(--bg));
  --line: color-mix(in oklab, var(--fg) 20%, transparent);
  --hair: color-mix(in oklab, var(--accent) 70%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--bg);
  color: var(--fg);
  transition: --bg 1.1s var(--ease-io), --fg 1.1s var(--ease-io), --accent 1.1s var(--ease-io);
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
  scrollbar-color: color-mix(in oklab, var(--fg) 30%, transparent) transparent;
  scrollbar-width: thin;
}
html.is-locked { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--t-body)/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Linen tooth over everything. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.11;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, dd, figure, blockquote, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
em { font-family: var(--f-display); font-style: italic; font-variation-settings: "SOFT" 100, "WONK" 1; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; border-radius: 2px; }

.mono {
  font: 400 var(--t-mono)/1.35 var(--f-mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.skip {
  position: fixed; left: var(--gutter); top: 12px; z-index: 400;
  padding: 10px 16px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ───────── Motion primitives ───────── */

.js [data-reveal] {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 1.1s var(--ease), translate 1.3s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js [data-reveal].is-in { opacity: 1; translate: 0 0; }

.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.1em 0.16em 0.2em; margin: -0.1em -0.16em -0.2em; }
.w > span { display: inline-block; }
.js [data-lines] .w > span {
  translate: 0 115%;
  rotate: 4deg;
  transform-origin: 0 100%;
  transition: translate 1.25s var(--ease), rotate 1.25s var(--ease);
  transition-delay: calc(var(--i) * 28ms);
}
.js [data-lines].is-in .w > span { translate: 0 0; rotate: 0deg; }

.js [data-reveal-clip] { clip-path: inset(100% 0 0 0); transition: clip-path 1.5s var(--ease); }
.js [data-reveal-clip].is-in { clip-path: inset(0 0 0 0); }

/* ───────── Nav ───────── */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--nav-h);
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap);
  transition: translate 0.7s var(--ease);
}
.nav::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transition: opacity 0.6s;
}
.nav.is-solid::before { opacity: 1; }
.nav.is-away { translate: 0 -100%; }

.nav__mark {
  justify-self: start;
  font: italic 380 1.3rem/1 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.01em;
}
.nav__chapter {
  justify-self: center;
  color: var(--muted);
  white-space: pre;
  overflow: hidden;
  height: 1.35em;
}
.nav__chapter span { display: block; transition: translate 0.7s var(--ease), opacity 0.5s; }
.nav__chapter.is-swapping span { translate: 0 -110%; opacity: 0; }
.nav__links { justify-self: end; display: flex; gap: clamp(18px, 2.4vw, 36px); margin-right: 132px; font-size: 0.95rem; }
.nav__links a, .foot__links a { position: relative; padding-block: 6px; }
.nav__links a::after, .foot__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform 0.6s var(--ease);
}
.nav__links a:hover::after, .foot__links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

.nav__cart {
  position: absolute; right: var(--gutter); top: 50%; translate: 0 -50%;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 10px 9px 18px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.95rem;
  transition: border-color 0.4s, background-color 0.4s, color 0.4s;
}
.nav__cart:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.nav__count {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding-inline: 6px;
  border-radius: 999px;
  background: var(--accent); color: var(--bg);
  letter-spacing: 0;
  transition: scale 0.5s var(--ease);
}
.nav__count.is-bump { scale: 1.35; }
.nav__menu { display: none; }

.menu {
  position: fixed; inset: 0; z-index: 55;
  background: var(--bg);
  padding: calc(var(--nav-h) + 6vh) var(--gutter) max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: space-between;
}
.menu nav { display: grid; gap: 0.1em; }
.menu a { font: italic 300 clamp(3rem, 15vw, 5.4rem)/1.04 var(--f-display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.03em; }
.menu p { color: var(--muted); }

/* ───────── Hero ───────── */

.hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: clip;
  isolation: isolate;
}
.hero__water {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
  opacity: 0;
  touch-action: pan-y;
}
.hero__water.is-live { opacity: 1; }

.hero__frame {
  position: absolute;
  top: 0;
  left: 62%;
  height: 100%;
  aspect-ratio: 1968 / 2464;
  translate: -50% 0;
  pointer-events: none;
}
.hero__still {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 13%, #000 87%, transparent), linear-gradient(to top, transparent, #000 26%);
  mask-image: linear-gradient(to right, transparent, #000 13%, #000 87%, transparent), linear-gradient(to top, transparent, #000 26%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
/* Without WebGL the painting's gold horizon is continued in CSS. */
.hero__frame::before, .hero__frame::after {
  content: ""; position: absolute; top: 49.65%; height: 1.5px; width: 100vw;
  background: var(--leaf); opacity: 0.85;
}
.hero__frame::before { right: 92%; }
.hero__frame::after { left: 92%; }
.is-water .hero__still { visibility: hidden; }
.is-water .hero__frame::before, .is-water .hero__frame::after { display: none; }

.hero__inner {
  position: relative; z-index: 2;
  height: 100%;
  padding: calc(var(--nav-h) + clamp(12px, 3vh, 36px)) var(--gutter) clamp(18px, 3.4vh, 34px);
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.hero__inner a { pointer-events: auto; }

.hero__kicker { display: grid; gap: 4px; color: var(--muted); }
.hero__kicker span:first-child { color: var(--fg); }

.hero__name {
  position: absolute;
  left: var(--gutter);
  top: calc(49.65% + clamp(12px, 2.2vw, 34px));
  font: italic 300 min(12.6vw, 21svh)/0.84 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.045em;
  color: var(--fg);
  white-space: nowrap;
}
.hero__word { display: block; }
.hero__word--b { margin-left: 1.08em; }
.hero__word .c {
  display: inline-block;
  will-change: transform, opacity;
}
.js .hero__word .c {
  opacity: 0;
  translate: 0 0.42em;
  rotate: 7deg;
  filter: blur(10px);
  transition: opacity 1.3s var(--ease), translate 1.6s var(--ease), rotate 1.6s var(--ease), filter 1.2s var(--ease);
  transition-delay: calc(240ms + var(--i) * 62ms);
}
.js.is-ready .hero__word .c { opacity: 1; translate: 0 0; rotate: 0deg; filter: blur(0); }

.js [data-rise] {
  opacity: 0; translate: 0 16px;
  transition: opacity 1.2s var(--ease), translate 1.4s var(--ease);
  transition-delay: calc(500ms + var(--d, 0) * 110ms);
}
.js.is-ready [data-rise] { opacity: 1; translate: 0 0; }

.hero__foot {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: end;
}
.hero__show, .hero__plate { display: grid; gap: 5px; align-content: end; }
.hero__show .mono, .hero__plate .mono { color: var(--muted); }
.hero__show em, .hero__plate em { font-size: clamp(1.25rem, 1.9vw, 1.75rem); font-weight: 340; line-height: 1.1; letter-spacing: -0.015em; }
.hero__plate { justify-self: start; padding-left: 18px; border-left: 1px solid var(--hair); transition: padding 0.7s var(--ease); }
.hero__plate:hover { padding-left: 28px; }
.hero__plate em { white-space: nowrap; }
.hero__plate .mono:last-child { color: var(--accent); }
.hero__hint { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.hero__hint svg { fill: none; stroke: var(--accent); stroke-width: 1; overflow: visible; }
.hero__hint svg circle { transform-origin: 12px 12px; animation: ripple 3.2s var(--ease) infinite; }
.hero__hint svg circle:nth-child(2) { animation-delay: 0.25s; }
.hero__hint svg circle:nth-child(3) { animation-delay: 0.5s; }
@keyframes ripple { 0% { transform: scale(0.2); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.05); opacity: 0; } }
[data-hint-touch] { display: none; }
@media (hover: none) {
  [data-hint-touch] { display: inline; }
  [data-hint-fine] { display: none; }
}

/* ───────── Statement ───────── */

.statement {
  position: relative;
  min-height: 118svh;
  padding: 20svh var(--gutter) 16svh;
  display: grid; align-content: center;
  overflow: clip;
}
.statement__figure { position: relative; z-index: 1; max-width: 1500px; }
.statement__quote {
  font: italic 300 clamp(2.4rem, 7.2vw, 7.6rem)/1.0 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.04em;
  text-wrap: balance;
  max-width: 15ch;
}
.statement__quote .q { display: inline-block; opacity: 0.16; transition: opacity 0.9s var(--ease), color 0.9s; }
.statement__quote .q.is-lit { opacity: 1; }
.no-js .statement__quote .q { opacity: 1; }
.statement figcaption { margin-top: clamp(28px, 5vh, 56px); color: var(--muted); display: flex; align-items: center; gap: 14px; }
.statement figcaption::before { content: ""; width: 56px; height: 1px; background: var(--hair); }
.statement__fig { position: absolute; right: var(--gutter); bottom: 9svh; color: var(--muted); text-align: right; }

.ring { display: block; overflow: visible; }
.ring path { fill: none; stroke: var(--accent); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ring--statement {
  position: absolute;
  right: -6vw; top: 50%;
  width: min(74vw, 96svh);
  translate: 0 -50%;
  opacity: 0.9;
}

/* ───────── Thesis ───────── */

.thesis {
  padding: clamp(80px, 14svh, 180px) var(--gutter) clamp(60px, 10svh, 120px);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(36px, 7vh, 80px);
}
.thesis__head { grid-column: 1 / span 10; display: grid; gap: 22px; }
.thesis__head .mono { color: var(--accent); }
.thesis__title {
  font: 300 var(--t-h2)/1.04 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 0;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.thesis__body { grid-column: 7 / span 5; display: grid; gap: 20px; font-size: var(--t-lede); line-height: 1.42; }
.thesis__motifs { color: var(--muted); }
.thesis__index { grid-column: 1 / -1; border-top: 1px solid var(--line); counter-reset: proof; }
.thesis__index a {
  display: grid;
  grid-template-columns: 5.5ch minmax(0, 1fr) auto auto;
  gap: var(--gap);
  align-items: baseline;
  padding: clamp(14px, 2.2vh, 26px) 0;
  border-bottom: 1px solid var(--line);
  transition: padding 0.8s var(--ease), color 0.5s;
}
.thesis__index a:hover { padding-left: clamp(12px, 2vw, 32px); color: var(--accent); }
.thesis__index .num { font: italic 300 var(--t-h3)/1 var(--f-display); color: var(--accent); }
.thesis__index .t { font: 300 var(--t-h3)/1.05 var(--f-display); font-variation-settings: "SOFT" 100; letter-spacing: -0.02em; }
.thesis__index .t small { display: inline-block; margin-left: 1.1em; vertical-align: middle; font: 400 var(--t-mono)/1.3 var(--f-mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.thesis__index .mono { color: var(--muted); white-space: nowrap; }
.thesis__index .mono:last-child { min-width: 11ch; text-align: right; }

/* ───────── Proofs: shared ───────── */

.proof { position: relative; padding-block: clamp(84px, 14svh, 180px); }
.proof__head { display: grid; gap: clamp(14px, 2.4vh, 26px); align-content: start; }
.proof__label { display: flex; gap: 0.9em; align-items: center; color: var(--accent); }
.proof__label::after { content: ""; flex: 0 0 64px; height: 1px; background: var(--hair); }
.proof__title {
  font: italic 300 var(--t-h1)/0.88 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.045em;
}
.proof__lede { font-size: var(--t-lede); line-height: 1.4; max-width: 30ch; text-wrap: pretty; }
.proof__meta { color: var(--muted); }
.proof__qed {
  display: flex; justify-content: flex-end; align-items: center; gap: 14px;
  padding: clamp(48px, 9vh, 110px) var(--gutter) 0;
  color: var(--muted);
}
.proof__qed i { display: block; width: 0.9rem; height: 1.15rem; background: var(--accent); }

/* ───────── Work card ───────── */

.work { display: block; position: relative; }
.work__media {
  display: block; position: relative;
  aspect-ratio: var(--ar);
  overflow: hidden;
  background-color: var(--c);
  background-size: cover;
  transform: skewY(calc(var(--v, 0) * -1.5deg));
  transition: clip-path 1.5s var(--ease);
  will-change: transform;
}
.js .work__media { clip-path: inset(0 0 100% 0); }
.js .work.is-in .work__media { clip-path: inset(0 0 0 0); }
.work__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  scale: 1.12;
  transition: opacity 0.9s var(--ease-io), scale 1.9s var(--ease);
}
.work.is-in .work__media img.is-loaded { opacity: 1; scale: 1; }
.no-js .work__media img { opacity: 1; scale: 1; }
@media (hover: hover) {
  .work.is-in:hover .work__media img.is-loaded { scale: 1.045; transition-duration: 0.9s, 1.4s; }
}
.work__cap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 0.9em; row-gap: 4px;
  align-items: baseline;
  padding-top: 14px;
}
.work__no { color: var(--accent); }
.work__title { font-size: 1.22rem; font-weight: 360; line-height: 1.15; letter-spacing: -0.01em; }
.work__price { color: var(--muted); white-space: nowrap; }
.work__note { display: none; grid-column: 2 / -1; color: var(--muted); font-size: 0.96rem; line-height: 1.4; max-width: 34ch; }

/* ───────── I. Second Line: a procession, moving sideways ───────── */

.procession { position: relative; }
.procession__sticky {
  position: sticky; top: 0;
  height: 100svh;
  overflow: clip;
  display: flex; align-items: center;
}
.procession__track {
  display: flex; align-items: center;
  gap: clamp(28px, 4.4vw, 84px);
  padding-inline: var(--gutter) 16vw;
  will-change: transform;
}
.proof--procession { padding-block: 0; }
.proof--procession .proof__head { flex: 0 0 min(46vw, 700px); padding-right: 4vw; }
.proof--procession .work { flex: 0 0 auto; width: calc(56svh * 0.7987); }
.proof--procession .work:nth-of-type(odd) { margin-bottom: 9svh; }
.proof--procession .work:nth-of-type(even) { margin-top: 9svh; }
.proof--procession .work__media { transform: skewX(calc(var(--v, 0) * -5deg)); transform-origin: 50% 100%; }
.proof--procession .proof__qed { flex: 0 0 auto; padding: 0 0 0 2vw; }
.procession__rule {
  position: absolute; left: 0; right: 0; bottom: clamp(26px, 6svh, 60px);
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 18px;
  color: var(--muted);
  white-space: pre;
}
.procession__bar { flex: 1; height: 1px; background: var(--line); }
.procession__bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }

/* ───────── II. Lake: two currents ───────── */

.proof__grid { padding-inline: var(--gutter); }
.proof--drift .proof__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
}
.proof--drift .proof__head { grid-column: 1 / span 6; grid-row: 1; padding-bottom: clamp(40px, 8vh, 100px); }
.proof--drift .work:nth-of-type(1) { grid-column: 7 / span 6; grid-row: 1 / span 2; margin-top: 6svh; }
.proof--drift .work:nth-of-type(2) { grid-column: 2 / span 4; grid-row: 2; }
.proof--drift .work:nth-of-type(3) { grid-column: 1 / span 5; grid-row: 3; margin-top: clamp(60px, 12vw, 190px); }
.proof--drift .work:nth-of-type(4) { grid-column: 8 / span 4; grid-row: 3; margin-top: clamp(120px, 24vw, 380px); }
.proof--drift .moon {
  position: absolute; right: 12vw; top: clamp(70px, 12svh, 150px);
  width: clamp(40px, 5.2vw, 84px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, #f6d9a0, var(--accent) 55%, #b98b45);
  box-shadow: 0 0 80px color-mix(in oklab, var(--accent) 35%, transparent);
}
.proof--drift .horizon { position: absolute; left: 0; right: 0; top: clamp(150px, 26svh, 300px); height: 1px; background: var(--hair); }

/* ───────── III. Grandmother: three columns at three speeds ───────── */

.proof--columns .proof__head {
  padding-inline: var(--gutter);
  grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  margin-bottom: clamp(48px, 9vh, 120px);
}
.proof--columns .proof__head > * { grid-column: 1 / span 8; }
.proof--columns .proof__head .proof__lede { grid-column: 8 / span 5; }
.proof--columns .proof__head .proof__meta { grid-column: 8 / span 5; }
.proof--columns .proof__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
.proof--columns .col { display: grid; gap: clamp(40px, 7vw, 120px); }
.proof--columns .col:nth-child(2) { margin-top: 24svh; }
.proof--columns .col:nth-child(3) { margin-top: 9svh; }

/* ───────── IV. Grandfather: long horizontals ───────── */

.proof--rows .proof__head { padding-inline: var(--gutter); margin-bottom: clamp(48px, 9vh, 120px); }
.proof--rows .proof__grid { display: grid; gap: clamp(64px, 12vw, 190px); }
.proof--rows .work {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: end;
}
.proof--rows .work__media { grid-column: 1 / span 8; grid-row: 1; }
.proof--rows .work__cap { grid-column: 10 / span 3; grid-row: 1; grid-template-columns: minmax(0, 1fr); row-gap: 10px; padding: 0 0 6px; }
.proof--rows .work:nth-of-type(even) .work__media { grid-column: 5 / span 8; }
.proof--rows .work:nth-of-type(even) .work__cap { grid-column: 1 / span 3; }
.proof--rows .work:nth-of-type(3) .work__media { grid-column: 1 / span 9; }
.proof--rows .work:nth-of-type(4) .work__media { grid-column: 6 / span 7; }
.proof--rows .work:nth-of-type(4) .work__cap { grid-column: 2 / span 3; }
.proof--rows .work:nth-of-type(5) .work__media { grid-column: 2 / span 9; }
.proof--rows .work:nth-of-type(5) .work__cap { grid-column: 11 / span 2; }
.proof--rows .work__title { font-size: var(--t-h3); font-weight: 300; }
.proof--rows .work__note { display: block; grid-column: 1; order: 1; }
.proof--rows .work__price { order: 2; margin-top: 6px; }
.proof--rows .work__cap::before { content: ""; width: 48px; height: 1px; background: var(--hair); margin-bottom: 4px; }

/* ───────── V. One Kitchen: three sheets become one pile ───────── */

.proof--stack .proof__head { padding-inline: var(--gutter); margin-bottom: clamp(48px, 9vh, 110px); }
.proof--stack .proof__grid { display: block; }
/* Room for the finished pile to rest before it scrolls away. */
.proof--stack .proof__grid::after { content: ""; display: block; height: 26svh; }
/* Each sheet may travel a little less far than the one after it, so the
   pile keeps its tabs showing when it finally lets go. */
.proof--stack .work {
  position: sticky;
  top: calc(var(--nav-h) + 3svh + var(--n) * 46px);
  width: min(100%, 70svh * 1.336);
  margin: 34svh auto calc((var(--count) - 1 - var(--n)) * 46px);
  background: var(--bg);
  transform-origin: 50% 0;
  will-change: transform;
}
.proof--stack .work:first-of-type { margin-top: 0; }
.proof--stack .work__cap { order: -1; padding: 0 0 12px; height: 46px; align-items: center; border-top: 1px solid var(--hair); }
.proof--stack .work { display: flex; flex-direction: column; }
.proof--stack .work__media { transform: none; }

/* ───────── Marquee ───────── */

/* ───────── 1890: the water stays above the street ───────── */

.proof--level .proof__head {
  padding-inline: var(--gutter);
  grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap);
  align-items: end;
  margin-bottom: clamp(56px, 11vh, 140px);
}
.proof--level .proof__label { grid-column: 1 / -1; }
.proof--level .proof__title { grid-column: 1 / span 6; grid-row: 2 / span 3; font-size: clamp(4.6rem, 16vw, 17rem); line-height: 0.8; }
.ineq {
  grid-column: 7 / span 6;
  display: flex; align-items: baseline; gap: 0.34em;
  font: 300 var(--t-h2)/1 var(--f-display);
  font-variation-settings: "SOFT" 100;
  letter-spacing: -0.03em;
}
.ineq i { font: 300 0.78em/1 var(--f-mono); color: var(--accent); }
.proof--level .proof__lede { grid-column: 7 / span 5; max-width: 34ch; }
.proof--level .proof__meta { grid-column: 7 / span 5; }

/* One level line holds its place on screen for the whole series; the
   pictures pass in front of it. River above, street below. */
.river { position: relative; }
.river__line { position: sticky; top: 36svh; z-index: 0; height: 0; pointer-events: none; }
.river__line::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--hair); }
.river__line span { position: absolute; right: var(--gutter); }
.river__line span:first-child { bottom: 9px; color: var(--accent); }
.river__line span:last-child { top: 10px; color: var(--muted); }

.proof--level .proof__grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap); row-gap: clamp(56px, 9vw, 150px);
  align-items: start;
}
.proof--level .work:nth-of-type(4n + 1) { grid-column: 1 / span 7; }
.proof--level .work:nth-of-type(4n + 2) { grid-column: 9 / span 4; margin-top: 18svh; }
.proof--level .work:nth-of-type(4n + 3) { grid-column: 2 / span 4; margin-top: 10svh; }
.proof--level .work:nth-of-type(4n + 4) { grid-column: 6 / span 7; }
.proof--level .work__note { display: block; }

/* ───────── Short story ───────── */

.story { padding: clamp(90px, 16svh, 200px) var(--gutter) clamp(70px, 12svh, 150px); }
.story__head { display: grid; gap: 18px; margin-bottom: clamp(44px, 9vh, 110px); }
.story__head .mono { color: var(--accent); }
.story__title { font: italic 300 var(--t-h1)/0.9 var(--f-display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.045em; }

/* Text in the middle, a margin on each side for pictures. A picture takes
   no height of its own, so it never opens a gap in the text. */
.story__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 62ch) minmax(0, 1fr);
  column-gap: clamp(24px, 4vw, 64px);
  row-gap: 1.05em;
  font: 350 clamp(1.12rem, 1.32vw, 1.32rem)/1.62 var(--f-display);
  font-variation-settings: "SOFT" 40, "WONK" 0;
}
.story__body > p { grid-column: 2; text-wrap: pretty; }
.story__first { font-size: 1.28em; line-height: 1.35; letter-spacing: -0.01em; padding-bottom: 0.3em; }
.story__turn {
  font: italic 300 var(--t-h2)/1.05 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.03em;
  padding-block: 0.55em 0.5em;
  color: var(--accent);
  text-wrap: balance;
}
.story__fig { display: block; height: 0; align-self: start; width: min(100%, 330px); }
.story__fig--right { grid-column: 3; justify-self: start; }
.story__fig--left { grid-column: 1; justify-self: end; }
.story__fig .work { margin-top: 0.45em; }
.story__fig .work__media { transform: none; }
.story__cap { display: grid; gap: 3px; padding-top: 11px; font-family: var(--f-text); line-height: 1.3; }
.story__cap em { font-size: 1.16rem; }
.story__cap .mono:first-child { color: var(--accent); }
.story__cap .mono:last-child { color: var(--muted); }
.story__end { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-top: clamp(64px, 12vh, 140px); }
.story__end .ring { width: 56px; }
.story__end a { border-bottom: 1px solid currentColor; padding-bottom: 3px; transition: color 0.4s; }
.story__end a:hover { color: var(--accent); }

/* Not enough margin for pictures: they drop into the text column. */
@media (max-width: 1120px) {
  .story__body { grid-template-columns: minmax(0, 62ch); justify-content: center; }
  .story__body > p, .story__fig--right, .story__fig--left { grid-column: 1; }
  .story__fig { height: auto; justify-self: center; width: min(100%, 440px); padding-block: 0.3em 0.9em; }
}

.marquee { overflow: clip; padding-block: clamp(40px, 9svh, 110px) 0; }
.marquee__track {
  display: flex; align-items: center; gap: 0.32em;
  width: max-content;
  font: italic 300 clamp(4rem, 13vw, 13rem)/1 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.045em;
  white-space: nowrap;
  will-change: transform;
}
.marquee__track span:nth-of-type(even) { color: transparent; -webkit-text-stroke: 1px var(--fg); }
.marquee__track i { flex: 0 0 auto; width: 0.2em; height: 0.2em; border-radius: 50%; border: 1px solid var(--accent); margin-inline: 0.12em; }

/* ───────── Editions ───────── */

.editions { padding: clamp(70px, 13svh, 160px) var(--gutter) clamp(90px, 16svh, 200px); }
.editions__head {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: 20px;
  align-items: end;
  margin-bottom: clamp(36px, 7vh, 80px);
}
.editions__head .mono { grid-column: 1 / -1; color: var(--accent); }
.editions__title { grid-column: 1 / span 7; font: italic 300 var(--t-h1)/0.9 var(--f-display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.045em; }
.editions__terms { grid-column: 9 / span 4; display: grid; gap: 8px; font-size: 0.98rem; line-height: 1.4; padding-bottom: 0.6em; }
.editions__terms p { padding-top: 8px; border-top: 1px solid var(--line); }

/* ───────── Frames ─────────
   A frame is a stack of rings drawn outside the picture, innermost first.
   One unit (--fu) scales every moulding and mat, so the same four looks
   serve the small samples here and the large picture in the viewer. */
[data-frame] { --frame: 0 0 0 0 transparent; --frame-out: 0px; }
[data-frame="studio"] {
  --frame: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 0 0 calc(var(--fu) * 1.3) #151517;
  --frame-out: calc(var(--fu) * 1.3);
}
[data-frame="gallery"] {
  --frame: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 0 calc(var(--fu) * 3.4) #f4efe3, 0 0 0 calc(var(--fu) * 3.4 + 1px) rgba(0, 0, 0, 0.22), 0 0 0 calc(var(--fu) * 4.7) #b88e5b;
  --frame-out: calc(var(--fu) * 4.7);
}
[data-frame="museum"] {
  --frame: 0 0 0 calc(var(--fu) * 0.36) #d8b064, 0 0 0 calc(var(--fu) * 4.6) #f6f2e8, 0 0 0 calc(var(--fu) * 4.6 + 1px) rgba(0, 0, 0, 0.28), 0 0 0 calc(var(--fu) * 6.6) #2c1b13;
  --frame-out: calc(var(--fu) * 6.6);
}
.viewer { --fu: clamp(4.5px, 0.6vw, 9.5px); }

.framing {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: clamp(24px, 4vh, 44px);
  padding-block: clamp(28px, 5vh, 56px) clamp(48px, 9vh, 110px);
  border-top: 1px solid var(--fg);
}
.framing__head { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline; }
.framing__head .mono { grid-column: 1 / span 3; color: var(--accent); }
.framing__lede { grid-column: 4 / span 7; font: 300 var(--t-h3)/1.12 var(--f-display); font-variation-settings: "SOFT" 100; letter-spacing: -0.02em; text-wrap: balance; }
.framing__levels { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.level { display: grid; gap: 6px; align-content: start; }
.level__swatch {
  --fu: clamp(3.5px, 0.42vw, 6px);
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
  background: color-mix(in oklab, var(--fg) 9%, var(--bg));
}
/* The top-left corner of one picture, hung on the wall of the swatch. */
.level__piece {
  position: absolute; left: 24%; top: 26%;
  width: 130%; aspect-ratio: 4 / 5;
  background-size: cover; background-position: 0 0;
  box-shadow: var(--frame), calc(var(--fu) * 1.5) calc(var(--fu) * 4) calc(var(--fu) * 7) calc(var(--frame-out) - var(--fu)) rgba(20, 12, 6, 0.42);
  transition: translate 1.1s var(--ease);
}
.level:hover .level__piece { translate: -3% -3%; }
.level__no { color: var(--accent); }
.level__name { font: italic 340 clamp(1.4rem, 2vw, 1.75rem)/1.1 var(--f-display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.015em; }
.level__detail { font-size: 0.96rem; line-height: 1.42; color: var(--muted); max-width: 30ch; }
.level__cost { margin-top: 6px; }

.editions__filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px;
  font: 400 var(--t-mono)/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.chip:hover { border-color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

.editions__list { border-top: 1px solid var(--fg); }
.edition { border-bottom: 1px solid var(--line); }
.edition[hidden] { display: none; }
.edition a {
  display: grid;
  grid-template-columns: 6ch minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 9ch;
  column-gap: var(--gap);
  align-items: baseline;
  padding: 15px 0 14px;
  transition: padding 0.7s var(--ease), background-color 0.5s, color 0.4s;
}
.edition__thumb { display: none; }
.edition__no, .edition__proof, .edition__sizes { color: var(--muted); transition: color 0.4s; }
.edition__title { font-size: clamp(1.3rem, 2vw, 1.75rem); font-weight: 340; line-height: 1.1; letter-spacing: -0.015em; }
.edition__price { text-align: right; }
@media (hover: hover) {
  .editions__list:hover .edition a { color: var(--muted); }
  .editions__list .edition a:hover { color: var(--fg); padding-left: 18px; }
  .editions__list .edition a:hover .edition__no { color: var(--accent); }
}

.peek {
  position: fixed; left: 0; top: 0; z-index: 40;
  width: clamp(180px, 17vw, 270px);
  pointer-events: none;
  opacity: 0; scale: 0.86;
  transition: opacity 0.45s var(--ease), scale 0.7s var(--ease);
  will-change: transform;
}
.peek.is-on { opacity: 1; scale: 1; }
.peek img { width: 100%; box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.5); }

/* ───────── About ───────── */

.about {
  padding: clamp(90px, 16svh, 210px) var(--gutter);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap); row-gap: 56px;
  align-items: start;
}
.about__media { grid-column: 1 / span 5; position: relative; padding-bottom: 14%; }
.about__portrait-clip, .about__corollary-clip { display: block; overflow: hidden; }
.about__portrait img, .about__corollary img { width: 100%; }
.about__portrait figcaption { margin-top: 12px; opacity: 0.7; }
.about__corollary {
  position: absolute; right: -18%; bottom: 0; width: 44%;
  display: grid; gap: 4px;
}
.about__corollary-clip { margin-bottom: 8px; box-shadow: 0 30px 70px -30px rgba(10, 22, 32, 0.7); }
.about__corollary em { font-size: 1.25rem; line-height: 1.1; }
.about__corollary .mono { opacity: 0.72; }
.about__text { grid-column: 8 / span 5; display: grid; gap: clamp(22px, 3.4vh, 40px); }
.about__text > .mono { color: var(--accent); }
.about__title { font: 300 clamp(1.9rem, 3.5vw, 3.4rem)/1.06 var(--f-display); font-variation-settings: "SOFT" 100; letter-spacing: -0.03em; text-wrap: balance; }
.about__bio { display: grid; gap: 1.05em; max-width: 60ch; }
.about__bio p:first-child { font-size: var(--t-lede); line-height: 1.42; }
.about__facts { border-top: 1px solid var(--fg); }
.about__facts div { display: grid; grid-template-columns: 14ch minmax(0, 1fr); gap: var(--gap); padding: 14px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.about__facts dt { opacity: 0.75; }

/* ───────── Exhibitions ───────── */

.shows { padding: clamp(90px, 16svh, 200px) var(--gutter) clamp(50px, 8svh, 100px); }
.shows > .mono { color: var(--accent); margin-bottom: 26px; }
.shows__list { border-top: 1px solid var(--line); }
.shows__list li {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--gap); flex-wrap: wrap;
  padding: clamp(18px, 3.2vh, 38px) 0;
  border-bottom: 1px solid var(--line);
}
.shows__list em { font-size: clamp(1.9rem, 5.4vw, 5.6rem); font-weight: 300; line-height: 1; letter-spacing: -0.04em; }
.shows__list .mono { color: var(--muted); }

/* ───────── Footer ───────── */

.foot { padding: clamp(40px, 8svh, 100px) var(--gutter) max(28px, env(safe-area-inset-bottom)); overflow: clip; }
.foot__mark {
  display: flex; align-items: center; justify-content: space-between; gap: 0.1em;
  font: italic 300 clamp(3rem, 14.6vw, 17rem)/0.9 var(--f-display);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
}
.ring--foot { flex: 0 0 auto; width: 0.62em; height: 0.62em; }
.foot__row {
  margin-top: clamp(28px, 6vh, 64px); padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px var(--gap);
  color: var(--muted);
}
.foot__links { display: flex; flex-wrap: wrap; gap: 6px 26px; color: var(--fg); }

/* ───────── Buttons and fields ───────── */

.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  width: 100%;
  padding: 19px 26px;
  border-radius: 999px;
  background: var(--fg); color: var(--bg);
  font-size: 1.02rem; font-weight: 500;
  transition: color 0.5s;
}
.btn::before {
  content: ""; position: absolute; inset: -2px; z-index: -1;
  background: var(--accent);
  border-radius: inherit;
  translate: 0 102%;
  transition: translate 0.75s var(--ease), border-radius 0.75s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { translate: 0 0; }
.btn.is-done::before { translate: 0 0; }
.btn .mono { letter-spacing: 0.04em; }

.field { display: grid; gap: 8px; }
.field .mono { color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  font: inherit; color: inherit;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 8px 0 10px;
  transition: border-color 0.4s;
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--fg); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }

/* ───────── Viewer ───────── */

.viewer {
  position: fixed; inset: 0; z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(480px, 38vw);
  grid-template-rows: minmax(0, 1fr);
  background: var(--bg); color: var(--fg);
  opacity: 0;
  transition: opacity 0.5s var(--ease-io), --bg 0.9s var(--ease-io), --fg 0.9s var(--ease-io), --accent 0.9s var(--ease-io);
}
.viewer.is-open { opacity: 1; }
.viewer.is-instant, .viewer.is-instant * { transition: none !important; }
.viewer__stage {
  position: relative;
  display: grid; place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  padding: clamp(20px, 5vh, 64px) clamp(20px, 4vw, 72px);
  min-height: 0; min-width: 0;
  overflow: hidden;
  cursor: zoom-in;
}
.viewer__img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  /* The chosen frame, then the shadow the framed piece casts on the wall. */
  box-shadow: var(--frame, 0 0 0 0 transparent), 0 50px 120px calc(var(--frame-out, 0px) - 40px) rgba(0, 0, 0, 0.6);
  transition: transform 0.9s var(--ease), opacity 0.5s;
  scale: 0.965; opacity: 0;
  transition-property: transform, opacity, scale, box-shadow;
  transition-timing-function: var(--ease), ease, var(--ease), var(--ease);
}
.viewer.is-open .viewer__img { scale: 1; opacity: 1; transition-duration: 0.9s, 0.5s, 1.1s, 0.9s; }
/* A framed picture steps back to make room for its frame. */
.viewer.is-open[data-frame="studio"] .viewer__img { scale: 0.95; }
.viewer.is-open[data-frame="gallery"] .viewer__img { scale: 0.89; }
.viewer.is-open[data-frame="museum"] .viewer__img { scale: 0.86; }
.viewer__img.is-swapping { opacity: 0; }
.viewer__stage.is-zoomed { cursor: zoom-out; }
.viewer__stage.is-zoomed .viewer__img { transform: scale(2.3); transition-duration: 0.7s; }
.viewer__zoomhint { position: absolute; left: clamp(20px, 4vw, 72px); bottom: clamp(14px, 2.4vh, 26px); color: var(--muted); transition: opacity 0.4s; }
.viewer__stage.is-zoomed .viewer__zoomhint { opacity: 0; }

.viewer__panel {
  display: flex; flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  translate: 40px 0; opacity: 0;
  transition: translate 1s var(--ease), opacity 0.7s var(--ease);
}
.viewer.is-open .viewer__panel { translate: 0 0; opacity: 1; transition-delay: 0.08s; }
.viewer__top {
  flex: 0 0 var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-inline: clamp(20px, 2.4vw, 36px);
  border-bottom: 1px solid var(--line);
  color: var(--accent);
}
.viewer__top > p { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__tools { display: flex; align-items: center; gap: 18px; white-space: nowrap; flex: 0 0 auto; }
.viewer__cart { color: var(--fg); padding: 9px 0; }
.viewer__cart span { color: var(--accent); }
.viewer__close {
  color: var(--fg);
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 999px;
  transition: background-color 0.4s, color 0.4s, border-color 0.4s;
}
.viewer__close:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.viewer__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: clamp(22px, 4vh, 44px) clamp(20px, 2.4vw, 36px);
  display: grid; gap: clamp(18px, 2.8vh, 28px); align-content: start;
}
.viewer__title { font: italic 300 clamp(2.2rem, 3.4vw, 3.3rem)/0.98 var(--f-display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.035em; text-wrap: balance; }
.viewer__note { font-size: var(--t-lede); line-height: 1.4; color: color-mix(in oklab, var(--fg) 84%, var(--bg)); max-width: 30ch; }
.viewer__terms { display: grid; gap: 7px; color: var(--muted); padding-top: 4px; }
.viewer__terms li { display: flex; gap: 10px; }
.viewer__terms li::before { content: ""; flex: 0 0 5px; height: 5px; margin-top: 0.45em; border-radius: 50%; border: 1px solid var(--accent); }

.buy { display: grid; gap: 16px; }
/* The button stays in reach while the size and framing lists scroll past. */
.buy > .btn { position: sticky; bottom: 12px; z-index: 2; box-shadow: 0 -16px 18px 6px var(--bg), 0 26px 0 6px var(--bg); }
.buy__sizes legend { color: var(--muted); margin-bottom: 10px; }
.buy__sizes > div { border-top: 1px solid var(--line); }
.size {
  position: relative;
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: padding 0.6s var(--ease), background-color 0.4s;
}
.size input { position: absolute; opacity: 0; pointer-events: none; }
.size__dot { width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); display: grid; place-items: center; transition: border-color 0.3s; }
.size__dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); scale: 0; transition: scale 0.5s var(--ease); }
.size:has(input:checked) { padding-left: 12px; background: color-mix(in oklab, var(--fg) 6%, transparent); }
.size:has(input:checked) .size__dot { border-color: var(--accent); }
.size:has(input:checked) .size__dot::after { scale: 1; }
.size:has(input:focus-visible) { outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.size__name { font-size: 1.08rem; }
/* Framing rows: the description opens under the level that is picked. */
.size--frame { grid-template-columns: 18px minmax(0, 1fr) auto; align-items: start; }
.size--frame .size__dot { margin-top: 0.3em; }
.size--frame .size__price { padding-top: 0.42em; white-space: nowrap; }
.size--frame small {
  display: block; overflow: hidden;
  max-height: 0; opacity: 0;
  font-size: 0.9rem; line-height: 1.4; color: var(--muted);
  transition: max-height 0.7s var(--ease), opacity 0.5s, margin 0.7s var(--ease);
}
.size--frame:has(input:checked) small { max-height: 5em; opacity: 1; margin-top: 4px; }
.size__ed { color: var(--muted); }
.size__price { min-width: 6ch; text-align: right; letter-spacing: 0.02em; font-size: 0.86rem; }

.viewer__nav { flex: 0 0 auto; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.viewer__nav button { display: grid; gap: 4px; padding: 16px clamp(20px, 2.4vw, 36px) max(18px, env(safe-area-inset-bottom)); text-align: left; transition: background-color 0.4s; min-width: 0; }
.viewer__nav button + button { border-left: 1px solid var(--line); text-align: right; }
.viewer__nav button:hover { background: color-mix(in oklab, var(--fg) 7%, transparent); }
.viewer__nav .mono { color: var(--muted); }
.viewer__nav em { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

::view-transition-group(work-image) { animation-duration: 0.85s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
::view-transition-old(work-image), ::view-transition-new(work-image) { height: 100%; width: 100%; object-fit: cover; animation-duration: 0.3s; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.5s; }

/* ───────── Cart: an order ticket ───────── */

.cart { position: fixed; inset: 0; z-index: 120; }
.cart__scrim {
  position: absolute; inset: 0; width: 100%; height: 100%;
  background: rgba(4, 12, 18, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.6s var(--ease-io);
  cursor: default;
}
.cart.is-open .cart__scrim { opacity: 1; }
.cart__sheet {
  --bg: #efe6d2; --fg: #19140f; --accent: #9c2a11;
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(500px, 100vw);
  display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  translate: 102% 0;
  transition: translate 0.85s var(--ease);
  box-shadow: -40px 0 90px -30px rgba(0, 0, 0, 0.55);
}
.cart.is-open .cart__sheet { translate: 0 0; }
.cart__head {
  flex: 0 0 auto;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 34px) 18px;
  border-bottom: 1px solid var(--fg);
}
.cart__title { font: italic 300 2.6rem/1 var(--f-display); font-variation-settings: "SOFT" 100, "WONK" 1; letter-spacing: -0.035em; }
.cart__head button { padding: 8px 0; }
.cart__view { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cart__view[hidden] { display: none; }
.cart__lines { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-inline: clamp(20px, 5vw, 34px); }
.line {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 16px; align-items: start;
  padding: 18px 0;
  border-bottom: 1px dashed color-mix(in oklab, var(--fg) 34%, transparent);
}
.line__thumb { display: block; background-size: cover; }
.line__thumb img { width: 100%; }
.line__title { display: block; font-size: 1.22rem; line-height: 1.1; }
.line__meta { display: block; margin-top: 6px; color: var(--muted); }
.line__price { font: 400 0.9rem/1.4 var(--f-mono); letter-spacing: 0.02em; text-align: right; }
.line__tools { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: -4px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 34px; height: 32px; display: grid; place-items: center; font-size: 1.1rem; line-height: 1; }
.qty output { min-width: 2ch; text-align: center; font: 400 0.86rem/1 var(--f-mono); }
.line__remove { color: var(--muted); padding: 8px 0; }
.line__remove:hover { color: var(--accent); }

.cart__empty { flex: 1 1 auto; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 40px; text-align: center; }
.cart__empty[hidden] { display: none; }
.cart__empty .ring { width: 150px; margin-bottom: 10px; }
.cart__empty p { font: italic 300 1.7rem/1.1 var(--f-display); }
.cart__empty a { color: var(--accent); border-bottom: 1px solid currentColor; padding-bottom: 3px; }

.cart__foot { flex: 0 0 auto; display: grid; gap: 12px; padding: 18px clamp(20px, 5vw, 34px) max(22px, env(safe-area-inset-bottom)); border-top: 1px solid var(--fg); }
.cart__foot[hidden] { display: none; }
.cart__sum { display: flex; justify-content: space-between; align-items: baseline; }
.cart__sum span:last-child { font: 300 2rem/1 var(--f-display); letter-spacing: -0.02em; }
.cart__small { font-size: 0.93rem; line-height: 1.45; color: var(--muted); }
.cart__form, .cart__done { padding: 22px clamp(20px, 5vw, 34px) max(22px, env(safe-area-inset-bottom)); gap: 20px; overflow-y: auto; overscroll-behavior: contain; }
.cart__actions { margin-top: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center; padding-top: 10px; }
.cart__actions > .mono { padding: 10px 0; border-bottom: 1px solid currentColor; }
.cart__error { color: var(--accent); font-size: 0.95rem; }

/* Payment step */
.pay { display: grid; gap: 14px; }
.pay__amount { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; font: 300 clamp(2.6rem, 9vw, 3.4rem)/1 var(--f-display); letter-spacing: -0.03em; }
.pay__to { color: var(--muted); }
.pay__to b, .pay__code b { font-weight: 400; color: var(--fg); letter-spacing: 0.04em; text-transform: none; }
.pay__code { color: var(--muted); padding-bottom: 14px; border-bottom: 1px solid var(--fg); }
.pay__code b { margin-left: 8px; padding: 4px 9px; border: 1px dashed color-mix(in oklab, var(--fg) 45%, transparent); font-size: 0.86rem; letter-spacing: 0.1em; text-transform: uppercase; user-select: all; }
.pay__steps { counter-reset: step; display: grid; gap: 18px; padding-top: 4px; }
.pay__steps li { counter-increment: step; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; row-gap: 10px; align-items: start; }
.pay__steps li::before { content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font: 400 0.74rem/1 var(--f-mono); }
.pay__steps li > * { grid-column: 2; }
.pay__steps p { line-height: 1.4; padding-top: 2px; }
.pay__action { justify-self: start; padding: 9px 15px; border: 1px solid var(--fg); border-radius: 999px; transition: background-color 0.4s, color 0.4s; }
.pay__action:hover { background: var(--fg); color: var(--bg); }
.pay__steps .pay__action + .pay__action { margin-top: -2px; }
.cart__plain { display: grid; gap: 12px; justify-items: start; }
.cart__done-title { font: italic 300 2rem/1.05 var(--f-display); letter-spacing: -0.03em; }
.cart__summary {
  margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-word;
  text-transform: none; letter-spacing: 0; font-size: 0.8rem; line-height: 1.6;
  border: 1px dashed color-mix(in oklab, var(--fg) 40%, transparent);
  max-height: 44svh; overflow: auto;
}

/* ───────── Cursor and toast ───────── */

.cursor { position: fixed; left: 0; top: 0; z-index: 250; pointer-events: none; display: none; will-change: transform; }
.cursor span {
  position: absolute; left: 0; top: 0;
  display: grid; place-items: center;
  width: 86px; height: 86px; margin: -43px 0 0 -43px;
  border-radius: 50%;
  background: var(--fg); color: var(--bg);
  font: 400 0.68rem/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase;
  scale: 0;
  transition: scale 0.55s var(--ease), background-color 0.4s, color 0.4s;
}
.cursor.is-on span { scale: 1; }
.cursor span::after { content: attr(data-label); }
@media (hover: hover) and (pointer: fine) { .cursor { display: block; } }

.toast {
  position: fixed; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); z-index: 260;
  translate: -50% 28px; opacity: 0;
  padding: 13px 20px; border-radius: 999px;
  background: var(--fg); color: var(--bg);
  transition: translate 0.7s var(--ease), opacity 0.5s;
  pointer-events: none; white-space: nowrap;
}
.toast.is-on { translate: -50% 0; opacity: 1; }

/* ───────── Narrow and tall screens ───────── */

@media (max-width: 860px), (max-aspect-ratio: 1/1) {
  .hero__frame { left: 50%; height: 66svh; }
  .hero__name {
    top: auto; bottom: clamp(150px, 23svh, 210px);
    font-size: min(22.5vw, 13.5svh);
  }
  .hero__word--b { margin-left: 0.5em; }
  .hero__foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hero__hint, .hero__kicker { display: none; }
  .hero__inner { justify-content: flex-end; }
  .hero__show em, .hero__plate em { font-size: clamp(1.1rem, 4.6vw, 1.5rem); }
}

@media (max-width: 860px) {
  :root { --nav-h: 60px; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__chapter, .nav__links { display: none; }
  .nav__cart { position: static; translate: none; justify-self: end; margin-right: 74px; padding: 6px 7px 6px 14px; }
  .nav__menu { display: block; position: absolute; right: var(--gutter); top: 50%; translate: 0 -50%; padding: 10px 0; font-size: 0.95rem; }

  .statement { min-height: 96svh; }
  .statement__fig { position: static; margin-top: 12svh; text-align: left; }
  .ring--statement { width: 128vw; right: -52vw; }

  .thesis__head, .thesis__body { grid-column: 1 / -1; }
  .thesis__index a { grid-template-columns: 3.2ch minmax(0, 1fr) auto; }
  .thesis__index .mono:last-child { display: none; }

  /* The procession becomes a strip you push by hand. */
  .procession { height: auto !important; }
  .procession__sticky { position: static; height: auto; display: block; padding-block: 90px 60px; overflow: visible; }
  .procession__track {
    transform: none !important;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    padding-inline: var(--gutter);
    align-items: flex-start;
    gap: 18px;
    scrollbar-width: none;
  }
  .procession__track::-webkit-scrollbar { display: none; }
  .proof--procession .proof__head { flex: 0 0 82vw; scroll-snap-align: start; padding-right: 0; }
  .proof--procession .work { width: 74vw; scroll-snap-align: start; margin: 0 !important; }
  .proof--procession .work__media { transform: none; }
  .proof--procession .proof__qed { align-self: center; padding: 0 8vw 0 0; }
  .procession__rule { display: none; }

  .proof--drift .proof__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); row-gap: 44px; }
  .proof--drift .proof__head { grid-column: 1 / -1; padding-bottom: 0; }
  .proof--drift .work:nth-of-type(1) { grid-column: 1 / -1; grid-row: auto; margin-top: 0; }
  .proof--drift .work:nth-of-type(2) { grid-column: 1 / span 4; grid-row: auto; }
  .proof--drift .work:nth-of-type(3) { grid-column: 3 / span 4; grid-row: auto; margin-top: 0; }
  .proof--drift .work:nth-of-type(4) { grid-column: 1 / span 5; grid-row: auto; margin-top: 0; }
  .proof--drift .moon { right: var(--gutter); }

  .proof--columns .proof__head > *, .proof--columns .proof__head .proof__lede, .proof--columns .proof__head .proof__meta { grid-column: 1 / -1; }
  .proof--columns .proof__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }
  .proof--columns .col { display: contents; }
  .proof--columns .work:nth-of-type(even) { translate: 0 0; }
  .proof--columns .work__cap { grid-template-columns: auto minmax(0, 1fr); }
  .proof--columns .work__price { grid-column: 2; }

  .proof--rows .work { display: block; }
  .proof--rows .work__cap { padding-top: 14px; }
  .proof--rows .work__cap::before { display: none; }

  .proof--stack .work { width: 100%; margin-top: 26svh; top: calc(var(--nav-h) + 8px + var(--n) * 46px); }

  .proof--level .proof__title, .ineq, .proof--level .proof__lede, .proof--level .proof__meta { grid-column: 1 / -1; grid-row: auto; }
  .proof--level .proof__title { font-size: 31vw; }
  .proof--level .proof__grid { row-gap: 40px; }
  .proof--level .work:nth-of-type(n) { grid-column: 1 / -1; margin-top: 0; }
  .proof--level .work:nth-of-type(even) { margin-left: 12%; }
  .river__line { display: none; }
  .thesis__index .t small { display: block; margin: 6px 0 0; }

  .editions__title, .editions__terms { grid-column: 1 / -1; }
  .edition a { grid-template-columns: 58px minmax(0, 1fr) auto; column-gap: 14px; align-items: center; padding: 10px 0; }
  .edition__thumb { display: block; width: 58px; aspect-ratio: 1; object-fit: cover; }
  .edition__no, .edition__sizes { display: none; }
  .edition__main { display: grid; gap: 3px; }
  .peek { display: none; }
  .framing__head .mono, .framing__lede { grid-column: 1 / -1; }
  .framing__levels { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 34px; }

  .about__media, .about__text { grid-column: 1 / -1; }
  .about__media { padding-bottom: 20%; padding-right: 14%; }
  .about__corollary { right: 0; width: 42%; }
  .about__facts div { grid-template-columns: 11ch minmax(0, 1fr); }

  .foot__mark { font-size: 15.5vw; }

  /* Viewer stacks: bar, picture, details, previous/next. */
  .viewer { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 36svh) minmax(0, 1fr) auto; }
  .viewer__nav em { display: none; }
  .viewer__nav button { padding-block: 15px max(15px, env(safe-area-inset-bottom)); }
  .viewer__body { padding-block: 20px; gap: 14px; }
  .viewer__title { font-size: 2rem; }
  .viewer__note { font-size: 1.05rem; }
  .viewer__panel { display: contents; }
  .viewer__top { order: 0; flex: none; height: var(--nav-h); padding-inline: var(--gutter); }
  .viewer__stage { order: 1; padding: 16px 18px; }
  .viewer__body { order: 2; border-top: 1px solid var(--line); padding-inline: var(--gutter); }
  .viewer__nav { order: 3; }
  .viewer__nav button { padding-inline: var(--gutter); }
  .viewer__zoomhint { display: none; }
}

@media (min-width: 861px) {
  .edition__main { display: contents; }
}

@media (prefers-reduced-motion: reduce) {
  html { transition: none; }
  .js [data-reveal], .js [data-lines] .w > span, .js [data-reveal-clip], .js .work__media, .js .hero__word .c, .js [data-rise] {
    opacity: 1 !important; translate: none !important; rotate: none !important; filter: none !important; clip-path: none !important; transition: none !important;
  }
  .work__media img { scale: 1 !important; transition: opacity 0.3s !important; }
  .statement__quote .q { opacity: 1; }
  .hero__hint svg circle { animation: none; }
  .work__media, .proof--procession .work__media { transform: none; }
}
