/* Maragato Media — cinematic, monochrome, imagery-first.
   Three-family type system: Display (uppercase, tracked) · Text (serif body) · Mono (labels, nav, buttons). */

:root {
  --canvas: #000;
  --surface-soft: #0d0d0d;
  --surface-card: #141414;
  --ink: #fff;
  --body: #ccc;
  --body-strong: #e6e6e6;
  --muted: #999;
  --muted-soft: #666;
  --hairline: #262626;
  --hairline-strong: #3a3a3a;
  --link: #c3d9f3;

  --f-display: "Saira Condensed", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-text: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 40px;
  --s-xxl: 64px;
  --s-section: 120px;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1280px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font: 400 18px/1.55 var(--f-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { 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(--link); outline-offset: 4px; }
::selection { background: #fff; color: #000; }
body.locked { overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- Type roles ---------- */
.display-xl, .display-lg, .display-md, .display-sm, .title {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.display-xl { font-size: clamp(36px, 6.2vw, 88px); line-height: 1.02; letter-spacing: .08em; }
.display-lg { font-size: clamp(30px, 4.2vw, 56px); line-height: 1.08; letter-spacing: .07em; }
.display-md { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: .06em; }
.display-sm { font-size: clamp(19px, 1.7vw, 24px); line-height: 1.25; letter-spacing: .06em; }
.title      { font-size: 20px; line-height: 1.3; letter-spacing: .05em; }

.caption, .label {
  font: 400 11px/1.5 var(--f-mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.label { color: var(--ink); }
.lead {
  font-family: var(--f-text);
  font-size: clamp(22px, 2.3vw, 32px);
  line-height: 1.4;
  color: var(--body-strong);
  margin: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 30px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 9999px;
  font: 400 12px/1 var(--f-mono);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  transition: background .4s var(--ease), color .4s var(--ease);
}
.btn:hover { background: #fff; color: #000; }
.band-actions { gap: 8px !important; }
.band-actions .btn { height: 36px; padding: 0 18px; gap: 8px; font-size: 10px; letter-spacing: .16em; }
.band-actions .btn svg { width: 8px; height: 8px; }
@media (max-width: 767px) {
  .band-actions { flex-wrap: nowrap !important; gap: 6px !important; }
  .band-actions .btn { height: 34px; padding: 0 11px; gap: 6px; font-size: 9px; letter-spacing: .1em; white-space: nowrap; }
}
.btn svg { width: 10px; height: 10px; }

.icon-btn {
  width: 42px; height: 42px;
  display: inline-grid; place-items: center;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 50%;
  color: var(--ink);
  transition: background .3s, color .3s, border-color .3s;
}
.icon-btn:hover { background: #fff; color: #000; border-color: #fff; }
.icon-btn svg { width: 14px; height: 14px; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--gutter);
  transition: background .5s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.nav.solid { background: rgba(0,0,0,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-color: var(--hairline); }
.nav .nav-link {
  font: 400 11px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink);
  display: inline-flex; align-items: center; gap: 10px; height: 44px;
}
.nav .nav-link:last-child { justify-self: end; }
.nav-burger { display: inline-flex; flex-direction: column; gap: 5px; width: 18px; }
.nav-burger i { display: block; height: 1px; background: currentColor; transition: transform .4s var(--ease), opacity .3s; }
.menu-open .nav-burger i:first-child { transform: translateY(3px) rotate(45deg); }
.menu-open .nav-burger i:last-child { transform: translateY(-3px) rotate(-45deg); }
.wordmark img { height: 34px; width: auto; }

/* Full-screen menu */
.menu {
  position: fixed; inset: 0; z-index: 40;
  background: #000;
  display: grid; align-content: center;
  padding: var(--nav-h) var(--gutter);
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease), visibility 0s .5s;
}
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity .5s var(--ease); }
.menu ol { list-style: none; margin: 0 auto; padding: 0; width: 100%; max-width: var(--max); }
.menu li { border-top: 1px solid var(--hairline); }
.menu li:last-child { border-bottom: 1px solid var(--hairline); }
.menu a {
  display: flex; align-items: baseline; gap: var(--s-lg);
  padding: clamp(14px, 2.4vh, 26px) 0;
  transform: translateY(12px); opacity: 0;
  transition: transform .7s var(--ease), opacity .7s var(--ease), color .3s;
}
.menu-open .menu a { transform: none; opacity: 1; }
.menu li:nth-child(2) a { transition-delay: .05s; }
.menu li:nth-child(3) a { transition-delay: .1s; }
.menu li:nth-child(4) a { transition-delay: .15s; }
.menu a .display-lg { transition: letter-spacing .6s var(--ease); }
.menu a:hover .display-lg { letter-spacing: .12em; }
.menu-foot { max-width: var(--max); margin: var(--s-xl) auto 0; width: 100%; display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s-md); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden;
  background: #000;
}
.hero video, .hero .hero-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 24%),
    linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.12) 100%);
  pointer-events: none;
}
.hero-inner {
  position: absolute; z-index: 2; inset: auto 0 0 0;
  padding: 0 var(--gutter) clamp(32px, 7vh, 72px);
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: var(--s-xl);
}
.hero h1 { max-width: 20ch; text-shadow: 0 0 40px rgba(0,0,0,.35); }
.hero .caption { color: var(--body-strong); margin-bottom: var(--s-lg); display: block; }
.hero-actions { display: flex; align-items: center; gap: var(--s-md); margin-top: var(--s-xl); flex-wrap: wrap; }
.hero-meta { text-align: right; display: grid; gap: 6px; justify-items: end; }
.hero-meta .caption { margin: 0; }
.hero-progress { width: 140px; height: 1px; background: rgba(255,255,255,.25); position: relative; margin-top: 10px; }
.hero-progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: #fff; }

/* ---------- Sections ---------- */
.section { padding: var(--s-section) var(--gutter); }
.wrap { max-width: var(--max); margin: 0 auto; }
.section-head {
  display: flex; justify-content: space-between; align-items: end; gap: var(--s-lg); flex-wrap: wrap;
  margin-bottom: var(--s-xxl);
}
.section-head .caption { display: block; margin-bottom: var(--s-md); }

.intro { display: grid; grid-template-columns: 220px 1fr; gap: var(--s-xl); }
.intro .lead { max-width: 46ch; font-size: clamp(20px, 1.9vw, 26px); }
.intro .lead em { font-style: italic; color: var(--ink); }

/* ---------- Featured film ---------- */
.feature { padding: 0 var(--gutter) var(--s-section); }
.feature-card { display: block; position: relative; max-width: var(--max); margin: 0 auto; cursor: pointer; }
.feature-media { position: relative; aspect-ratio: 21 / 9; overflow: hidden; background: var(--surface-soft); }
.feature-media img, .feature-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease), opacity .8s; }
.feature-card:hover .feature-media img, .feature-card:hover .feature-media video { transform: scale(1.03); }
.feature-media video { opacity: 0; }
.feature-card.playing .feature-media video { opacity: 1; }
.feature-media .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 2;
}
.feature-meta { display: flex; justify-content: space-between; align-items: start; gap: var(--s-lg); padding-top: var(--s-lg); flex-wrap: wrap; }
.feature-meta .caption { display: block; margin-top: 10px; }

