/* ============================================
   ÍNDIGO FILMS — base tokens
   ============================================ */
:root {
  --bg:          #030304;
  --bg-panel:    #08090d;
  --cobalt:      #1a35d4;
  --cobalt-2:    #3b5bff;
  --cobalt-glow: rgba(59,91,255,0.16);
  --ink:         #f3f3ef;
  --mute:        rgba(243,243,239,0.46);
  --mute-dim:    rgba(243,243,239,0.24);
  --line:        rgba(243,243,239,0.09);

  --font-display: 'Fraunces', serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'Space Mono', monospace;

  --ease: cubic-bezier(0.77,0,0.18,1);
  --dur: 0.75s;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { width: 100%; scroll-behavior: smooth; }
body { width: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  cursor: none;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cobalt-2);
}

.eyebrow-invert { color: rgba(255,255,255,0.6); }

/* ============================================
   GRAIN OVERLAY — filmic texture
   ============================================ */
.grain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.035;
  mix-blend-mode: overlay;
}
/* The grain's blend mode renders as visible colored noise over <video>
   elements in some browsers — turn it off while a video is open so only
   the video itself shows. */
body.p2-modal-open .grain,
body.p2-feed-open .grain { display: none; }

/* ============================================
   SIGNATURE — viewfinder frame + HUD
   ============================================ */
.frame { position: fixed; inset: 18px; z-index: 490; pointer-events: none; }

.frame-corner {
  position: absolute;
  width: 22px; height: 22px;
  border: 1px solid var(--mute-dim);
}
.frame-corner.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.frame-corner.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.frame-corner.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.frame-corner.br { bottom: 0; right: 0; border-left: none; border-top: none; }

.hud {
  position: fixed;
  bottom: 32px;
  z-index: 500;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-left { left: 52px; }
.hud-right { right: 52px; }

.hud-rec { display: flex; align-items: center; gap: 6px; color: var(--mute); }
.hud-rec i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cobalt-2);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.tc { font-variant-numeric: tabular-nums; color: var(--mute); }

/* ============================================
   CURSOR
   ============================================ */
#cur { position:fixed; width:6px; height:6px; background:var(--cobalt-2); border-radius:50%; pointer-events:none; z-index:9999; transform:translate(-50%,-50%); transition: width .2s, height .2s; }
#cur-ring { position:fixed; width:28px; height:28px; border:1px solid rgba(59,91,255,0.5); border-radius:50%; pointer-events:none; z-index:9998; transform:translate(-50%,-50%); }

/* ============================================
   PAGE SYSTEM — vertical scroll, sections stacked
   ============================================ */
.pages { display: flex; flex-direction: column; }

.page {
  display: flex; flex-direction: column;
  min-height: 100vh;
  scroll-margin-top: 88px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

.page.in-view { opacity: 1; transform: translateY(0); }
.page.active { opacity: 1; transform: translateY(0); }

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 2200;
  display: flex; justify-content: space-between; align-items: center;
  padding: 32px 52px;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
}
.nav-logo span { color: var(--cobalt-2); margin: 0 6px; font-family: var(--font-mono); }
.nav-logo-img { width: 44px; height: 44px; object-fit: contain; display: block; }

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mute);
  cursor: none;
  position: relative;
  padding-bottom: 3px;
  transition: color .3s;
}

.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px;
  background: var(--cobalt-2);
  transition: right .35s var(--ease);
}

.nav-links a:hover,
.nav-links a.active-link { color: var(--ink); }
.nav-links a:hover::after,
.nav-links a.active-link::after { right: 0; }

.nav-links-cta {
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 18px !important;
}
.nav-links-cta::after { display: none; }
.nav-links-cta:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }

/* Desktop "Proyectos" dropdown — click-triggered, small contained panel
   under the nav item, not the full-width mobile menu style */
.nav-dropdown { position: relative; }

.nav-dropdown-btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  cursor: none;
  padding-bottom: 3px;
  transition: color .3s;
}
.nav-dropdown-btn:hover,
.nav-dropdown.is-open .nav-dropdown-btn { color: var(--ink); }

.nav-dropdown-panel {
  position: absolute;
  top: 100%; left: 50%;
  transform: translate(-50%, -6px);
  margin-top: 18px;
  min-width: 170px;
  background: rgba(8,9,13,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.45);
  padding: 8px;
  display: flex; flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.nav-dropdown-panel.is-open { opacity: 1; pointer-events: all; transform: translate(-50%, 0); }

.nav-dropdown-panel a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--mute);
  padding: 11px 14px;
  border-radius: 10px;
  cursor: none;
  transition: color .2s, background .2s;
}
.nav-dropdown-panel a:hover,
.nav-dropdown-panel a.active-link { color: var(--ink); background: var(--cobalt-glow); }

