/* ============================================================
   bynicolaasjoosten — preview
   Calm, cinematic, slow. Motion is soft and never in the way.
   ============================================================ */

:root {
  --bg:        #0B0B0B;
  --bg-2:      #121212;
  --ink:       #F2F0EC;
  --ink-2:     #A3A09A;
  --ink-3:     #5E5C58;
  --line:      rgba(242, 240, 236, 0.12);
  --line-2:    rgba(242, 240, 236, 0.28);

  --ease:      cubic-bezier(0.22, 1, 0.36, 1);      /* soft expo-out */
  --ease-io:   cubic-bezier(0.65, 0, 0.35, 1);
  --slow:      1.2s;
  --med:       0.8s;

  --gutter:    clamp(16px, 4vw, 56px);
  --max:       1600px;

  --font-body:    'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --display-weight: 500;
  --display-track: -0.045em;
  --display-scale: 1;
  --display-upper: none;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.theme-light {
  --bg:   #F4F2EE;
  --bg-2: #EAE7E1;
  --ink:  #111111;
  --ink-2:#5A5853;
  --ink-3:#9C9993;
  --line: rgba(17, 17, 17, 0.12);
  --line-2: rgba(17, 17, 17, 0.3);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }

/* ---------- Type helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-track);
  line-height: 0.95;
  text-transform: var(--display-upper);
}
.display em { font-style: normal; color: var(--ink-2); }
.hero .display em { color: rgba(242, 240, 236, 0.62); }
.label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 80;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  color: var(--ink);
  view-transition-name: nav;
}
/* Soft dark scrim with a fading blur, so the nav reads on any image */
.nav::before {
  content: ''; position: absolute; inset: 0 0 -48px 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(11,11,11,.72), rgba(11,11,11,.35) 55%, rgba(11,11,11,0));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
          mask-image: linear-gradient(to bottom, #000 40%, transparent);
  pointer-events: none;
}
.nav__mark,
.nav__links a,
.nav__toggle {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.nav__links { display: flex; gap: 36px; align-items: center; }
.nav__links a {
  position: relative;
  opacity: 0.75;
  transition: opacity 0.4s var(--ease);
}
.nav__links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { opacity: 1; }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.nav__toggle {
  display: none;
  background: none; border: 0; color: inherit; cursor: pointer;
  padding: 8px 0;
}

.menu {
  position: fixed; inset: 0; z-index: 79;
  background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 96px var(--gutter) 48px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.9s var(--ease-io);
  pointer-events: none;
}
.menu.open { clip-path: inset(0 0 0 0); pointer-events: auto; }
.menu a.display {
  display: block;
  font-size: clamp(48px, 14vw, 96px);
  overflow: hidden;
}
.menu a.display span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 0.9s var(--ease);
}
.menu.open a.display span { transform: none; }
.menu.open a.display:nth-child(2) span { transition-delay: 0.06s; }
.menu.open a.display:nth-child(3) span { transition-delay: 0.12s; }
.menu.open a.display:nth-child(4) span { transition-delay: 0.18s; }
.menu__foot { display: flex; justify-content: space-between; margin-top: 40px; }

@media (max-width: 760px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
}

/* ---------- Reveal system ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* Masked line reveal (headlines) */
.lines .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.lines .line > span { display: inline-block; }
.js .lines .line > span {
  transform: translateY(110%);
  transition: transform 1.4s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.09s + var(--d, 0s));
}
.js .lines.is-in .line > span { transform: none; }

