/* =====================================================================
   Любомир Мазуркевич — AI Video Creator
   Art direction "03:47": the night room from «Вайбкодер і Codex».
   Indigo night, Codex-cloud violet, LCD clock, warm cat-peach for focus.
   ===================================================================== */

:root {
  --night: #0d0f2b;
  --night-2: #13163d;
  --room: #1b1f55;
  --paper: #f3eee6;
  --muted: #b9b7dc;
  --faint: #8a89b8;
  --line: rgba(179, 177, 255, 0.18);
  --cloud: #aaa8ff;
  --cloud-2: #7c7ff7;
  --lcd: #cfe0ff;
  --cat: #ffb27a;

  --f-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --f-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-pixel: "VT323", ui-monospace, Consolas, monospace;
  --f-code: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4vw, 64px);
  --head: 68px;
  --radius: 18px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--head);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night);
}

body {
  margin: 0;
  background: var(--night);
  color: var(--paper);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; }
img, video { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, ol, ul, figure, pre { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--cat); outline-offset: 3px; border-radius: 6px; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 200;
  padding: 10px 16px; border-radius: 10px; background: var(--paper); color: var(--night);
  font-weight: 600; text-decoration: none;
  transform: translateY(-200%); transition: transform .2s;
}
.skip:focus { transform: none; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 54px; padding: 0 24px;
  border: 0; border-radius: 999px;
  font: 600 16px/1 var(--f-body);
  text-decoration: none; cursor: pointer;
  transition: transform .35s var(--spring), background-color .25s, color .25s, box-shadow .35s var(--ease);
}
.btn--cloud {
  background: var(--cloud); color: var(--night);
  box-shadow: 0 10px 40px -12px rgba(124, 127, 247, .8);
}
.btn--cloud:hover { transform: translateY(-2px); background: #bdbbff; box-shadow: 0 18px 50px -14px rgba(124, 127, 247, .95); }
.btn--cloud:active { transform: translateY(0) scale(.98); }
.btn__icon {
  display: grid; place-items: center; width: 30px; height: 30px; margin-left: -10px;
  border-radius: 50%; background: var(--night); color: var(--cloud);
  transition: transform .45s var(--spring);
}
.btn__icon svg { width: 12px; height: 12px; margin-left: 2px; }
.btn--cloud:hover .btn__icon { transform: rotate(-12deg) scale(1.1); }
.btn__time { font: 400 21px/1 var(--f-pixel); opacity: .75; }
.btn--line { color: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--line:hover { box-shadow: inset 0 0 0 1.5px var(--cloud); transform: translateY(-2px); }
.btn--big { min-height: 64px; padding: 0 30px; font-size: 17px; }

.link {
  font-weight: 600; text-decoration: underline; text-decoration-color: var(--cloud-2);
  text-decoration-thickness: 2px; text-underline-offset: 6px;
  transition: text-decoration-color .2s, color .2s;
}
.link:hover { color: var(--cloud); text-decoration-color: var(--cloud); }

/* ---------- Masthead ---------- */
.masthead {
  position: fixed; inset: 0 0 auto; z-index: 60;
  height: var(--head);
  display: flex; align-items: center; gap: 28px;
  padding-inline: var(--gutter);
  transition: background-color .35s, box-shadow .35s;
}
.masthead.is-scrolled {
  background: rgba(13, 15, 43, .82);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand__cloud { width: 38px; height: 29px; transition: transform .5s var(--spring); }
.brand:hover .brand__cloud { transform: translateY(-2px) rotate(-6deg); }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  padding: 8px 12px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--paper); background: rgba(170, 168, 255, .12); }
.masthead__tg {
  padding: 9px 18px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: box-shadow .2s;
}
.masthead__tg:hover { box-shadow: inset 0 0 0 1.5px var(--cloud); }

/* =====================================================================
   HERO
   ===================================================================== */
.hero {
  --sh: clamp(420px, calc(100svh - var(--head) - 72px), 820px); /* scene height */
  position: relative; isolation: isolate;
  min-height: max(100svh, 560px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center; column-gap: clamp(24px, 3vw, 56px);
  padding: calc(var(--head) + 24px) var(--gutter) 48px;
  overflow: clip; /* decorative backdrop is larger than the hero */
}
.hero__backdrop {
  position: absolute; inset: -6% -6% -6% 30%; z-index: -2;
  pointer-events: none;
}
.hero__backdrop img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%;
  filter: blur(34px) saturate(1.25); opacity: .5;
}
.hero::before { /* scrim: keeps the type side calm, lets the room glow on the right */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 70% at 72% 52%, rgba(109, 112, 242, .28), transparent 70%),
    linear-gradient(90deg, var(--night) 34%, rgba(13, 15, 43, .55) 62%, rgba(13, 15, 43, .2));
}

