/* ---------- Tokens ---------- */

:root {
  --ink: #0c0c0d;        /* dark base */
  --ink-2: #1b1b1d;      /* dark surface / empty frame */
  --paper: #e4e5e1;      /* light sections: cool silver, not cream */
  --paper-2: #cfd0cb;    /* light surface / empty frame */
  --smoke: #8a8b87;      /* secondary text */
  --tally: #e5341d;      /* recording light — only for tiny signals */

  --display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --gutter: clamp(16px, 2.6vw, 40px);
  --ease: cubic-bezier(.7, 0, .2, 1);
}

.tone-dark  { --bg: var(--ink);   --fg: #f1f1ee; --muted: var(--smoke); --surface: var(--ink-2);   --line: rgba(241, 241, 238, .14); }
.tone-light { --bg: var(--paper); --fg: var(--ink); --muted: #5f605c;  --surface: var(--paper-2); --line: rgba(12, 12, 13, .16); }

/* ---------- Base ---------- */

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

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

body {
  margin: 0;
  background: var(--ink);
  color: #f1f1ee;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p, h1, h2 { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--tally); outline-offset: 3px; }

.skip {
  position: fixed; left: 8px; top: 8px; z-index: 100;
  padding: 8px 12px; background: #fff; color: #000;
  font-family: var(--mono); font-size: 12px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.label {
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Nav ---------- */
/* Difference blend keeps the nav readable over dark and light sections alike. */

.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--gutter);
  --nav-fg: #f1f1ee; --nav-bg: var(--ink);
  color: var(--nav-fg);
  transition: color .35s var(--ease);
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
}
.nav[data-tone='light'] { --nav-fg: var(--ink); --nav-bg: var(--paper); }
.nav__brand { justify-self: start; }
.nav__contact { justify-self: end; }
.nav__brand::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 10px;
  border-radius: 50%; background: currentColor; vertical-align: 1px;
}

.switch {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid currentColor; border-radius: 999px;
  padding: 3px;
}
.switch__btn {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
  transition: color .35s var(--ease);
}
.switch__btn[aria-pressed='true'] { color: var(--nav-bg); }
.switch__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  border-radius: 999px; background: var(--nav-fg);
  transition: transform .45s var(--ease), background .35s var(--ease);
}
.switch[data-mode='reels'] .switch__thumb { transform: translateX(100%); }

/* The toggle's icons are the two aspect ratios themselves. */
.switch__frame { display: inline-block; border: 1.5px solid currentColor; border-radius: 1px; }
.switch__frame--h { width: 14px; height: 8px; }
.switch__frame--v { width: 8px; height: 13px; }

/* ---------- Blocks ---------- */

.block {
  background: var(--bg);
  color: var(--fg);
  padding: clamp(72px, 10vw, 140px) var(--gutter);
}

/* ---------- The cut heading ---------- */

.cut {
  --win-w: 1.04em; --win-h: 1.04em;      /* the round window */
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  font-size: 12vw;               /* overwritten by fitAll() */
  line-height: .9;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.cut__line { display: inline-block; white-space: nowrap; }
.cut__a, .cut__b { display: inline-block; transition: transform 1.1s var(--ease); }

.cut__win {
  position: relative;
  display: inline-block;
  width: var(--win-w); height: var(--win-h);
  margin: -.2em .07em;           /* negative block margin: the frame overhangs the line */
  vertical-align: calc(.36em - var(--win-h) / 2 + .2em);   /* centred on the cap height */
}
.cut__pic {
  position: absolute; inset: 0;
  background: var(--surface);
  overflow: hidden;
  transition: clip-path 1.1s var(--ease);
}
.cut__pic img {
  width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity .6s, filter 1.6s var(--ease) .25s, transform 1.6s var(--ease) .25s;
}
.cut__win.has-img img { opacity: 1; }
.cut__ring { position: absolute; pointer-events: none; }

/* The window is round: it opens like an iris and pulls focus, inside a focus ring that turns as it opens.
   Closed state: letters meet in the middle, window shut. */
h1.cut { --win-w: 1.34em; --win-h: 1.34em; }
.cut__pic { border-radius: 50%; clip-path: circle(50% at 50% 50%); }
.cut:not(.is-open) .cut__pic { clip-path: circle(0 at 50% 50%); }
.cut:not(.is-open) .cut__pic img { filter: blur(.07em); transform: scale(1.3); }
.cut:not(.is-open) .cut__a { transform: translateX(calc(var(--win-w) / 2 + .07em)); }
.cut:not(.is-open) .cut__b { transform: translateX(calc(var(--win-w) / -2 - .07em)); }
.cut__ring {
  inset: -.09em; border-radius: 50%;
  background: repeating-conic-gradient(currentColor 0 .8deg, transparent .8deg 7.5deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - .045em), #000 calc(100% - .045em));
          mask: radial-gradient(farthest-side, transparent calc(100% - .045em), #000 calc(100% - .045em));
  opacity: .45;
  transition: transform 1.9s var(--ease), opacity .9s .2s;
}
.cut:not(.is-open) .cut__ring { opacity: 0; transform: rotate(-120deg); }
/* The hero opens while the page is still loading: its moving parts get their own layers. */
.hero .cut__a, .hero .cut__b, .hero .cut__ring { will-change: transform; }
.hero .cut__pic img { will-change: transform, filter; }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end; gap: clamp(20px, 3vw, 44px);
  padding-top: 88px;
  padding-bottom: clamp(32px, 4vw, 56px);
}

/* ---------- Hero: choose a format ---------- */

.chooser {
  flex: 1 1 0; min-height: 300px;
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: 1fr auto;
  align-items: center; column-gap: clamp(20px, 4vw, 80px); row-gap: 14px;
}
.chooser__opt { grid-row: 1; display: grid; gap: 14px; }
.chooser__opt--films { grid-column: 1; justify-self: end; text-align: right; }
.chooser__opt--reels { grid-column: 3; justify-self: start; text-align: left; }
.chooser__word {
  font-weight: 800; font-stretch: 125%;
  font-size: clamp(26px, 3.1vw, 54px);
  line-height: .9; letter-spacing: .02em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px var(--fg);
  transition: color .5s var(--ease);
}
.chooser[data-guide='films'] .chooser__opt--films .chooser__word,
.chooser[data-guide='reels'] .chooser__opt--reels .chooser__word,
.chooser__opt:focus-visible .chooser__word { color: var(--fg); }
.chooser__meta { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
/* The other format invites a click: its outline fills with a sweep every few seconds, until you touch the chooser. */
.chooser__opt:not([aria-current]) .chooser__word {
  background: linear-gradient(var(--fg) 0 0) no-repeat 0 0 / 0 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: invite-x 3.2s var(--ease) 2.8s infinite;
}
.chooser.is-touched .chooser__opt .chooser__word { animation: none; }
@keyframes invite-x { 0% { background-size: 0 100%; background-position: 0 0; } 40%, 55% { background-size: 100% 100%; background-position: 0 0; } 95%, 100% { background-size: 0 100%; background-position: 100% 0; } }
.chooser__opt { cursor: pointer; }
.chooser__opt[aria-current] .chooser__meta::before {     /* the format you're in: a tally light */
  content: ''; display: inline-block; width: 6px; height: 6px; margin-inline-end: 8px;
  border-radius: 50%; background: var(--tally); vertical-align: 1px;
}
/* The other format, said plainly: a button with an arrow that keeps nudging toward it. */
.chooser__go {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px;
  margin-top: 6px; padding: 10px 16px 10px 18px;
  border: 1px solid var(--fg); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg);
  white-space: nowrap;
  transition: background-color .3s, color .3s;
}
.chooser__opt--films .chooser__go { justify-self: end; }
.chooser__go i { font-style: normal; display: inline-block; animation: nudge 1.6s var(--ease) infinite; }
.chooser__opt:hover .chooser__go, .chooser__opt:focus-visible .chooser__go { background: var(--fg); color: var(--bg); }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateX(5px); } }
.chooser__stage { grid-row: 1; grid-column: 2; position: relative; display: grid; justify-items: center; gap: 14px; cursor: pointer; }
.chooser__hint {
  grid-row: 2; grid-column: 1 / -1; justify-self: center;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  opacity: 0; transition: opacity 1s 1.2s;
}
.chooser.is-in .chooser__hint { opacity: 1; }
.chooser__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* A viewfinder that turns between landscape and portrait, like a camera does. */
.turn { position: relative; width: calc(var(--stage) * 16 / 9); height: var(--stage); }
.turn__body { position: absolute; inset: 0; background: #000; }
.turn__h, .turn__v { position: absolute; overflow: hidden; transition: opacity .3s var(--ease) .35s; }
.turn__h { inset: 0; }
.turn__v { left: 50%; top: 50%; width: 56.25%; height: 177.78%; transform: translate(-50%, -50%) rotate(-90deg); opacity: 0; }
.chooser[data-show='reels'] .turn__h { opacity: 0; }
.chooser[data-show='reels'] .turn__v { opacity: 1; }
.turn__corners {
  position: absolute; inset: -12px; color: var(--fg);
  --t: 2px; --l: 26px;
  background:
    linear-gradient(currentColor 0 0) 0 0 / var(--l) var(--t), linear-gradient(currentColor 0 0) 0 0 / var(--t) var(--l),
    linear-gradient(currentColor 0 0) 100% 0 / var(--l) var(--t), linear-gradient(currentColor 0 0) 100% 0 / var(--t) var(--l),
    linear-gradient(currentColor 0 0) 0 100% / var(--l) var(--t), linear-gradient(currentColor 0 0) 0 100% / var(--t) var(--l),
    linear-gradient(currentColor 0 0) 100% 100% / var(--l) var(--t), linear-gradient(currentColor 0 0) 100% 100% / var(--t) var(--l);
  background-repeat: no-repeat;
  opacity: 0; transform: scale(1.12);
  transition: opacity .5s, transform .8s cubic-bezier(.2, 1.4, .4, 1);
}
.turn__cross {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%);
  background: linear-gradient(rgba(255, 255, 255, .8) 0 0) 50% 50% / 100% 1px, linear-gradient(rgba(255, 255, 255, .8) 0 0) 50% 50% / 1px 100%;
  background-repeat: no-repeat; opacity: 0; transition: opacity .6s .4s;
}
.chooser.is-in .turn__corners { opacity: 1; transform: none; }
.chooser.is-in .turn__cross { opacity: 1; }
.turn__hud { display: flex; align-items: center; gap: 14px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.turn__hud i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chooser.is-live .turn__hud i { background: var(--tally); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: .2; } }