.nav-burger {
  display: none;
  width: 34px; height: 34px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: none;
  z-index: 2100;
}
.nav-burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--ink);
  transition: transform .3s ease, opacity .3s ease;
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2050;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s cubic-bezier(.16,1,.3,1);
}
.mobile-menu.is-open { max-height: 560px; }

.mobile-menu-logo-slot { display: flex; justify-content: center; padding-top: 118px; height: 84px; }

.mobile-menu-links {
  list-style: none;
  padding: 16px 24px 28px;
}
.mobile-menu-links li + li { border-top: 1px solid var(--line); }
.mobile-menu-links a {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--ink);
  text-decoration: none;
  padding: 16px 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .35s ease, transform .35s ease;
}
.mobile-menu.is-open .mobile-menu-links a { opacity: 1; transform: translateY(0); }
.mobile-menu-links li:nth-child(1) a { transition-delay: .06s; }
.mobile-menu-links li:nth-child(2) a { transition-delay: .1s; }
.mobile-menu-links li:nth-child(3) a { transition-delay: .14s; }
.mobile-menu-links li:nth-child(4) a { transition-delay: .18s; }
.mobile-menu-links li:nth-child(5) a { transition-delay: .22s; }

.mobile-menu-num { font-family: var(--font-mono); font-size: 11px; color: var(--cobalt-2); }

/* Contacto stands out from the category links above it */
.mobile-menu-cta {
  color: var(--cobalt-2) !important;
  font-style: italic;
}
.mobile-menu-cta .mobile-menu-num { color: var(--cobalt-2); }

body.mobile-menu-open { overflow: hidden; }

.nav-fly-logo {
  position: fixed;
  z-index: 2300;
  object-fit: contain;
  pointer-events: none;
  will-change: top, left, width, height;
}

/* ============================================
   PAGE 1 — PORTADA
   ============================================ */
#p1 { background: var(--bg); justify-content: center; min-height: 100vh; }

.p1-inner { display: grid; grid-template-columns: minmax(340px, 460px) 1fr; min-height: 100vh; }

.p1-left {
  display: flex; flex-direction: column; justify-content: center;
  gap: 28px;
  padding: 120px 60px;
  position: relative; overflow: hidden;
}

.p1-left::before {
  content: '';
  position: absolute; bottom: 40px; left: -120px;
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--cobalt-glow) 0%, transparent 70%);
  pointer-events: none;
}

.p1-card { display: flex; flex-direction: column; gap: 15px; }

.p1-title {
  font-family: var(--font-display);
  font-size: clamp(58px, 7vw, 104px);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.p1-title em { display: block; font-style: italic; font-weight: 300; color: var(--cobalt-2); }
.p1-title-script {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
}

.p1-tagline {
  font-size: 15px;
  color: var(--mute);
  letter-spacing: 0.02em;
  line-height: 1.9;
  max-width: 340px;
}

.p1-right { position: relative; }

.p1-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.p1-media video,
.p1-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.p1-media .p1-video-desktop { display: block; }
.p1-media .p1-video-mobile  { display: none; }

.p1-video-placeholder {
  position: relative;
  width: 100%; height: 100%;
  min-height: 480px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.p1-media-fade { position: absolute; pointer-events: none; z-index: 2; }

.p1-media-fade-top    { left: 0; right: 0; height: clamp(90px, 20%, 260px); }
.p1-media-fade-bottom { left: 0; right: 0; height: clamp(140px, 38%, 520px); }
.p1-media-fade-left,
.p1-media-fade-right  { top: 0; bottom: 0; width: clamp(70px, 16%, 220px); }

.p1-media-fade-top    { top: 0;    background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%); }
.p1-media-fade-bottom { bottom: 0; background: linear-gradient(to top,    var(--bg) 0%, transparent 100%); }
.p1-media-fade-left   { left: 0;   background: linear-gradient(to right,  var(--bg) 0%, transparent 100%); }
.p1-media-fade-right  { right: 0;  background: linear-gradient(to left,   var(--bg) 0%, transparent 100%); }

/* ============================================
   PAGE 2 — PROYECTOS
   ============================================ */
#p2 { background: var(--bg); justify-content: center; scroll-margin-top: -60px; }

.p2-inner { height: 100%; display: flex; flex-direction: column; padding: 90px 52px 40px; }

.p2-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 36px; }
.p2-count { font-family: var(--font-mono); font-size: 12px; color: var(--mute); letter-spacing: 0.08em; }

