:root {
  color-scheme: light;
  --bg: #ffffff;          /* matches the video's background exactly */
  --ink: #0a0a0a;
  --muted: #8a8a8a;
  --line: #e6e6e6;
  --gutter: clamp(16px, 2.6vw, 48px);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
/* The site is intentionally light in every mode so it sits seamlessly with the video. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #ffffff; --ink: #0a0a0a; } }
:root[data-theme="dark"] { --bg: #ffffff; --ink: #0a0a0a; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); }
body { font-family: var(--mono); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }

/* ---------- contact (top right, shared) ---------- */
.contact {
  position: absolute; top: var(--gutter); right: var(--gutter); z-index: 10;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.contact .email { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.contact .icons { display: flex; gap: 6px; }
.contact .icons a { display: block; width: 28px; height: 28px; transition: opacity .2s; }
.contact .icons a:hover, .contact .email:hover { opacity: .5; }
.contact svg { width: 100%; height: 100%; display: block; }

/* ---------- landing ---------- */
.landing { position: fixed; inset: 0; overflow: hidden; }
.landing video {
  position: absolute; top: 50%; left: 50%;
  width: 100vw; height: 100vh; object-fit: contain;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.projects {
  position: fixed; right: var(--gutter); bottom: clamp(48px, 8vh, 110px); z-index: 10;
  list-style: none; text-align: right;
}
.projects { margin-right: -0.4em; }
.projects li + li { margin-top: 0.42em; }
.projects a {
  display: block;   /* every bar spans the full width of the list */
  font-size: clamp(14px, 1.05vw, 20px); letter-spacing: 0.12em; text-transform: uppercase;
  line-height: 1.55; padding: 0 0.4em 0 4em;
  background: transparent;
  transition: background-color .45s cubic-bezier(.4,0,.2,1), color .45s cubic-bezier(.4,0,.2,1);
}
.projects a:hover, .projects a:focus-visible { background: var(--ink); color: var(--bg); outline: none; }

@media (max-aspect-ratio: 1/1) {
  .landing video { width: 175vw; height: auto; top: 42%; transform: translate(-45%, -50%); }
}
@media (max-width: 600px) {
  .projects { left: var(--gutter); }
  .projects a { font-size: 13px; letter-spacing: 0.1em; }
}

/* ---------- project pages ---------- */
.back {
  position: fixed; top: var(--gutter); left: var(--gutter); z-index: 10;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.back:hover { opacity: .5; }
.project { padding: calc(var(--gutter) + 120px) var(--gutter) var(--gutter); max-width: 1600px; margin: 0 auto; }
.project h1 {
  font-weight: 400; font-size: clamp(26px, 4.4vw, 72px); letter-spacing: 0.04em;
  text-transform: uppercase; line-height: 1.05;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 8px 40px; margin: 28px 0 56px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.meta b { font-weight: 400; color: var(--ink); }
.intro { max-width: 62ch; font-size: 14px; line-height: 1.7; margin-bottom: 64px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(12px, 1.6vw, 28px); }
.gallery .wide { grid-column: 1 / -1; }
.gallery figure {
  aspect-ratio: 4 / 5; background: #f1f1f1; display: grid; place-items: center;
  font-size: 11px; letter-spacing: 0.12em; color: var(--muted);
}
.gallery .wide { aspect-ratio: 16 / 9; }
.gallery img, .gallery video { width: 100%; height: 100%; object-fit: cover; display: block; }
.next {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--line); margin-top: 96px; padding-top: 24px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.next a:hover { opacity: .5; }
.next .title { font-size: clamp(16px, 1.6vw, 24px); letter-spacing: 0.08em; }
@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr; }
  .project { padding-top: 140px; }
}

/* ---------- logo (project pages) ---------- */
.logo { position: absolute; top: calc(var(--gutter) * 0.75); left: calc(var(--gutter) * 1.8); z-index: 10; display: block; }
.logo img { display: block; width: clamp(140px, 14vw, 280px); height: auto; transition: opacity .3s; }
.logo:hover img { opacity: .55; }

/* ---------- carousel page ---------- */
html:has(.carousel-page), .carousel-page { overflow-x: clip; }
.carousel-page main { overflow: hidden; }
.carousel-page main { padding-top: clamp(150px, 13.5vw, 280px); padding-bottom: clamp(40px, 3vw, 64px); }
.about {
  margin-left: calc(var(--gutter) * 1.8); max-width: 50ch;
  font-size: clamp(11px, 0.68vw, 14px); line-height: 1.4; letter-spacing: 0.02em; text-transform: uppercase;
}
.carousel {
  --w: 60vw; --gap: 5.2vw; --ratio: 1.414; --side-scale: 0.6;
  --shift: calc(var(--w) * (1 + var(--side-scale)) / 2 + var(--gap));
  position: relative; height: calc(var(--w) / var(--ratio)); margin-top: clamp(40px, 4.6vw, 96px);
}
/* posters: portrait, side posters fully visible */
.carousel--posters { --w: 42.4vw; --gap: 2.1vw; --ratio: 0.7072; --side-scale: 0.59; margin-top: clamp(30px, 3.9vw, 80px); }
.slide {
  position: absolute; top: 0; left: 50%; width: var(--w); height: 100%; margin-left: calc(var(--w) / -2);
  background: #f2f2f2; overflow: hidden; cursor: pointer;
  display: grid; place-items: center;
  transform: translateX(calc(var(--k, 0) * var(--shift))) scale(var(--s, 1));
  opacity: var(--o, 1);
  transition: transform .8s cubic-bezier(.65, 0, .35, 1), opacity .8s cubic-bezier(.65, 0, .35, 1);
  will-change: transform;
}
.slide span { font-size: 11px; letter-spacing: 0.12em; color: #555; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: cover; display: block; grid-area: 1 / 1; user-select: none; -webkit-user-drag: none; }
.slide.is-side:hover { opacity: .8; }
@media (max-width: 700px) {
  .carousel { --w: 80vw; --gap: 4vw; }
  .carousel--posters { --w: 62vw; --gap: 3vw; }
  .carousel-page main { padding-top: 130px; }
  .contact .email { font-size: 9px; }
}

/* ---------- stacked boards page ---------- */
.stack-page main { padding-top: clamp(150px, 13.5vw, 280px); padding-bottom: clamp(60px, 6vw, 120px); }
.stack { margin-top: clamp(30px, 3vw, 64px); }
.stack img {
  display: block; width: 100%; height: auto;
  opacity: 0; transform: translateY(24px);
  transition: opacity 1s cubic-bezier(.4,0,.2,1), transform 1s cubic-bezier(.4,0,.2,1);
}
.stack img.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .stack img { opacity: 1; transform: none; transition: none; } }
@media (max-width: 700px) { .stack-page main { padding-top: 130px; } }
.stack img.photo { margin-bottom: clamp(24px, 3vw, 64px); }

/* ---------- confidential grid page ---------- */
.grid-page main { padding-top: clamp(150px, 13.5vw, 280px); padding-bottom: clamp(60px, 6vw, 120px); }
.grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  column-gap: 2.55vw; row-gap: 2.4vw;
  margin: clamp(40px, 4vw, 80px) calc(var(--gutter) * 1.8) 0;
}
.cell {
  aspect-ratio: 1.9 / 1; overflow: hidden;
  display: grid; place-items: center;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.cell span { font-size: 10px; letter-spacing: 0.12em; color: #aaa; }
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); column-gap: 10px; row-gap: 10px; margin-left: var(--gutter); margin-right: var(--gutter); } .grid-page main { padding-top: 130px; } }

/* ---------- wayfinding (two projects) ---------- */
.carousel--wayfinding { --ratio: 1.5; }
.carousel--wayfinding .slide { background: #fff; }
.carousel--wayfinding .slide img { object-fit: contain; }
.carousel--wayfinding .slide:not(:has(img)) { background: #f2f2f2; }
.wf-project + .wf-project { margin-top: clamp(90px, 9vw, 180px); }
.wf-title {
  margin: 0 0 14px calc(var(--gutter) * 1.8);
  font-weight: 400; font-size: clamp(12px, 0.8vw, 15px); letter-spacing: 0.14em; text-transform: uppercase;
}
.carousel--wf-plans { --ratio: 2; }

/* ---------- footer ---------- */
.site-footer {
  padding: clamp(60px, 6vw, 120px) calc(var(--gutter) * 1.8) calc(var(--gutter) * 0.9);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
}
/* landing page doesn't scroll, so the footer sits in the bottom-left corner */
.landing ~ .site-footer, body:has(.landing) .site-footer {
  position: fixed; left: var(--gutter); bottom: calc(var(--gutter) * 0.9); padding: 0; z-index: 10;
}
@media (max-width: 600px) {
  body:has(.landing) .site-footer { bottom: 14px; font-size: 9px; }
  body:has(.landing) .projects { bottom: 56px; }
}
