/* Layout: a 12-column Swiss grid (4 on phones) with exposed 2px structural rules.
   Type carries the hierarchy, one grotesk at extreme scale contrast plus a mono for data.
   Images keep their native 4:3. The single signal colour is reserved for interaction. */
:root {
  /* one look, whatever the visitor's system setting: Flexoki dark (github.com/kepano/flexoki),
     warm ink on warm black, chosen for long, easy reading */
  --paper: #100F0F;     /* black */
  --ink: #CECDC3;       /* base-200, Flexoki's primary dark-mode text */
  --mute: #878580;      /* base-500, secondary text */
  --hair: #282726;      /* base-900, faint UI */
  --signal: #4385BE;    /* blue-400, the dark-mode accent */
  --on-signal: #100F0F;
  color-scheme: dark;

  --f-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --side: clamp(16px, 2vw, 32px);
  --gutter: clamp(12px, 1.4vw, 24px);
  --rule: 2px solid var(--ink);
  --thin: 1px solid var(--ink);

  --t-mono: 12px;
  --t-ui: 16px;
  --t-body: clamp(17px, 1.2vw, 20px);
  --t-m: clamp(21px, 1.9vw, 30px);
  --t-l: clamp(27px, 3.1vw, 50px);
  --t-xl: clamp(48px, 9vw, 168px);

  --scale: 1;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  padding-inline: var(--side);
  padding-block: 0 72px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: var(--t-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, figure, ul, ol, dl, dd { margin: 0; padding: 0; }
/* No single word left alone on a last line (JS adds a fallback for browsers without text-wrap: pretty) */
h1, h2, h3, p, dd, li, blockquote, .t, .ttl, b { text-wrap: pretty; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
::selection { background: var(--signal); color: var(--on-signal); }

.mono {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.muted { color: var(--mute); }
.num { font-variant-numeric: tabular-nums; }

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
}
.grid > * { min-width: 0; }
.c1-2 { grid-column: 1 / 3; }  .c1-3 { grid-column: 1 / 4; }  .c1-6 { grid-column: 1 / 7; }
.c1-8 { grid-column: 1 / 9; }  .c1-9 { grid-column: 1 / 10; } .c1-10 { grid-column: 1 / 11; }
.c1-12 { grid-column: 1 / -1; } .c1-1 { grid-column: 1 / 2; } .c2-7 { grid-column: 2 / 8; } .c8-10 { grid-column: 8 / 11; }
.r1 { grid-row: 1; }
.c3-9 { grid-column: 3 / 10; } .c4-6 { grid-column: 4 / 7; }  .c4-9 { grid-column: 4 / 10; }
.c4-10 { grid-column: 4 / 11; } .c4-12 { grid-column: 4 / -1; } .c6-12 { grid-column: 6 / -1; }
.c7-9 { grid-column: 7 / 10; } .c7-10 { grid-column: 7 / 11; } .c7-12 { grid-column: 7 / -1; }
.c9-12 { grid-column: 9 / -1; } .c10-12 { grid-column: 10 / -1; } .c11-12 { grid-column: 11 / -1; }
.end { justify-self: end; text-align: right; }

/* Grid overlay */
.gridlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding-inline: var(--side);
  pointer-events: none;
}
.gridlay > div { height: 100%; }
.gridlay span {
  background: color-mix(in srgb, var(--signal) 8%, transparent);
  border-inline: 1px solid color-mix(in srgb, var(--signal) 40%, transparent);
}

/* Top bar */
.bar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  margin-inline: calc(var(--side) * -1);
  padding: 10px var(--side) 9px;
  background: var(--paper);
  border-bottom: var(--rule);
  align-items: baseline;
  font-size: var(--t-ui);
  line-height: 1.2;
}
.brand { font-weight: 700; letter-spacing: -0.01em; transition: opacity 240ms ease, transform 240ms ease, visibility 240ms; }
html:has(.mega):not(.past-mega) .bar .brand { opacity: 0; visibility: hidden; transform: translateY(6px); }
.bar nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-weight: 500; }
.bar nav a { padding: 1px 3px; margin: -1px -3px; }
/* Optical spacing: the open diagonals of "k" and "W" leave extra white between Work and Writing */
.bar nav a:nth-child(2) { margin-left: -5px; }
.bar nav a:hover { background: var(--signal); color: var(--on-signal); }
.bar nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* Shared type */
.mega {
  margin-top: clamp(28px, 5vw, 80px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.8;
  white-space: nowrap;
}
.mega .fit { display: inline-block; }
.mega-desk { display: block; }
.mega-mob { display: none; }
.title-xl {
  font-size: var(--t-xl);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.88;
  text-wrap: balance;
}
.lede {
  font-size: var(--t-l);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
}
.mid {
  font-size: var(--t-m);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

/* Sections */
.section { margin-top: clamp(64px, 8vw, 128px); }
.sh {
  align-items: baseline;
  padding-top: 10px;
  margin-bottom: clamp(20px, 2.4vw, 36px);
  border-top: var(--rule);
  row-gap: 14px;
}
.sh h2 {
  font-size: var(--t-m);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.arrow-link { display: inline-block; padding: 2px 4px; margin: -2px -4px; }
.arrow-link:hover { background: var(--signal); color: var(--on-signal); }

/* Hero facts */
.hero-info {
  margin-top: clamp(20px, 2.4vw, 36px);
  padding-top: 12px;
  border-top: var(--rule);
  row-gap: 20px;
}
.facts { display: grid; gap: 10px; }
.facts dt { color: var(--mute); }
.facts dd { font-size: var(--t-ui); line-height: 1.3; }

/* Figures */
.fig img, .fig video {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--hair);
}
.cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-top: 8px;
}
.cap b { font-size: var(--t-ui); font-weight: 600; letter-spacing: -0.01em; }
a.fig:hover .cap b { background: var(--signal); color: var(--on-signal); }
.feature { row-gap: clamp(40px, 5vw, 80px); align-items: start; }

/* Work wall */
.wall { margin-top: clamp(40px, 5vw, 72px); row-gap: clamp(40px, 5vw, 72px); align-items: start; }
.wall .c-6 { grid-column: span 6; }
.wall .c-3 { grid-column: span 3; }
.tcap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 12px; padding-top: 8px; font-size: 14px; line-height: 1.3; }
.tcap b { justify-self: start; font-size: var(--t-ui); font-weight: 600; letter-spacing: -0.01em; }
.wall .c-6 .tcap b { font-size: var(--t-m); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
a.tile:hover .tcap b { background: var(--signal); color: var(--on-signal); }

.feature .half { grid-column: span 6; }
#work-list { border-top: var(--rule); }
#work-list .wrow:first-of-type { border-top: 0; }

/* Contact focus: content above the contact softens away */
main, .bar ~ .crumbs { transition: filter 700ms cubic-bezier(.2, .7, .2, 1), opacity 700ms ease; }
html.contact-focus main { filter: blur(10px) grayscale(1); opacity: 0.28; cursor: zoom-out; }
html.contact-focus .preview { display: none !important; }
html.contact-focus .colophon { filter: blur(6px) grayscale(1); opacity: 0.35; transition: transform 900ms cubic-bezier(.2, .8, .2, 1), filter 700ms ease, opacity 700ms ease; }
html.contact-focus .colophon * { pointer-events: none; }
html.contact-focus main * { pointer-events: none; }
.contact, .colophon { transition: transform 900ms cubic-bezier(.2, .8, .2, 1); }
html.contact-focus .contact, html.contact-focus .colophon { position: relative; z-index: 3; background: var(--paper); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax -100vmax); }
html.contact-lifted .contact, html.contact-lifted .colophon { transform: translateY(var(--contact-lift, 0)); }
@media (prefers-reduced-motion: reduce) { .contact, .colophon { transition: none; } }
@media (prefers-reduced-motion: reduce) { main { transition: none; } }