.hero__index {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  border-top: 1px solid var(--line);
}
.hero__index a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 16px 0 0;
  font-size: 15px; font-weight: 500;
}
.hero__count { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.hero__index a:hover span:first-child { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Marquee ---------- */

.marquee {
  padding: clamp(12px, 1.5vw, 20px) 0;
  overflow: hidden;
}
.marquee__track {
  display: flex; width: max-content;
  animation: marquee 60s linear infinite;
}
.marquee__run {
  display: flex; align-items: center;
  font-weight: 700; font-stretch: 112%;
  font-size: clamp(15px, 2.1vw, 30px);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee__run span { padding: 0 .55em; }
.marquee__run i { width: .22em; height: .22em; border-radius: 50%; background: var(--tally); flex: none; }
.marquee:hover .marquee__track,
.marquee.is-off .marquee__track { animation-play-state: paused; }

@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Works ---------- */

.works__head { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 2.4vw, 32px); margin-bottom: clamp(48px, 6vw, 88px); }

.grid { display: grid; gap: clamp(28px, 3vw, 44px) clamp(12px, 1.6vw, 24px); }
.grid--h { grid-template-columns: repeat(2, 1fr); }
.grid--feature > :first-child { grid-column: 1 / -1; }
.grid--v { grid-template-columns: repeat(4, 1fr); }

.card__media {
  position: relative;
  display: block; width: 100%;
  background: var(--surface);
  overflow: hidden;
}
.card--h .card__media { aspect-ratio: 16 / 9; }
.card--v .card__media { aspect-ratio: 9 / 16; }

.card__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity .6s, transform 1.2s var(--ease);
}
.card__media.has-img img { opacity: 1; }

.card__clip {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity .25s, transform 1.2s var(--ease);
}
.card__media.is-playing .card__clip { opacity: 1; }
.card__media::after {          /* gentle vignette so the play mark always reads */
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, .35));
  pointer-events: none;
}

