/* ---------- Tokens ---------- */
:root {
  --bg: #00040f;
  --bg-raised: #0a1020;
  --fg: #eef0f5;
  --muted: #8a93a8;
  --line: #1b2338;
  --accent: #a9b8ff;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 3vw, 40px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--fg); color: var(--bg); }

.container { padding-inline: var(--gutter); max-width: 1680px; margin-inline: auto; }
.mono {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
/* Large display text: grotesk, sentence case, tight. */
.display, .statement, .page-title, .project-title, .footer-mail, .not-found h1, .not-found p {
  font-family: var(--sans); font-weight: 500; letter-spacing: -.035em;
}

/* ---------- Dot cursor (mouse devices only, see main.js) ---------- */
.has-cursor-dot, .has-cursor-dot * { cursor: none !important; }
.cursor-dot {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  transition: width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), opacity .2s;
}
.cursor-dot.is-hidden { opacity: 0; }
.cursor-dot.is-link { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.cursor-dot.is-view { opacity: 0; }

/* ---------- Header ---------- */
.skip-link {
  position: fixed; left: var(--gutter); top: 12px; z-index: 20;
  padding: 10px 14px; background: var(--fg); color: var(--bg);
  transform: translateY(-200%); transition: transform .2s var(--ease);
}
.skip-link:focus { transform: none; }
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 16px var(--gutter);
  transition: background-color .4s var(--ease);
}
.site-header.is-solid { background: rgb(0 4 15 / .85); backdrop-filter: blur(10px); }
.site-name { justify-self: center; font-size: 13px; letter-spacing: .04em; text-transform: none; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); }
.site-nav--right { justify-self: end; }
.site-nav nav { display: flex; gap: inherit; }
/* Phones: name on the left and larger, the two links together on the right (no menu needed). */
@media (max-width: 767px) {
  .site-header { display: flex; gap: 16px; }
  .site-name { order: -1; margin-right: auto; font-size: 15px; letter-spacing: 0; }
}
.site-nav a, .lang-switch button { color: rgb(238 240 245 / .62); transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"],
.lang-switch button:hover, .lang-switch button[aria-pressed="true"] { color: var(--fg); }
.lang-switch { display: inline-flex; gap: 6px; color: rgb(238 240 245 / .3); }
.lang-switch button { letter-spacing: inherit; text-transform: inherit; font-size: inherit; padding: 4px 0; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(96px, 14vw, 200px);
  padding-block: 48px 32px;
  border-top: 1px solid var(--line);
}
.footer-mail { font-size: clamp(26px, 6vw, 80px); line-height: 1; display: inline-block; max-width: 100%; overflow-wrap: anywhere; transition: color .2s; }
.footer-mail:hover { color: var(--accent); }
.footer-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  margin-top: 40px; color: var(--muted);
}
.footer-meta nav { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-meta a:hover { color: var(--fg); }

/* ---------- Page heading ---------- */
.page { padding-top: clamp(110px, 14vw, 170px); }
.page-title {
  font-size: clamp(56px, 10vw, 152px); line-height: .92;
  margin: 0 0 clamp(32px, 5vw, 64px);
}

/* ---------- Page curtain: covers the page from first paint, lifts when motion.js is ready,
   drops again before leaving. The 3s animation is a safety net if scripts never run. ---------- */
.js body::before {
  content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background: var(--bg); opacity: 1; transition: opacity .7s var(--ease);
  animation: curtain-safety 0s 3s forwards;
}
.js.is-loaded body::before { opacity: 0; animation: none; }
.js.is-leaving body::before { opacity: 1; transition-duration: .4s; }
@keyframes curtain-safety { to { opacity: 0; } }

/* ---------- Mouse glow (mouse devices) ---------- */
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: -1; pointer-events: none;
  width: 900px; height: 900px; margin: -450px 0 0 -450px; border-radius: 50%;
  background: radial-gradient(circle, rgb(0 128 255 / .28) 0%, rgb(0 128 255 / .1) 35%, transparent 68%);
  will-change: transform;
}