.hero__copy { position: relative; z-index: 2; container-type: inline-size; }
.hero__title {
  font: 800 clamp(34px, min(5.5vw, 11.5svh), 112px)/.98 var(--f-display);
  font-size: clamp(32px, min(11.2cqi, 12svh), 132px);
  letter-spacing: -.035em;
  margin-left: -.04em;
}
.hero__line { display: block; overflow: clip; padding-bottom: .06em; }
.hero__line > span { display: inline-block; }
.hero__line:nth-child(2) { padding-left: .45em; color: var(--cloud); }
.hero__lede { margin-top: clamp(20px, 3svh, 36px); max-width: 44ch; font-size: clamp(17px, 1.25vw, 20px); line-height: 1.55; color: var(--muted); }
.hero__actions { margin-top: clamp(22px, 3.4svh, 40px); display: flex; flex-wrap: wrap; gap: 12px; }

.hero__scene {
  position: relative; z-index: 1;
  height: var(--sh);
  display: grid; place-items: center;
}
.screen { position: relative; height: calc(var(--sh) * .94); aspect-ratio: 9 / 16; }
.screen__btn {
  position: relative; display: block; width: 100%; height: 100%; padding: 0;
  border: 0; border-radius: 26px; overflow: hidden; cursor: pointer;
  background: #141316;
  box-shadow:
    0 0 0 1.5px rgba(170, 168, 255, .35),
    0 30px 90px -20px rgba(91, 95, 230, .75),
    0 0 140px -30px rgba(170, 168, 255, .55);
  transition: transform .6s var(--spring), box-shadow .5s var(--ease);
}
.screen__btn:hover { transform: scale(1.015); box-shadow: 0 0 0 2px var(--cloud), 0 36px 100px -20px rgba(91, 95, 230, .9), 0 0 160px -20px rgba(170, 168, 255, .7); }
/* The reel is 16:9; its centre column is exactly a 9:16 Short.
   In a 9:16 box with object-fit: cover only that column is shown — no side text is cut. */
.screen__video { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.screen__play {
  position: absolute; left: 50%; top: 50%;
  display: grid; place-items: center;
  width: clamp(64px, calc(var(--sh) * .11), 92px); aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%; background: rgba(243, 238, 230, .94); color: var(--night);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  transition: transform .45s var(--spring), background-color .2s;
}
.screen__play svg { width: 30%; height: 30%; margin-left: 6%; }
.screen__btn:hover .screen__play { transform: scale(1.12); background: var(--cloud); }
.screen__note {
  position: absolute; left: 50%; bottom: -30px; translate: -50% 0;
  font-size: 13px; color: var(--faint); white-space: nowrap;
}

.codex {
  position: absolute; z-index: 3;
  width: calc(var(--sh) * .36);
  left: calc(50% - var(--sh) * .2645 - var(--sh) * .25);
  top: calc(var(--sh) * .06);
  pointer-events: none;
}
.codex__body { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 18px 30px rgba(40, 42, 140, .55)); animation: bob 5.5s ease-in-out infinite; }
.codex__face { transition: transform .25s linear; }
.codex__cursor { animation: blink 1.1s steps(1, end) infinite; }
@keyframes bob { 50% { transform: translateY(-7px) rotate(-1.5deg); } }
@keyframes blink { 50% { opacity: 0; } }

