:root {
  --bg: #0b0b0c;
  --bg2: #141317;
  --line: #26242c;
  --fg: #ece9f2;
  --dim: #8b8794;
  --accent: #9d6bff;
  --accent2: #e2d4ff;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --pad: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
::selection { background: var(--accent); color: var(--bg); }

.mono { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.accent { color: var(--accent); }
em { font-style: normal; color: var(--accent); }

/* loader */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-content: center; gap: 18px; justify-items: center;
  transition: transform .9s var(--ease) .1s;
}
.loader-logo { width: 72px; image-rendering: pixelated; animation: pulse 1s steps(2) infinite; }
.loader-word { font: 700 clamp(22px, 4vw, 36px)/1 "Space Grotesk"; letter-spacing: .3em; }
.loader-bar { width: 160px; height: 2px; background: var(--line); position: relative; overflow: hidden; }
.loader-bar::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: load 1s var(--ease) forwards; }
body:not(.loading) .loader { transform: translateY(-100%); }
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pulse { 50% { opacity: .6; } }

.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); z-index: 60; }

/* nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px var(--pad);
  background: linear-gradient(var(--bg) 20%, transparent);
}
.logo { font-weight: 700; letter-spacing: .22em; font-size: 14px; display: flex; align-items: center; gap: 12px; }
.logo img { transition: transform .5s var(--ease); }
.logo:hover img { transform: rotate(180deg); }
.nav nav { display: flex; gap: clamp(14px, 2.6vw, 34px); font-size: 14px; }
.nav nav a { position: relative; color: var(--dim); transition: color .3s; }
.nav nav a:hover { color: var(--fg); }
.nav nav a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* hero */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; padding: 120px var(--pad) 80px; overflow: hidden; }
.hero-grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; max-width: 1100px; pointer-events: none; }
.hero-inner .btn { pointer-events: auto; }
.hero-model { position: absolute; inset: 0; pointer-events: none; opacity: 0; transform: translateY(30px); transition: opacity 1.4s var(--ease) .6s, transform 1.4s var(--ease) .6s; }
.hero-model.on { opacity: 1; transform: none; }
.hero-model canvas { width: 100%; height: 100%; display: block; }
.tag { color: var(--dim); margin-bottom: 28px; }
.hero-title { font-size: clamp(48px, 10vw, 148px); line-height: .92; font-weight: 700; letter-spacing: -.04em; }
.hero-title .line { display: block; overflow: hidden; }
.hero-title .line > span { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease); }
body.ready .hero-title .line > span { transform: none; }
body.ready .hero-title .line:nth-child(2) > span { transition-delay: .08s; }
body.ready .hero-title .line:nth-child(3) > span { transition-delay: .16s; }
.hero-sub { max-width: 520px; margin: 36px 0 40px; color: var(--dim); font-size: 18px; }
.btn { display: inline-flex; gap: 12px; align-items: center; padding: 14px 24px; border: 1px solid var(--line); border-radius: 100px; transition: background .3s, color .3s, border-color .3s; }
.btn:hover { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn span { transition: transform .3s var(--ease); }
.btn:hover span { transform: translateY(3px); }
.hero-foot { position: absolute; left: var(--pad); right: var(--pad); bottom: 28px; display: flex; justify-content: space-between; gap: 16px; color: var(--dim); }

/* marquee */
.marquee { border-block: 1px solid var(--line); overflow: hidden; white-space: nowrap; padding: 18px 0; color: var(--dim); }
.marquee > div { display: inline-flex; animation: marquee 40s linear infinite; }
.marquee span { padding: 0 28px; }
.marquee span::before { content: "■"; color: var(--accent); margin-right: 28px; font-size: 8px; vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* sections */
.section { padding: clamp(80px, 12vw, 160px) var(--pad); border-bottom: 1px solid var(--line); }
.label { color: var(--dim); margin-bottom: 40px; }
.label::before { content: "■ "; color: var(--accent); }
.title { font-size: clamp(40px, 7vw, 96px); line-height: 1; letter-spacing: -.035em; font-weight: 700; margin-bottom: 32px; }
.sub { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.02em; font-weight: 500; margin: 96px 0 32px; }
.prose p + p { margin-top: 1em; }
.prose, .narrow { max-width: 640px; color: #c9c5d2; }
.prose strong { color: var(--fg); font-weight: 500; }
.hint { color: var(--dim); text-transform: none; letter-spacing: 0; margin-top: 16px; }

.big { font-size: clamp(26px, 3.6vw, 52px); line-height: 1.2; letter-spacing: -.02em; max-width: 1200px; }
.reveal-words .w { opacity: .15; transition: opacity .5s; }
.reveal-words .w.on { opacity: 1; }

/* reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* work */

/* case */
.case-head { display: grid; gap: 40px; margin-bottom: 80px; }
.case-title { font-size: clamp(64px, 14vw, 220px); line-height: .85; letter-spacing: -.05em; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.facts div { padding: 18px 18px 0 0; }
.facts dt { font: 12px "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin-bottom: 6px; }
.facts b { color: var(--accent); font-weight: 500; }
.case-body > * + * { margin-top: 64px; }

.ticks { list-style: none; margin-top: 1.4em; }
.ticks li { padding: 12px 0 12px 28px; border-top: 1px solid var(--line); position: relative; }
.ticks li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* trailer stage */
.stage { position: relative; aspect-ratio: 16/9; background: #000; border-radius: 4px; overflow: hidden; }
.stage video, .stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; display: block; }
.stage video { cursor: pointer; }
.stage:has(video)::after { content: "Click for sound"; position: absolute; right: 18px; bottom: 16px; font: 11px "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 100px; background: #0b0b0ccc; color: var(--dim); pointer-events: none; transition: opacity .4s; }
.stage.sound::after { content: "Sound on"; color: var(--accent2); }
.yt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 12px; background: #0b0b0c55; color: var(--fg); transition: background .4s; cursor: pointer; }
.yt-play:hover { background: #0b0b0c22; }
.yt-play .play { transition: transform .4s var(--ease); }
.yt-play:hover .play { transform: scale(1.15); }
.stage-tag { position: absolute; left: 20px; top: 18px; padding: 6px 12px; border-radius: 100px; background: #0b0b0ccc; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.stage-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s steps(2) infinite; }

.shot { display: block; overflow: hidden; background: var(--bg2); border-radius: 4px; cursor: zoom-in; width: 100%; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.shot:hover img { transform: scale(1.04); }
.hero-shot { aspect-ratio: 21/9; }

.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 28px; }
.gallery .shot { aspect-ratio: 16/10; }
.gallery .shot.wide { grid-column: 1 / -1; aspect-ratio: 21/9; }

.bosses { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 80px); }
.bosses .mono { margin-bottom: 16px; }
.phases { list-style: none; counter-reset: p; }
.phases li { counter-increment: p; padding: 16px 0 16px 48px; border-top: 1px solid var(--line); position: relative; }
.phases li::before { content: "0" counter(p); position: absolute; left: 0; top: 18px; font: 12px "JetBrains Mono"; color: var(--accent); }
.phases b { display: block; color: var(--fg); font-weight: 500; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); border-radius: 100px; padding: 8px 14px; color: var(--dim); transition: border-color .3s, color .3s; }
.chips li:hover { border-color: var(--accent); color: var(--fg); }

.videos { display: flex; flex-wrap: wrap; gap: 12px; }
.video { display: flex; align-items: center; gap: 14px; padding: 12px 22px 12px 12px; border: 1px solid var(--line); border-radius: 100px; transition: border-color .3s, background .3s; }
.video:hover { border-color: var(--accent); background: var(--bg2); }
.play { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); position: relative; flex: none; }
.play::after { content: ""; position: absolute; left: 14px; top: 11px; border-left: 11px solid var(--bg); border-block: 7px solid transparent; }
.play.doc-ico { background: var(--bg2); border: 1px solid var(--line); }
.play.doc-ico::after { left: 12px; top: 10px; width: 10px; height: 14px; border: 2px solid var(--accent); border-radius: 1px; }

.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.notes > div { background: var(--bg2); padding: 28px; border-radius: 4px; color: #c9c5d2; }
.notes .mono { color: var(--accent); margin-bottom: 10px; }

/* partners: 2 big on top, 3 below */
.partners { display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; margin-top: 56px; }
.partner { grid-column: span 2; background: var(--bg2); border-radius: 6px; padding: 12px; transition: box-shadow .5s; }
.partner:nth-child(-n+2) { grid-column: span 3; }
.partner:hover { box-shadow: 0 24px 60px -24px #9d6bff66; }
.partner-img { position: relative; aspect-ratio: 16/9; overflow: hidden; border-radius: 4px; background: #000; }
.partner-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s, transform 1.2s var(--ease); }
.swap img + img { opacity: 0; }
.partner:hover .swap img + img { opacity: 1; transform: scale(1.06); }
.partner-info { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 20px; padding: 20px 10px 8px; }
.partner-info .mono { color: var(--dim); }
.partner-info a { color: var(--accent); grid-column: 2; grid-row: 1; border-bottom: 1px solid transparent; transition: border-color .3s; }
.partner-info a:hover { border-color: var(--accent); }
.partner h3 { font-size: clamp(22px, 2.2vw, 32px); font-weight: 500; letter-spacing: -.02em; margin-top: 4px; }
.stat { color: var(--dim); font-size: 15px; }
.stat b { color: var(--accent2); font-weight: 500; }

.credits { list-style: none; border-top: 1px solid var(--line); margin-top: 32px; }
.credits a { display: grid; grid-template-columns: 1fr auto 40px; align-items: center; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); font-size: clamp(20px, 2.4vw, 30px); letter-spacing: -.02em; transition: padding .4s var(--ease), color .3s; }
.credits a .mono { color: var(--dim); }
.credits a i { font-style: normal; text-align: right; transition: transform .4s var(--ease); }
.credits a:hover { padding-left: 16px; color: var(--accent); }
.credits a:hover i { transform: translate(4px, -4px); }

/* lab */
.lab-intro { margin: 48px 0; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); margin-bottom: 56px; }
.features > div { padding: 24px 24px 0 0; }
.features span { color: var(--accent); }
.features h4 { font-size: 20px; font-weight: 500; margin: 12px 0 6px; }
.features p { color: var(--dim); font-size: 15px; }

/* archive */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 32px; }
.filters button { border: 1px solid var(--line); border-radius: 100px; padding: 8px 16px; color: var(--dim); transition: all .3s; }
.filters button:hover { color: var(--fg); }
.filters button.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.docs { columns: 4 240px; column-gap: 16px; }
.doc-card { display: block; width: 100%; break-inside: avoid; margin-bottom: 16px; padding: 10px 10px 16px; background: var(--bg2); border: 1px solid var(--line); border-radius: 4px; cursor: zoom-in; transition: border-color .3s, transform .5s var(--ease); animation: pop .5s var(--ease); }
.doc-card:hover { border-color: var(--accent); transform: rotate(-.6deg) translateY(-3px); }
.doc-card img { width: 100%; border-radius: 2px; margin-bottom: 14px; filter: grayscale(.4); transition: filter .4s; }
.doc-card:hover img { filter: none; }
.doc-card .mono { color: var(--accent); display: block; padding: 0 4px; }
.doc-card b { display: block; font-weight: 500; padding: 2px 4px 0; }
.doc-card[hidden] { display: none; }

/* next */
.next-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.next { background: var(--bg2); border-radius: 4px; padding: clamp(24px, 3vw, 40px); transition: transform .5s var(--ease); }
.next:hover { transform: translateY(-4px); }
.next > .mono { color: var(--accent); }
.next h3 { font-size: clamp(26px, 3vw, 40px); letter-spacing: -.03em; font-weight: 500; margin: 12px 0 10px; }
.next p { color: var(--dim); }
.next .chips { margin-top: 18px; }
.mini { display: flex; gap: 12px; margin-top: 20px; }
.mini .shot { width: 88px; aspect-ratio: 2/3; }
.mini .shot img { object-fit: contain; image-rendering: pixelated; }
.link { display: inline-block; margin-top: 18px; border-bottom: 1px solid var(--accent); }

/* team */
.people { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.person { border-top: 1px solid var(--line); padding-top: 24px; }
.avatar { width: 56px; height: 56px; display: grid; place-content: center; background: var(--bg2); border: 1px solid var(--line); margin-bottom: 24px; font-size: 14px; transition: background .3s, color .3s; }
.person:hover .avatar { background: var(--accent); color: var(--bg); }
.person h3 { font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.person h3 i { font-style: normal; color: var(--dim); }
.person .mono { margin: 6px 0 14px; }
.person p:last-child { color: var(--dim); font-size: 15px; }

/* words */
.letter { border-top: 1px solid var(--line); padding-top: 48px; margin-top: 16px; }
.quote p { font-size: clamp(26px, 3.4vw, 48px); line-height: 1.2; letter-spacing: -.02em; max-width: 1100px; }
.quote p::first-letter { color: var(--accent); }
.who { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.who b, .rec b { font-weight: 500; font-size: 18px; }
.who .mono, .rec .mono { color: var(--dim); }
details { margin-top: 28px; }
summary { cursor: pointer; color: var(--accent); list-style: none; display: inline-flex; gap: 10px; }
summary::before { content: "+"; transition: transform .3s; }
details[open] summary::before { transform: rotate(45deg); }
details .prose { margin-top: 24px; padding-left: 20px; border-left: 2px solid var(--accent); }
.recs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 80px; }
.rec { background: var(--bg2); border-radius: 4px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 28px; transition: transform .5s var(--ease); }
.rec:hover { transform: translateY(-4px); }
.rec p { font-size: 18px; line-height: 1.5; color: #d6d2de; }
.rec footer { display: grid; gap: 4px; border-top: 1px solid var(--line); padding-top: 18px; }

/* footer */
.end { padding: clamp(100px, 16vw, 220px) var(--pad) 32px; }
.end-logo { width: 64px; margin-bottom: 40px; }
.end-title { font-size: clamp(40px, 8vw, 120px); line-height: .95; letter-spacing: -.04em; font-weight: 700; margin-bottom: 120px; }
.end-row { display: flex; justify-content: space-between; color: var(--dim); border-top: 1px solid var(--line); padding-top: 20px; }
.end-row a:hover { color: var(--accent); }

/* dialogs */
.lightbox { margin: auto; border: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
.lightbox::backdrop { background: #07060acc; backdrop-filter: blur(6px); }
.lightbox[open] { animation: pop .4s var(--ease); }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 4px; }
.lightbox iframe { width: min(1200px, 94vw); aspect-ratio: 16/9; border: 0; border-radius: 4px; background: #000; }
.close { position: absolute; top: -36px; right: 0; color: var(--fg); }
.close:hover { color: var(--accent); }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }

/* responsive */
@media (max-width: 900px) {
  /* nav: one row, links scroll sideways */
  .nav { gap: 16px; padding: 14px var(--pad); background: linear-gradient(var(--bg) 55%, transparent); }
  .nav nav { overflow-x: auto; scrollbar-width: none; gap: 18px; font-size: 13px; padding: 4px 0; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav nav::-webkit-scrollbar { display: none; }
  .nav nav a { white-space: nowrap; }

  /* hero: dragon on top, text below */
  .hero { flex-direction: column; justify-content: flex-end; align-items: stretch; padding: 50svh var(--pad) 72px; }
  .hero-model { inset: 0 0 auto 0; height: 58svh; }
  .hero-title { font-size: clamp(40px, 11vw, 72px); }
  .hero-sub { font-size: 16px; margin: 20px 0 28px; }
  .tag { margin-bottom: 16px; }
  .hero-foot { bottom: 20px; }
  .hero-foot span:first-child { display: none; }

  .label { margin-bottom: 24px; }
  .sub { margin: 64px 0 24px; }
  .case-head { margin-bottom: 40px; gap: 28px; }
  .case-title { font-size: clamp(48px, 14vw, 120px); }
  .case-body > * + * { margin-top: 40px; }
  .bosses, .notes, .next-list, .people, .recs, .partners { grid-template-columns: 1fr; }
  .partner, .partner:nth-child(-n+2) { grid-column: auto; }
  .partners { gap: 14px; margin-top: 32px; }
  .facts, .features { grid-template-columns: 1fr 1fr; }
  .facts div { padding-right: 12px; }
  .gallery { gap: 8px; }
  .docs { columns: 2; column-gap: 10px; }
  .doc-card { margin-bottom: 10px; padding: 6px 6px 12px; }
  .doc-card b { font-size: 14px; }
  .rec { padding: 24px; }
  .credits a { grid-template-columns: 1fr 30px; }
  .credits a .mono { display: none; }
  .end-title { margin-bottom: 64px; }
  .stage-tag { left: 12px; top: 12px; }
}

/* touch screens: no hover, so wording and affordances change */
@media (hover: none) {
  .stage:has(video)::after { content: "Tap for sound"; right: 12px; bottom: 12px; }
  .stage.sound::after { content: "Sound on"; }
  * { -webkit-tap-highlight-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero-title .line > span { transform: none; }
}
