:root {
  --bg: #0a0a0b;
  --panel: #141416;
  --line: #242428;
  --text: #f2f1ee;
  --muted: #8d8c88;
  --red: #e5202a;
  --gutter: clamp(16px, 4vw, 48px);
  --gap: clamp(8px, 1.2vw, 16px);
  --display: "Archivo", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; }

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--red);
}
.eyebrow:empty { display: none; }

/* header */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--gutter);
  background: linear-gradient(to bottom, rgba(10,10,11,.85), rgba(10,10,11,0));
  transition: background-color .3s;
}
.top.scrolled {
  background: rgba(10,10,11,.88);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: block; }
.brand img { height: 30px; width: auto; }
.top nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); }
.top nav a { font-size: 14px; color: var(--muted); transition: color .2s; }
.top nav a:hover { color: var(--text); }
.top nav a.back { color: var(--text); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }

/* hero */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 96px var(--gutter);
  overflow: hidden;
}
.hero-loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s; }
.hero-loop.ready { opacity: .55; }
.hero-glow {
  position: absolute; width: 70vmax; height: 70vmax; left: 50%; top: 55%;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(229,32,42,.22), rgba(229,32,42,0) 60%);
  animation: drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift { from { transform: translate(-8%, 4%) scale(1); } to { transform: translate(8%, -4%) scale(1.15); } }
.hero-shade { position: absolute; inset: 0; background: radial-gradient(60% 50% at 50% 50%, rgba(10,10,11,.55), rgba(10,10,11,0)), linear-gradient(to top, var(--bg) 0%, rgba(10,10,11,.25) 50%, rgba(10,10,11,.55) 100%); }
.hero-text { position: relative; text-shadow: 0 2px 30px rgba(0,0,0,.45); }
.hero h1 {
  margin: 0;
  font: 800 clamp(64px, 15vw, 220px)/.86 var(--display);
  font-stretch: 75%;
  text-transform: uppercase; letter-spacing: -.01em;
}
.hero-tag { margin: 22px auto 0; max-width: 520px; color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); }
.hero-tag:empty { display: none; }

/* letter-by-letter build */
.split .word { display: inline-block; white-space: nowrap; }
.split .ch { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .04em; }
.split .ch > span { display: inline-block; }
.js .split .ch > span { transform: translateY(105%); animation: rise .9s var(--ease) forwards; animation-delay: calc(.25s + var(--i) * 45ms); }
@keyframes rise { to { transform: none; } }
.js .hero-fade { opacity: 0; animation: fade 1s var(--ease) forwards; animation-delay: .9s; }
.js .hero .eyebrow.hero-fade { animation-delay: .1s; }
@keyframes fade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; translate: -50% 0;
  width: 1px; height: 56px; background: var(--line); overflow: hidden;
}
.scroll-cue span { position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--text); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { to { top: 100%; } }

/* sections */
.block { padding: clamp(80px, 14vh, 140px) var(--gutter) 0; }
.block-head { margin-bottom: clamp(24px, 4vw, 44px); position: relative; }
.block-head.center { text-align: center; }
.block-head h2 {
  margin: 0;
  font: 800 clamp(36px, 6vw, 76px)/.95 var(--display);
  font-stretch: 75%; text-transform: uppercase;
}
.lede { margin: 14px 0 0; color: var(--muted); }
.count { position: absolute; right: 0; bottom: 6px; margin: 0; color: var(--muted); font-size: 14px; }

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

/* service cards */
.service-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(4, 1fr); }
.service {
  position: relative; aspect-ratio: 3 / 4; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: clamp(16px, 1.8vw, 24px);
}
.service img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.service:not(:has(img))::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(130% 90% at 50% 115%, rgba(229,32,42,.5), rgba(229,32,42,0) 62%);
  transition: opacity .6s;
}
.service::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0) 60%); }
.service > * { position: relative; z-index: 1; }
.service-num { position: absolute; top: clamp(16px, 1.8vw, 24px); left: clamp(16px, 1.8vw, 24px); font: 500 13px/1 var(--body); color: var(--muted); }
.service h3 { margin: 0; font: 800 clamp(22px, 2.2vw, 30px)/1 var(--display); font-stretch: 75%; text-transform: uppercase; }
.service p { margin: 10px 0 0; font-size: 14px; color: rgba(242,241,238,.72); }
.service:hover img { transform: scale(1.06); }
.service { transition: border-color .4s, translate .6s var(--ease); }
.service:hover { border-color: rgba(229,32,42,.5); translate: 0 -6px; }