/* Category hub — 4 big tiles linking out to their own standalone pages */
.p2-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
}

.p2-cat-tile {
  position: relative;
  display: block;
  background: var(--bg-panel);
  overflow: hidden;
  text-decoration: none;
  cursor: none;
  min-height: 260px;
}

.p2-cat-tile-photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.55);
  transition: transform .6s cubic-bezier(.25,.46,.45,.94), filter .4s ease;
}
.p2-cat-tile:hover .p2-cat-tile-photo { transform: scale(1.06); filter: brightness(0.4); }

.p2-cat-tile-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.p2-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: 1400px;
  margin: 0 auto;
}

.p2-item {
  aspect-ratio: 1 / 1;
  background: var(--bg-panel);
  position: relative;
  overflow: hidden;
  cursor: none;
  transform-origin: center center;
  transition: transform .3s ease;
}
.p2-item:nth-child(2),
.p2-item:nth-child(3),
.p2-item:nth-child(6),
.p2-item:nth-child(7),
.p2-item:nth-child(10) { grid-column: span 2; aspect-ratio: 2 / 1; }

.p2-item:hover { transform: scale(1.16); z-index: 10; }

/* Comercial's own 2-item grid (desktop) — full width each, stacked, since
   one small + one large would look lopsided with just 2 projects */
.page-comercial .p2-item { grid-column: span 3; aspect-ratio: 2.5 / 1; }
.page-bodas .p2-item { grid-column: span 3; aspect-ratio: 2.5 / 1; }

/* Conciertos has only 4 items — the shared large-item rule (2,3,6,7,10)
   would make items 2 AND 3 both large here, leaving several scattered
   gaps. Reset item 3 back to small so there's just one clean gap. */
/* Visual order: Daniel Quien(chica) → Majo(grande) → Silvana(grande) →
   Bahidora(chica). DOM order stays Majo,Silvana,Bahidora,DanielQuien so
   clicking still opens the right project — only the display order moves. */
.page-conciertos .p2-item:nth-child(1) { order: 2; grid-column: span 2; aspect-ratio: 2 / 1; } /* Majo */
.page-conciertos .p2-item:nth-child(2) { order: 3; grid-column: span 2; aspect-ratio: 2 / 1; } /* Silvana */
.page-conciertos .p2-item:nth-child(3) { order: 4; grid-column: span 1; aspect-ratio: 1 / 1; } /* Bahidora */
.page-conciertos .p2-item:nth-child(4) { order: 1; grid-column: span 1; aspect-ratio: 1 / 1; } /* Daniel Quien */

.p2-item-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; transition: transform .6s cubic-bezier(.25,.46,.45,.94); }
.p2-item:hover .p2-item-img { transform: scale(1.04); }

.p2-item-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.p2-placeholder-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--cobalt-glow) 1px, transparent 1px), linear-gradient(90deg, var(--cobalt-glow) 1px, transparent 1px);
  background-size: 32px 32px;
}
.p2-placeholder-label { position: relative; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; color: rgba(243,243,239,0.15); }

.p2-item-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 22px 24px;
  background: linear-gradient(to top, rgba(3,3,4,0.94) 0%, transparent 100%);
  transform: translateY(4px); opacity: 0;
  transition: all .35s ease;
}
.p2-item:hover .p2-item-info { opacity: 1; transform: translateY(0); }

.p2-item-num { font-family: var(--font-mono); font-size: 11px; color: var(--cobalt-2); letter-spacing: 0.1em; margin-bottom: 4px; }
.p2-item-name { font-family: var(--font-display); font-size: 22px; }
.p2-item-tag { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 3px; }

/* ── Project preview modal ── */
.p2-modal-overlay {
  position: fixed; inset: 0;
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 32px;
  background: rgba(3,3,4,0);
  opacity: 0;
  pointer-events: none;
  transition: background .4s ease, opacity .4s ease;
}
.p2-modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
  background: rgba(3,3,4,0.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.p2-modal-card {
  position: relative;
  width: clamp(900px, 84vw, 1720px);
  max-height: 90vh;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease;
}
.p2-modal-card.is-visible { opacity: 1; transform: translateY(0); transition-delay: .18s; }

/* Brief dip while swapping to the next/previous project — the photo/video
   already crossfade on their own, this just keeps the info panel in sync */
.p2-modal-info { transition: opacity .2s ease; }
.p2-modal-card.is-switching .p2-modal-info { opacity: 0; }

.p2-modal-img-slot { position: relative; background: var(--bg); min-height: 540px; overflow: hidden; }

.p2-modal-photo,
.p2-modal-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity .4s ease;
}
.p2-modal-photo { object-fit: cover; }
.p2-modal-video { object-fit: contain; background: var(--bg); }
.p2-modal-photo.is-visible,
.p2-modal-video.is-visible { opacity: 1; }

