/* ---------- Tokens: a dark blue night sky ---------- */
:root {
  --sky-0: #07090f;
  --sky-1: #0c1019;
  --sky-2: #111726;
  --sky-3: #182034;
  --ink: #ecebe8;
  --ink-2: #a6a9b1;
  --ink-3: #737885;
  --line: rgba(236, 235, 232, .12);
  --line-2: rgba(236, 235, 232, .24);
  --accent: #ecebe8;

  --serif: 'Spectral', Georgia, 'Times New Roman', serif;
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --pad: clamp(20px, 5vw, 64px);
  --max: 1240px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --sky-top: #07090f;
  --sky-bottom: #0b101b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--sky-0);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--sky-0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
section[id], article[id] { scroll-margin-top: 80px; }

.skip {
  position: fixed; left: 16px; top: 12px; z-index: 100; padding: 10px 16px; border-radius: 6px;
  background: var(--ink); color: var(--sky-0); font-weight: 500; transform: translateY(-200%); transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }

/* ---------- Sky behind the page ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}
.stars { position: absolute; inset: -10% 0; will-change: transform; }
.stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #e6e8ee;
  opacity: var(--o, .5);
}
.stars i.tw { animation: twinkle var(--t, 5s) ease-in-out infinite var(--dl, 0s); }
@keyframes twinkle { 50% { opacity: .05; } }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: 22px var(--pad); transition: background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.header.is-solid {
  padding-block: 14px; background: rgba(7, 9, 15, .86); border-bottom-color: var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.brand { font: 400 20px/1 var(--serif); letter-spacing: -.01em; }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 14.5px; }
.nav a, .lang button { position: relative; color: var(--ink-2); transition: color .3s; }
.nav a.is-current::after, .lang button[aria-pressed='true']::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: currentColor;
}
.nav a:hover, .nav a.is-current { color: var(--ink); }
.lang { display: flex; align-items: center; gap: 8px; font-size: 13.5px; letter-spacing: .06em; color: var(--ink-3); }
.lang button[aria-pressed='true'] { color: var(--ink); }
.lang button:hover { color: var(--ink); }

/* ---------- Shared bits ---------- */
.label { font: 500 12.5px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.btn {
  display: inline-flex; align-items: center; padding: 14px 24px; border-radius: 999px;
  background: var(--ink); color: var(--sky-0); font-weight: 500; font-size: 15.5px;
  transition: background-color .25s;
}
.btn:hover { background: #d4d3cf; }
.link {
  font-weight: 500; font-size: 15.5px; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 5px; text-decoration-color: var(--line-2); transition: text-decoration-color .25s;
}
.link:hover { text-decoration-color: currentColor; }
.link[hidden] { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 640px; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__video {
  width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%;
  transform: scale(calc(1.02 + var(--hp, 0) * .08)) translateY(calc(var(--hp, 0) * 4%));
  filter: brightness(calc(1 - var(--hp, 0) * .45));
}
.hero__media::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(7, 9, 15, .86) 0%, rgba(7, 9, 15, .55) 40%, rgba(7, 9, 15, .05) 72%);
}
.hero__media::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(7, 9, 15, .4) 0%, rgba(7, 9, 15, 0) 22%, rgba(7, 9, 15, 0) 60%, var(--sky-0) 100%);
}
.hero__inner {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(64px, 12vh, 130px);
  max-width: 820px; opacity: calc(1 - var(--hp, 0) * 1.6);
}
.hero__id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.hero__name { font: 400 clamp(22px, 1.9vw, 28px)/1.2 var(--serif); letter-spacing: -.005em; color: var(--ink); }
.hero__role { font-size: 13.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.hero__title {
  margin-top: 22px; font: 300 clamp(2.5rem, 5.4vw, 5.1rem)/1.04 var(--serif); letter-spacing: -.022em; text-wrap: balance;
}
.hero__title em { font-style: italic; color: var(--ink-2); }
.hero__lead { max-width: 33em; margin-top: 24px; font-size: clamp(17px, 1.3vw, 19px); color: var(--ink-2); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; margin-top: 36px; }
.hero__credit {
  position: absolute; right: var(--pad); bottom: 26px; max-width: 22em; text-align: right;
  font-size: 12.5px; color: var(--ink-3);
}

/* intro */
.js [data-rise] { opacity: 0; transform: translateY(18px); filter: blur(6px); }
.is-ready [data-rise] {
  opacity: 1; transform: none; filter: none;
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 110ms + 150ms);
}