/* ---------- Smooth scroll (Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Headings rise word by word ([data-split], see motion.js) ---------- */
.word-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.word { display: inline-block; }
.js [data-split].is-split .word { transform: translateY(110%); transition: transform .9s var(--ease); transition-delay: calc(var(--d) + .15s); }
.js [data-split].is-split.is-in .word { transform: none; }

/* ---------- Reveal (only hides when JS runs; see the inline script in each <head>) ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Home: statement ---------- */
.intro { padding-top: clamp(96px, 14vh, 160px); padding-bottom: clamp(24px, 4vw, 56px); }
.statement {
  max-width: 17ch; margin: 0 auto;
  font-size: clamp(40px, min(7.4vw, 12vh), 120px); line-height: 1.0;
  text-wrap: balance;
}

/* ---------- Home: marquee ---------- */
.marquee { overflow: hidden; white-space: nowrap; padding-block: 8px clamp(40px, 6vw, 88px); }
/* Moved by motion.js: drifts left and speeds up while scrolling. The track repeats the
   phrase 8×, so wrapping at half its width is seamless. */
.marquee-track {
  display: inline-block; will-change: transform;
  font: 500 clamp(64px, 11vw, 168px)/1 var(--sans); letter-spacing: -.035em; text-transform: uppercase;
}

/* ---------- Home: staggered blocks ---------- */
/* `dense` lets a dropped block share the row of the block before it. */
.blocks { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-flow: row dense; column-gap: clamp(12px, 2vw, 32px); row-gap: clamp(64px, 10vw, 140px); }
.block { grid-column: var(--start, 1) / span var(--span, 12); align-self: start; }
/* Small blocks sit lower than their big neighbour, like a contact sheet slightly out of line. */
.block.is-dropped { margin-top: clamp(80px, 15vw, 200px); }
.block-link { display: block; }
.block-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-raised); transition: transform .6s var(--ease); }
.block.is-portrait .block-media { aspect-ratio: 9 / 16; }
.block-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.block-loop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.block-loop { pointer-events: none; opacity: 0; transition: opacity .8s var(--ease); }
.block-loop.is-playing { opacity: 1; }
.block-caption { display: flex; justify-content: space-between; gap: 16px; margin: 12px 0 0; }
.block-caption .muted { text-align: right; }
/* Hovered work: the whole frame zooms 3% and a viewfinder (corner marks + centre cross) appears. */
.hover-frame { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); }
.hover-frame i { position: absolute; width: 12px; height: 12px; border: 0 solid var(--fg); }
.hover-frame i:nth-child(1) { left: 8px; top: 8px; border-width: 2px 0 0 2px; }
.hover-frame i:nth-child(2) { right: 8px; top: 8px; border-width: 2px 2px 0 0; }
.hover-frame i:nth-child(3) { left: 8px; bottom: 8px; border-width: 0 0 2px 2px; }
.hover-frame i:nth-child(4) { right: 8px; bottom: 8px; border-width: 0 2px 2px 0; }
.hover-frame b { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; }
.hover-frame b::before, .hover-frame b::after { content: ""; position: absolute; background: var(--fg); }
.hover-frame b::before { left: 15px; top: 0; width: 2px; height: 32px; }
.hover-frame b::after { top: 15px; left: 0; width: 32px; height: 2px; }
/* `is-hovered` is set by loops.js: on hover with a mouse, or for the work crossing the middle of a touch screen. */
.block.is-hovered .block-media, .is-hovered > .card .card-media { transform: scale(1.03); }
.block.is-hovered .hover-frame, .is-hovered > .card .hover-frame { opacity: 1; }
@media (hover: hover) {
  .block-link:hover .block-media, .card:hover .card-media { transform: scale(1.03); }
  .block-link:hover .hover-frame, .card:hover .hover-frame { opacity: 1; }
  .block-link:hover .block-caption > span:first-child { color: var(--accent); }
}
@media (max-width: 767px) {
  .blocks { grid-template-columns: 1fr; }
  .block { grid-column: 1 / -1; }
  .block.is-dropped { margin-top: 0; }
  .block.is-portrait { width: min(72%, 320px); }
  .block:nth-of-type(even) { width: 82%; justify-self: end; }
  .block-caption { flex-direction: column; gap: 2px; }
  .block-caption .muted { text-align: left; }
}
.all-projects {
  display: inline-block; margin-top: clamp(96px, 12vw, 180px);
  font: 500 clamp(40px, 7vw, 104px)/1 var(--sans); letter-spacing: -.035em;
  transition: color .2s;
}
.all-projects:hover { color: var(--accent); }