.clock {
  position: absolute; z-index: 3;
  right: calc(50% - var(--sh) * .2645 - 26px);
  bottom: calc(var(--sh) * .12);
  padding: 8px 14px 6px; border-radius: 10px;
  background: #0a1145; box-shadow: inset 0 0 0 2px #2b3a9a, 0 12px 30px rgba(0, 0, 0, .35);
  font: 400 clamp(34px, calc(var(--sh) * .07), 58px)/.9 var(--f-pixel);
  color: var(--lcd); letter-spacing: .04em;
  text-shadow: 0 0 12px rgba(160, 196, 255, .8);
}

/* =====================================================================
   WORKS — episode shelf
   ===================================================================== */
.works { padding: clamp(72px, 9vw, 140px) 0 clamp(80px, 9vw, 150px); }
.works__head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 18px clamp(24px, 5vw, 96px); align-items: end;
  padding-inline: var(--gutter);
  margin-bottom: clamp(32px, 4vw, 56px);
}
.works__title {
  grid-row: span 2;
  font: 700 clamp(40px, 6vw, 104px)/.95 var(--f-display);
  letter-spacing: -.035em;
}
.works__logline { color: var(--muted); }
.works__head .link { justify-self: start; }

/* Default (touch / narrow): horizontal strip with snap */
.shelf {
  display: flex; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 4px var(--gutter) 18px;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: thin; scrollbar-color: var(--room) transparent;
}
.ep {
  position: relative; flex: 0 0 clamp(220px, 64vw, 320px);
  aspect-ratio: 9 / 16;
  scroll-snap-align: start;
  border-radius: var(--radius); overflow: hidden;
  background: var(--room);
}
.ep__link { position: absolute; inset: 0; display: block; color: var(--paper); text-decoration: none; -webkit-user-select: none; user-select: none; }
.ep__img, .ep__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.ep__img { transition: transform 1s var(--ease), filter .6s var(--ease); }
.ep__video { opacity: 0; transition: opacity .4s; }
.ep.is-previewing .ep__video { opacity: 1; }
.ep__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(9, 10, 34, .92) 0%, rgba(9, 10, 34, .25) 38%, transparent 60%);
  transition: opacity .6s;
}
.ep__num {
  position: absolute; left: 16px; top: 14px;
  font: 400 38px/1 var(--f-pixel); color: var(--lcd);
  text-shadow: 0 0 12px rgba(160, 196, 255, .7);
}
.ep.is-active .ep__num { color: var(--cat); text-shadow: 0 0 14px rgba(255, 178, 122, .6); }
.ep__info { position: absolute; left: 18px; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.ep__title { font: 700 clamp(17px, 1.5vw, 22px)/1.15 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.ep__meta { font-size: 14px; color: var(--muted); }
.ep__link:focus-visible { outline-offset: -4px; border-radius: var(--radius); }

/* Desktop with a mouse: expanding shelf. The active episode opens to its true 9:16 width. */
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .shelf {
    --shelf-h: clamp(420px, 72svh, 760px);
    height: var(--shelf-h);
    overflow: visible; scroll-snap-type: none;
    gap: 10px; padding: 0 var(--gutter);
  }
  .ep {
    flex: 1 1 0; min-width: 0; aspect-ratio: auto; height: 100%;
    transition: flex .75s var(--ease);
  }
  .ep.is-active { flex: 0 0 calc(var(--shelf-h) * 9 / 16); }
  .ep:not(.is-active) .ep__img { filter: saturate(.55) brightness(.55); transform: scale(1.08); }
  .ep:not(.is-active):hover .ep__img { filter: saturate(.8) brightness(.75); }
  .ep:not(.is-active) .ep__shade { opacity: .6; }
  .ep:not(.is-active) .ep__info {
    left: 14px; right: auto; bottom: 18px; top: 64px;
    writing-mode: vertical-rl; transform: rotate(180deg);
    align-content: start;
  }
  .ep:not(.is-active) .ep__title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 100%; }
  .ep:not(.is-active) .ep__meta { display: none; }
  .ep.is-active .ep__info { animation: info-in .6s .25s var(--ease) both; }
  .ep.is-active .ep__title { font-size: clamp(20px, 1.7vw, 26px); }
}
@keyframes info-in { from { opacity: 0; transform: translateY(14px); } }