/* film grid */
.film-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); }
.film {
  position: relative; display: block; width: 100%;
  padding: 0; border: 0; background: var(--panel); color: inherit;
  cursor: pointer; text-align: left; overflow: hidden;
  aspect-ratio: 16 / 9;
}
.film.featured { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.film img, .film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .5s; }
.film video { opacity: 0; }
.film video.playing { opacity: 1; }
.film:hover img, .film:hover video { transform: scale(1.04); }
.film::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0) 55%); }
.film-meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(14px, 2vw, 24px); }
.film-title { display: block; font: 800 clamp(20px, 2.4vw, 32px)/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; }
.film-sub { display: block; margin-top: 6px; font-size: 13px; color: rgba(242,241,238,.72); }
.film-play {
  position: absolute; top: clamp(14px, 2vw, 24px); right: clamp(14px, 2vw, 24px); z-index: 1;
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border-radius: 99px; background: var(--red);
  opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s var(--ease);
}
.film:hover .film-play, .film:focus-visible .film-play { opacity: 1; transform: none; }
.film:focus-visible, .photo:focus-visible, .car-card:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* full sets */
.set-grid { display: grid; gap: clamp(20px, 3vw, 32px) var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); }
.set { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; }
.set-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: border-color .4s; }
.set-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.set-thumb::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); transition: background .4s; }
.set-play {
  position: absolute; left: 50%; top: 50%; z-index: 1; translate: -50% -50%;
  width: 68px; height: 68px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 rgba(229,32,42,.5); transition: scale .4s var(--ease), box-shadow .6s;
}
.set-play::before { content: ""; position: absolute; left: 27px; top: 22px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff; }
.set:hover .set-thumb { border-color: rgba(229,32,42,.6); }
.set:hover .set-thumb img { transform: scale(1.04); }
.set:hover .set-thumb::after { background: rgba(0,0,0,.1); }
.set:hover .set-play { scale: 1.1; box-shadow: 0 0 0 14px rgba(229,32,42,0); }
.set:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.set-meta { display: block; padding-top: 14px; }
.set-artist { display: block; font: 800 clamp(22px, 2.4vw, 30px)/1.05 var(--display); font-stretch: 75%; text-transform: uppercase; }
.set-title { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.set-grid .empty { grid-column: auto; }

/* multicam carousel */
.carousel { position: relative; }
.car-track {
  display: flex; gap: clamp(12px, 2vw, 24px);
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding: 12px 0; /* side padding set in app.js to centre the end cards */
  margin: 0 calc(var(--gutter) * -1);
}
.car-track::-webkit-scrollbar { display: none; }
.car-card {
  position: relative; flex: 0 0 clamp(220px, 26vw, 340px); aspect-ratio: 9 / 16;
  scroll-snap-align: center; overflow: hidden;
  padding: 0; border: 1px solid var(--line); background: var(--panel); color: inherit; cursor: pointer;
  transform: scale(var(--s, .86)); opacity: var(--o, .45);
  transition: transform .5s var(--ease), opacity .5s, border-color .5s;
}
.car-card.active { border-color: rgba(229,32,42,.7); box-shadow: 0 0 60px rgba(229,32,42,.18); }
.car-card img, .car-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.car-card video { opacity: 0; transition: opacity .5s; }
.car-card video.playing { opacity: 1; }
.car-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0) 45%); }
.car-card .film-meta { text-align: left; }
.car-card .film-title { font-size: clamp(18px, 1.8vw, 24px); }
.car-nav {
  position: absolute; top: 50%; z-index: 2; translate: 0 -50%;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(10,10,11,.7); color: var(--text);
  font-size: 26px; line-height: 1; cursor: pointer; transition: border-color .2s;
}
.car-nav:hover { border-color: var(--red); }
.car-nav.prev { left: 0; }
.car-nav.next { right: 0; }

