:root {
  --ink: #1b1c1e;
  --muted: #6e7074;
  --line: #e2e3e5;
  --paper: #ffffff;
  --accent: #8a6b2f;
  --gutter: clamp(16px, 6vw, 120px);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.52;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* header */
.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px var(--gutter) 0;
  max-width: 1360px;
  margin: 0 auto;
}
/* On home the header shares the hero's 1120px column, so the name sits over the portrait's left edge. */
body[data-page="/"] .top { max-width: calc(1120px + 2 * var(--gutter)); }
.wordmark { white-space: nowrap; font-weight: 700; font-size: 1.22rem; text-decoration: none; letter-spacing: -0.01em; }
.topnav { display: flex; gap: 22px; font-size: 0.95rem; color: var(--muted); }
.topnav a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.topnav a:hover { text-decoration-color: currentColor; }

/* home */
.home { min-height: calc(100vh - 60px); display: flex; align-items: center; padding: 40px var(--gutter) 64px; }
.home-grid {
  display: grid;
  grid-template-columns: minmax(260px, 372px) minmax(0, 640px);
  gap: clamp(32px, 8vw, 104px);
  align-items: center;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}
.card {
  position: relative;
  margin: 0;
  aspect-ratio: 0.742;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 22% 12%, #fafafa 0%, #ededee 48%, #e2e3e5 100%);
}
.card-arc { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #c9cacd; stroke-width: 1px; }
.card-tag {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.card-mono {
  position: absolute;
  left: 7%;
  bottom: 3%;
  font-size: clamp(5.5rem, 24cqw, 9rem);
  line-height: 0.82;
  font-weight: 700;
  letter-spacing: -0.07em;
}
/* Silver sheen: site.js writes the pointer position into --mx/--my and a small tilt into --rx/--ry.
   ::before is the specular hotspot that follows the cursor, ::after a diagonal glint band through it.
   Both paint under the arc, tag and monogram because those come later in the DOM. */
:root { --sheen-t: 420ms; }
@media (prefers-reduced-motion: reduce) { :root { --sheen-t: 0ms; } }
.card {
  container-type: inline-size;
  --mx: 30%;
  --my: 20%;
  --rx: 0deg;
  --ry: 0deg;
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform var(--sheen-t) ease, box-shadow var(--sheen-t) ease;
}
.card.is-lit { transition: transform 120ms linear, box-shadow var(--sheen-t) ease; box-shadow: 0 18px 40px -18px rgba(27, 28, 30, 0.35); }
.card::before,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--sheen-t) ease;
}
.card::before {
  /* hotspot, then the metal falling off into cool gray away from the light */
  background:
    radial-gradient(circle at var(--mx) var(--my), #ffffff 0%, rgba(255, 255, 255, 0.96) 4%, rgba(255, 255, 255, 0.55) 12%, rgba(255, 255, 255, 0) 30%),
    radial-gradient(120% 100% at var(--mx) var(--my), rgba(0, 0, 0, 0) 18%, rgba(70, 78, 92, 0.22) 62%, rgba(36, 40, 50, 0.38) 100%);
}
.card::after {
  /* a glint band through the hotspot and a faint brushed grain */
  background:
    linear-gradient(118deg,
      rgba(255, 255, 255, 0) calc(var(--mx) - 16%),
      rgba(255, 255, 255, 0.7) var(--mx),
      rgba(255, 255, 255, 0) calc(var(--mx) + 16%)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, rgba(20, 24, 32, 0.022) 1px 3px);
}
.card.is-lit::before,
.card.is-lit::after { opacity: 1; }
.card-arc, .card-tag, .card-mono { z-index: 1; }
.card-arc { transition: stroke var(--sheen-t) ease; }
.card.is-lit .card-arc { stroke: #b4b7bd; }
.bio p { font-size: clamp(1.12rem, 1.4vw, 1.3rem); margin: 0 0 1.1em; }
.bio p a, .links a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 2.6em; font-size: 1rem; }

/* splash */
.splash { display: none; }
html.intro .home { opacity: 0; }
html.intro.intro-done .home { opacity: 1; transition: opacity 420ms ease; }
html.intro .splash {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--paper);
  cursor: pointer;
}
html.intro.intro-done .splash { opacity: 0; transition: opacity 360ms ease; pointer-events: none; }
html.intro.intro-off .splash { display: none; }
.pile { position: relative; width: min(46vw, 300px); aspect-ratio: 4 / 3; }
.sp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 10px 24px rgba(0,0,0,.18);
  opacity: 0;
  transform: translate3d(0, -70vh, 0) rotate(calc(var(--r) * 2)) scale(1.06);
  --r: 0deg;
}
.sp:nth-child(1) { --r: -6deg; }
.sp:nth-child(2) { --r: 5deg; }
.sp:nth-child(3) { --r: -2deg; }
.sp:nth-child(4) { --r: 8deg; }
.sp:nth-child(5) { --r: -5deg; }
.sp:nth-child(6) { --r: 3deg; }
.sp:nth-child(7) { --r: -1deg; }
html.intro-go .sp {
  animation: drop 300ms cubic-bezier(.2,.8,.3,1) forwards;
  animation-delay: calc(var(--i) * 95ms);
}
@keyframes drop {
  0%   { opacity: 0; transform: translate3d(0, -70vh, 0) rotate(calc(var(--r) * 2)) scale(1.06); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotate(var(--r)) scale(1); }
}