/* reveal */
.js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal-fig] .fig__frame { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease); }
.js [data-reveal-fig] .fig__frame > * { transform: scale(1.05); transition: transform 1.8s var(--ease); }
.js [data-reveal-fig] figcaption { opacity: 0; transition: opacity .9s .5s var(--ease); }
.js [data-reveal-fig].is-in .fig__frame { clip-path: inset(0 0 0 0); }
.js [data-reveal-fig].is-in .fig__frame > * { transform: scale(1); }
.js [data-reveal-fig].is-in figcaption { opacity: 1; }

/* ---------- Layout ---------- */
.index, .project, .about, .contact { max-width: calc(var(--max) + var(--pad) * 2); margin: 0 auto; padding-inline: var(--pad); }

/* ---------- Index ---------- */
.index { padding-top: clamp(80px, 11vw, 150px); padding-bottom: clamp(60px, 8vw, 110px); }
.toc { margin-top: 26px; border-top: 1px solid var(--line); }
.toc li { border-bottom: 1px solid var(--line); }
.toc a {
  position: relative; display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) minmax(0, 1.2fr) auto; align-items: baseline; gap: 12px 28px;
  padding: 30px 0;
}
.toc__n { font: italic 300 20px/1 var(--serif); color: var(--ink-3); }
.toc__t { font: 300 clamp(2.1rem, 4.6vw, 3.8rem)/1 var(--serif); letter-spacing: -.02em; }
.toc__d { transition: color .25s; }
.toc a:hover .toc__d { color: var(--ink); }
.toc__d { color: var(--ink-2); }
.toc__note { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); text-align: right; }
.toc .star { width: 14px; height: 14px; fill: var(--ink-2); }

/* ---------- Project common ---------- */
.project { padding-block: clamp(70px, 10vw, 140px); }
.kicker { display: flex; align-items: baseline; gap: 14px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.kicker__n { font: italic 300 22px/1 var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.project__title { margin-top: 18px; font: 300 clamp(3.6rem, 8.6vw, 7.6rem)/.92 var(--serif); letter-spacing: -.035em; }
.project__title--italic { font-style: italic; letter-spacing: -.03em; }
.project__lead { margin-top: 28px; font-size: clamp(18px, 1.45vw, 20px); line-height: 1.55; max-width: 34em; }
.project__idea { margin-top: 22px; font: italic 300 clamp(21px, 1.9vw, 26px)/1.4 var(--serif); color: var(--ink-2); max-width: 26em; }
.project__foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 14px 28px; margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); }
.role { font-size: 14.5px; color: var(--ink-3); }
.links { display: flex; flex-wrap: wrap; gap: 12px 26px; }

/* figures */
.fig figcaption { margin-top: 14px; max-width: 46em; font-size: 13.5px; line-height: 1.5; color: var(--ink-3); }
.fig figcaption b { margin-right: .55em; font-weight: 500; color: var(--ink-2); }
.fig__frame { position: relative; overflow: hidden; border-radius: 4px; background: var(--sky-1); outline: 1px solid var(--line); outline-offset: -1px; }
.fig__frame img, .fig__frame video { width: 100%; height: auto; }