.p2-modal-mute-btn {
  position: absolute;
  bottom: 16px; left: 16px;
  z-index: 4;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(243,243,239,0.2);
  background: rgba(3,3,4,0.55);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, border-color .3s ease, background .3s ease;
}
.p2-modal-video.is-visible ~ .p2-modal-mute-btn { opacity: 1; pointer-events: all; }
.p2-modal-mute-btn:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }
.p2-modal-mute-btn .icon-off { display: none; }
.p2-modal-mute-btn.is-muted .icon-on { display: none; }
.p2-modal-mute-btn.is-muted .icon-off { display: block; }

/* Native player controls (added to non-index pages) already include their
   own volume control — hide the custom mute button so it's not doubled up,
   and tint the native controls to match the site's cobalt accent where
   the browser supports it. */
body.has-native-controls .p2-modal-mute-btn,
body.has-native-controls .p2-feed-mute { display: none; }

body.has-native-controls video[controls] {
  accent-color: var(--cobalt-2);
  border-radius: 2px;
  cursor: auto !important;
}

.p2-yt-crop {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.p2-yt-crop.is-visible { opacity: 1; pointer-events: all; }
.p2-yt-crop iframe {
  position: absolute;
  top: 50%; left: 50%;
  width: 120%;
  height: 130%;
  transform: translate(-50%, -50%);
  border: none;
}

.p2-modal-close {
  position: absolute; top: 18px; right: 18px;
  z-index: 5;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(3,3,4,0.55);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: border-color .3s, background .3s;
}
.p2-modal-close:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }

.p2-modal-nav {
  position: absolute; top: 18px; right: 70px;
  z-index: 5;
  display: flex; gap: 8px;
}
.p2-modal-nav-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(3,3,4,0.55);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: border-color .3s, background .3s, opacity .3s;
}
.p2-modal-nav-btn:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }
.p2-modal-nav-btn:disabled { opacity: 0.25; pointer-events: none; }

.p2-modal-info { padding: 56px 48px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.p2-modal-num { font-family: var(--font-mono); font-size: 13px; color: var(--cobalt-2); letter-spacing: 0.1em; }
.p2-modal-title { font-family: var(--font-display); font-size: 46px; font-weight: 400; line-height: 1.08; }
.p2-modal-tag { font-family: var(--font-mono); font-size: 13px; color: var(--mute); letter-spacing: 0.12em; text-transform: uppercase; }

.p2-modal-about-btn {
  align-self: flex-start;
  margin-top: 12px;
  padding: 13px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: none;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: none;
  transition: border-color .3s, background .3s;
}
.p2-modal-about-btn:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }

.p2-modal-about { font-size: 16px; color: var(--mute); line-height: 1.9; max-width: 46ch; }

.p2-modal-more-link {
  align-self: flex-start;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--cobalt-2);
  cursor: none;
  transition: opacity .3s;
}
.p2-modal-more-link:hover { opacity: 0.7; }

.p2-modal-mobile-notice { display: none; }

body.p2-modal-open { overflow: hidden; }

.p2-fly-img {
  position: fixed;
  z-index: 2001;
  object-fit: cover;
  pointer-events: none;
  will-change: top, left, width, height;
  box-shadow: -12px 0 40px rgba(0,0,0,0.5);
}

/* ── Fullscreen project feed (Arte test) — replaces the modal on this page ── */
.p2-feed-overlay {
  position: fixed; inset: 0;
  z-index: 3000;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.p2-feed-overlay.is-open { opacity: 1; pointer-events: all; }

.p2-feed-scroll {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none;
}
.p2-feed-scroll::-webkit-scrollbar { display: none; }

.p2-feed-slide {
  position: relative;
  display: flex; flex-direction: column;
}

.p2-feed-beat {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding-top: 84px;
  opacity: 0.32;
  filter: brightness(0.55);
  transition: opacity .5s ease, filter .5s ease;
}
.p2-feed-beat.is-focused { opacity: 1; filter: brightness(1); }

.p2-feed-beat-text {
  justify-content: center;
  align-items: center;
  padding-top: 0;
}

/* Media fills the full screen — object-fit:contain keeps the video/photo's
   own proportions intact (no cropping), letterboxed if its shape doesn't
   match the screen, instead of a small contained post card. */
.p2-feed-media {
  position: relative;
  flex: 1;
  width: 100%;
  background: var(--bg);
  overflow: hidden;
}
.p2-feed-photo,
.p2-feed-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity .4s ease;
}
.p2-feed-photo.is-visible,
.p2-feed-video.is-visible { opacity: 1; }