/* =====================================================================
   ROLES
   ===================================================================== */
.roles {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr; align-items: start;
  gap: 28px clamp(32px, 6vw, 120px);
  padding: clamp(72px, 9vw, 140px) var(--gutter);
  background: var(--night-2);
  border-radius: clamp(24px, 3vw, 44px) clamp(24px, 3vw, 44px) 0 0;
}
.roles__title { font: 700 clamp(30px, 3.6vw, 58px)/1.04 var(--f-display); letter-spacing: -.03em; text-wrap: balance; }
.roles__text { grid-column: 1; color: var(--muted); max-width: 42ch; }
.roles__list {
  grid-column: 2; grid-row: 1 / span 2;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 48px);
}
.roles__list div { padding: 18px 0; border-top: 1px solid var(--line); }
.roles__list dt { font: 500 clamp(16px, 1.25vw, 19px)/1.25 var(--f-display); letter-spacing: -.01em; }
.roles__list dd { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); }

/* =====================================================================
   PROCESS — steps + sticky stage with "cut" transitions
   ===================================================================== */
.process { padding: clamp(72px, 9vw, 140px) var(--gutter); background: var(--night-2); }
.process__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 18px 48px; align-items: end; margin-bottom: clamp(36px, 5vw, 72px); }
.process__title { font: 700 clamp(36px, 5vw, 84px)/.98 var(--f-display); letter-spacing: -.035em; }
.process__head p { color: var(--muted); }

.steps { display: grid; gap: 56px; }
.step { position: relative; padding-left: 64px; }
.step__num {
  position: absolute; left: 0; top: -4px;
  font: 800 40px/1 var(--f-display); color: var(--cloud); letter-spacing: -.04em;
}
.step h3 { font: 700 clamp(22px, 2vw, 30px)/1.1 var(--f-display); letter-spacing: -.02em; }
.step p { margin-top: 12px; color: var(--muted); max-width: 46ch; }
.art { margin-top: 24px; }
.art figcaption { margin-top: 12px; font-size: 14px; color: var(--faint); }

.stage { display: none; }

.script {
  padding: clamp(18px, 2.4vw, 32px); border-radius: var(--radius);
  background: var(--room); box-shadow: inset 0 0 0 1px var(--line);
}
.script li { display: grid; grid-template-columns: 48px 92px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 0; }
.script li + li { border-top: 1px dashed var(--line); }
.script time { font: 400 20px/1 var(--f-pixel); color: var(--lcd); }
.script b { font-size: 14px; font-weight: 700; }
.script b.is-codex { color: var(--cloud); }
.script span { font-size: clamp(15px, 1.2vw, 18px); }

.cast { display: grid; grid-template-columns: 1.1fr 1fr .9fr; gap: 12px; align-items: end; }
.cast img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 14px; }
.cast img:nth-child(1) { object-position: 50% 30%; }
.cast img:nth-child(2) { margin-bottom: 18%; object-position: 50% 40%; }
.cast img:nth-child(3) { object-position: 50% 70%; }

.art--sheet img { width: 100%; height: auto; border-radius: 12px; }
.art--wave { padding: clamp(18px, 2.4vw, 32px); border-radius: var(--radius); background: var(--room); }
.art--wave img { width: 100%; height: auto; }
.wave__axis { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); font: 400 18px/1 var(--f-pixel); color: var(--lcd); }