/* projects index */
.index, .catpage { padding: 56px var(--gutter) 96px; max-width: 1360px; margin: 0 auto; }
.huge {
  font-size: clamp(3.2rem, 8vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}
.dim { color: var(--muted); font-weight: 400; }
.sub { color: var(--muted); font-size: 1.12rem; margin: 20px 0 0; }
.cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 56px 40px;
  margin-top: 64px;
}
.cat { display: block; text-decoration: none; }
.stack { position: relative; display: block; aspect-ratio: 1.3; }
.print {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80%;
  aspect-ratio: 4 / 3;
  padding: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 8px 22px rgba(0,0,0,.16);
  transform: translate(-50%, -50%) translate(var(--x), var(--y)) rotate(var(--r));
  transition: transform 320ms cubic-bezier(.2,.7,.2,1);
}
.print img { width: 100%; height: 100%; object-fit: cover; }
.p0 { --x: -8%; --y: -6%; --r: -5deg; }
.p1 { --x: 6%; --y: 0%; --r: 7deg; }
.p2 { --x: 0%; --y: 6%; --r: 3deg; }
.cat:hover .p0, .cat:focus-visible .p0 { --x: -14%; --y: -9%; --r: -9deg; }
.cat:hover .p1, .cat:focus-visible .p1 { --x: 11%; --y: -2%; --r: 11deg; }
.cat:hover .p2, .cat:focus-visible .p2 { --x: 1%; --y: 8%; --r: 1deg; }
.num {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.72rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  padding: 3px 7px;
  letter-spacing: 0.04em;
}
.cat-title { display: block; margin-top: 8px; font-weight: 700; font-size: 1.22rem; letter-spacing: -0.01em; }
.cat:hover .cat-title { color: var(--accent); }

/* category page */
.crumb { margin: 0 0 18px; font-size: 1rem; color: var(--muted); }
.crumb a { color: var(--ink); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.catpage hr { margin: 28px 0 24px; }
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #efefef;
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; }
.cap {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
  font-size: 0.78rem;
  line-height: 1.35;
  color: #fff;
  background: rgba(18, 18, 20, 0.78);
  padding: 5px 8px;
  opacity: 0;
  transition: opacity 160ms ease;
}
.tile:hover .cap, .tile:focus-visible .cap { opacity: 1; }
@media (hover: none) { .cap { opacity: 1; } }
.ai {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(18, 18, 20, 0.78);
  padding: 4px 6px;
}
.play {
  position: absolute;
  left: 10px;
  bottom: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(18, 18, 20, 0.78);
}
.play::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 7px;
  border-left: 8px solid #fff;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}
.pager a { text-decoration: underline; text-underline-offset: 3px; }
.pager .prev { margin-left: auto; }