/* Small carousel for projects with more than one video in the same beat */
.p2-carousel-nav {
  position: absolute;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex; align-items: center; gap: 14px;
  padding: 8px 10px;
  background: rgba(3,3,4,0.5);
  border: 1px solid rgba(243,243,239,0.15);
  border-radius: 30px;
}
.p2-carousel-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: background .2s;
}
.p2-carousel-btn:hover { background: rgba(255,255,255,0.12); }
.p2-carousel-dots { display: flex; gap: 7px; }
.p2-carousel-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(243,243,239,0.3);
  transition: background .25s, transform .25s;
}
.p2-carousel-dots span.is-active { background: var(--cobalt-2); transform: scale(1.3); }

.p2-feed-info {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 24px 50px;
}
.p2-feed-beat-text .p2-feed-info { padding: 24px; text-align: center; }

/* ── Movie-credits style (Soumaya test): fixed media on the left,
   continuously scrolling text + photos on the right — no full-screen
   beat-swapping here, it's a normal read-through. ── */
.p2-feed-credits {
  display: grid;
  grid-template-columns: 54% 46%;
  align-items: start;
}

.p2-credits-media-col {
  position: sticky;
  top: 0;
  height: 100vh;
}
.p2-credits-media-col .p2-feed-beat { min-height: 100vh; padding-top: 84px; }

.p2-credits-text-col {
  padding: 140px 60px 200px 50px;
  display: flex; flex-direction: column;
  gap: 34px;
}
.p2-credits-text-col .p2-feed-title { font-size: 30px; }
.p2-credits-text-col .p2-feed-desc { max-width: 44ch; }

.p2-credits-line {
  display: flex; align-items: baseline; gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.p2-credits-role {
  flex: 0 0 140px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}
.p2-credits-name {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--ink);
}

/* Compact block at the end — tighter line-height, no gap from the
   column's normal spacing so the lines sit close together */
.p2-credits-final {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 60px;
}
.p2-credits-final .p2-credits-line {
  padding-bottom: 6px;
  line-height: 1.1;
  border-bottom: none;
}

/* Full gallery — grid of every photo for a project, phone-camera-roll
   style. Lives inline at the bottom of the column, not a popup. */
.p2-gallery-grid {
  columns: 2;
  column-gap: 6px;
  max-width: 100%;
  margin-top: 10px;
}
.p2-gallery-grid img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 6px;
  break-inside: avoid;
  cursor: none;
  transition: opacity .2s ease;
}
.p2-gallery-grid img:hover { opacity: 0.75; }
/* Lightbox — clicking a gallery photo opens it large */
.p2-lightbox {
  position: fixed; inset: 0;
  z-index: 3600;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: rgba(3,3,4,0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.p2-lightbox.is-open { opacity: 1; pointer-events: all; }
.p2-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: none;
}
.p2-lightbox-close {
  position: fixed; top: 24px; right: 24px;
  z-index: 3601;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(3,3,4,0.55);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: border-color .3s, background .3s;
}
.p2-lightbox-close:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }
.p2-feed-title { font-family: var(--font-display); font-size: 26px; font-weight: 400; color: var(--ink); }
.p2-feed-tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cobalt-2); margin-top: 6px; }
.p2-feed-desc { font-size: 14px; color: var(--mute); line-height: 1.8; margin-top: 12px; }

.p2-feed-close,
.p2-feed-mute {
  position: fixed;
  z-index: 3001;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(3,3,4,0.55);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  cursor: none;
  transition: border-color .3s, background .3s;
}
.p2-feed-close { top: 24px; right: 24px; }
.p2-feed-mute { bottom: 24px; left: 24px; }
.p2-feed-close:hover, .p2-feed-mute:hover { border-color: var(--cobalt-2); background: var(--cobalt-glow); }
.p2-feed-mute .icon-off { display: none; }
.p2-feed-mute.is-muted .icon-on { display: none; }
.p2-feed-mute.is-muted .icon-off { display: block; }

body.p2-feed-open { overflow: hidden; }