.vtt {
  padding: clamp(18px, 2.4vw, 32px); border-radius: var(--radius);
  background: #0a0c22; box-shadow: inset 0 0 0 1px var(--line);
  font: 400 clamp(13px, 1.05vw, 16px)/1.7 var(--f-code); color: var(--paper);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.vtt__head { color: var(--cat); }
.vtt__time { color: var(--faint); }

/* ---- Before / after ---- */
.compare {
  --pos: 50%;
  position: relative; width: 100%; max-width: 520px;
  aspect-ratio: 427 / 476;
  border-radius: var(--radius); overflow: hidden; /* rounded frame */
  background: var(--room);
  cursor: ew-resize; touch-action: pan-y;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.compare__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.compare__after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.compare__handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 0; pointer-events: none; }
.compare__handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: var(--paper); box-shadow: 0 0 18px rgba(0, 0, 0, .45); }
.compare__knob {
  position: absolute; top: 50%; left: 0; translate: -50% -50%;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--paper); color: var(--night);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  transition: transform .3s var(--spring), background-color .2s;
}
.compare__knob svg { width: 16px; height: 16px; }
.compare:hover .compare__knob, .compare.is-dragging .compare__knob { transform: scale(1.1); background: var(--cloud); }
.compare:has(.compare__range:focus-visible) .compare__knob { outline: 3px solid var(--cat); outline-offset: 3px; }
.compare__tag {
  position: absolute; top: 14px; padding: 6px 12px; border-radius: 999px;
  background: rgba(13, 15, 43, .78); font-size: 14px; font-weight: 600; pointer-events: none;
}
.compare__tag--before { left: 14px; }
.compare__tag--after { right: 14px; }
.compare__range { /* keyboard and screen-reader control; pointer input is handled by the frame */
  position: absolute; left: 0; bottom: 0; width: 100%; height: 1px;
  margin: 0; opacity: 0; pointer-events: none;
}

.process__auto {
  margin-top: clamp(48px, 6vw, 96px); padding-top: 28px; border-top: 1px solid var(--line);
  max-width: 72ch; color: var(--muted);
}

/* Desktop: text on the left, one sticky stage on the right */
@media (min-width: 1024px) {
  .process__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 110px); }
  .steps { gap: 0; }
  .step {
    min-height: min(68svh, 620px);
    display: flex; flex-direction: column; justify-content: center;
    padding-left: 84px;
    opacity: .38; transition: opacity .5s var(--ease);
  }
  .step.is-active { opacity: 1; }
  .step__num { top: calc(50% - 56px); font-size: 52px; transition: color .4s; }
  .step:not(.is-active) .step__num { color: var(--faint); }
  .has-stage .step .art { display: none; }
  .has-stage .stage {
    display: block; position: sticky; top: calc(var(--head) + 24px);
    height: calc(100svh - var(--head) - 48px); max-height: 760px; min-height: 440px;
    align-self: start;
  }
  .stage__frame { position: relative; height: 100%; border-radius: 24px; background: var(--room); box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px -30px rgba(91, 95, 230, .55); overflow: hidden; }
  .stage .art {
    position: absolute; inset: 0; margin: 0; padding: clamp(20px, 2.4vw, 40px);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: var(--room);
    clip-path: inset(0 0 0 100%);
    transition: clip-path .75s var(--ease);
    z-index: 1;
  }
  .stage .art.is-prev { clip-path: inset(0); z-index: 1; transition: none; }
  .stage .art.is-active { clip-path: inset(0); z-index: 2; }
  .stage .art > * { max-width: 100%; }
  .stage .art--script .script, .stage .vtt { width: 100%; box-shadow: none; }
  .stage .art--wave { width: 100%; padding: clamp(20px, 2.4vw, 40px); }
  .stage .art--script .script { background: none; }
  .stage .art--sheet img { width: auto; max-height: calc(100% - 36px); }
  .stage .art--cast .cast { width: 100%; }
  .stage .cast img { aspect-ratio: 9 / 16; }
  .stage .art--compare .compare { height: calc(100% - 36px); width: auto; max-width: 100%; }
  .stage__count {
    position: absolute; right: 18px; top: 14px; z-index: 3;
    font: 400 20px/1 var(--f-pixel); color: var(--faint);
  }
}