.card__play {
  position: absolute; left: 50%; top: 50%; z-index: 1;
  display: grid; place-items: center;
  width: clamp(48px, 5vw, 68px); aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .85); border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .3);
  transform: translate(-50%, -50%);
  transition: background .35s var(--ease), color .35s var(--ease), transform .45s var(--ease);
}
.card__play svg { width: 38%; fill: currentColor; margin-left: 6%; }
.card--v .card__play { width: clamp(42px, 4vw, 56px); }

button.card__media:hover :is(img, .card__clip),
button.card__media:focus-visible :is(img, .card__clip) { transform: scale(1.035); }
button.card__media:hover .card__play,
button.card__media:focus-visible .card__play { background: #fff; color: #000; transform: translate(-50%, -50%) scale(1.08); }

.card__views {
  position: absolute; left: 10px; top: 10px; z-index: 1;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 8px 4px; border-radius: 4px;
  background: rgba(8, 8, 9, .62); color: #f1f1ee;
  font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase;
}
.card__views::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tally); }
.card__cap { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.card__client { font-size: 16px; font-weight: 600; line-height: 1.25; }
.card__what { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.card--empty .card__play { border-color: var(--line); background: none; color: var(--muted); }
.card--empty .card__media::after { display: none; }
.card--empty .card__client,
.card--empty .card__what { color: var(--muted); opacity: .55; }

/* More than 8 works: the rest wait behind "More". */
.works:not(.is-open) .card--extra { display: none; }
.works.is-open .card--extra { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i) * 55ms); }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.more { display: flex; justify-content: center; margin-top: clamp(40px, 5vw, 72px); }
.more__btn {
  display: inline-flex; align-items: center; gap: 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
}
.more__icon {
  position: relative; width: 58px; height: 58px; flex: none;
  border: 1px solid currentColor; border-radius: 50%;
  transition: background .35s var(--ease), color .35s var(--ease);
}
.more__icon::before, .more__icon::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 18px; height: 1.5px;
  background: currentColor; transform: translate(-50%, -50%);
  transition: transform .45s var(--ease);
}
.more__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.works.is-open .more__icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.more__btn:hover .more__icon, .more__btn:focus-visible .more__icon { background: var(--fg); color: var(--bg); }
.more__count { color: var(--muted); }