@media (max-width: 900px) {
  .p2-feed-beat { padding-top: 76px; }
  .p2-feed-credits { grid-template-columns: 1fr; }
  .p2-credits-media-col { position: relative; height: 70vh; }
  .p2-credits-media-col .p2-feed-beat { min-height: 70vh; padding-top: 76px; }
  .p2-credits-text-col { padding: 40px 24px 100px; gap: 32px; }
  .p2-credits-line { flex-direction: column; gap: 4px; }
  .p2-credits-role { flex-basis: auto; }
  .p2-feed-beat-text { padding-top: 0; }
  .p2-feed-info { padding-top: 16px; }
  .p2-feed-title { font-size: 22px; }

  /* Floating window instead of edge-to-edge fullscreen — uses as much
     space as it can, but stays a distinct "little screen" over the page,
     with its own internal scroll. */
  .p2-feed-overlay {
    position: fixed;
    padding: 46px 10px 18px;
    display: flex;
  }
  .p2-feed-overlay.is-open { background: rgba(3,3,4,0.82); }

  .p2-feed-scroll {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--bg);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .p2-feed-close { position: fixed; top: 58px; right: 22px; }
  .p2-feed-mute { position: fixed; bottom: 30px; left: 22px; }

  .p2-feed-beat { min-height: 100%; }
  .p2-credits-media-col { height: 60vh; }
  .p2-credits-media-col .p2-feed-beat { min-height: 60vh; }
}

@media (max-width: 900px) {
  .p2-fly-img { box-shadow: none; object-fit: contain; background: var(--bg); }
  .p2-modal-overlay { padding: 92px 12px 20px; align-items: flex-start; }
  .p2-modal-card { width: 100%; max-width: 100%; max-height: calc(100vh - 112px); grid-template-columns: 1fr; overflow-y: auto; }

  /* Standard rectangle box for the video/photo — video gets a slight zoom
     (cover + small scale) so it reads bigger than plain "contain", but it's
     not forced to fill every corner of the box. */
  .p2-modal-img-slot { min-height: 0; aspect-ratio: 16 / 9; background: var(--bg); }
  .p2-modal-video {
    object-fit: contain;
    /* Video keeps its real proportions — no stretching, no distortion.
       This number is YOUR zoom control: 1 = no zoom (full video visible,
       may show black bars). Above 1 zooms in, cropping proportionally
       more the higher it goes (1.1 = slight zoom, 1.3 = noticeable, etc). */
    transform: scale(1.15);
  }

  .p2-modal-info { padding: 28px 24px; }
  .p2-modal-mobile-notice {
    display: block;
    font-size: 12px;
    color: var(--mute);
    line-height: 1.6;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
}

/* ============================================
   PAGE 3 — ESTUDIO
   ============================================ */
#p3 { background: var(--bg); scroll-margin-top: 0px; }

.p3-inner { height: 100%; display: grid; grid-template-columns: 52px 1fr 1fr; }

.p3-sidebar { border-right: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.p3-sidebar-text { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--mute); }

.p3-left { padding: 120px 60px 80px 52px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); gap: 40px; }

.p3-heading { font-family: var(--font-display); font-size: clamp(38px, 4vw, 60px); font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; }
.p3-heading em { font-style: italic; font-weight: 300; color: var(--cobalt-2); }

.p3-quote {
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  color: var(--mute); line-height: 1.9;
  border-left: 2px solid var(--cobalt-2); padding-left: 20px;
}

.p3-right { padding: 120px 52px 80px 52px; display: flex; flex-direction: column; justify-content: space-between; }

.p3-body { font-size: 15px; color: var(--mute); line-height: 2.1; max-width: 420px; }
.p3-body p + p { margin-top: 20px; }
.p3-body strong { color: var(--ink); font-weight: 400; }

.p3-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); }
.p3-stat { background: var(--bg); padding: 24px 0; }
.p3-stat-num { font-family: var(--font-display); font-size: 34px; font-weight: 400; color: var(--cobalt-2); line-height: 1; }
.p3-stat-label { font-family: var(--font-mono); font-size: 11px; color: var(--mute); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 8px; }

/* ============================================
   PAGE 4 — CONTACTO
   ============================================ */
#p4 { background: var(--cobalt); scroll-margin-top: -40px; height: calc(100vh + 30px); }

.p4-inner { height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 120px 60px 60px; position: relative; overflow: hidden; }