/* =====================================================================
   CONTACT
   ===================================================================== */
.contact {
  position: relative; isolation: isolate;
  padding: clamp(96px, 12vw, 200px) var(--gutter) clamp(80px, 9vw, 140px);
  text-align: center;
  background: radial-gradient(70% 60% at 50% 0%, rgba(109, 112, 242, .22), transparent 70%), var(--night);
}
.contact__cloud { width: clamp(120px, 14vw, 200px); height: auto; margin: 0 auto 28px; overflow: visible; filter: drop-shadow(0 20px 36px rgba(40, 42, 140, .6)); animation: bob 5.5s ease-in-out infinite; }
.contact__title { max-width: 18ch; margin-inline: auto; font: 700 clamp(34px, 5.2vw, 88px)/1.02 var(--f-display); letter-spacing: -.035em; text-wrap: balance; }
.contact__text { margin: 24px auto 0; max-width: 44ch; color: var(--muted); }
.contact__links { margin-top: 36px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.footer {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 24px var(--gutter); font-size: 14px; color: var(--faint);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--paper); }

/* =====================================================================
   THEATER (showreel, full 16:9 frame)
   ===================================================================== */
.theater, .player {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; color: var(--paper);
  background: rgba(9, 10, 30, .97);
  overscroll-behavior: contain;
}
.theater::backdrop, .player::backdrop { background: rgba(9, 10, 30, .6); }
.theater[open], .player[open] { animation: dlg-in .35s var(--ease); }
@keyframes dlg-in { from { opacity: 0; } }

.theater[open] { display: grid; place-items: center; }
.theater__inner {
  --fw: min(calc(100vw - 2 * var(--gutter)), calc((100dvh - 210px) * 16 / 9), 1600px);
  width: var(--fw);
}
.theater__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.theater__title { font: 700 clamp(18px, 1.6vw, 24px)/1.1 var(--f-display); letter-spacing: -.02em; }
.theater__frame { width: 100%; aspect-ratio: 16 / 9; background: #141316; border-radius: 12px; overflow: hidden; }
.theater__video { width: 100%; height: 100%; object-fit: contain; background: #141316; }
.theater__hint { margin-top: 14px; font-size: 14px; color: var(--faint); }

.chapters { display: flex; gap: 4px; margin-top: 14px; width: 100%; }
.chapters li { flex: var(--w) 1 0; min-width: 0; }
.chapters button {
  position: relative; width: 100%;
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--faint); text-align: left; white-space: nowrap;
  transition: color .2s;
}
.chapters button::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; border-radius: 3px; background: rgba(179, 177, 255, .22); }
.chapters button::after { content: ""; position: absolute; left: 0; top: 0; height: 3px; border-radius: 3px; width: calc(var(--p, 0) * 100%); background: var(--cloud); }
.chapters button:hover, .chapters .is-current button { color: var(--paper); }
.chapters__ep { font: 400 20px/1 var(--f-pixel); }
.chapters .is-current .chapters__ep { color: var(--cat); }
.chapters__t { font-size: 13px; }

.close-btn {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(170, 168, 255, .14); color: var(--paper);
  transition: background-color .2s, transform .35s var(--spring);
}
.close-btn svg { width: 18px; height: 18px; }
.close-btn:hover { background: var(--paper); color: var(--night); transform: rotate(90deg); }

/* =====================================================================
   PLAYER (episodes)
   ===================================================================== */
