:root {
  --bg: #0b0b0d;
  --surface: #141417;
  --line: #24242a;
  --text: #f2f2f0;
  --muted: #9a9aa2;
  --accent: #d7ff45;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --row-h: 250px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px 0 0;
}
.name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.name::after {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px;
  border-radius: 50%; background: var(--accent); vertical-align: 2px;
}
.nav { display: flex; gap: 28px; font-size: 15px; color: var(--muted); }
.nav a { transition: color .2s var(--ease); }
.nav a:hover { color: var(--text); }

/* Hero */
.hero { padding: 40px 0 0; }
.hero-title {
  margin: 0 0 28px;
  font-size: clamp(30px, 5.2vw, 64px);
  font-weight: 600; line-height: 1.04; letter-spacing: -.035em;
}
.hero-title .amp { color: var(--accent); font-weight: 500; }
.reel {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.reel-video { width: 100%; height: 100%; object-fit: cover; }
.reel-toggle {
  position: absolute; right: 16px; bottom: 16px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: rgba(11, 11, 13, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: .7; transition: opacity .2s var(--ease);
}
.reel-toggle:hover { opacity: 1; }
.reel-toggle svg { width: 16px; height: 16px; fill: var(--text); }
.reel-toggle .i-play, .reel.paused .reel-toggle .i-pause { display: none; }
.reel.paused .reel-toggle .i-play { display: block; }

/* Work */
.work { padding: 120px 0 0; }
.work-head {
  display: flex; align-items: end; justify-content: space-between;
  flex-wrap: wrap; gap: 20px; margin-bottom: 36px;
}
h2 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -.025em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  border: 1px solid var(--line); background: transparent; cursor: pointer;
  padding: 7px 16px; border-radius: 999px; font-size: 14px; color: var(--muted);
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease);
}
.filter:hover { color: var(--text); border-color: #3a3a42; }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b0b0d; font-weight: 500; }

/* Justified grid: images in a row share one height, every video keeps its own shape */
.grid { display: flex; flex-wrap: wrap; gap: 48px 24px; }
.card {
  flex-grow: var(--ar);
  flex-basis: calc(var(--ar) * var(--row-h));
  min-width: 0;
}
.card[hidden] { display: none; }
.card-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; cursor: pointer;
  aspect-ratio: var(--ar); border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.card-media img, .card-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease), opacity .3s var(--ease);
}
.card-media video { opacity: 0; }
.card.playing .card-media video { opacity: 1; }
.card-media:hover img, .card-media:hover video { transform: scale(1.025); }
.card-media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); pointer-events: none;
}
.card-text { padding-top: 16px; }
.tag { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.card h3 { margin: 4px 0 4px; font-size: 18px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* About */
.about { padding: 140px 0 0; max-width: 720px; margin-left: max(24px, (100% - 1240px) / 2); }
.about h2 { margin-bottom: 20px; }
.about p { margin: 0 0 12px; font-size: clamp(18px, 2vw, 21px); line-height: 1.55; color: #cfcfd3; }

.foot { padding: 120px 0 48px; color: var(--muted); font-size: 14px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: flex; padding: 72px 24px 24px; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(5, 5, 7, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .25s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.open { opacity: 1; }
.lb-panel {
  margin: auto; width: var(--lb-w, 90vw); max-width: 100%;
  transform: translateY(12px); transition: transform .35s var(--ease);
}
.lightbox.open .lb-panel { transform: none; }
.lb-frame { aspect-ratio: var(--lb-ar, 16 / 9); border-radius: var(--radius); overflow: hidden; background: #000; }
.lb-frame video, .lb-frame iframe { width: 100%; height: 100%; border: 0; }
.lb-text { padding-top: 16px; max-width: 70ch; }
.lb-text h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.lb-desc { margin: 0; color: var(--muted); font-size: 15px; }
/* Vertical videos on wide screens: text beside the video */
.lightbox.side .lb-panel { display: flex; align-items: center; gap: 40px; width: auto; }
.lightbox.side .lb-frame { width: var(--lb-w); flex: none; }
.lightbox.side .lb-text { width: 340px; padding-top: 0; }
.lb-close {
  position: fixed; top: 16px; right: 16px; z-index: 1; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: var(--surface); cursor: pointer;
  display: grid; place-items: center;
}
.lb-close svg { width: 18px; height: 18px; stroke: var(--text); stroke-width: 2; stroke-linecap: round; fill: none; }
.lb-close:hover { background: #222228; }
body.lb-lock { overflow: hidden; }

/* Fade-in on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* Phone */
@media (max-width: 700px) {
  .wrap { width: calc(100% - 32px); }
  .top { padding-top: 20px; }
  .nav { gap: 20px; }
  .hero { padding-top: 28px; }
  .hero-title { margin-bottom: 20px; }
  .reel { border-radius: 10px; }
  .reel-toggle { right: 10px; bottom: 10px; width: 34px; height: 34px; }
  .work { padding-top: 80px; }
  .grid { flex-direction: column; gap: 40px; }
  .card { flex: none; width: 100%; }
  .card.v { width: 68%; align-self: center; }
  .about { padding-top: 96px; margin-left: auto; }
  .foot { padding-top: 80px; }
  .lightbox { padding: 68px 16px 16px; }
  .lb-close { top: 12px; right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .card-media img, .card-media video { transition: none; }
}