/* Image reveal: curtain lifts, image settles */
.js [data-curtain] { clip-path: inset(100% 0 0 0); transition: clip-path 1.6s var(--ease-io); }
.js [data-curtain] img { transform: scale(1.15); transition: transform 2.2s var(--ease); }
.js [data-curtain].is-in { clip-path: inset(0 0 0 0); }
.js [data-curtain].is-in img { transform: scale(1); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh; min-height: 560px;
  overflow: hidden;
  color: #F2F0EC;
  background: #000;
}
.hero__media, .hero__poster {
  position: absolute; inset: 0;
  container-type: size;
}
.hero__poster img { width: 100%; height: 100%; object-fit: cover; }
.hero__media { opacity: 0; transition: opacity 1.8s var(--ease); }
.hero__media.is-playing { opacity: 1; }
.cover-frame {
  position: absolute; top: 50%; left: 50%;
  width:  max(100cqw, calc(100cqh * var(--r, 1.7778)));
  height: max(100cqh, calc(100cqw / var(--r, 1.7778)));
  transform: translate(-50%, -50%);
  border: 0; pointer-events: none;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 62%, rgba(0,0,0,0.45) 100%);
}
.hero__inner {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(32px, 7vh, 72px);
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 32px;
}
.hero__title { font-size: calc(var(--display-scale) * clamp(44px, 8.2vw, 148px)); max-width: 13ch; }
.hero__title em { font-style: normal; }
.hero__side { display: flex; flex-direction: column; align-items: flex-end; gap: 18px; text-align: right; }
.hero__side .label { color: rgba(242,240,236,0.7); }
.hero__scroll {
  position: relative; width: 1px; height: 64px; background: rgba(242,240,236,0.2); overflow: hidden;
}
.hero__scroll::after {
  content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 40%;
  background: #F2F0EC;
  animation: scrollcue 2.4s var(--ease-io) infinite;
}
@keyframes scrollcue { 0% { transform: translateY(-100%); } 100% { transform: translateY(260%); } }

@media (max-width: 760px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__side { align-items: flex-start; text-align: left; flex-direction: row; justify-content: space-between; width: 100%; }
  .hero__scroll { display: none; }
}

/* ---------- Sections ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(96px, 16vh, 200px) 0; }
.section--tight { padding: clamp(64px, 10vh, 120px) 0; }

.statement {
  font-size: calc(var(--display-scale) * clamp(30px, 4.6vw, 76px));
  max-width: 22ch;
}
.statement .w { opacity: 0.16; transition: opacity 0.5s linear; }
.statement .w.on { opacity: 1; }
.statement-meta { display: flex; gap: 48px; margin-top: 56px; flex-wrap: wrap; }
.statement-meta p { max-width: 34ch; color: var(--ink-2); }

/* ---------- Work list ---------- */
.work-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: clamp(48px, 8vh, 96px); }
.work-head h2 { font-size: clamp(36px, 5vw, 72px); }

.case {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: clamp(88px, 16vh, 180px);
}
.case__media { grid-column: 1 / span 8; }
.case__meta  { grid-column: 10 / span 3; padding-bottom: 8px; }
.case:nth-child(even) .case__media { grid-column: 5 / span 8; grid-row: 1; }
.case:nth-child(even) .case__meta  { grid-column: 1 / span 3; grid-row: 1; }
.case--tall .case__media { grid-column: 3 / span 5; }
.case--tall:nth-child(even) .case__media { grid-column: 6 / span 5; }

.tile {
  position: relative; display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
  container-type: size;
}
.case--tall .tile { aspect-ratio: 4 / 5; }
.tile > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.8s var(--ease);
}
.tile__video { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s var(--ease); container-type: size; }
.tile.is-playing .tile__video { opacity: 1; }
.tile:hover > img, .tile.is-playing > img { transform: scale(1.04); }
.tile__cue {
  position: absolute; left: 20px; bottom: 18px;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: #F2F0EC;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.tile__cue::before { content: ''; width: 24px; height: 1px; background: currentColor; }
.tile:hover .tile__cue, .tile.is-playing .tile__cue { opacity: 1; transform: none; }

.case__num { font-size: 11px; letter-spacing: 0.22em; color: var(--ink-3); margin-bottom: 18px; }
.case__title { font-size: calc(var(--display-scale) * clamp(32px, 3.6vw, 56px)); overflow-wrap: break-word; margin-bottom: 14px; }
.case__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.8s var(--ease); }
.case__title a:hover { background-size: 100% 1px; }
.case__type { color: var(--ink-2); font-size: 14px; }