.player__inner {
  position: relative; height: 100%;
  display: grid; grid-template-columns: auto minmax(280px, 400px); justify-content: center; align-items: center;
  gap: clamp(24px, 4vw, 72px); padding: 28px var(--gutter);
}
.player__stage { position: relative; height: min(calc(100dvh - 56px), 960px); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: #000; }
.player__video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player__video::cue { font-family: var(--f-body); font-size: 15px; background: rgba(0, 0, 0, .72); }
.player__error { position: absolute; inset: auto 12px 12px; padding: 12px 14px; border-radius: 12px; background: var(--room); font-size: 14px; }
.player__num { font: 400 46px/1 var(--f-pixel); color: var(--cat); text-shadow: 0 0 14px rgba(255, 178, 122, .5); }
.player__title { margin-top: 14px; font: 700 clamp(24px, 2.2vw, 36px)/1.08 var(--f-display); letter-spacing: -.025em; text-wrap: balance; }
.player__text { margin-top: 14px; color: var(--muted); }
.player__tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.player__nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 0; border-radius: 999px; background: none; cursor: pointer;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: box-shadow .2s, background-color .2s, color .2s;
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--cloud); }
.chip[aria-pressed="true"] { background: var(--cloud); color: var(--night); box-shadow: none; }
.chip:disabled { opacity: .35; cursor: default; box-shadow: inset 0 0 0 1.5px var(--line); }
.player__close { position: absolute; top: 16px; right: 16px; margin: 0; }

body.is-locked { overflow: hidden; }

/* ---------- View-transition names ---------- */
::view-transition-group(media) { animation-duration: .55s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
::view-transition-old(media), ::view-transition-new(media) { height: 100%; object-fit: cover; }

/* ---------- Cursor label (mouse only) ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none;
  padding: 8px 14px; border-radius: 999px;
  background: var(--paper); color: var(--night);
  font: 600 13px/1 var(--f-body); white-space: nowrap;
  opacity: 0; scale: .6;
  transition: opacity .2s, scale .3s var(--spring);
  will-change: transform;
}
.cursor.is-on { opacity: 1; scale: 1; }

/* =====================================================================
   Entrance — one orchestrated moment: the room switches on
   ===================================================================== */
.js .hero__line > span { transform: translateY(105%); }
.js .hero__lede, .js .hero__actions { opacity: 0; }
.js .screen__btn { clip-path: inset(49.6% 0 49.6% 0 round 26px); }
.js .codex { opacity: 0; transform: translate(40px, 30px) scale(.6); }
.js .clock { opacity: 0; }

.is-ready .hero__line > span { transform: none; transition: transform 1s var(--ease); }
.is-ready .hero__line:nth-child(2) > span { transition-delay: .09s; }
.is-ready .hero__lede { opacity: 1; transition: opacity .8s .45s; }
.is-ready .hero__actions { opacity: 1; transition: opacity .8s .6s; }
.is-ready .screen__btn { clip-path: inset(0 0 0 0 round 26px); transition: clip-path .9s .2s cubic-bezier(.7, 0, .2, 1), transform .6s var(--spring), box-shadow .5s var(--ease); animation: power-on 1.1s .2s both; }
.is-ready .codex { opacity: 1; transform: none; transition: opacity .5s .8s, transform .9s .8s var(--spring); }
.is-ready .clock { opacity: 1; transition: opacity .4s 1.1s; }
@keyframes power-on { 0% { filter: brightness(2.4); } 40% { filter: brightness(1.5); } 100% { filter: none; } }

/* Shelf reveal: panels rise like a film strip when the gallery enters */
.js .shelf .ep { clip-path: inset(100% 0 0 0 round var(--radius)); }
.js .shelf.is-in .ep { clip-path: inset(0 0 0 0 round var(--radius)); transition: clip-path .9s var(--ease), flex .75s var(--ease); }
.shelf.is-in .ep:nth-child(2) { transition-delay: .06s, 0s; }
.shelf.is-in .ep:nth-child(3) { transition-delay: .12s, 0s; }
.shelf.is-in .ep:nth-child(4) { transition-delay: .18s, 0s; }
.shelf.is-in .ep:nth-child(5) { transition-delay: .24s, 0s; }
.shelf.is-in .ep:nth-child(6) { transition-delay: .3s, 0s; }

/* Scroll-linked depth as the hero leaves (progressive, no JS) */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero__scene { animation: scene-out linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    @keyframes scene-out { to { transform: translateY(14%) scale(.94); } }
  }
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1023px) {
  .hero {
    --sh: clamp(380px, 58svh, 640px);
    grid-template-columns: 1fr;
    row-gap: 28px; align-content: start;
    padding-top: calc(var(--head) + 20px);
  }
  .hero::before { background: radial-gradient(80% 50% at 50% 70%, rgba(109, 112, 242, .3), transparent 70%), linear-gradient(180deg, var(--night) 25%, rgba(13, 15, 43, .5)); }
  .hero__backdrop { inset: 30% -10% -10% -10%; }
  .hero__scene { order: 2; }
  .hero__copy { order: 1; }
  .works__head, .process__head { grid-template-columns: 1fr; }
  .works__title { grid-row: auto; }
  .roles { grid-template-columns: 1fr; }
  .roles__list { grid-column: 1; grid-row: auto; }

  .player__inner { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 16px; padding: 14px 14px 18px; }
  .player__stage { height: 100%; max-height: calc(100dvh - 230px); max-width: 100%; }
  .player__info { width: 100%; max-width: 560px; }
  .player__num { font-size: 24px; }
  .player__title { font-size: 20px; margin-top: 8px; }
  .player__text { display: none; }
  .player__tools { margin-top: 14px; }
  .player__nav { margin-top: 14px; padding-top: 12px; }
}

