[hidden]:not([hidden=until-found i]) { display: none !important; }
/* Layout: an exhibition catalog on uncoated paper. Work sits as plates with museum-label captions;
   projects get an engineering title block; photos get a contact sheet with grease-pencil selects.
   Deliberate single (paper) theme. */
:root {
  color-scheme: light;
  --paper: #F2F0EA;
  --mat: #E7E3DA;
  --ink: #171614;
  --graphite: #67635C;
  --rule: #D3CEC3;
  --grease: #C4372A;
  --note: #F0E2A2;
  --serif: "Times New Roman", Times, Tinos, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --s-1: 0.75rem; --s0: 1rem; --s1: 1.125rem; --s2: 1.5rem; --s3: 2.25rem; --s4: 3.5rem; --s5: 5rem;
  --wrap: 1180px;
}
* { box-sizing: border-box; }
body {
  background: var(--paper); color: var(--ink);
  font: 400 var(--s0)/1.5 var(--sans);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; padding-bottom: 1px;
  background: linear-gradient(currentColor, currentColor) 50% 100% / 0 1px no-repeat;
  transition: background-size .28s cubic-bezier(.2,.7,.2,1); }
/* underline grows from the centre on hover; the current nav item keeps it */
a:hover, a:focus-visible, nav.site a[aria-current="page"] { background-size: 100% 1px; }
.plate, .mark, .name a { background: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; }
.mono { font-family: var(--mono); font-size: var(--s-1); letter-spacing: 0.02em; }
.muted { color: var(--graphite); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.fill { background: var(--note); padding: 0 4px; font-family: var(--mono); font-size: 0.85em; border-radius: 2px; white-space: nowrap; }

header.site { padding-block: var(--s0) var(--s0); border-bottom: 1px solid var(--ink); }
/* every page starts the same distance under the header rule */
main > section > :first-child { margin-top: var(--s2); }
main > section > .sechead:first-child { border-top: 0; padding-top: 0; }
.top { display: flex; flex-wrap: wrap; gap: var(--s0) var(--s3); justify-content: space-between; align-items: flex-start; }
nav.site { padding-top: 0.2rem; }
.lockup { display: flex; gap: 16px; align-items: center; }
.namerow { display: flex; align-items: center; gap: 12px; }
.mark { flex: none; display: block; }
.mark svg { height: 2.6rem; width: auto; aspect-ratio: 120 / 103; display: block; fill: currentColor; overflow: visible; }
/* the face blinks and its nose twitches now and then; different cycle lengths keep them from syncing up */
.face .eye { transform-box: fill-box; transform-origin: center; animation: blink 9s infinite; }
/* pivot sits at the right, where the nose meets the face, so only the tip moves */
.face .snout { transform-box: fill-box; transform-origin: 84% 25%; animation: twitch 7s 1.5s infinite; }
.face .snout.poke { animation: poke .5s; }
@keyframes blink {
  0%, 39%, 42%, 88%, 90.5%, 92%, 94.5%, 100% { transform: none; }
  40.5%, 89.3%, 93.3% { transform: scaleY(.1); }
}
@keyframes twitch {
  0%, 60%, 62%, 64.5%, 100% { transform: none; }
  61% { transform: rotate(5deg); }
  63.3% { transform: rotate(3.5deg); }
}
@keyframes poke {
  0%, 100% { transform: none; }
  15% { transform: rotate(6deg); }
  35% { transform: rotate(-2deg); }
  55% { transform: rotate(5deg); }
  75% { transform: rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) { .face .eye, .face .snout, .face .snout.poke { animation: none; } }
.id { flex: 1; min-width: 0; }
.name { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 3.6vw, 2.4rem); line-height: 1; margin: 0; letter-spacing: -0.015em; font-style: italic; }
.name a { text-decoration: none; }
.tag { margin: 12px 0 0; font-size: 0.9375rem; color: var(--graphite); }
nav.site { display: flex; gap: var(--s2); }
nav.site a { font-family: var(--mono); font-size: 0.8125rem; padding-bottom: 2px; }

.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s0);
  border-top: 1px solid var(--ink); padding-top: 10px; margin-top: var(--s3); margin-bottom: var(--s2); }
