:root {
  --bg: #161513;
  --bg-2: #1d1c19;
  --ink: #f3ede4;
  --mute: #8f897f;
  --dim: #5d5952;
  --line: rgba(243, 237, 228, .09);
  --card: #1f1e1b;
  --red: #ff5a3c;
  --gold: #f0b62c;
  --blue: #6f8fe0;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --pad: clamp(16px, 4vw, 56px);
  --max: 1320px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img, video { display: block; max-width: 100%; }
.mono { font-family: var(--mono); font-size: 13px; line-height: 1.75; letter-spacing: .01em; }
.u { border-bottom: 1px solid rgba(243, 237, 228, .28); transition: border-color .2s, color .2s; }
.u:hover, .u:focus-visible { border-color: var(--gold); color: #fff; }
:focus-visible { outline: 1px dashed var(--gold); outline-offset: 3px; }
::selection { background: var(--gold); color: #111; }

/* ---------- pond ---------- */
#pond {
  position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none;
  opacity: var(--pond, 1); transition: opacity .25s linear;
}
main, footer { position: relative; z-index: 1; }

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 20; top: 14px; left: 50%; transform: translateX(-50%);
  width: min(760px, calc(100% - 32px)); height: 52px; padding: 0 10px 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 999px; background: rgba(36, 34, 31, .62);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 30px rgba(0, 0, 0, .25);
}
.brand { font-weight: 500; font-size: 15px; letter-spacing: -.01em; }
.brand i { font-style: normal; color: var(--mute); font-family: var(--mono); font-size: 12px; margin-left: 8px; }
.nav nav { display: flex; gap: 4px; }
.nav nav a {
  font-family: var(--mono); font-size: 12.5px; color: var(--mute);
  padding: 7px 12px; border-radius: 999px; transition: color .2s, background .2s;
}
.nav nav a:hover, .nav nav a.on { color: var(--ink); background: rgba(255, 255, 255, .07); }
.menu-btn { display: none; width: 36px; height: 36px; border-radius: 50%; place-items: center; }
.menu-btn span { display: grid; grid-template-columns: repeat(3, 4px); gap: 3px; }
.menu-btn span i { width: 4px; height: 4px; background: var(--ink); opacity: .8; }
.menu-btn span i:nth-child(2n) { opacity: .35; }

/* ---------- hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; position: relative; padding: 0 var(--pad); }
.hero-meta {
  position: absolute; top: 84px; left: var(--pad); right: var(--pad);
  display: flex; justify-content: space-between; color: var(--mute); font-size: 12px;
}
#denoise.done { color: var(--dim); transition: color 2s; }
.hero-text {
  position: absolute; left: var(--pad); bottom: clamp(40px, 9vh, 96px);
  max-width: 600px; font-size: 13.5px;
}
.hero-text p { margin: 0 0 14px; }
.poem { color: var(--mute); white-space: pre; min-height: 3.5em; margin-bottom: 26px !important; }
.cur { display: inline-block; width: .6em; height: 1.05em; background: var(--ink); vertical-align: -.17em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hello { color: var(--ink); }
.hero-text .links { margin-top: 22px; color: var(--dim); }
.hero-text .links a, .hero-text .links button { color: var(--mute); }
.hero-text .links a:hover, .hero-text .links button:hover { color: var(--ink); }
.hero-hint {
  position: absolute; right: var(--pad); bottom: clamp(40px, 9vh, 96px);
  color: var(--dim); font-size: 11.5px; text-align: right;
}

/* ---------- sections ---------- */
section.block { padding: clamp(80px, 12vh, 140px) var(--pad) 0; max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto; }
.head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 28px;
}
.head h2 { margin: 0; font: 500 clamp(26px, 3.4vw, 44px)/1.05 var(--sans); letter-spacing: -.03em; }
.head h2 small { display: block; font: 400 12px/1.4 var(--mono); color: var(--red); letter-spacing: .06em; margin-bottom: 10px; }
.head .side { color: var(--mute); white-space: nowrap; }
.lede { max-width: 640px; color: #cfc8bd; margin: 0 0 40px; }
.lede b { color: var(--ink); font-weight: 500; }

/* ---------- work grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 28px); }
.card { position: relative; }
.media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 10px;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); cursor: zoom-in;
}
.media img, .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media video { opacity: 0; transition: opacity .6s; }
.media video.playing { opacity: 1; }
.media .num {
  position: absolute; z-index: 3; top: 12px; left: 12px; font: 400 11px/1 var(--mono);
  padding: 6px 8px; border-radius: 6px; background: rgba(22, 21, 19, .72); color: var(--ink);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.media img.lazy { opacity: 0; }
.media img.lazy.in { opacity: 1; }
.loading::after {
  content: "[ denoising … ]"; position: absolute; inset: 0; display: grid; place-items: center;
  font: 400 11px/1 var(--mono); color: var(--dim); animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
.media canvas.px { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; image-rendering: pixelated; pointer-events: none; }
.card .meta { padding: 14px 2px 0; }
.card .title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h3 { margin: 0; font: 500 18px/1.2 var(--sans); letter-spacing: -.015em; }
.card p { margin: 6px 0 0; color: var(--mute); font-size: 13.5px; line-height: 1.5; }
.card .bd { font: 400 12px/1.2 var(--mono); color: var(--mute); white-space: nowrap; padding-top: 4px; }
.card .bd:hover { color: var(--gold); }
.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font: 400 10.5px/1 var(--mono); color: var(--mute); padding: 5px 7px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); }

.workflow {
  margin-top: clamp(28px, 4vw, 48px); padding: 22px 24px; border-radius: 10px;
  background: rgba(31, 30, 27, .72); box-shadow: inset 0 0 0 1px var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.workflow div b { display: block; font: 400 11px/1.4 var(--mono); color: var(--gold); margin-bottom: 6px; letter-spacing: .04em; }
.workflow div { color: #cfc8bd; font-size: 13.5px; line-height: 1.5; }

.stills { margin-top: clamp(40px, 6vw, 72px); }
.stills .row { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 28px); }
.stills .media { aspect-ratio: 1 / 1; }
.sub-head { display: flex; justify-content: space-between; color: var(--mute); margin-bottom: 14px; }

/* ---------- pipeline compare ---------- */
.compare {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line); touch-action: pan-y; cursor: ew-resize; user-select: none; -webkit-user-select: none;
}
.compare .layer { position: absolute; inset: 0; }
.compare .layer img, .compare .layer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare .layer video { opacity: 0; transition: opacity .4s; }
.compare.playing .layer video { opacity: 1; }
.compare .handle { position: absolute; top: 0; bottom: 0; width: 32px; margin-left: -16px; display: grid; place-items: center; z-index: 2; outline: none; }
.compare .handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--ink); box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.compare .handle span { position: relative; width: 14px; height: 14px; background: var(--ink); box-shadow: 4px 5px 0 rgba(0, 0, 0, .38); transition: background .2s, transform .2s; }
.compare .handle:focus-visible span, .compare.dragging .handle span, .compare .handle:hover span { background: var(--gold); transform: scale(1.15); }
.compare .tag { position: absolute; top: 12px; white-space: nowrap; margin-left: 12px; z-index: 1; font-size: 11px; padding: 6px 9px; border-radius: 999px; background: rgba(22, 21, 19, .72); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); pointer-events: none; transition: opacity .2s; }
.workflow.steps { grid-template-columns: repeat(3, 1fr); margin-top: clamp(18px, 3vw, 28px); }
.workflow .pending { opacity: .6; }
.workflow em { display: block; font-style: normal; color: var(--gold); margin-top: 8px; font-size: 11px; }

