/* Layout: a black room. The work page is only images: a gapless three-up grid
   with titles set on the thumbnails, and a footer set like a letterhead. No accent colour; the work supplies it. */
:root {
  --paper: #000000;
  --ink: #f0f0ec;
  --mute: #75756f;
  --rule: #262624;
  --tile: #121211;

  --sans: Arial, "Helvetica Neue", Helvetica, sans-serif;
  --mono: Arial, "Helvetica Neue", Helvetica, sans-serif;

  --fs-s: 0.875rem;                                  /* captions, UI */
  --fs-m: var(--fs-s);                               /* one size everywhere */
  --fs-xl: var(--fs-s);
  --gutter: clamp(12px, 1.2vw, 20px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-s);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
/* footer sits at the bottom even on short pages */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img, video, canvas { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.mono { font-family: var(--mono); font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.label { color: var(--mute); }

.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* Header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding-block: 16px; background: var(--paper);
}
.brand { font-weight: 500; }
.nav { display: flex; gap: 20px; }
.nav a { color: var(--mute); transition: color .15s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Work grid: three up, edge to edge, no gaps, title on the image */
.grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.card { position: relative; display: block; min-width: 0; }
.media { position: relative; overflow: hidden; background: var(--tile); aspect-ratio: 4 / 5; max-width: 100%; }
.media canvas, .media img, .media video { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }

.card-meta { position: absolute; left: 0; bottom: 0; max-width: 100%; z-index: 1; }
.card-meta h3 {
  display: block; margin: 0; padding: 8px 14px;
  font-size: var(--fs-s); font-weight: 400; line-height: 1.3;
  color: #fff; background: #000;
  transition: background-color .12s, color .12s;
}
.card:hover .card-meta h3, .card:focus-visible .card-meta h3 { color: #000; background: #fff; }
.card.is-hidden { display: none; }

/* Every page's content starts directly under the header, at the same height */
/* Archive (index list): a light page, nothing but the list */
body.is-archive, body.is-info { --paper: #ffffff; --ink: #000000; --mute: #8a8a85; --rule: #e6e6e2; --tile: #f2f2ef; color-scheme: light; }
body { transition: background-color .2s, color .2s; }

.index { padding-block: 0 72px; }
.row {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 3fr) minmax(0, 3fr) 4rem; column-gap: var(--gutter);
  padding-block: 3px; align-items: baseline; line-height: 1.25;
}
.row > * { min-width: 0; }
.row .d { color: var(--mute); }
.row .y { text-align: right; }
.row.head { color: var(--mute); padding-block: 0 4px; line-height: 1.3; }
a.row { transition: color .15s; }
.index:hover a.row { color: var(--mute); }
.index:hover a.row:hover { color: var(--ink); }
.row.is-hidden { display: none; }
.peek {
  position: fixed; left: 0; top: 0; width: 240px; aspect-ratio: 4 / 5; z-index: 20;
  pointer-events: none; opacity: 0; transition: opacity .15s; background: var(--tile);
}
.peek.on { opacity: 1; }
.peek canvas, .peek img, .peek video { width: 100%; height: 100%; object-fit: cover; }

/* Project page */
.p-head { padding-block: 0 40px; display: flex; flex-direction: column; gap: 24px; }
.p-title { margin: 0; max-width: 18em; font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.p-summary { margin: 0; font-size: var(--fs-m); line-height: 1.35; max-width: 42ch; }
.p-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gutter); border-top: 1px solid var(--rule); padding-top: 12px; }
.p-facts div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.p-facts .mono { font-family: var(--sans); font-size: var(--fs-s); color: var(--mute); text-transform: none; }
.p-media { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gutter); padding-block: 0 24px; }
.p-media .media { aspect-ratio: 4 / 5; }
.p-media .media.full { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.p-next { display: flex; justify-content: space-between; gap: 16px; padding-block: 20px 56px; }
.p-next a { color: var(--mute); }
.p-next a:hover { color: var(--ink); }

/* Info: light page, bio / portrait / clients / publications in four columns */
.about {
  padding-block: 0 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px var(--gutter); align-items: start;
  font-size: var(--fs-s); line-height: 1.3;
}
.about-bio { margin: 0; font-weight: 700; max-width: 30ch; }
.about-photo { margin: 0; }
/* photo is capped to the screen height so Info fits one screen and the footer lands where it does on Archive */
.about-photo img { width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 200px); }
.about-list h2 { margin: 0 0 1.3em; font-size: inherit; font-weight: 700; }
.about-list ul { list-style: none; margin: 0; padding: 0; }
.about-list a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.about-list a:hover { text-decoration: none; }

/* Footer, set like a letterhead */
.site-foot {
  padding-block: 20px 28px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px var(--gutter);
}
.foot-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.foot-col:first-child { grid-column: span 2; }
.foot-col a:hover { color: var(--mute); }
.foot-end { text-align: right; }

/* Cookie card: sharp glass panel, bottom right */
.cookies {
  position: fixed; z-index: 30;
  right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  width: min(380px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  padding: 4px 16px 16px;
  color: #fff; background: rgb(150 150 160 / .38);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgb(255 255 255 / .25);
  font-size: var(--fs-s); line-height: 1.3;
}
.cookies h2 { margin: 0; padding: 12px 0; font-size: inherit; font-weight: 400; text-transform: uppercase; border-bottom: 1px solid rgb(255 255 255 / .6); }
.cookie-opt { display: block; padding: 12px 0; border-bottom: 1px solid rgb(255 255 255 / .6); cursor: pointer; }
.cookie-opt input { margin: 0 6px 0 0; vertical-align: -1px; accent-color: #fff; }
.cookie-opt input:disabled { cursor: default; }
.cookie-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-top: 14px; }
.cookie-actions button { padding: 10px 8px; color: #fff; background: rgb(255 255 255 / .18); transition: background-color .15s, color .15s; }
.cookie-actions button:hover { background: #fff; color: #000; }
.cookie-actions button:focus-visible { outline-color: #fff; }

[hidden] { display: none !important; }
.view { animation: fade .5s ease both; }
@keyframes fade { from { opacity: .4; } to { opacity: 1; } }

@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .about-bio { grid-column: 1 / -1; }
  .about-photo { grid-column: 1 / -1; max-width: 560px; }
  .row { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) 3.5rem; }
  .row .d { display: none; }
}
@media (max-width: 560px) {
  .p-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .p-media { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr) 3.5rem; }
  .row .c { display: none; }
  .site-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-end { grid-column: 1 / -1; text-align: left; }
  .peek { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
  .media canvas, .media img, .media video { transition: none; }
  .card:hover .media > * { transform: none; }
}