.sechead h2 { font: 500 var(--s-1)/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
.sechead a { font-family: var(--mono); font-size: var(--s-1); }

/* plates */
.plate { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; min-width: 0; }
.plate .frame { position: relative; overflow: hidden; background: var(--mat); }
.plate .frame img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.plate:hover .frame img { transform: scale(1.015); }
.label { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.9375rem; line-height: 1.35; }
.label .pl { font-family: var(--mono); font-size: var(--s-1); color: var(--graphite); padding-top: 1px; }
.label .t { font-weight: 500; }
/* hovering a project swipes the highlighter across its title */
.label .hl { font-weight: inherit; padding: 0 3px; margin: 0 -3px; border-radius: 2px;
  background: linear-gradient(var(--note), var(--note)) 0 0 / 0% 100% no-repeat; transition: background-size .3s cubic-bezier(.2,.7,.2,1); }
.plate:hover .hl, .plate:focus-visible .hl { background-size: 100% 100%; }
.label .t i { font-style: normal; font-weight: 400; color: var(--graphite); }
/* description slides up over the bottom of the image, so nothing below it moves */
.plate .note { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 14px 10px;
  background: linear-gradient(to top, rgba(23, 22, 20, .55), rgba(23, 22, 20, 0));
  color: var(--paper); font-size: 0.8125rem; line-height: 1.45; text-shadow: 0 1px 2px rgba(23, 22, 20, .35);
  opacity: 0; transform: translateY(6px); transition: opacity .3s ease, transform .4s cubic-bezier(.2,.7,.2,1); }
.plate:hover .note, .plate:focus-visible .note { opacity: 1; transform: none; }
@media (hover: none) { .plate .note { opacity: 1; transform: none; } }

/* one row; --cols (set by the template) makes each column as wide as its cover's aspect ratio, so all covers share a height */
.projects { display: grid; grid-template-columns: var(--cols, repeat(3, minmax(0, 1fr))); gap: var(--s3) var(--s2); }

.gallery { columns: 4; column-gap: var(--s0); }
.gallery button { all: unset; display: block; overflow: hidden; cursor: pointer; margin-bottom: var(--s0); break-inside: avoid; }
.gallery button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.gallery img { width: 100%; height: auto; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.gallery button:hover img { transform: scale(1.06); }

/* Work page carousel: two identical sets slide left by one set's width, then loop */
.carousel { overflow: hidden; padding-block: 22px 6px; margin-top: -22px; -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
.carousel .track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
/* keeps moving under the mouse; only pauses while a keyboard user is focused on an image */
.carousel:has(:focus-visible) .track { animation-play-state: paused; }
.carousel .set { display: flex; gap: var(--s0); padding-right: var(--s0); }
/* --lift (0–1) is set by site.js from how close each image is to the cursor */
.carousel button { all: unset; flex: none; display: block; cursor: pointer; --lift: 0;
  transform: translateY(calc(var(--lift) * -16px));
  box-shadow: 0 calc(var(--lift) * 14px) calc(var(--lift) * 26px) rgba(23, 22, 20, calc(var(--lift) * .22)); }
.carousel.settling button { transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease; }
.carousel button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.carousel img { height: 300px; width: auto; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .carousel { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .carousel .track { animation: none; }
  .carousel .set[aria-hidden] { display: none; }
}

footer.site { margin-top: var(--s3); border-top: 1px solid var(--ink); padding-block: var(--s0) var(--s4);
  display: flex; flex-wrap: wrap; gap: var(--s0) var(--s3); justify-content: space-between; }
footer.site ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px var(--s2); margin: 0; padding: 0; }
.copy { all: unset; cursor: pointer; font-family: var(--mono); font-size: var(--s-1); border-bottom: 1px solid var(--ink); }
.copy:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* project pages */
.back { font-family: var(--mono); font-size: var(--s-1); display: inline-block; margin-top: 0; }
.ptitle { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.1; letter-spacing: -0.015em; margin: var(--s2) 0 var(--s0); text-wrap: balance; }
.back + .ptitle { margin-top: var(--s0); }
.lede { font-size: var(--s1); line-height: 1.45; max-width: 40rem; margin: 0 0 var(--s3); text-wrap: pretty; }
.prose { max-width: 38rem; }
.prose p { margin: 0 0 0.75rem; line-height: 1.55; }
/* links inside body text get the highlighter; the hover underline still grows on top */
.prose p a { background-color: var(--note); padding: 0 3px; border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }


.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.steps li { display: grid; grid-template-columns: 3rem minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--s2); align-items: start; border-top: 1px solid var(--rule); padding-top: var(--s0); }
.steps .needed { aspect-ratio: 16 / 7; }
.steps .n { font-family: var(--mono); font-size: var(--s-1); color: var(--graphite); }
.steps h3 { margin: 0 0 4px; font-size: var(--s0); font-weight: 600; }
.steps p { margin: 0; color: var(--graphite); }
.steps .broke h3::after { content: "failed"; font-family: var(--mono); font-size: 0.6875rem; font-weight: 400; color: var(--grease); border: 1px solid var(--grease); padding: 0 5px; margin-left: 8px; vertical-align: 2px; text-transform: uppercase; letter-spacing: .06em; }
.needed { border: 1px dashed var(--graphite); aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; padding: var(--s0); color: var(--graphite); font-family: var(--mono); font-size: var(--s-1); }

.hero2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s3); align-items: start; margin-bottom: var(--s4); }
.hero2 figure { margin: 0; }
figcaption { font-family: var(--mono); font-size: var(--s-1); color: var(--graphite); margin-top: 8px; }