.play-ring {
  width: 84px; height: 84px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.85);
  display: grid; place-items: center; color: #fff;
  transition: transform .6s var(--ease), background .4s, color .4s, opacity .5s;
  backdrop-filter: blur(2px);
}
.play-ring svg { width: 16px; height: 16px; margin-left: 3px; }
.feature-card:hover .play-ring { background: #fff; color: #000; transform: scale(1.06); }

/* ---------- Film index ---------- */
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter {
  height: 36px; padding: 0 16px; border-radius: 9999px;
  font: 400 11px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); border: 1px solid transparent;
  transition: color .3s, border-color .3s;
}
.filter:hover { color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--ink); border-color: rgba(255,255,255,.7); }

.films-section.grid-off { padding-bottom: var(--s-xxl); }
.films-section.grid-off .section-head { margin-bottom: 0; }

.film-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: var(--s-xxl) var(--s-xl);
}
.film { cursor: pointer; display: block; text-align: left; width: 100%; }
.film[hidden] { display: none; }
.film-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-soft); }
.film-media img, .film-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-media img { transition: transform 1.4s var(--ease), opacity .6s; }
.film-media video { opacity: 0; transition: opacity .6s var(--ease); }
.film.playing .film-media video { opacity: 1; }
.film:hover .film-media img { transform: scale(1.04); }
.film-media .runtime {
  position: absolute; right: 14px; bottom: 12px; z-index: 2; color: #fff;
  opacity: 0; transform: translateY(4px); transition: opacity .4s, transform .4s var(--ease);
}
.film:hover .runtime, .film.playing .runtime { opacity: 1; transform: none; }
.film-meta { display: flex; justify-content: space-between; gap: var(--s-md); padding-top: var(--s-md); align-items: baseline; }
.film-meta .caption { white-space: nowrap; }
.more-polo { max-width: var(--max); margin: var(--s-xl) auto 0; }
.polo-folder { margin-top: var(--s-xl); scroll-margin-top: calc(var(--nav-h, 64px) + 24px); }
#poloToggle svg { transition: transform .4s var(--ease); }
#poloToggle.open svg { transform: rotate(180deg); }
.pair-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-xl); }
.sa-films + #photography { padding-top: 0; }
.film-grid .film:first-child { grid-column: span 2; }
.film-grid .film:first-child .film-media { aspect-ratio: 21 / 9; }
.film-grid.filtered .film { grid-column: auto; }
.film-grid.filtered .film .film-media { aspect-ratio: 16 / 9; }