/* ---------- clips ---------- */
.clips { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(14px, 2vw, 28px); }
.clip .frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
}
.clip .frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.9); transition: transform .6s, filter .3s; }
.clip .frame iframe, .clip .frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.clip button.play { position: absolute; inset: 0; display: grid; place-items: center; }
.clip button.play span {
  font: 400 12px/1 var(--mono); padding: 11px 14px; border-radius: 999px;
  background: rgba(22, 21, 19, .75); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s;
}
.clip button.play:hover span { background: var(--gold); color: #111; }
.clip:hover .frame img { transform: scale(1.025); }
.clip .meta { padding: 12px 2px 0; display: flex; justify-content: space-between; gap: 12px; }
.clip h3 { margin: 0; font: 500 16px/1.3 var(--sans); letter-spacing: -.01em; }
.clip .meta span { color: var(--mute); white-space: nowrap; }
.clip.vertical {
  grid-column: 1 / -1; display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: clamp(20px, 3.5vw, 56px); align-items: end; margin-top: clamp(10px, 2vw, 24px);
}
.clip.vertical .frame { aspect-ratio: 9 / 16; background: radial-gradient(120% 90% at 30% 20%, #2a2722, #161513); }
.clip .fmt { position: absolute; top: 12px; left: 12px; font-size: 11px; color: var(--mute); padding: 6px 9px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.clip.vertical .side { border-top: 1px solid var(--line); padding-top: 16px; }
.clip.vertical .meta { padding: 0 0 18px; }
.clip.vertical h3 { font-size: clamp(20px, 2.4vw, 30px); }
.clip dl.specs { margin: 0; display: grid; grid-template-columns: 90px 1fr; row-gap: 10px; column-gap: 18px; color: #d6cfc4; max-width: 560px; }
.clip dl.specs dt { color: var(--dim); }
.clip dl.specs dd { margin: 0; }
.consent { color: var(--dim); margin-top: 18px; font-size: 11.5px; }

/* ---------- photo ---------- */
.tabs { display: flex; gap: 6px; }
.tabs button {
  font: 400 12.5px/1 var(--mono); color: var(--mute); padding: 9px 13px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); transition: all .2s;
}
.tabs button[aria-selected="true"] { color: #111; background: var(--ink); box-shadow: none; }
.masonry { columns: 3; column-gap: clamp(10px, 1.4vw, 18px); }
.masonry figure { min-height: 120px; margin: 0 0 clamp(10px, 1.4vw, 18px); break-inside: avoid; position: relative; border-radius: 8px; overflow: hidden; background: var(--card); cursor: zoom-in; }
.masonry img { width: 100%; height: auto; opacity: 0; transition: opacity .3s; }
.masonry img.in { opacity: 1; }
.masonry canvas.px { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; pointer-events: none; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(28px, 5vw, 80px); }
.about .bio p { margin: 0 0 16px; color: #d6cfc4; max-width: 560px; }
.about .bio p:first-child { font-size: clamp(19px, 2vw, 24px); line-height: 1.4; color: var(--ink); letter-spacing: -.01em; }
dl.cv { margin: 0; display: grid; grid-template-columns: 112px 1fr; row-gap: 14px; column-gap: 18px; }
dl.cv dt { color: var(--dim); }
dl.cv dd { margin: 0; color: #d6cfc4; }
dl.cv dd small { display: block; color: var(--mute); font-size: 12px; }
.contact { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px; }
.contact a {
  font: 400 13px/1 var(--mono); padding: 12px 16px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line); transition: all .2s;
}
.contact a:first-child { background: var(--ink); color: #111; box-shadow: none; }
.contact a:hover { background: var(--gold); color: #111; box-shadow: none; }

footer {
  max-width: calc(var(--max) + 2 * var(--pad)); margin: clamp(90px, 14vh, 160px) auto 0; padding: 18px var(--pad) 30px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--dim);
}
footer > div { border-top: 1px solid var(--line); padding-top: 18px; width: 100%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
footer a:hover { color: var(--ink); }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(14, 13, 12, .94);
  display: grid; grid-template-rows: 1fr auto; padding: 64px 16px 16px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 150px); border-radius: 8px; object-fit: contain; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 6px 0; color: var(--mute); }
.lb-bar b { color: var(--ink); font-weight: 400; }
.lb-close { position: absolute; top: 16px; right: 18px; font: 400 12.5px/1 var(--mono); color: var(--mute); padding: 10px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.lb-close:hover { color: var(--ink); }
.lb-nav { display: flex; gap: 8px; }
.lb-nav button { font: 400 12.5px/1 var(--mono); padding: 10px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--mute); }
.lb-nav button:hover { color: #111; background: var(--ink); }

/* ---------- reveal ---------- */
.rv { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .workflow { grid-template-columns: repeat(2, 1fr); }
  .about { grid-template-columns: 1fr; }
  .masonry { columns: 2; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .nav { padding-left: 18px; }
  .nav nav {
    position: absolute; top: 60px; right: 0; left: 0; flex-direction: column; gap: 2px; padding: 8px;
    border-radius: 18px; background: rgba(30, 29, 26, .96); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    opacity: 0; pointer-events: none; transform: translateY(-6px); transition: all .2s;
  }
  .nav.open nav { opacity: 1; pointer-events: auto; transform: none; }
  .nav nav a { padding: 12px 14px; font-size: 14px; }
  .menu-btn { display: grid; }
  .brand i { display: none; }
  .hero-meta { top: 80px; font-size: 11px; }
  .hero-text { font-size: 13px; right: var(--pad); bottom: 92px; }
  .hero-hint { left: var(--pad); right: auto; text-align: left; bottom: 32px; }
  .grid, .clips, .stills .row { grid-template-columns: 1fr; }
  .stills .row { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .workflow, .workflow.steps { grid-template-columns: 1fr; }
  .head { flex-direction: column; gap: 14px; align-items: flex-start; }
  .masonry { columns: 2; column-gap: 8px; }
  .masonry figure { margin-bottom: 8px; }
  dl.cv { grid-template-columns: 1fr; row-gap: 4px; }
  dl.cv dd { margin-bottom: 12px; }
  .clip.vertical { grid-template-columns: 1fr; }
  .clip.vertical .frame { width: min(100%, 340px); }
}