.works__empty {
  margin-top: 32px;
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted);
}

/* ---------- Contact ---------- */

.contact { display: grid; gap: clamp(32px, 5vw, 64px); }
.contact__mail {
  font-weight: 800; font-stretch: 125%;
  font-size: clamp(18px, 3.3vw, 50px);
  line-height: 1.1; letter-spacing: -.01em;
  overflow-wrap: normal;                /* one line; phones may break at the <wbr> before "@" */
}
.contact__mail:hover { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .1em; }
.contact__social { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; font-weight: 500; }
.contact__social a:hover { text-decoration: underline; text-underline-offset: 4px; }
.contact__foot { padding-top: 20px; border-top: 1px solid var(--line); }

/* ---------- Player ---------- */

.player {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 16px var(--gutter);
  background: rgba(6, 6, 7, .97);
  color: #f1f1ee;
  animation: fade .35s ease;
}
.player[hidden] { display: none; }
.player__bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  width: var(--pw);
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
}
.player__cap { color: var(--smoke); }
.player__cap span { color: #f1f1ee; }
.player__close { text-transform: uppercase; letter-spacing: .04em; }
.player__cap a { color: #f1f1ee; text-decoration: underline; text-decoration-color: rgba(241, 241, 238, .35); text-underline-offset: 3px; }
.player__cap a:hover { text-decoration-color: currentColor; }
.player__close kbd { font: inherit; color: var(--smoke); margin-left: 6px; }
.player__frame { width: var(--pw); aspect-ratio: 16 / 9; background: #000; }
.player__frame :is(iframe, video) { width: 100%; height: 100%; border: 0; display: block; background: #000; }
/* Phones: the frame itself goes fullscreen; the film fits inside it whichever way the phone is held. */
.player__frame:fullscreen { width: 100%; height: 100%; aspect-ratio: auto; background: #000; }
.player__frame:fullscreen video { object-fit: contain; }

.player[data-orient='h'] { --pw: min(100%, 1400px, calc((100svh - 110px) * 16 / 9)); }
.player[data-orient='v'] { --pw: min(100%, 440px, calc((100svh - 110px) * 9 / 16)); }
.player[data-orient='v'] .player__frame { aspect-ratio: 9 / 16; }
.player[data-orient='social'] { --pw: min(100%, 420px, calc((100svh - 110px) * 9 / 17)); }
.player[data-orient='social'] .player__frame { aspect-ratio: 9 / 17; background: #fff; }

@keyframes fade { from { opacity: 0; } }

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .grid--v { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .chooser { flex: none; min-height: 0; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; row-gap: 22px; }
  .chooser__stage { grid-row: 1; grid-column: 1 / -1; }
  .chooser__opt { grid-row: 2; }
  .chooser__opt--films { grid-column: 1; justify-self: start; text-align: left; }
  .chooser__opt--reels { grid-column: 2; justify-self: end; text-align: right; }
  .chooser__opt--reels .chooser__go { justify-self: end; }
  .chooser__opt--films .chooser__go { justify-self: start; }
  .chooser__opt { min-width: 0; align-self: start; }
  .chooser__go { padding: 9px 14px; }
  .chooser__word { font-size: clamp(24px, 8vw, 32px); }
  .chooser__hint { grid-row: 3; }
  .nav { grid-template-columns: 1fr auto; row-gap: 12px; }
  .nav__contact { display: none; }
  .switch__btn { padding: 6px 12px; }
  .grid--h { grid-template-columns: 1fr; }
  .grid--v { grid-template-columns: repeat(2, 1fr); }
  .hero__index { grid-template-columns: 1fr; }
  .hero__index a { padding: 12px 0; border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .marquee { overflow-x: auto; }
}
