/* Artem Biloborodko — "Cinema" direction.
   Black ground, Jost for type, IBM Plex Mono for labels, tally red as the only accent. */
:root {
  --bg: #000;
  --panel: #0d0d0d;
  --fg: #f2f2f2;
  --soft: #cfcfcf;
  --muted: #9a9a9a;
  --rule: #1f1f1f;
  --tally: #e5262b;
  --display: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(20px, 4vw, 56px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--tally); outline-offset: 3px; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tally); flex: 0 0 auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Navigation ---------- */
.nav {
  display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap;
  padding: 28px max(var(--gutter), env(safe-area-inset-right)) 28px max(var(--gutter), env(safe-area-inset-left));
  position: relative; z-index: 3;
}
.nav--overlay { position: absolute; top: 0; left: 0; right: 0; }
.wordmark { font-size: 15px; letter-spacing: .18em; white-space: nowrap; }
.wordmark b { font-weight: 600; }
.nav-links { display: flex; gap: clamp(20px, 3vw, 40px); font-size: 15px; }
.nav-links a { opacity: .85; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }

/* ---------- Hero reel ---------- */
.hero {
  position: relative; overflow: hidden; background: #000;
  height: clamp(560px, 56.25vw, 100svh);
  container-type: size;
}
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-poster { object-fit: cover; }
.hero-video { opacity: 0; transition: opacity 1.2s ease; pointer-events: none; overflow: hidden; }
.hero-video.is-ready { opacity: 1; }
.hero-video iframe {
  position: absolute; top: 50%; left: 50%; border: 0;
  width: max(100cqw, 177.78cqh); height: max(100cqh, 56.25cqw);
  transform: translate(-50%, -50%) scale(1.02);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 66%, rgba(0,0,0,.75) 100%);
}
.hero-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 40px max(var(--gutter), env(safe-area-inset-left));
}
.hero-title { margin: 0; font-weight: 300; font-size: clamp(22px, 1.9vw, 28px); line-height: 1.2; }
.play-pill {
  display: inline-flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 22px;
  border: 1px solid rgba(255,255,255,.55); border-radius: 999px; background: rgba(0,0,0,.3);
  color: var(--fg); font: inherit; cursor: pointer; transition: background .2s, border-color .2s;
}
.play-pill:hover { background: rgba(0,0,0,.55); border-color: #fff; }

/* ---------- Featured frames ---------- */
.frames { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.frame { position: relative; display: block; aspect-ratio: 2.39 / 1; overflow: hidden; background: var(--panel); }
.frame-media, .frame-media img, .frame-preview { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame-media img { object-fit: cover; opacity: .9; transform: scale(1.001); transition: transform 1.6s cubic-bezier(.2,.7,.2,1), opacity .4s; }
.frame:hover .frame-media img { transform: scale(1.035); }
.frame-preview { opacity: 0; transition: opacity .6s ease; pointer-events: none; overflow: hidden; container-type: size; }
.frame-preview.is-ready { opacity: 1; }
.frame-preview iframe {
  position: absolute; top: 50%; left: 50%; border: 0;
  width: max(100cqw, 177.78cqh); height: max(100cqh, 56.25cqw); transform: translate(-50%, -50%) scale(1.02);
}
.frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,0) 58%); pointer-events: none; }
.frame-caption {
  position: absolute; z-index: 2; bottom: clamp(22px, 3.4vw, 52px);
  left: max(var(--gutter), env(safe-area-inset-left)); right: max(var(--gutter), env(safe-area-inset-right));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap;
}
.frame-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.frame-kicker { color: var(--soft); }
.frame-title { font-size: clamp(30px, 4.6vw, 72px); font-weight: 300; line-height: 1; letter-spacing: -.015em; text-wrap: balance; }
.frame-cta { font-size: 16px; color: var(--soft); white-space: nowrap; }