/* ---------- Play icon (showreel, vertical ads) ---------- */
.reel-icon {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border: 1px solid rgb(238 240 245 / .8); border-radius: 50%; background: rgb(0 4 15 / .35);
  backdrop-filter: blur(4px); transition: background-color .2s, border-color .2s;
}
.reel-icon::after {
  content: ""; position: absolute; left: 26px; top: 21px;
  border-style: solid; border-width: 11px 0 11px 17px; border-color: transparent transparent transparent var(--fg);
}
.reel-play:hover .reel-icon, .reel-play:focus-visible .reel-icon { background: var(--fg); border-color: var(--fg); }
.reel-play:hover .reel-icon::after, .reel-play:focus-visible .reel-icon::after { border-left-color: var(--bg); }

/* ---------- Work grid ---------- */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 32px 20px; grid-template-columns: 1fr;
}
@media (min-width: 768px) { .grid { grid-template-columns: repeat(2, 1fr); } }
.work-page { padding-top: clamp(80px, 10vw, 120px); }
.work-page .marquee { padding-bottom: clamp(24px, 3vw, 40px); }
.card { display: block; }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-raised); transition: transform .6s var(--ease); }
.card-media .block-loop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; opacity: 0; transition: opacity .8s var(--ease); }
.card-media .block-loop.is-playing { opacity: 1; }
.card-media img, .card-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s var(--ease), opacity .4s;
}
.card-media video { opacity: 0; }
.card-caption { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-top: 12px; }
.card-title { margin: 0; font-weight: 400; }
.card-roles { color: var(--muted); text-align: right; }
@media (hover: hover) {
  .card:hover .card-media video.is-ready { opacity: 1; }
  .card:hover .card-title { color: var(--accent); }
}
.filters { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-bottom: clamp(32px, 4vw, 56px); }
.filters button {
  color: var(--muted); padding: 6px 0; border-bottom: 1px solid transparent;
  font-size: inherit; letter-spacing: inherit; text-transform: inherit;
}
.filters button:hover { color: var(--fg); }
.filters button[aria-pressed="true"] { color: var(--fg); border-color: var(--fg); }
.count { color: var(--muted); margin-left: 4px; }

