@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Geist Serif";
  src: url("fonts/GeistSerifVF.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #fff;
  --ink: #0a0a0a;
  --ink-2: #525252;
  --ink-3: #8a8a8a;
  --line: #e8e8e8;
  --tint: #f5f5f5;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Geist Serif", ui-serif, Georgia, "Times New Roman", serif;
  --wrap: 960px;
  --gutter: clamp(20px, 5vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.site-header, main, .site-footer {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* header / footer */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding-block: 28px;
  font-size: 15px;
}
.brand { display: block; line-height: 0; }
.brand img { width: 36px; height: 36px; border-radius: 50%; filter: grayscale(1); }
.site-header nav { display: flex; gap: 24px; color: var(--ink-2); }
.site-header nav a:hover, .site-footer a:hover { color: var(--ink); }
.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 120px; padding-block: 32px 48px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-3);
}

/* type */
h1, h2 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.025em; }
h1 { font-size: clamp(38px, 6.4vw, 68px); line-height: 1.04; }
.lede { font-size: clamp(18px, 2.2vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 36em; margin: 0; }
.label {
  font: 500 13px/1.4 var(--sans); letter-spacing: 0.02em; color: var(--ink-3); margin: 0;
}

/* hero */
html, body { overflow-x: clip; }
.hero {
  position: relative; min-height: 660px;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding-block: 32px;
}
.hero > :not(.stream-wrap) { position: relative; z-index: 1; }
.hero h1, .hero .lede { text-shadow: 0 0 14px #fff, 0 0 28px #fff, 0 0 48px #fff; }

/* waterfall of work: screens glide in from beyond the right edge at a constant pace and recede
   to a vanishing point under the text. The slide-in is the same straight line as the recede, so
   there is no change of speed (perspective 1000px; depth stops keep the on-screen scale falling evenly). */
.stream-wrap {
  position: absolute; z-index: 0; pointer-events: none;
  top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw;
}
/* white wash between the screens and the text */
.stream-wrap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, #fff 0%, #fff 42%, rgba(255,255,255,.93) 56%, rgba(255,255,255,.6) 69%, rgba(255,255,255,0) 87%);
}
.stream {
  --in: max(340px, 28.5vw); /* how far off-screen each card waits; scales with the screen so pace stays even */
  position: absolute; inset: 0;
  perspective: 1000px; perspective-origin: 16% 50%;
  transform-style: preserve-3d;
}
.card {
  --w: 300px; --h: 214px;
  position: absolute;
  left: calc(100% - var(--w) - 32px); top: calc(50% + var(--y, 0px)); margin-top: calc(var(--h) / -2);
  width: var(--w); height: var(--h);
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .09);
  opacity: 1;
  animation: flow var(--dur, 48s) linear infinite;
}
.card.portrait { --w: 150px; --h: 270px; }
.card img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card.photo img { object-fit: cover; padding: 0; }
@keyframes flow { /* slide in, then recede; depth strictly decreases so paint order never flips */
  0% { transform: translate3d(var(--in), 0, 0); }
  33% { transform: translate3d(0, 0, -24px); }
  38.6% { transform: translate3d(0, 0, -107px); }
  44.2% { transform: translate3d(0, 0, -204px); }
  49.8% { transform: translate3d(0, 0, -320px); }
  55.3% { transform: translate3d(0, 0, -461px); }
  60.9% { transform: translate3d(0, 0, -636px); }
  66.5% { transform: translate3d(0, 0, -858px); }
  72.1% { transform: translate3d(0, 0, -1149px); }
  77.7% { transform: translate3d(0, 0, -1550px); }
  83.2% { transform: translate3d(0, 0, -2133px); opacity: 1; }
  88.8% { transform: translate3d(0, 0, -3063px); }
  94.4% { transform: translate3d(0, 0, -4779px); }
  100.0% { transform: translate3d(0, 0, -9000px); opacity: 0; }
}
@keyframes flow-m { /* phones: slide-in takes half the cycle */
  0% { transform: translate3d(var(--in), 0, 0); }
  50% { transform: translate3d(0, 0, -24px); }
  54.2% { transform: translate3d(0, 0, -107px); }
  58.3% { transform: translate3d(0, 0, -204px); }
  62.5% { transform: translate3d(0, 0, -320px); }
  66.7% { transform: translate3d(0, 0, -461px); }
  70.8% { transform: translate3d(0, 0, -636px); }
  75.0% { transform: translate3d(0, 0, -858px); }
  79.2% { transform: translate3d(0, 0, -1149px); }
  83.3% { transform: translate3d(0, 0, -1550px); }
  87.5% { transform: translate3d(0, 0, -2133px); opacity: 1; }
  91.7% { transform: translate3d(0, 0, -3063px); }
  95.8% { transform: translate3d(0, 0, -4779px); }
  100.0% { transform: translate3d(0, 0, -9000px); opacity: 0; }
}
@media (max-width: 900px) { .card { --w: 220px; --h: 157px; } .card.portrait { --w: 110px; --h: 198px; } .hero { min-height: 600px; } }
@media (max-width: 720px) {
  .card { --w: 170px; --h: 121px; animation-name: flow-m; } .card.portrait { --w: 86px; --h: 155px; }
  .stream { --in: 230px; perspective-origin: 30% 50%; } .hero { min-height: 560px; }
  .stream-wrap::after { background: linear-gradient(to right, rgba(255,255,255,.94) 0%, rgba(255,255,255,.9) 70%, rgba(255,255,255,.5) 100%); }
}
.hero h1 { max-width: 12em; margin-bottom: 24px; }
.hero .lede { margin-bottom: 36px; }
.button {
  display: inline-block; padding: 11px 20px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 500;
  transition: background .15s;
}
.button:hover { background: #333; }

/* clients */
.clients { padding-block: 40px 56px; border-top: 1px solid var(--line); }
.logos {
  display: flex; flex-wrap: wrap; align-items: center; gap: 28px 48px; margin-top: 28px;
}
.logos img { height: var(--h, 26px); width: auto; transform: translateY(var(--dy, 0)); filter: grayscale(1) opacity(.55); transition: filter .2s; }
.logos img:hover { filter: grayscale(1) opacity(1); }

/* work list */
.work { padding-top: 56px; border-top: 1px solid var(--line); }
.rows { margin-top: 20px; }
.row {
  display: grid; grid-template-columns: 120px 180px 1fr 24px; gap: 16px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  transition: padding .2s, background .2s;
}
.rows li:first-child .row { border-top: 1px solid var(--line); }
.row-year { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.row-title { font-family: var(--serif); font-size: 26px; letter-spacing: -0.02em; line-height: 1.2; }
.row-sum { color: var(--ink-2); font-size: 15px; }
.row-arrow { color: var(--ink-3); transition: transform .2s, color .2s; text-align: right; }
.rows .row { transition: opacity .2s; }
@media (hover: hover) { .rows:hover .row:not(:hover):not(:focus-visible) { opacity: .4; } }

/* hover preview (see home.js) */
.peek {
  position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none;
  display: flex; gap: 8px; padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .14);
  opacity: 0; transition: opacity .15s, transform .12s ease-out;
}
.peek.on { opacity: 1; }
.peek img { height: 150px; width: auto; max-width: 260px; object-fit: contain; border-radius: 10px; background: var(--tint); padding: 6px; }
.row:hover .row-arrow { transform: translateX(4px); color: var(--ink); }
.row:hover .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }

/* project page */
.project { padding-top: 24px; }
.back { display: inline-block; font-size: 14px; color: var(--ink-3); margin-bottom: 40px; }
.back:hover { color: var(--ink); }
.project h1 { margin-bottom: 32px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 56px; margin: 0 0 32px; padding: 20px 0; border-block: 1px solid var(--line); }
.meta dt { font: 500 13px/1.4 var(--sans); color: var(--ink-3); margin-bottom: 2px; }
.meta dd { margin: 0; font-size: 15px; }
.ext { border-bottom: 1px solid var(--ink-3); }
.ext:hover { border-color: var(--ink); }

.gallery { display: grid; gap: 16px; margin-top: 64px; }
.frame {
  margin: 0; background: var(--tint); border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.frame img { width: 100%; height: auto; }
.frame.wide { padding: clamp(20px, 5vw, 56px); }
.frame.wide img { max-height: 640px; width: auto; max-width: 100%; margin-inline: auto; }
.frame.photo { padding: 0; }
.frame.photo img { width: 100%; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.frame.tall { padding: clamp(24px, 4vw, 48px); }
.frame.tall img { max-height: 560px; width: auto; max-width: 100%; }

.next {
  display: block; margin-top: 96px; padding: 28px 0; border-top: 1px solid var(--line);
}
.next-title { display: block; font-family: var(--serif); font-size: clamp(30px, 5vw, 48px); letter-spacing: -0.025em; line-height: 1.15; margin-top: 6px; transition: transform .2s; }
.next:hover .next-title { transform: translateX(6px); }

@media (max-width: 720px) {
  .row { grid-template-columns: 1fr 24px; gap: 2px 16px; }
  .row-year { grid-column: 1; grid-row: 1; }
  .row-title { grid-column: 1; grid-row: 2; }
  .row-sum { grid-column: 1; grid-row: 3; }
  .row-arrow { grid-column: 2; grid-row: 2; }
  .site-footer { margin-top: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card { animation-play-state: paused; }
  * { transition: none !important; }
}