.p4-inner::before {
  content: ''; position: absolute; top: -220px; right: -220px;
  width: 720px; height: 720px;
  background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.p4-inner::after {
  content: 'ÍNDIGO'; position: absolute; bottom: -70px; right: -20px;
  font-family: var(--font-display); font-size: 220px; font-weight: 600;
  color: rgba(255,255,255,0.045); line-height: 1;
  pointer-events: none; user-select: none;
}

/* Logo watermark — huge and mostly cropped off-screen, just a fragment
   showing through on the right side where the section felt empty. */
.p4-logo-watermark {
  position: absolute; top: 50%; right: -420px;
  transform: translateY(-50%);
  width: 1100px; height: auto;
  opacity: 0.05;
  filter: brightness(0) invert(1); /* forces it white regardless of source colors */
  pointer-events: none; user-select: none;
}

.p4-title { font-family: var(--font-display); font-size: clamp(50px, 7vw, 96px); font-weight: 400; line-height: 0.95; letter-spacing: -0.01em; }
.p4-title em { font-style: italic; font-weight: 300; display: block; color: rgba(255,255,255,0.62); }

.p4-bottom { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 40px; }
.p4-links { display: flex; flex-direction: column; gap: 16px; }

.p4-link { display: flex; align-items: center; gap: 16px; text-decoration: none; color: rgba(255,255,255,0.72); font-size: 15px; letter-spacing: 0.02em; transition: color .3s; }
.p4-link:hover { color: #fff; }

.p4-link-icon { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background .3s, border-color .3s; }
.p4-link:hover .p4-link-icon { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }

.p4-copy { font-family: var(--font-mono); font-size: 11px; color: rgba(255,255,255,0.35); letter-spacing: 0.06em; }

/* ============================================
   PAGE COUNTER / PROGRESS
   ============================================ */
.progress { position: fixed; bottom: 0; left: 0; height: 2px; background: var(--cobalt-2); z-index: 500; transition: width var(--dur) var(--ease); }

/* Contact page: invert HUD/frame contrast */
body.on-contact .frame-corner { border-color: rgba(255,255,255,0.25); }
body.on-contact .hud, body.on-contact .nav-links a { color: rgba(255,255,255,0.6); }
body.on-contact .nav-links a:hover, body.on-contact .nav-links a.active-link { color: #fff; }
body.on-contact .nav-links a::after { background: #fff; }
body.on-contact .nav-links-cta { border-color: rgba(255,255,255,0.3); }
body.on-contact .progress { background: #fff; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .page.enter-right, .page.enter-left, .page.exit-left, .page.exit-right { animation: none !important; }
  .hud-rec i { animation: none; }
}

@media (max-width: 900px) {
  .p1-inner, .p3-inner { grid-template-columns: 1fr; }
  .p3-sidebar { display: none; }
  .hud-right { right: 24px; font-size: 10px; }

  #p1 { position: relative; }
  .p1-inner { display: block; min-height: 100vh; }

  .p1-right {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
  }
  .p1-right .p1-media { position: absolute; inset: 0; }
  .p1-media .p1-video-desktop { display: none; }
  .p1-media .p1-video-mobile  { display: block; }

  .p1-left {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    justify-content: flex-end;
    padding-top: 24px;
    padding-bottom: 150px;
  }

  .p1-title { font-size: clamp(64px, 16vw, 96px); }
  .p1-tagline { display: none; }
  .p1-card .eyebrow { order: 2; }
  .p1-card .p1-title { order: 1; }
  .p1-tagline { font-size: 15px; }
  .p1-card .eyebrow,
  .p1-card .p1-title em { color: #4f7dff; }
  .p1-card .eyebrow,
  .p1-card .p1-title { text-shadow: 0 10px 44px rgba(0,0,0,0.85), 0 4px 18px rgba(0,0,0,0.9); }
  body { overflow-x: hidden; }

  .nav { padding: 22px 24px; }
  .p2-grid { grid-template-columns: 1fr 1fr; }
  /* Mobile-only layout — visual order via `order`, doesn't touch the DOM
     order that desktop relies on.
     Row1: Majo(L) — Row2: Levi's Activación+Soumaya(S,S)
     Row3: Boda A&A(L) — Row4: Levi's Inauguración+Silvana Estrada(S,S)
     Row5: Detrás de la Puerta(L) — Row6: Bahidora+Daniel Quien(S,S)
     Row7: Tinta Color Obsidiana(L) — Row8: Boda V&A(L)
     Every small is paired, larges never need a partner — zero gaps. */
  .p2-item:nth-child(1)  { order: 2;  grid-column: span 1; aspect-ratio: 1 / 1; }
  .p2-item:nth-child(2)  { order: 1;  grid-column: span 2; aspect-ratio: 2 / 1; }
  .p2-item:nth-child(3)  { order: 4;  grid-column: span 2; aspect-ratio: 2 / 1; }
  .p2-item:nth-child(4)  { order: 5;  grid-column: span 1; aspect-ratio: 1 / 1; }
  .p2-item:nth-child(5)  { order: 3;  grid-column: span 1; aspect-ratio: 1 / 1; }
  .p2-item:nth-child(6)  { order: 7;  grid-column: span 2; aspect-ratio: 2 / 1; }
  .p2-item:nth-child(7)  { order: 11; grid-column: span 1; aspect-ratio: 1 / 1; }
  .p2-item:nth-child(8)  { order: 6;  grid-column: span 1; aspect-ratio: 1 / 1; }
  .p2-item:nth-child(9)  { order: 8;  grid-column: span 1; aspect-ratio: 1 / 1; }
  .p2-item:nth-child(10) { order: 10; grid-column: span 2; aspect-ratio: 2 / 1; }
  .p2-item:nth-child(11) { order: 9;  grid-column: span 1; aspect-ratio: 1 / 1; }

  /* Conciertos' own 4-item grid — the rules above are scoped for the big
     Producciones mosaic and bleed into every .p2-item on the page, so this
     resets it: Daniel Quien+Bahidora paired small, Majo/Silvana large alone. */
  .page-conciertos .p2-item:nth-child(1) { order: 1; grid-column: span 2; aspect-ratio: 2 / 1; } /* Majo */
  .page-conciertos .p2-item:nth-child(2) { order: 4; grid-column: span 2; aspect-ratio: 2 / 1; } /* Silvana */
  .page-conciertos .p2-item:nth-child(3) { order: 3; grid-column: span 1; aspect-ratio: 1 / 1; } /* Bahidora */
  .page-conciertos .p2-item:nth-child(4) { order: 2; grid-column: span 1; aspect-ratio: 1 / 1; } /* Daniel Quien */

  /* Arte's own 3-item grid — same unscoped-bleed fix as Conciertos */
  .page-arte .p2-item:nth-child(1) { order: 1; grid-column: span 1; aspect-ratio: 1 / 1; } /* Soumaya */
  .page-arte .p2-item:nth-child(2) { order: 3; grid-column: span 2; aspect-ratio: 2 / 1; } /* Detrás de la Puerta */
  .page-arte .p2-item:nth-child(3) { order: 2; grid-column: span 1; aspect-ratio: 1 / 1; } /* Tinta Color Obsidiana */
  .page-arte .p2-item:nth-child(3) .p2-item-photo { object-position: left center; }

  /* Comercial's own 2-item grid (mobile) — same fix as desktop, needed
     again here since a later unscoped mobile rule above wins ties */
  .page-comercial .p2-item { grid-column: span 3 !important; aspect-ratio: 2.5 / 1 !important; order: 0; }
  .page-bodas .p2-item { grid-column: span 3 !important; aspect-ratio: 2.5 / 1 !important; order: 0; }

  /* Levi's Activación (and any other card marked data-orientation="vertical")
     gets a taller modal shape instead of the standard 16:9 box, since its
     video is portrait — adjust this ratio to taste */
  .p2-modal-img-slot.is-vertical { aspect-ratio: 3 / 4; }

  /* Tinta Color Obsidiana thumbnail — anchor crop to the left so the
     silhouette + title text aren't cut off by a centered crop */
  .p2-item:nth-child(7) .p2-item-photo { object-position: left center; }
  .p1-left, .p2-inner, .p3-left, .p4-inner { padding-left: 24px; padding-right: 24px; }

  /* Contacto — don't force a full 100vh here like desktop; that was
     leaving a big awkward empty gap between the title and the links on
     narrower/shorter screens. A shorter, tighter card reads better. */
  #p4 { height: auto; min-height: calc(100vh + 40px); }
  .p4-inner { padding: 130px 24px 44px; gap: 40px; }
  .p4-logo-watermark { display: none; }
  .p4-title { font-size: clamp(38px, 11vw, 56px); margin-top: 24px; }
  .p4-bottom { flex-direction: column; align-items: flex-start; gap: 26px; }
  .p4-links { gap: 14px; }
  .p4-link { font-size: 14px; }
  .p4-link-icon { width: 34px; height: 34px; }
  .p4-copy { font-size: 10px; }
  .p4-inner::after { font-size: 130px; bottom: -18px; right: -8px; }
  .p4-inner::before { width: 380px; height: 380px; top: -140px; right: -140px; }
  .hud-left { left: 24px; }
  .frame { inset: 10px; }
  body { cursor: auto; }
  .nav-links a, .p2-item, .p2-modal-close, .p2-modal-about-btn, .nav-burger { cursor: auto; }
  #cur, #cur-ring { display: none; }
}