/* ---------- Full-bleed band ---------- */
.band {
  position: relative; min-height: 78vh; min-height: 78svh;
  display: grid; align-items: end;
  overflow: hidden;
}
.band video, .band img.band-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.15) 65%); }
.band-inner { position: relative; z-index: 2; padding: var(--s-xxl) var(--gutter); max-width: calc(var(--max) + 2 * var(--gutter)); width: 100%; margin: 0 auto; }
.band-inner .caption { color: var(--body-strong); display: block; margin-bottom: var(--s-lg); }
.band-title { display: flex; align-items: center; gap: .35em; font-size: clamp(36px, 6.2vw, 88px); }
.client-caption { display: flex !important; align-items: center; gap: .6em; }
.caption-logo { width: 22px; height: 22px; }
.band-actions { display: flex; flex-wrap: wrap; gap: var(--s-sm, 12px); }
.bmw-film { padding-top: var(--s-xxl); }
.bmw-film .feature-media { aspect-ratio: 16 / 9; }
.band + .band { border-top: 1px solid var(--hairline); }
.band-inner p { max-width: 46ch; color: var(--body-strong); margin: var(--s-lg) 0 var(--s-xl); }

/* ---------- Photography ---------- */
.masonry { columns: 3; column-gap: var(--s-md); }
.masonry .photo { break-inside: avoid; margin-bottom: var(--s-md); }
.photo { position: relative; overflow: hidden; background: var(--surface-soft); cursor: zoom-in; display: block; width: 100%; }
.photo img { width: 100%; height: auto; transition: transform 1.4s var(--ease), opacity .8s; opacity: 0; }
.photo img.loaded { opacity: 1; }
.photo:hover img { transform: scale(1.035); }
.photo-more { display: flex; justify-content: center; margin-top: var(--s-xxl); }

/* ---------- Behind the scenes ---------- */
.bts-rail {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: var(--s-xl) var(--s-md);
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto;
  padding: 0 var(--gutter);
}
.bts-rail::-webkit-scrollbar { display: none; }
.bts { scroll-snap-align: start; cursor: pointer; text-align: left; }
.bts-media { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: var(--surface-soft); }
.bts-media img, .bts-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bts-media img { transition: transform 1.4s var(--ease); }
.bts-media video { opacity: 0; transition: opacity .6s var(--ease); }
.bts.playing .bts-media video { opacity: 1; }
.bts:hover .bts-media img { transform: scale(1.04); }
.bts-meta { display: flex; justify-content: space-between; gap: var(--s-sm); padding-top: var(--s-sm); }

/* ---------- Services / places ---------- */
.rows { border-top: 1px solid var(--hairline); }
.row {
  display: grid; grid-template-columns: 80px 1.2fr 1fr auto; gap: var(--s-lg); align-items: baseline;
  padding: var(--s-lg) 0; border-bottom: 1px solid var(--hairline);
}
.row p { margin: 0; color: var(--body); font-size: 18px; }
.row .caption { justify-self: end; }

/* ---------- About ---------- */
.about { display: grid; gap: var(--s-xxl); }
.about .lead { max-width: 48ch; font-size: clamp(20px, 1.9vw, 26px); }
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-xl); }
.person { margin: 0; }
.person-photo { aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-soft); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }
.person:hover .person-photo img { transform: scale(1.03); }
.person figcaption { display: grid; gap: 8px; padding-top: var(--s-md); }
.person .label { color: var(--muted); line-height: 1.8; }