.cues { display: grid; gap: var(--s4); }
.cue { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: var(--s2); }
.cue .margin { font-family: var(--mono); font-size: var(--s-1); color: var(--graphite); border-right: 1px solid var(--rule); padding-right: var(--s0); display: grid; gap: 4px; align-content: start; }
.cue .margin b { color: var(--ink); font-weight: 500; font-size: 0.875rem; }
.cue figure { margin: 0; }
.cue img { width: 100%; }
.cue.tall img { max-width: 420px; }
.cue p { margin: 10px 0 0; line-height: 1.5; max-width: 38rem; }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s4); margin-top: var(--s2); }
/* columns stretch to equal height; the drawing floats midway in the space left under the text */
.about > .prose { display: flex; flex-direction: column; }
.about .ptitle { margin-top: 0; }
.idx { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.idx th { text-align: left; font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--graphite); padding: 0 0 8px; border-bottom: 1.5px solid var(--ink); }
.idx td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 0.9375rem; }
.idx td:first-child { font-family: var(--mono); font-size: var(--s-1); white-space: nowrap; padding-top: 14px; }
.idx td:last-child { font-family: var(--mono); font-size: var(--s-1); color: var(--graphite); padding-right: 0; padding-top: 14px; white-space: nowrap; }
.idx .sub { display: block; color: var(--graphite); font-size: 0.875rem; line-height: 1.4; margin-top: 2px; }
.portrait { margin: var(--s3) var(--s1) auto var(--s1); display: flex; align-items: flex-start; gap: 4px; }
.portrait img { width: 160px; height: auto; flex: none; }
.portrait figcaption { margin: 18px 0 0; display: flex; align-items: flex-start; gap: 6px; max-width: 15rem; font: italic 1.0625rem/1.3 var(--serif); color: var(--graphite); }
.portrait .arrow { flex: none; width: 52px; height: auto; fill: none; stroke: var(--graphite); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-top: 10px; }

/* viewer */
dialog { border: 0; padding: 0; background: transparent; overflow: visible; /* the image flies in from outside the dialog box; do not clip it */ max-width: min(92vw, 1100px); max-height: 92vh; }
dialog::backdrop { background: rgba(242, 240, 234, .96); }
dialog .in { display: grid; gap: 12px; justify-items: center; }
dialog img { max-height: 80vh; width: auto; max-width: 100%; box-shadow: 0 2px 30px rgba(23,22,20,.12); }
dialog .cap { display: flex; gap: var(--s2); justify-content: flex-end; width: 100%; color: var(--ink); align-items: baseline; }
dialog button.x { all: unset; cursor: pointer; font-family: var(--mono); font-size: var(--s-1); border-bottom: 1px solid var(--ink); white-space: nowrap; }
/* backdrop and Close fade while the image itself flies in from / back to its thumbnail (site.js) */
dialog[open]::backdrop, dialog[open] .cap { animation: fade-in .35s ease both; }
dialog.closing::backdrop, dialog.closing .cap { animation: fade-out .3s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

@media (max-width: 860px) {
  .gallery { columns: 3; }
  .about, .hero2 { grid-template-columns: minmax(0, 1fr); }
  .steps li { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .steps li > :last-child { grid-column: 2; }
}
@media (max-width: 600px) {
  .carousel img { height: 200px; }
  .projects { grid-template-columns: minmax(0, 1fr); }
  .gallery { columns: 2; }
  .cue { grid-template-columns: minmax(0, 1fr); }
  .cue .margin { border-right: 0; border-bottom: 1px solid var(--rule); padding: 0 0 8px; grid-auto-flow: column; justify-content: start; gap: 14px; }
  .mark svg { height: 2rem; }
  .lockup { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* page transitions (cross-document view transitions; browsers without support just navigate) */
@view-transition { navigation: auto; }
header.site { view-transition-name: site-header; }
main { view-transition-name: page; }
::view-transition-old(page) { animation: page-out .1s cubic-bezier(.4,0,1,1) both; }
::view-transition-new(page) { animation: page-in .18s cubic-bezier(.2,.7,.2,1) .08s both; }
::view-transition-group(*), ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .15s; }
@keyframes page-out { to { opacity: 0; transform: translateY(18px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(page), ::view-transition-new(page) { animation-duration: .01s; animation-delay: 0s; }
}