@media (max-width: 699px) {
  :root { --head: 60px; }
  body { font-size: 16px; }
  .brand__name { display: none; }
  .masthead { gap: 8px; }
  .masthead__tg { display: none; }
  .nav { gap: 0; }
  .nav a { padding: 8px 10px; font-size: 14px; }

  .hero { --sh: clamp(330px, calc(100svh - var(--head) - 340px), 560px); row-gap: 22px; min-height: auto; padding-bottom: 56px; }
  .hero__title { font-size: clamp(32px, 11.2vw, 56px); }
  .hero__line:nth-child(2) { padding-left: 0; }
  .hero__lede { font-size: 16px; margin-top: 14px; }
  .hero__actions { margin-top: 0; }
  .hero__copy { display: contents; }
  .hero__title { order: 1; }
  .hero__scene { order: 2; }
  .hero__actions { order: 3; }
  .hero__lede { order: 4; }
  .hero__actions .btn { flex: 1 1 auto; }
  .screen__note { display: none; }
  .codex { width: calc(var(--sh) * .32); left: max(0px, calc(50% - var(--sh) * .2645 - var(--sh) * .22)); }
  .clock { font-size: 30px; padding: 6px 10px 4px; right: max(0px, calc(50% - var(--sh) * .2645 - 20px)); }

  .roles__list { grid-template-columns: 1fr; }
  .step { padding-left: 52px; }
  .step__num { font-size: 32px; }
  .script li { grid-template-columns: 44px minmax(0, 1fr); row-gap: 2px; }
  .script b { grid-column: 2; }
  .script span { grid-column: 2; }
  .script time { grid-row: 1 / span 2; }
  .cast { gap: 8px; }
  .contact__links .btn { width: 100%; }
  .footer { flex-direction: column; }

  .chapters__t { display: none; }
  .chapters li:last-child .chapters__ep { display: none; }
  .theater__bar { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .hero__line > span, .js .hero__lede, .js .hero__actions, .js .screen__btn, .js .codex, .js .clock, .js .shelf .ep { transform: none; opacity: 1; clip-path: none; }
  .cursor { display: none; }
}