/* ---------- Qol-AI ---------- */
.qol { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.qol__sticky { position: sticky; top: 100px; }
.award {
  display: inline-flex; align-items: center; gap: 16px; margin-top: 30px; padding: 14px 22px 14px 16px;
  border: 1px solid var(--line-2); border-radius: 3px; background: rgba(236, 235, 232, .03);
}
.award__star { flex: none; width: 34px; height: 34px; fill: rgba(236, 235, 232, 0); stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.js .award__star path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s .3s var(--ease); }
.js .award.is-in .award__star path { stroke-dashoffset: 0; }
.award.is-in .award__star { fill: rgba(236, 235, 232, .14); transition: fill 1s 1.5s; }
.award__k { display: block; font: italic 400 25px/1.1 var(--serif); }
.award__t { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-2); }
.award__src {
  display: inline-block; margin-top: 8px; font-size: 13px; color: var(--ink-2);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--line-2);
  transition: color .25s, text-decoration-color .25s;
}
.award__src:hover { color: var(--ink); text-decoration-color: currentColor; }
.award__src[hidden] { display: none; }

.features { margin-top: 32px; border-top: 1px solid var(--line); }
.features > div { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); gap: 4px 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.features dt { font-weight: 500; }
.features dd { color: var(--ink-2); }

.qol__media { display: grid; gap: clamp(48px, 6vw, 80px); }
.shots { display: grid; gap: 18px; }
.shots__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.shots .fig__frame { aspect-ratio: 16 / 10; }
.shots .fig__frame img { height: 100%; object-fit: cover; object-position: 50% 0; }
.shots figcaption { margin-top: 10px; font-size: 13px; }

/* ---------- Scroll sequences ---------- */
.seq__poster, .seq__canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seq__canvas { opacity: 0; transition: opacity .5s; }
.is-live .seq__canvas { opacity: 1; }
.stages { display: flex; align-items: center; gap: 18px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.stages li[data-stage] { transition: color .3s; white-space: nowrap; }
.stages li.is-on { color: var(--ink); }
.stages__bar { flex: 1; min-width: 40px; height: 1px; background: var(--line); }
.stages__bar i { display: block; height: 100%; background: var(--ink-2); transform-origin: left; transform: scaleX(var(--p, 0)); }

.build { height: 240vh; }
.build__sticky { position: sticky; top: 96px; }
.build__frame { width: min(100%, calc((100vh - 240px) * .8)); aspect-ratio: 4 / 5; }
.build .stages { width: min(100%, calc((100vh - 240px) * .8)); margin-top: 14px; }
.build figcaption { max-width: min(100%, calc((100vh - 240px) * .8)); }

.assemble { position: relative; width: 100vw; margin: clamp(48px, 6vw, 80px) 0 0 calc(50% - 50vw); height: 330vh; }
.assemble__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--sky-0); }
.assemble__sticky::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--sky-0) 0%, rgba(7, 9, 15, 0) 14%, rgba(7, 9, 15, 0) 62%, rgba(7, 9, 15, .9) 100%);
}
.assemble__overlay {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0;
  max-width: calc(var(--max) + var(--pad) * 2); margin: 0 auto; padding: 0 var(--pad) clamp(28px, 5vh, 48px);
}
.assemble .stages { color: var(--ink-3); }
.assemble__cap { margin-top: 12px; font-size: 13.5px; color: var(--ink-3); max-width: 46em; }
.assemble__cap b { margin-right: .55em; font-weight: 500; color: var(--ink-2); }

/* ---------- IzTime ---------- */
.iz__head { max-width: 900px; }
.iz__lead { max-width: 36em; }
.fig--wide { margin-top: clamp(48px, 6vw, 80px); }
.fig--wide .fig__frame { aspect-ratio: 16 / 9; }
[data-drift] { height: 100%; object-fit: cover; }
.fig--wide [data-drift], .iz__pair [data-drift] { transform-origin: 50% 50%; }
.drift-on [data-drift] { translate: 0 var(--dy, 0); scale: 1.08; }
.iz__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); margin-top: clamp(56px, 7vw, 96px); align-items: start; }
.iz__idea { margin-top: 0; font-size: clamp(24px, 2.4vw, 34px); color: var(--ink); }
.numerals { margin-top: 16px; counter-reset: n; border-top: 1px solid var(--line); }
.numerals li {
  counter-increment: n; display: grid; grid-template-columns: 3rem minmax(0, 1fr); padding: 13px 0; border-bottom: 1px solid var(--line);
}
.numerals li::before { content: counter(n, upper-roman); font: italic 300 18px/1.5 var(--serif); color: var(--ink-3); }
.iz__pair { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: end; margin-top: clamp(56px, 7vw, 96px); }
.iz__pair .fig:first-child .fig__frame { aspect-ratio: 4 / 5; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: 32px; padding-block: clamp(70px, 10vw, 140px); border-top: 1px solid var(--line); }
.about__text { font: 300 clamp(1.55rem, 2.7vw, 2.35rem)/1.36 var(--serif); letter-spacing: -.01em; max-width: 30em; }
.about__also { margin-top: 30px; max-width: 36em; color: var(--ink-2); }