/* Email copies itself */
.email a { cursor: copy; transition: background 160ms, color 160ms; }
.email a.is-copied { background: var(--signal); color: var(--on-signal); }
.copy-status { margin-right: auto; padding: 2px 0; color: var(--mute); }
.copy-status.is-on { color: var(--signal); }

/* Reply window: Addis day against the visitor's day */
.reply { margin-top: clamp(36px, 4vw, 56px); display: grid; gap: 18px; }
.reply-track { position: relative; height: 2px; margin-top: 30px; background: var(--ink); }
.reply-hours { position: absolute; top: -5px; height: 12px; background: color-mix(in srgb, var(--signal) 22%, transparent); }
.reply-dot { position: absolute; font-style: normal; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; }
.reply-dot.is-addis { background: var(--signal); }
.reply-dot.is-you { border: 2px solid var(--ink); background: var(--paper); }
.reply-dot b { position: absolute; left: 50%; transform: translateX(-50%); font-weight: 400; white-space: nowrap; }
.reply-dot.is-addis b { bottom: 16px; color: var(--signal); }
.reply-dot.is-you b { top: 16px; }
.reply-scale { position: absolute; left: 0; right: 0; top: 34px; display: flex; justify-content: space-between; color: var(--mute); }
.reply-text { margin-top: 44px; max-width: 58ch; font-size: var(--t-ui); line-height: 1.4; }
.reply-text b { font-weight: 600; }