/* project tiles: one mesh gradient per tone, assigned by project index across the site */
.tone-0  { --t0: #1a1033; --t1: #5b3fd1; --t2: #c43d8e; --t3: #2b6bd6; }
.tone-1  { --t0: #0f2a2a; --t1: #0e8f8a; --t2: #3fc0a0; --t3: #0b4f6c; }
.tone-2  { --t0: #2a1407; --t1: #d4571f; --t2: #f0a030; --t3: #8c2c2c; }
.tone-3  { --t0: #0b1a36; --t1: #1f5fd6; --t2: #27a6e8; --t3: #4b2bb8; }
.tone-4  { --t0: #2c0b1c; --t1: #c2185b; --t2: #ef6a4a; --t3: #6e1050; }
.tone-5  { --t0: #0e2616; --t1: #1e8a4a; --t2: #a8d53a; --t3: #0f5a66; }
.tone-6  { --t0: #241a0a; --t1: #a67c1a; --t2: #e8c04a; --t3: #7a3a14; }
.tone-7  { --t0: #1c1024; --t1: #7b3fc9; --t2: #e05aa0; --t3: #2b2f8f; }
.tone-8  { --t0: #0a1f2e; --t1: #0f6f9e; --t2: #58c8d8; --t3: #3b2a8a; }
.tone-9  { --t0: #2e0f0f; --t1: #b8302b; --t2: #f08a3a; --t3: #5a1a3e; }
.tone-10 { --t0: #112012; --t1: #4f8a2a; --t2: #c9c52e; --t3: #1f6a5a; }
.tone-11 { --t0: #1a1326; --t1: #4a4fd8; --t2: #8ad0f0; --t3: #9a2f8a; }
.ptile, .pp-card {
  color: #f6f5f1;
  background:
    radial-gradient(85% 75% at 15% 20%, var(--t1) 0%, transparent 72%),
    radial-gradient(80% 70% at 88% 85%, var(--t2) 0%, transparent 70%),
    radial-gradient(95% 80% at 80% 5%, var(--t3) 0%, transparent 74%),
    var(--t0);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  isolation: isolate;
}
.ptile::before, .pp-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.14;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}
.ptile {
  display: grid;
  place-items: center;
  text-decoration: none;
  padding: 12px;
  container-type: inline-size;
}
.pword, .pp-word {
  position: relative;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}
/* Sized from the word length so it always fits on one line: ~0.6em per bold Helvetica glyph. */
.pword { font-size: min(2.4rem, calc((100cqw - 32px) / (var(--len) * 0.62))); }
.pmark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 12px;
  height: 12px;
  border-right: 1.5px solid rgba(255, 255, 255, 0.55);
  border-top: 1.5px solid rgba(255, 255, 255, 0.55);
  transition: transform 180ms ease, border-color 180ms ease;
}
.ptile:hover { color: #fff; }
.ptile:hover .pmark, .ptile:focus-visible .pmark { border-color: #fff; transform: translate(2px, -2px); }
.pcontent[hidden] { display: none; }

/* project panel */
.pp {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 11, 0.6);
  display: grid;
  place-items: center;
  padding: 24px;
}
.pp[hidden] { display: none; }
.pp-panel {
  position: relative;
  width: min(100%, 980px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  color: var(--ink);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}
.pp-card {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 400px;
  padding: 32px;
  container-type: inline-size;
}
.pp-word { font-size: min(4.6rem, calc((100cqw - 48px) / (var(--len) * 0.62))); letter-spacing: -0.05em; }
.pp-text { padding: 52px 48px 36px; display: flex; flex-direction: column; min-width: 0; }
.pp-title { margin: 0 0 14px; font-size: 1.8rem; letter-spacing: -0.03em; line-height: 1.1; }
.pp-body p { margin: 0 0 1em; font-size: 1.02rem; color: #3a3b3e; }
.pp-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pj-link {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
}
.pj-link:hover { background: var(--ink); color: #fff; }
.pp-nav { margin-top: auto; padding-top: 28px; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 0.85rem; }
.pp-nav button { font: inherit; font-size: 1.3rem; line-height: 1; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 4px 6px; }
.pp-nav button:hover { color: var(--accent); }
.pp-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 1;
  font: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pp-close:hover { color: var(--accent); }

/* lightbox */
.lb {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 10, 11, 0.965);
  color: #fff;
  display: grid;
  place-items: center;
}
.lb[hidden] { display: none; }
.lb-fig { margin: 0; width: 100%; height: 100%; display: grid; grid-template-rows: 1fr auto; padding: 56px 64px 20px; }
.lb-media { display: grid; place-items: center; min-height: 0; }
.lb-media img, .lb-media video { max-width: 100%; max-height: calc(100vh - 140px); width: auto; height: auto; object-fit: contain; }
.lb-cap { text-align: center; font-size: 0.95rem; color: #d8d8d8; padding-top: 14px; min-height: 2.6em; }
.lb button {
  position: absolute;
  font: inherit;
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px 12px;
}
.lb button:hover { color: #c9a964; }
.lb-close { top: 12px; right: 14px; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 3px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 1.6rem; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
body.lb-open, body.pp-open { overflow: hidden; }

/* responsive */
@media (max-width: 800px) {
  .home { align-items: start; padding-top: 32px; min-height: 0; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; max-width: 520px; }
  .card { max-width: 420px; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 24px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cap { font-size: 0.72rem; padding: 4px 6px; }
  .lb-fig { padding: 56px 12px 16px; }
  .lb-media img, .lb-media video { max-height: calc(100vh - 150px); }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-cap { padding: 14px 44px 0; }
  .pp { padding: 12px; align-items: end; }
  .pp-panel { grid-template-columns: minmax(0, 1fr); max-height: calc(100vh - 24px); }
  .pp-card { min-height: 0; aspect-ratio: 16 / 9; padding: 24px; }
  .pp-word { font-size: min(3.4rem, calc((100cqw - 48px) / (var(--len) * 0.62))); }
  .pp-text { padding: 28px 20px 20px; }
  .pp-close { color: #f4f3ef; }
}
@media (max-width: 560px) {
  .top { padding-top: 22px; }
  .topnav { gap: 14px; font-size: 0.9rem; }
  .nav-x { display: none; }
  .index, .catpage { padding-top: 40px; }
  .cats { grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 48px; }
  .stack { max-width: 360px; }
  .huge { letter-spacing: -0.04em; }
  .pager { flex-direction: column; gap: 14px; }
  .pager .prev { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .print, .sp, html.intro .home { transition: none; animation: none; }
}

/* Portrait variant of the home card: the photo fills the card, the tag becomes a small dark chip. */
.card.has-photo { background: #e9e9ea; }
.card-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.has-photo .card-tag { color: #fff; padding: 5px 8px; background: rgba(20, 20, 22, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