/* ---------- Contact ---------- */
.contact { padding-block: clamp(70px, 10vw, 140px) clamp(60px, 8vw, 110px); border-top: 1px solid var(--line); }
.contact__title { margin-top: 26px; max-width: 13ch; font: 300 clamp(2.7rem, 7.2vw, 6.2rem)/1 var(--serif); letter-spacing: -.035em; }
.contact__text { margin-top: 24px; color: var(--ink-2); max-width: 32em; }
.contact__list { margin-top: 44px; border-top: 1px solid var(--line); }
.contact__list a {
  position: relative; display: grid; grid-template-columns: 9rem minmax(0, 1fr) auto; align-items: baseline; gap: 20px; padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.contact__k { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.contact__v { font: 300 clamp(1.5rem, 3vw, 2.4rem)/1.1 var(--serif); overflow-wrap: anywhere; }
.contact__arrow { font-size: 22px; color: var(--ink-3); transition: color .25s; }
.contact__list a:hover .contact__arrow { color: var(--ink); }

/* ---------- Footer ---------- */
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px 24px;
  max-width: calc(var(--max) + var(--pad) * 2); margin: 0 auto; padding: 28px var(--pad) 40px;
  border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-3);
}
.footer__motto { font: italic 300 17px var(--serif); color: var(--ink-2); }
.footer a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .qol { grid-template-columns: 1fr; }
  .qol__sticky { position: static; }
  .iz__body, .iz__pair { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 18px; }
  .toc a { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .toc__d, .toc__note { grid-column: 2; text-align: left; }
}
@media (max-width: 680px) {
  .build { height: 200vh; }
  .build__sticky { top: 72px; }
  .build__frame, .build .stages, .build figcaption { width: min(100%, calc((100svh - 230px) * .8)); max-width: none; }
  .stages { flex-wrap: wrap; gap: 6px 14px; font-size: 11.5px; }
  .stages__bar { display: none; }
  body { font-size: 16px; }
  .nav { display: none; }
  .lang { margin-left: auto; }
  .hero__media::before { background: linear-gradient(0deg, rgba(7, 9, 15, .92) 0%, rgba(7, 9, 15, .6) 45%, rgba(7, 9, 15, 0) 75%); }
  .hero__video { object-position: 68% 50%; }
  .hero__inner { bottom: 76px; }
  .hero__credit { left: var(--pad); right: auto; bottom: 22px; text-align: left; }
  .features > div { grid-template-columns: 1fr; }
  .shots__row { grid-template-columns: 1fr; }
  .contact__list a { grid-template-columns: minmax(0, 1fr) auto; }
  .contact__k { grid-column: 1 / -1; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-rise], .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .js [data-reveal-fig] .fig__frame { clip-path: none; }
  .js [data-reveal-fig] .fig__frame > *, .drift-on [data-drift] { transform: none; scale: 1; translate: none; }
  .js [data-reveal-fig] figcaption { opacity: 1; }
  .js .award__star path { stroke-dashoffset: 0; }
  .hero__video { transform: none; filter: none; }
  .hero__inner { opacity: 1; }
  .build, .assemble { height: auto; }
  .build__sticky, .assemble__sticky { position: relative; top: 0; }
  .assemble__sticky { height: 70vh; }
  .seq__canvas { display: none; }
}