/* Sleepy page: drifts off the grid when left alone, snaps back on any movement */
.drift { transition: transform 420ms cubic-bezier(.2, .9, .2, 1); }
/* Home sleep with physics: real text is hidden while its letters fall in a fixed layer */
.fall-layer { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.fall-layer span { position: absolute; white-space: pre; transform-origin: 50% 50%; will-change: transform; }
html.physics main, html.physics .contact, html.physics .colophon { -webkit-text-fill-color: transparent; }
/* Home only: when left alone, everything slowly falls to the bottom of the screen */
html.falling .drift { transform: translate(var(--dx, 0), var(--fy, 0)) rotate(var(--fr, 0)); transition: transform var(--fd, 4s) cubic-bezier(.55, 0, .9, .35) var(--fdl, 0s); }
html.drowsy .drift { transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--dr, 0)); transition: transform 6s cubic-bezier(.45, 0, .25, 1); }

/* Colophon */
.colophon [data-pagume] { cursor: none; }
.colophon [data-pagume]:hover, .colophon [data-pagume]:focus-visible { color: var(--signal); }

/* Secret photo booth */
html.booth-open { overflow: hidden; }
.booth { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 14px var(--side) 18px;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, #3A0F0C 0%, #120807 60%, #0B0707 100%); color: #EFE6E1; }
.booth[hidden] { display: none; }
.booth button { padding: 2px 4px; margin: -2px -4px; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.booth button:hover:not(:disabled) { background: #EFE6E1; color: #120807; }
.booth button:disabled { opacity: 0.4; cursor: default; }
.booth-bar, .booth-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; }
.booth-note { color: #B99A90; margin-right: auto; }
.booth-msg { margin-left: auto; display: grid; justify-items: end; gap: 4px; max-width: 46ch; color: #E8A33D; text-align: right; }
.booth-hint { color: #B99A90; }
.booth .booth-link { color: #E8A33D; text-decoration: underline; text-underline-offset: 3px; }
.booth .booth-link:hover { background: #E8A33D; color: #120807; text-decoration: none; }
.booth-bar, .booth-actions, .booth-stage { width: min(100%, 1180px); }
.booth-stage { position: relative; }
.booth-paper { width: 100%; max-height: calc(100dvh - 140px); overflow: auto; padding: clamp(20px, 4vw, 56px); background: #F2EFE9; color: #111; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); }
.booth-paper[hidden] { display: none; }
.booth-strip { background: #121110; color: #E2A33A;
  --holes: repeating-linear-gradient(90deg, transparent 0 10px, #F2EFE9 10px 22px, transparent 22px 30px); }
.booth-edge { position: relative; display: flex; justify-content: space-between; padding: 18px 12px 6px; font-size: 10px; letter-spacing: 0.06em; }
.booth-edge::before { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 9px; border-radius: 2px; background: var(--holes); }
.booth-edge:last-child { padding: 6px 12px 18px; }
.booth-edge:last-child::before { top: auto; bottom: 4px; }
.booth-edge:last-child span { flex: 1; }
.booth-frames { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0 10px; }
.booth-frame { position: relative; aspect-ratio: 4 / 3; background: #1D1B1A; }
.booth-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.booth .booth-plus { position: absolute; inset: 0; margin: 0; width: 100%; display: grid; place-items: center; font-family: var(--f-display); font-size: clamp(36px, 5vw, 64px); font-weight: 300; color: #8C8580; }
.booth .booth-plus:hover { background: #2A2725; color: #F2EFE9; }
.booth .booth-retake { position: absolute; right: 8px; bottom: 8px; margin: 0; padding: 3px 6px; background: rgba(0, 0, 0, 0.6); color: #F2EFE9; opacity: 0; transition: opacity 160ms; }
.booth-frame:hover .booth-retake, .booth .booth-retake:focus-visible { opacity: 1; }
.booth-thanks { text-align: center; margin-top: clamp(20px, 3vw, 40px); font-size: clamp(22px, 3vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.booth-cam { position: relative; width: min(100%, calc((100dvh - 140px) * 4 / 3)); margin: 0 auto; aspect-ratio: 4 / 3; background: #000; }
.booth-cam[hidden] { display: none; }
.booth-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); filter: grayscale(1) contrast(1.2); }
.booth-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(120px, 22vw, 320px); font-weight: 700; letter-spacing: -0.05em; color: #fff; mix-blend-mode: difference; }
.booth-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.booth-flash.go { animation: booth-flash 520ms ease-out; }
@keyframes booth-flash { 0% { opacity: 1; } 100% { opacity: 0; } }

/* Contact row: the reply line sits where the hint used to be */
.contact-actions .reply-text { margin: 0 auto 0 0; max-width: 62ch; font-family: var(--f-mono); font-size: var(--t-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--mute); line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.email a, .email a * { cursor: none; }
.cursor-tag { position: fixed; top: 0; left: 0; z-index: 120; padding: 6px 9px 5px; background: var(--ink); color: var(--paper); pointer-events: none; white-space: nowrap; }
.cursor-tag.is-toast { top: auto; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 14px 9px; background: var(--signal); color: var(--on-signal); }


/* Grid play: everything floats and can be dragged */
.movable { translate: var(--gx, 0) var(--gy, 0); transition: translate 600ms cubic-bezier(.2, .9, .2, 1), rotate 700ms cubic-bezier(.2, .9, .2, 1), box-shadow 200ms; }
html.grid-play .movable, html.grid-play .movable * { cursor: grab !important; }
html.grid-play .movable { rotate: var(--tilt, 0deg); translate: var(--gx, 0) calc(var(--gy, 0px) + var(--lift, 0px)); touch-action: none; user-select: none; -webkit-user-select: none; animation: bob 5s ease-in-out var(--bob, 0s) infinite; }
html.grid-play .movable:hover { outline: 1px dashed var(--signal); outline-offset: 3px; }
html.grid-play .movable.dragging, html.grid-play .movable.dragging * { cursor: grabbing !important; }
html.grid-play [data-sleep-toggle] { cursor: pointer !important; }
html.grid-play .movable.dragging { position: relative; z-index: 85; transition: none; animation: none; background: var(--paper); box-shadow: 0 22px 48px rgba(0, 0, 0, 0.22); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { html.grid-play .movable { animation: none; } }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.filters.right { justify-content: flex-end; }
.filters button {
  margin: -2px -4px;
  padding: 2px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}
.filters button sup { margin-left: 4px; font-size: 10px; vertical-align: 2px; color: var(--mute); }
.filters button:hover { background: var(--signal); color: var(--on-signal); }
.filters button:hover sup { color: inherit; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filters button[aria-pressed="true"] sup { color: inherit; }

/* Work index */
.idx-head { padding-block: 0 8px; border-bottom: var(--rule); }
.row {
  align-items: center;
  min-height: 78px;
  padding-block: 12px 11px;
  border-bottom: var(--thin);
}
.row .ttl {
  font-size: var(--t-m);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.row .cl { font-size: var(--t-ui); line-height: 1.3; }
.row .th { display: none; }
.row:hover { background: var(--signal); color: var(--on-signal); }
.row:hover .muted { color: inherit; }
.preview {
  position: fixed;
  z-index: 60;
  top: 0;
  left: 0;
  width: clamp(220px, 24vw, 400px);
  pointer-events: none;
  border: var(--rule);
  background: var(--paper);
}
.preview img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.preview .ptext { display: none; gap: 14px; padding: 14px 16px 18px; }
.preview.is-text img { display: none; }
.preview.is-text .ptext { display: grid; }
.preview .ptext p { font-size: var(--t-m); font-weight: 500; letter-spacing: -0.02em; line-height: 1.18; text-wrap: pretty; }

/* Project rows (home) share the writing rows' cells */
.prow > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.prow .cl { font-size: var(--t-ui); }
/* Work index rows */
.wr.pr { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) max-content; }
.wr.pr .end { white-space: nowrap; }
.wr.pr .cl { font-size: var(--t-ui); }

/* Writing rows (home) */
.wrow { align-items: center; padding-block: 12px 11px; border-bottom: var(--thin); }
.wrow:first-of-type { border-top: var(--rule); }
.wrow:hover { background: var(--signal); color: var(--on-signal); }
.wrow:hover .muted { color: inherit; }

/* Contact block */
.contact { margin-top: clamp(96px, 12vw, 200px); padding-top: 12px; border-top: var(--rule); row-gap: 20px; }
.email {
  margin-top: clamp(16px, 3vw, 48px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.9;
  white-space: nowrap;
}
.email .fit { display: inline-block; }
.email a:hover { background: var(--signal); color: var(--on-signal); }
.contact-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px; margin-top: 24px; }
.btn {
  display: inline-block;
  margin: -2px -4px;
  padding: 2px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.btn:hover { background: var(--signal); color: var(--on-signal); }
.colophon { margin-top: 48px; padding-block: 10px 24px; border-top: var(--thin); row-gap: 8px; }
.colophon button { padding: 0; border: 0; background: none; cursor: pointer; text-transform: inherit; letter-spacing: inherit; font: inherit; }
.colophon a:hover, .colophon button:hover { background: var(--signal); color: var(--on-signal); }

/* Project page */
.crumbs { margin-top: 14px; align-items: baseline; }
.crumbs a:hover { background: var(--signal); color: var(--on-signal); }
.p-title { margin-top: clamp(36px, 6vw, 96px); }
.meta { margin-top: clamp(28px, 4vw, 56px); padding-top: 10px; border-top: var(--rule); row-gap: 18px; }
.meta dt { margin-bottom: 6px; color: var(--mute); }
.meta dd { font-size: var(--t-ui); line-height: 1.3; }
.p-lede { margin-top: clamp(40px, 5vw, 80px); }
.seq { display: grid; gap: clamp(56px, 7vw, 120px); margin-top: clamp(56px, 7vw, 120px); }
.seq .grid { align-items: end; row-gap: 12px; }
.seq .side-cap { padding-bottom: 2px; }
.seq .side-cap b { display: block; margin-bottom: 4px; font-size: var(--t-ui); font-weight: 600; }
.seq .note.grid, .note { align-items: start; row-gap: 12px; padding-top: 10px; border-top: var(--thin); }
.note p { font-size: var(--t-m); font-weight: 500; letter-spacing: -0.02em; line-height: 1.22; max-width: 34ch; }
.pair { row-gap: 32px; align-items: start !important; }
.next {
  margin-top: clamp(80px, 10vw, 160px);
  padding-block: 12px 28px;
  border-top: var(--rule);
  row-gap: 16px;
  align-items: end;
}
.next .title-xl { font-size: clamp(40px, 6.4vw, 120px); }
.next:hover { background: var(--signal); color: var(--on-signal); }
.next:hover .muted { color: inherit; }

/* Project media: full-width opener, then a mixed grid */
:root:has(main.project-page) { --side: clamp(20px, 5vw, 96px); }
.p-hero { margin-top: clamp(48px, 6vw, 96px); }
.p-body { margin-block: clamp(48px, 6vw, 96px) clamp(24px, 3vw, 48px); padding-top: 10px; border-top: var(--rule); row-gap: 16px; align-items: start; }
.p-body .prose > :first-child { margin-top: 0; }
/* project media keep their own proportions, so nothing designed into the frame is cropped */
.p-hero video, .p-hero img { display: block; width: 100%; height: auto; background: var(--hair); }
.mosaic .fig img, .mosaic .fig video { aspect-ratio: auto; height: auto; object-fit: initial; }
.mosaic { margin-top: var(--gutter); row-gap: clamp(28px, 3vw, 48px); align-items: start; }
.mosaic .m-1, .mosaic .m-full { grid-column: 1 / -1; }
.mosaic .m-2 { grid-column: span 6; }
.mosaic .m-3 { grid-column: span 4; }
.mosaic .m-full.note { margin-block: clamp(24px, 4vw, 64px); }
.mosaic .cap { justify-content: flex-start; gap: 4px 14px; padding-top: 6px; }

/* Writing index */
.w-title { margin-top: clamp(36px, 6vw, 96px); }
.w-intro { margin-top: clamp(28px, 4vw, 56px); padding-top: 12px; border-top: var(--rule); row-gap: 16px; }
.w-filters { margin-top: 28px; }
/* Optical compensation on Writing: the rule and the heavy year read closer than an image does */
.w-filters[data-filters="#writing-list"] { margin-top: clamp(32px, 3vw, 44px); }
#writing-list .yg:first-child { margin-top: clamp(56px, 7vw, 100px); }
.yg { margin-top: clamp(40px, 5vw, 72px); padding-top: 0; border-top: var(--rule); row-gap: 8px; align-items: start; }
.yg h2 {
  position: sticky;
  top: 64px;
  font-size: clamp(40px, 5vw, 88px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.85;
}
.wr {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 2fr) minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: center;
  padding-block: 10px 9px;
  border-bottom: var(--thin);
}
.yg h2 { padding-top: 10px; }
.wr .t { font-size: var(--t-m); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.wr:hover { background: var(--signal); color: var(--on-signal); }
.wr:hover .muted { color: inherit; }

/* Article */
.a-title { margin-top: clamp(36px, 6vw, 96px); font-size: clamp(44px, 7.2vw, 132px); }
.a-meta { margin-top: clamp(28px, 4vw, 56px); padding-top: 10px; border-top: var(--rule); row-gap: 18px; align-items: start; }
.a-meta dt { margin-bottom: 6px; color: var(--mute); }
.a-meta dd { font-size: var(--t-ui); line-height: 1.3; }
.sizer { display: flex; gap: 18px; }
.sizer .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.a-body { margin-top: clamp(48px, 6vw, 96px); align-items: start; row-gap: 24px; }
.a-side { position: sticky; top: 64px; display: grid; gap: 6px; }
.progress { height: 2px; background: var(--hair); }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); }
.prose { overflow-wrap: break-word; display: grid; gap: 1.1em; max-width: 64ch; }
.prose p { font-size: calc(var(--t-body) * var(--scale)); line-height: 1.5; }
.prose .standfirst { font-size: calc(var(--t-m) * var(--scale)); font-weight: 500; line-height: 1.25; letter-spacing: -0.015em; }
/* Markdown inside articles */
.prose h2, .prose h3, .prose h4 { margin-top: 0.8em; font-size: calc(var(--t-m) * var(--scale)); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.prose h4 { font-size: calc(var(--t-body) * var(--scale)); }
.prose ul, .prose ol { display: grid; gap: 0.5em; padding-left: 1.2em; font-size: calc(var(--t-body) * var(--scale)); line-height: 1.5; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li::marker { color: var(--mute); }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; overflow-wrap: anywhere; }
.prose a:hover { background: var(--signal); color: var(--on-signal); text-decoration: none; }
.prose blockquote:not(.pull) { margin: 0; padding-left: 1em; border-left: var(--rule); }
.prose blockquote:not(.pull) p { font-size: calc(var(--t-m) * var(--scale)); line-height: 1.3; }
.prose hr { width: 100%; height: 0; margin: 1em 0; border: 0; border-top: var(--thin); }
.prose img { width: 100%; }
.prose code { font-family: var(--f-mono); font-size: 0.9em; }
.pull {
  margin-inline: 0;
  margin-block: clamp(24px, 4vw, 56px);
  padding-block: 14px 18px;
  border-block: var(--rule);
}
.pull p { font-size: var(--t-l); font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
.a-end { margin-top: clamp(72px, 9vw, 140px); padding-top: 12px; border-top: var(--rule); row-gap: 24px; align-items: start; }
.a-end a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 4px; margin: -4px; min-width: 0; max-width: 100%; }
.a-end .mid { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.a-end a:hover { background: var(--signal); color: var(--on-signal); }
.a-end a:hover .muted { color: inherit; }

/* Phones and small tablets */
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid > * { grid-column: 1 / -1; }
  .end { justify-self: start; text-align: left; }
  .r1 { grid-row: auto; }
  .filters.right { justify-content: flex-start; }
  .hide-mob { display: none; }
  .a-end { column-gap: 16px; }
  .a-end > a:first-child { grid-column: 1 / 3; }
  .a-end > a:last-child { grid-column: 3 / -1; justify-self: end; text-align: right; }

  .bar { row-gap: 6px; }
  .bar .brand { grid-column: 1 / 3; }
  .bar nav { grid-column: 3 / -1; justify-content: flex-end; gap: 4px 12px; }
  .bar .hide-s { display: none; }

  .mega-desk { display: none; }
  .mega-mob { display: block; }
  .mega-mob .fit { display: block; width: max-content; }


  .row { grid-template-columns: 72px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: start; min-height: 0; }
  .row .th { display: block; grid-column: 1; grid-row: 1 / 3; }
  .row .th img { width: 72px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--hair); }
  .row .ttl { grid-column: 2; grid-row: 1; }
  .row .yr { grid-column: 3; grid-row: 1; }
  .row .cl { grid-column: 2 / -1; grid-row: 2; font-size: 14px; }
  .row .ds { display: none; }
  .idx-head { display: none; }

  .prow .cl { display: none; }
  .prow .t { white-space: normal; }
  .wr.pr { grid-template-columns: minmax(0, 1fr) auto; }
  .wr.pr .cl { grid-column: 1 / -1; grid-row: 3; font-size: 14px; }
  .wall .c-6, .wall .c-3 { grid-column: 1 / -1; }
  .mosaic .m-2 { grid-column: 1 / -1; }
  .mosaic .m-3 { grid-column: span 2; }
  .mosaic .m-3-end { grid-column: 1 / -1; }
  .wrow .date { grid-column: 1 / 3; }
  .wrow .type { grid-column: 3 / -1; justify-self: end; }
  .wrow .t { grid-row: 2; }

  .meta dl, .meta > div { grid-column: span 2; }
  .a-meta > div { grid-column: span 2; }
  .a-meta > .sizer-cell { grid-column: 1 / -1; }

  .seq .side-cap { order: 2; }

  .yg h2 { position: static; }
  .wr { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .wr .t { grid-column: 1 / -1; }

  .next .thumb { grid-row: 1; }
  /* ---- mobile pass ---- */
  html { overflow-x: clip; }
  /* section heads keep their link on the right */
  .sh { grid-template-columns: minmax(0, 1fr) auto; }
  .sh > * { grid-column: auto; }
  .sh .end { justify-self: end; text-align: right; }
  /* homepage tiles: title only */
  .feature .cap .mono { display: none; }
  /* homepage work list: title left, disciplines right */
  .wrow.prow { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline; }
  .wrow.prow .t { grid-column: 1; grid-row: 1; }
  .wrow.prow .type { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
  /* writing lists: title only */
  .wrow:not(.prow) .date, .wrow:not(.prow) .type { display: none; }
  .wrow:not(.prow) .t { grid-row: auto; }
  .wr:not(.pr) > .mono { display: none; }
  /* Work wall: no year */
  .tcap .num { display: none; }
  /* footer: copyright and photo booth on one line */
  .colophon { grid-template-columns: minmax(0, 1fr) auto; }
  .colophon > * { grid-column: auto; }
  .colophon [data-pagume], .colophon > .end { display: none; }
  /* contact: no mail-app link */
  .contact-actions .btn[href^="mailto:"] { display: none; }
  /* project: prev / count / next across the full width */
  .crumbs > :first-child { display: none; }
  .project-page .crumbs > .end { display: flex; justify-content: space-between; justify-self: stretch; }
  .next .thumb { display: none; }
  /* big titles never wider than the screen */
  .title-xl, .a-title, .next .title-xl { font-size: clamp(34px, 11vw, 64px); overflow-wrap: break-word; hyphens: auto; }
  /* Work wall: title and disciplines only */
  .tcap > .muted:not(.mono) { display: none; }
  /* project images: numbers only */
  .mosaic .cap .mono:not(.num) { display: none; }
  /* Selected Writing: year on the left, titles on the right, as on desktop */
  .yg { grid-template-columns: 64px minmax(0, 1fr); column-gap: 16px; }
  .yg > * { grid-column: auto; }
  .yg h2 { font-size: 26px; letter-spacing: -0.03em; line-height: 1; padding-top: 12px; }
  /* photo booth: the thank-you line doesn't dominate a small screen */
  .booth-thanks { font-size: 17px; letter-spacing: -0.02em; line-height: 1.15; }
  /* reading progress stays in view */
  .a-side { position: sticky; top: 38px; z-index: 30; padding-block: 8px; margin-inline: calc(var(--side) * -1); padding-inline: var(--side); background: var(--paper); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