/* photo grid */
.photo-grid { columns: 3 280px; column-gap: var(--gap); }
.photo {
  display: block; width: 100%; margin: 0 0 var(--gap);
  padding: 0; border: 0; background: var(--panel); cursor: zoom-in;
  break-inside: avoid; overflow: hidden;
}
.photo img { width: 100%; height: auto; transition: transform 1.2s var(--ease), opacity .3s; }
.photo:hover img { transform: scale(1.04); }

/* empty state (localhost only) */
.empty { border: 1px dashed var(--line); padding: 32px; color: var(--muted); font-size: 14px; column-span: all; grid-column: 1 / -1; }
.empty code { color: var(--text); }

/* footer */
.foot { padding: clamp(96px, 16vh, 160px) var(--gutter) 32px; }
.foot-line { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 48px; }
.foot-line a {
  font: 800 clamp(28px, 5vw, 60px)/1.05 var(--display);
  font-stretch: 75%; text-transform: uppercase;
  background: linear-gradient(var(--red), var(--red)) 0 100% / 0 3px no-repeat;
  transition: background-size .5s var(--ease);
}
.foot-line a:hover { background-size: 100% 3px; }
.foot-line a:empty { display: none; }
.foot-back { margin: 0 0 32px; }
.foot-back a { display: inline-flex; align-items: center; gap: 16px; font-size: 15px; }
.foot-back img { height: 26px; width: auto; }
.foot-back a > span { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.foot-small { margin: 0; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }

/* viewer */
html:has(.viewer[open]) { overflow: hidden; }
.viewer {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(5,5,6,.97); color: var(--text);
}
.viewer[open] { display: grid; grid-template-columns: 56px 1fr 56px; grid-template-rows: 1fr auto; align-items: center; animation: fade .35s ease; }
.viewer::backdrop { background: rgba(0,0,0,.8); }
.viewer-stage { grid-column: 2; grid-row: 1; display: flex; justify-content: center; align-items: center; height: 100%; padding: 56px 0 8px; min-width: 0; }
.viewer-stage img, .viewer-stage video { max-width: 100%; max-height: calc(100vh - 120px); object-fit: contain; }
.viewer-stage video { background: #000; }
.viewer-stage video.wide { width: 100%; }
.viewer-stage iframe { width: 100%; aspect-ratio: 16 / 9; max-height: calc(100vh - 120px); border: 0; }
.viewer-stage iframe.tall { width: auto; height: calc(100vh - 120px); aspect-ratio: 9 / 16; }
.viewer-caption { grid-column: 2; grid-row: 2; margin: 0; padding: 12px 0 20px; text-align: center; color: var(--muted); font-size: 14px; }
.viewer-caption:empty { padding: 0 0 20px; }
.viewer button { background: none; border: 0; color: var(--text); cursor: pointer; font: 300 40px/1 var(--body); }
.viewer-close { position: absolute; top: 10px; right: 16px; z-index: 2; font-size: 36px; }
.viewer-nav { height: 100%; opacity: .6; }
.viewer-nav:hover { opacity: 1; }
.viewer-nav[hidden] { visibility: hidden; display: block; }
.viewer-nav.prev { grid-column: 1; grid-row: 1; }
.viewer-nav.next { grid-column: 3; grid-row: 1; }

@media (max-width: 900px) {
  .service-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .top nav a:not(.back):not([href="#film"]) { display: none; }
  .film.featured { aspect-ratio: 16 / 9; }
  .film-play { opacity: 1; transform: none; }
  .service { aspect-ratio: 4 / 5; }
  .car-nav { display: none; }
  .car-card { flex-basis: 240px; }
  .count { position: static; margin-top: 10px; }
  .viewer[open] { grid-template-columns: 36px 1fr 36px; }
  .viewer button { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-loop:not(.still), .film video, .car-card video { display: none; }
  .hero-glow, .scroll-cue span { animation: none; }
  .js .split .ch > span, .js .hero-fade { animation: none; transform: none; opacity: 1; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