/* ---------- More work index ---------- */
.section { padding: clamp(96px, 10vw, 160px) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left)); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid #2a2a2a; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.index { list-style: none; margin: 0; padding: 0; }
.index a {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) minmax(0, 1fr) 24px; gap: 24px; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--rule); color: var(--muted); transition: color .2s;
}
.index a:hover, .index a:focus-visible { color: var(--fg); }
.index-title { font-size: clamp(20px, 2vw, 26px); font-weight: 300; color: var(--fg); }
.index-client { font-size: 16px; }
.index-arrow { text-align: right; transition: transform .2s; }
.index a:hover .index-arrow { transform: translateX(4px); color: var(--tally); }

/* ---------- About + contact ---------- */
.about { padding: clamp(120px, 12vw, 200px) max(var(--gutter), env(safe-area-inset-right)) clamp(120px, 12vw, 200px) max(var(--gutter), env(safe-area-inset-left)); display: flex; justify-content: center; }
.about p { margin: 0; max-width: 980px; text-align: center; font-size: clamp(26px, 3.2vw, 46px); line-height: 1.2; font-weight: 300; letter-spacing: -.01em; text-wrap: balance; }
.about span { color: #7d7d7d; }
.contact { border-top: 1px solid var(--rule); text-align: center; }
.contact-inner { padding: clamp(80px, 9vw, 140px) max(var(--gutter), env(safe-area-inset-right)) 48px max(var(--gutter), env(safe-area-inset-left)); display: flex; flex-direction: column; align-items: center; gap: 40px; }
.contact-email { font-size: clamp(32px, 6.4vw, 104px); font-weight: 300; line-height: 1; letter-spacing: -.02em; overflow-wrap: anywhere; transition: color .2s; }
.contact-email:hover { color: #fff; }
.contact-meta { display: flex; gap: 14px 32px; flex-wrap: wrap; justify-content: center; font-size: 16px; color: #a8a8a8; }
.contact-meta a:hover { color: var(--fg); }
.bars { height: 6px; display: grid; grid-template-columns: repeat(7, 1fr); }
.bars i:nth-child(1){background:#c4c4c4}.bars i:nth-child(2){background:#f2e400}.bars i:nth-child(3){background:#00b6e3}
.bars i:nth-child(4){background:#00a651}.bars i:nth-child(5){background:#d4008a}.bars i:nth-child(6){background:#e10019}.bars i:nth-child(7){background:#1f2aa6}

/* ---------- Project page ---------- */
.player { position: relative; width: min(100%, calc(86svh * 16 / 9)); margin: 0 auto; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.player img, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player img { object-fit: cover; opacity: .92; }
.player .play-pill { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.player.is-playing .play-pill, .player.is-playing img { display: none; }
.project-head { padding: clamp(64px, 8vw, 120px) max(var(--gutter), env(safe-area-inset-right)) clamp(80px, 9vw, 140px) max(var(--gutter), env(safe-area-inset-left)); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 32px; }
.project-head h1 { margin: 0; max-width: 1100px; font-size: clamp(40px, 6vw, 96px); font-weight: 300; line-height: 1; letter-spacing: -.02em; text-wrap: balance; }
.project-head p { margin: 0; max-width: 640px; font-size: 20px; line-height: 1.6; color: #b0b0b0; }
.credits { display: flex; gap: 14px clamp(28px, 4vw, 64px); flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.credits span span { color: #8f8f8f; margin-right: .8em; }
.back { color: var(--muted); }
.back:hover { color: var(--fg); }
.footer-line { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 36px max(var(--gutter), env(safe-area-inset-right)) 36px max(var(--gutter), env(safe-area-inset-left)); color: #a8a8a8; font-size: 16px; }
.next .frame-caption { justify-content: center; text-align: center; }
.next .frame-text { align-items: center; }
.next::after { background: rgba(0,0,0,.45); }

/* ---------- Reel lightbox ---------- */
dialog.lightbox { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(0,0,0,.94); color: var(--fg); }
dialog.lightbox::backdrop { background: rgba(0,0,0,.9); }
.lightbox-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 72px max(var(--gutter), env(safe-area-inset-right)) 48px max(var(--gutter), env(safe-area-inset-left)); }
.lightbox-frame { position: relative; width: min(100%, calc((100svh - 140px) * 16 / 9)); aspect-ratio: 16 / 9; background: #000; }
.lightbox-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lightbox-close { position: absolute; top: 20px; right: max(var(--gutter), env(safe-area-inset-right)); min-height: 44px; padding: 0 18px; background: transparent; color: var(--fg); border: 1px solid rgba(255,255,255,.4); border-radius: 999px; font: inherit; cursor: pointer; }

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero { height: min(640px, 100svh); }
  .hero-title { font-size: 30px; font-weight: 300; }
  .frame { aspect-ratio: 4 / 3; }
  .frame::after { background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.78) 100%); }
  .frame-cta { display: none; }
  .frame-title { font-size: 28px; line-height: 1.05; }
  .index a { grid-template-columns: minmax(0, 1fr) 24px; gap: 6px 16px; }
  .index-client { grid-column: 1; grid-row: 2; font-size: 15px; }
  .index-cat { display: none; }
  .index-arrow { grid-column: 2; grid-row: 1; }
  .player { aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .hero-video, .frame-preview { display: none; }
}

/* ---------- Brand details from the card ---------- */
.hero-left { display: flex; flex-direction: column; gap: 14px; }
.rec { display: inline-flex; align-items: center; gap: 12px; color: #e6e6e6; }
.rec .tc { color: #9a9a9a; font-variant-numeric: tabular-nums; }
.rec .dot { animation: tally 2.4s ease-in-out infinite; }
@keyframes tally { 0%, 60%, 100% { opacity: 1; } 80% { opacity: .35; } }
.hero > .bars { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 2; }
.hero-foot { bottom: 8px; }

/* The full test-pattern strip from the card front closes every page. */
.signature { display: grid; grid-template-rows: 67fr 9fr 24fr; height: clamp(44px, 5vw, 72px); }
.signature > div { display: grid; }
.sig-a, .sig-b { grid-template-columns: repeat(7, 1fr); }
.sig-c { grid-template-columns: 5fr 5fr 5fr 5fr 1.6fr 1.6fr 1.6fr 5fr; }
.sig-a i:nth-child(1){background:#c4c4c4}.sig-a i:nth-child(2){background:#f2e400}.sig-a i:nth-child(3){background:#00b6e3}
.sig-a i:nth-child(4){background:#00a651}.sig-a i:nth-child(5){background:#d4008a}.sig-a i:nth-child(6){background:#e10019}.sig-a i:nth-child(7){background:#1f2aa6}
.sig-b i:nth-child(1){background:#1f2aa6}.sig-b i:nth-child(2){background:#111}.sig-b i:nth-child(3){background:#d4008a}
.sig-b i:nth-child(4){background:#111}.sig-b i:nth-child(5){background:#00b6e3}.sig-b i:nth-child(6){background:#111}.sig-b i:nth-child(7){background:#c4c4c4}
.sig-c i:nth-child(1){background:#08214d}.sig-c i:nth-child(2){background:#f4f4f4}.sig-c i:nth-child(3){background:#2d0a63}.sig-c i:nth-child(4){background:#0b0b0b}
.sig-c i:nth-child(5){background:#000}.sig-c i:nth-child(6){background:#0b0b0b}.sig-c i:nth-child(7){background:#1a1a1a}.sig-c i:nth-child(8){background:#0b0b0b}

/* Click-to-reveal email */
button.reveal { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button.contact-email.reveal { font-size: clamp(32px, 5.6vw, 88px); font-weight: 300; line-height: 1; letter-spacing: -.02em; color: var(--soft); border-bottom: 1px solid #333; padding-bottom: .12em; transition: color .2s, border-color .2s; }
button.contact-email.reveal:hover { color: #fff; border-color: var(--tally); }
.footer-line button.reveal { font-size: 16px; color: #a8a8a8; text-decoration: underline; text-underline-offset: 3px; }
.footer-line button.reveal:hover { color: var(--fg); }