@media (max-width: 760px) {
  .case, .case:nth-child(even) { grid-template-columns: 1fr; gap: 20px; }
  .case .case__media, .case:nth-child(even) .case__media,
  .case--tall .case__media, .case--tall:nth-child(even) .case__media { grid-column: 1; grid-row: 1; }
  .case .case__meta, .case:nth-child(even) .case__meta { grid-column: 1; grid-row: 2; }
  .case--tall .tile { aspect-ratio: 4 / 5; max-width: 80%; }
}

/* ---------- Clients marquee ---------- */
.marquee { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; padding: 28px 0; }
.marquee__track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.marquee__track span { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(28px, 3.4vw, 52px); padding: 0 0.6em; white-space: nowrap; color: var(--ink-2); }
.marquee__track span::after { content: '·'; padding-left: 1.2em; color: var(--ink-3); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- CTA ---------- */
.cta { text-align: left; }
.cta__link {
  display: inline-flex; align-items: baseline; gap: 0.3em;
  font-size: calc(var(--display-scale) * clamp(44px, 8vw, 140px));
  margin-top: 24px;
}
.cta__link .arrow { display: inline-block; font-family: var(--font-body); font-weight: 200; font-size: 0.55em; transition: transform 0.8s var(--ease); }
.cta__link:hover .arrow { transform: translateX(0.25em) rotate(-45deg); }
.cta__link .u { background: linear-gradient(currentColor, currentColor) 0 92% / 0 2px no-repeat; transition: background-size 1s var(--ease); }
.cta__link:hover .u { background-size: 100% 2px; }
.cta__sub { display: flex; gap: 40px; margin-top: 40px; flex-wrap: wrap; color: var(--ink-2); }
.cta__sub a { border-bottom: 1px solid var(--line-2); padding-bottom: 2px; transition: color 0.4s, border-color 0.4s; }
.cta__sub a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 48px 0 32px; overflow: hidden; }
.footer__row { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__links { display: flex; gap: 28px; flex-wrap: wrap; }
.footer__links a { color: var(--ink-2); transition: color 0.4s; }
.footer__links a:hover { color: var(--ink); }
.footer__markwrap { position: relative; margin-top: 48px; height: calc(var(--mark-size, 9vw) * 1.2); }
.footer__mark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.055em;
  font-size: var(--mark-size, 9vw);
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  margin-left: -0.05em;
  color: var(--ink);
}
.footer__mark { position: relative;
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent 92%);
          mask-image: linear-gradient(to bottom, #000 45%, transparent 92%); }
.footer__blur {
  position: absolute; left: 0; top: 0;
  /* padding gives the blur room inside the mask box, so no hard edges on the sides or bottom */
  padding: 0 0.3em 0.35em;
  margin-left: calc(-0.05em - 0.3em);
  filter: blur(9px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 30%, #000 56%, #000 68%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 30%, #000 56%, #000 68%, transparent 100%);
  pointer-events: none;
}

/* ---------- Film page ---------- */
.film-hero { padding: clamp(140px, 24vh, 240px) 0 clamp(40px, 6vh, 72px); }
.film-hero h1 { font-size: calc(var(--display-scale) * clamp(56px, 11vw, 200px)); }
.film-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; margin-top: 48px; }
.film-meta p:last-child { margin-top: 6px; }
.player { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.player--tall { aspect-ratio: 9 / 16; max-width: 520px; margin: 0 auto; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player + .player { margin-top: 24px; }
.film-body { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.film-body .label { grid-column: 1 / span 3; padding-top: 10px; }
.film-body p.big { grid-column: 4 / span 8; font-size: clamp(20px, 2vw, 30px); line-height: 1.45; color: var(--ink); }
.next { display: block; border-top: 1px solid var(--line); padding: clamp(64px, 12vh, 140px) 0; position: relative; }
.next .display { font-size: calc(var(--display-scale) * clamp(48px, 9vw, 160px)); transition: transform 1s var(--ease); }
.next:hover .display { transform: translateX(1.5vw); }
.next__img { position: absolute; right: var(--gutter); top: 50%; width: min(28vw, 380px); aspect-ratio: 4 / 3; overflow: hidden; transform: translateY(-50%); opacity: 0; transition: opacity 0.8s var(--ease); pointer-events: none; }
.next__img img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); transition: transform 1.6s var(--ease); }
.next:hover .next__img { opacity: 1; }
.next:hover .next__img img { transform: scale(1); }
@media (max-width: 760px) {
  .film-meta { grid-template-columns: 1fr 1fr; }
  .film-body .label, .film-body p.big { grid-column: 1 / -1; }
  .next__img { display: none; }
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; align-items: start; }
.about-grid .portrait { grid-column: 1 / span 5; aspect-ratio: 4 / 5; overflow: hidden; }
.about-grid .portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-grid .copy { grid-column: 7 / span 6; padding-top: 8vh; }
.about-grid .copy .display { font-size: clamp(34px, 3.8vw, 60px); margin-bottom: 40px; }
.about-grid .copy p { color: var(--ink-2); max-width: 46ch; margin-bottom: 18px; font-size: 17px; }
.points { list-style: none; border-top: 1px solid var(--line); margin-top: 56px; }
.points li { display: grid; grid-template-columns: 56px 1fr; padding: 22px 0; border-bottom: 1px solid var(--line); font-size: 18px; }
.points li span { color: var(--ink-3); font-size: 11px; letter-spacing: 0.22em; padding-top: 6px; }
@media (max-width: 760px) {
  .about-grid .portrait, .about-grid .copy { grid-column: 1 / -1; }
  .about-grid .copy { padding-top: 24px; }
}

/* ---------- Contact ---------- */
.contact-list { border-top: 1px solid var(--line); margin-top: 72px; }
.contact-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; padding: 28px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.contact-row .label { grid-column: 1 / span 3; }
.contact-row .val { grid-column: 4 / span 9; font-size: clamp(22px, 2.6vw, 40px); font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-track); }
.contact-row a.val { transition: transform 0.8s var(--ease), color 0.4s; display: inline-block; }
.contact-row a.val:hover { transform: translateX(12px); }
@media (max-width: 760px) {
  .contact-row .label, .contact-row .val { grid-column: 1 / -1; }
}

/* ---------- Stills ---------- */
.stills { columns: 3 320px; column-gap: 16px; }
.stills figure { break-inside: avoid; margin-bottom: 16px; overflow: hidden; cursor: zoom-in; background: var(--bg-2); }
.stills img { width: 100%; height: auto; transition: transform 1.6s var(--ease); }
.stills figure:hover img { transform: scale(1.03); }

.lightbox {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(244, 242, 238, 0.97);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s var(--ease);
  cursor: zoom-out;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 88vw; max-height: 86vh; object-fit: contain; transform: scale(0.96); transition: transform 0.9s var(--ease); }
.lightbox.open img { transform: none; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: clamp(140px, 24vh, 240px) 0 0; }
.page-head h1 { font-size: calc(var(--display-scale) * clamp(56px, 10vw, 180px)); }
.page-head .label { margin-bottom: 28px; display: block; }

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.5s var(--ease-io) both; }
::view-transition-new(root) { animation: vt-in 0.9s var(--ease) 0.1s both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(16px); } }

/* Fallback page fade for browsers without cross-document view transitions */
.js body { animation: page-in 0.9s var(--ease) both; }
@keyframes page-in { from { opacity: 0; } }
@supports (view-transition-name: none) { .js body { animation: none; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .js [data-reveal], .js .lines .line > span, .js [data-curtain], .js [data-curtain] img { opacity: 1; transform: none; clip-path: none; }
  .statement .w { opacity: 1; }
}

/* Several vertical reels side by side */
.players { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.players .player--tall { max-width: none; margin: 0; }
.players .player + .player { margin-top: 0; }
@media (max-width: 760px) { .players { grid-template-columns: 1fr; } .players .player--tall { max-width: 420px; margin: 0 auto; width: 100%; } }
.marquee__track span.main { color: var(--ink); }