/* ---------- CTA ---------- */
.cta { position: relative; min-height: max(80vh, 56vw); display: grid; place-items: center; text-align: center; overflow: hidden; }
.cta picture { position: absolute; inset: 0; }
.cta img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; opacity: .55; }
.cta-inner { position: relative; z-index: 2; padding: var(--s-section) var(--gutter); }
.cta-inner .caption { display: block; margin-bottom: var(--s-lg); color: var(--body-strong); }
.cta-inner .display-lg { max-width: 24ch; text-wrap: balance; margin: 0 auto var(--s-xl); }
.cta-mail { display: block; margin-top: var(--s-lg); line-height: 1.3; color: var(--body-strong); font-size: 20px; }
.cta-mail:hover { color: var(--link); }
.cta-mail + .cta-mail { margin-top: 4px; }

/* ---------- Footer ---------- */
.footer { padding: var(--s-xxl) var(--gutter) var(--s-xl); color: var(--muted); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-xl); padding-bottom: var(--s-xxl); border-bottom: 1px solid var(--hairline); }
.footer h4 { margin: 0 0 var(--s-md); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a:hover { color: var(--ink); }
.footer-logo img { height: 44px; width: auto; opacity: .9; }
.footer-logo p { max-width: 32ch; margin: var(--s-lg) 0 0; }
.footer-base { display: flex; justify-content: space-between; gap: var(--s-md); padding-top: var(--s-lg); color: var(--muted-soft); flex-wrap: wrap; }

/* ---------- Lightbox / player ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.97);
  display: grid; grid-template-rows: auto 1fr auto;
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease), visibility 0s .45s;
}
.overlay.open { opacity: 1; visibility: visible; transition: opacity .45s var(--ease); }
.overlay-top, .overlay-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s-md); padding: var(--s-md) var(--gutter); }
.overlay-stage { position: relative; display: grid; place-items: center; padding: 0 var(--gutter); min-height: 0; }
.overlay-stage video { width: 100%; max-height: 100%; max-width: calc((100vh - 160px) * 16 / 9); aspect-ratio: 16 / 9; background: #000; }
.overlay-stage video.vertical { width: auto; max-width: 100%; height: 100%; max-height: calc(100vh - 160px); aspect-ratio: 9 / 16; }
.overlay-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.overlay-nav { display: flex; gap: var(--s-xs); }
.overlay .title { font-size: 16px; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  :root { --s-section: 96px; }
  .intro { grid-template-columns: 1fr; gap: var(--s-lg); }
  .about { gap: var(--s-xl); }
  .bts-rail { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 56px 1fr auto; row-gap: 8px; }
  .row > .caption:last-child { grid-column: 3; grid-row: 1; }
  .row p { grid-column: 2 / -1; grid-row: 2; }
}
@media (max-width: 767px) {
  .pair-grid { grid-template-columns: 1fr; gap: var(--s-xl); }
  .band { min-height: 60vh; min-height: 60svh; }
  .band-inner { padding-top: var(--s-xl); padding-bottom: var(--s-xl); }
  .band-inner .display-xl, .band-title { font-size: 30px; }
  .band-inner .caption { margin-bottom: var(--s-md); }
  .band-inner p { margin: var(--s-md) 0 var(--s-lg); }
  :root { --s-section: 80px; --nav-h: 56px; }
  body { font-size: 17px; }
  .nav .nav-link .hide-sm { display: none; }
  .wordmark img { height: 24px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-meta { display: none; }
  .hero h1 { font-size: 36px; }
  .film-grid { grid-template-columns: 1fr; gap: var(--s-xl); }
  .film-grid .film:nth-child(n) { grid-column: auto; }
  .film-grid .film:nth-child(n) .film-media { aspect-ratio: 16 / 9; }
  .feature-media { aspect-ratio: 4 / 5; }
  .play-ring { width: 64px; height: 64px; }
  .masonry { columns: 2; column-gap: 8px; }
  .masonry .photo { margin-bottom: 8px; }
  .team { grid-template-columns: 1fr; gap: var(--s-xl); }
  .bts-rail {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62vw; gap: 8px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    scroll-padding: 0 var(--gutter);
  }
  .bts-rail::after { content: ""; width: 1px; }
  .row { grid-template-columns: 1fr auto; padding: var(--s-md) 0; }
  .row > .caption:first-child { display: none; }
  .row p { grid-column: 1 / -1; font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-xl); }
  .overlay-stage { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