/* ---------- Project ---------- */
.player { position: relative; aspect-ratio: 16 / 9; background: var(--bg-raised) center / cover no-repeat; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.project-head { display: grid; gap: 24px; margin-top: clamp(32px, 4vw, 56px); }
@media (min-width: 900px) { .project-head { grid-template-columns: 2fr 1fr; align-items: start; } }
.project-title { font-size: clamp(44px, 6.4vw, 96px); line-height: .96; margin: 0; }
.project-desc { color: var(--muted); max-width: 46ch; margin: 20px 0 0; font-size: 19px; }
.credits { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.credits dt { color: var(--muted); }
.credits dd { margin: 0; }
.credits a, .team a { border-bottom: 1px solid var(--line); transition: border-color .2s, color .2s; }
.credits a:hover, .team a:hover { color: var(--accent); border-color: var(--accent); }
.team { margin-top: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line); padding-top: 20px; }
.team h2 { margin: 0 0 24px; font-weight: 400; }
.team-list { margin: 0; display: grid; gap: 24px 32px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.team-item dt { margin-bottom: 6px; }
.team-item dd { margin: 0; font-size: 18px; line-height: 1.5; }
.reels { display: grid; gap: clamp(12px, 2vw, 24px); grid-template-columns: repeat(auto-fit, minmax(200px, 320px)); justify-content: center; }
.reel-frame { position: relative; aspect-ratio: 9 / 16; background: var(--bg-raised); overflow: hidden; }
.reel-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-play { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.reel-play img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.reel-play:hover img { transform: scale(1.03); }
.vimeo-link { display: inline-block; margin-top: 16px; color: var(--muted); }
.vimeo-link:hover { color: var(--fg); }
.stills { display: grid; gap: clamp(8px, 1.2vw, 16px); grid-template-columns: repeat(3, 1fr); margin-top: clamp(48px, 6vw, 96px); }
.stills img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery { display: grid; gap: clamp(8px, 1.2vw, 16px); margin-top: clamp(48px, 6vw, 96px); }
@media (min-width: 900px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
.gallery img { width: 100%; height: auto; background: var(--bg-raised); }
.pager {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: clamp(80px, 10vw, 140px); padding-top: 24px; border-top: 1px solid var(--line);
}
.pager a { display: grid; gap: 6px; max-width: 45%; }
.pager a:last-child { text-align: right; margin-left: auto; }
.pager span:last-child {
  font: 500 clamp(22px, 3vw, 40px)/1.05 var(--sans); letter-spacing: -.03em;
  text-transform: none; transition: color .2s;
}
.pager a:hover span:last-child { color: var(--accent); }
.not-found { min-height: 50vh; }
.not-found p, .not-found h1 { font-size: clamp(36px, 5vw, 64px); line-height: 1; margin: 0 0 24px; }
.not-found a { border-bottom: 1px solid var(--fg); }

/* ---------- Contact (mirrors the reference: big heading, big address line, small people grid) ---------- */
.contact-title { font-size: clamp(32px, 3vw, 40px); line-height: 1.05; font-weight: 500; letter-spacing: -.03em; margin: 0 0 clamp(24px, 3vw, 40px); }
.contact-email {
  display: inline-block; font: 500 clamp(22px, 6.6vw, 64px)/1.05 var(--sans); letter-spacing: -.03em;
  max-width: 100%; overflow-wrap: anywhere; transition: color .2s;
}
.contact-email:hover { color: var(--accent); }
.contact-group { margin-top: clamp(56px, 7vw, 96px); }
.contact-group-title { font-size: clamp(22px, 2vw, 28px); font-weight: 500; letter-spacing: -.02em; margin: 0 0 24px; }
.contact-grid { margin: 0; display: grid; gap: 32px 24px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: 1000px; }
.contact-item dt { font-size: 14px; font-weight: 600; }
.contact-item dd { margin: 2px 0 0; font-size: 13px; }
.contact-button {
  display: inline-block; margin-top: 12px; padding: 10px 16px;
  border: 1px solid rgb(238 240 245 / .35); border-radius: 999px;
  transition: background-color .2s, color .2s, border-color .2s;
}
.contact-button:hover, .contact-button:focus-visible { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* ---------- About ---------- */
.about { display: grid; gap: clamp(32px, 5vw, 80px); }
@media (min-width: 900px) { .about { grid-template-columns: 5fr 7fr; align-items: start; } }
.about-portrait { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 30%; }
.about-bio { font-size: clamp(22px, 2.3vw, 32px); line-height: 1.25; letter-spacing: -.02em; font-weight: 500; margin: 0 0 clamp(40px, 5vw, 72px); }
.about-lists { display: grid; gap: 32px; }
@media (min-width: 640px) { .about-lists { grid-template-columns: 1fr 1fr; } }
.about-lists h2 { color: var(--muted); margin: 0 0 12px; font-weight: 400; }
.about-lists ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.services-also { margin: 14px 0 0; }
.about-lists .services li { font: 500 30px/1.1 var(--sans); letter-spacing: -.03em; }

@media (max-width: 639px) {
  .stills { grid-template-columns: 1fr; }
  .card-caption { flex-direction: column; gap: 4px; }
  .card-roles { text-align: left; }
  .site-nav { gap: 16px; }
  .lang-switch { gap: 4px; }
}
