:root {
  --bg: #0b0b0c;
  --surface: #151517;
  --line: #26262a;
  --text: #f2f0eb;
  --muted: #9a9890;
  --accent: #ecebe7;   /* paleta en negros, grises y blancos */
  --radius: 4px;   /* redondeado mínimo en todo el sitio (botones, pestañas, tarjetas, videos y fotos) */
  --wrap: 1720px;                         /* ancho máximo del contenido (márgenes incluidos) */
  --gutter: clamp(24px, 5vw, 80px);       /* margen lateral: crece con la pantalla */
  --font: "Inter", system-ui, sans-serif;   /* Inter con tamaño óptico 18 (= "Inter 18pt") */
  --display: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 300 17px/1.6 var(--font);   /* texto corrido en light */
  font-variation-settings: "opsz" 18;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
/* sin el botón de play que algunos celulares dibujan encima mientras el video no arrancó */
video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
video::-webkit-media-controls { display: none !important; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* Inter 18pt (tamaño óptico 18) en todo el sitio, títulos y texto */
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 700; max-width: 16ch; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); font-weight: 600; max-width: 22ch; }
h3 { font-size: 1.3rem; font-weight: 600; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.kicker {
  margin: 0 0 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #d6d3cc; max-width: 54ch; margin: 20px 0 32px; }

.btn {
  display: inline-block;
  padding: 16px 28px;
  border-radius: var(--radius);
  /* vidrio esmerilado: translúcido, desenfoca lo que hay detrás */
  background: rgba(255,255,255,.05);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, background .25s ease, color .25s ease;
}
/* al pasar el mouse el vidrio se vuelve blanco y el texto pasa al gris oscuro del fondo */
.btn:hover { transform: translateY(-2px); background: var(--accent); color: var(--bg); }
.btn--small { padding: 10px 18px; font-size: 0.9rem; }

/* NAV */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  /* mismo borde izquierdo y derecho que el contenido */
  padding: 16px max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter)));
  background: linear-gradient(to bottom, rgba(11,11,12,.85), rgba(11,11,12,0));
  backdrop-filter: blur(6px);
}
.nav__brand { font-family: var(--display); font-weight: 700; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.nav .btn--small { white-space: nowrap; }
.nav__links { display: flex; gap: 24px; margin-left: auto; }
.nav__links a { text-decoration: none; color: var(--muted); font-size: 0.95rem; font-weight: 400; }
.nav__links a:hover { color: var(--text); }

/* HERO */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% 50%; }
.hero__shade { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 2%, rgba(11,11,12,.55) 45%, rgba(11,11,12,.25)); }
.hero__content { position: relative; padding-block: 140px 96px; }

/* Pantallas anchas: el texto se queda sobre la zona negra de la izquierda y no tapa la toma de la derecha */
@media (min-aspect-ratio: 1/1) and (min-width: 901px) {
  .hero h1 { font-size: clamp(2.4rem, 4.2vw, 3.9rem); max-width: 13.5ch; }   /* 4 líneas */
  .hero .lead { max-width: 64ch; }
  /* el reel se ve al 100 %: solo se oscurece la franja izquierda (debajo del texto) y el borde inferior */
  .hero__shade {
    background:
      linear-gradient(to right, rgba(11,11,12,.9) 0%, rgba(11,11,12,.78) 28%, rgba(11,11,12,.35) 46%, rgba(11,11,12,0) 62%),
      linear-gradient(to top, var(--bg) 0%, rgba(11,11,12,0) 16%);
  }
}

/* Pantallas verticales: el reel cuadrado va arriba como bloque y el título debajo, sin taparlo */
@media (max-aspect-ratio: 1/1) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 64px; }
  .hero__video { position: relative; inset: auto; height: auto; aspect-ratio: 1 / 1; max-height: 60svh; object-position: 50% 50%; }
  .hero__shade { inset: 64px 0 auto 0; height: min(100vw, 60svh); background: linear-gradient(to top, var(--bg) 0%, rgba(11,11,12,0) 35%); }
  .hero__content { padding-block: 0 72px; margin-top: -40px; }
}

/* SECTIONS */
.section { padding-block: 96px 0; }
.section--tight { padding-top: 32px; }
.section__text { color: var(--muted); font-size: 1.1rem; max-width: 78ch; margin: 20px 0 40px; }

.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 1.05rem;
}

.steps li { border-top: 1px solid var(--line); padding-top: 24px; }
.steps__n { display: block; font-family: var(--display); color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.steps p, .who p { color: var(--muted); margin: 8px 0 0; }

.who { margin-top: 32px; }
.who li { padding: 28px 32px; border: 1px solid var(--line); border-radius: var(--radius); }

/* Íconos de las tarjetas */
.icon {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.04); color: var(--text);
}
.icon svg { width: 22px; height: 22px; }
.card span:not(.icon) { display: block; }

/* CASES */
#proyectos h2 { margin-bottom: 40px; }
.case {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 96px;
}
.case--flip .case__media { order: 2; }
.case__media { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.case__media img, .case__media video { width: 100%; height: 100%; object-fit: cover; }
.media--square { aspect-ratio: 1 / 1; }
.media--wide { aspect-ratio: 16 / 9; }
.media--tall { aspect-ratio: 9 / 16; width: 100%; max-width: 400px; justify-self: center; }

/* Vairo: los 4 videos apilados; el activo se ve y el resto espera cargado */
.js-switcher video { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.js-switcher video.is-active { opacity: 1; }

/* Bundesliga: video a todo el ancho y texto debajo */
.case--full { grid-template-columns: 1fr; gap: 40px; }
.case--full .case__body { display: grid; grid-template-columns: 1fr 2.2fr; gap: 56px; align-items: start; }
.case--full dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.case--full dt { margin-top: 0; }
.case__body h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin-bottom: 20px; }
#proyectos .case:last-child { margin-bottom: 0; }   /* sin doble espacio antes de la sección siguiente */
.case dl { margin: 0; }
.case dt { font-size: 0.78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 20px; }
.case dd { margin: 6px 0 0; color: #d6d3cc; font-size: 0.98rem; max-width: 62ch; }   /* líneas cómodas de leer aunque la columna sea ancha */

/* pestañas de los videos: mismo vidrio esmerilado que los botones */
.tabs { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 0; padding: 0; overflow: hidden; border-radius: var(--radius); background: rgba(255,255,255,.05); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.tabs__btn { border: 0; background: transparent; color: rgba(242,240,235,.7); font: 300 0.85rem var(--font); font-variation-settings: "opsz" 18; padding: 8px 14px; border-radius: var(--radius); cursor: pointer; transition: background .2s ease, color .2s ease; }
.tabs__btn:hover { color: var(--text); }
.tabs__btn.is-active { background: rgba(255,255,255,.12); color: var(--text); }

/* Fotos fijas debajo de cada proyecto (se amplían al hacer clic) */
.gallery { grid-column: 1 / -1; order: 3; display: grid; /* order: siempre al final, también en los proyectos invertidos */ grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery__item { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface); cursor: zoom-in; }
.gallery--square .gallery__item { aspect-ratio: 1 / 1; }
.gallery--tall .gallery__item { aspect-ratio: 3 / 4; }   /* recorte más bajo en la grilla; al ampliar se ve la foto entera */
@media (min-width: 1200px) { .gallery--square { grid-template-columns: repeat(8, 1fr); } }   /* Vairo: las 8 fotos en una fila */
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .3s ease; opacity: .9; }
.gallery__item:hover img { transform: scale(1.04); opacity: 1; }

.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; overflow: hidden; }
.lightbox::backdrop { background: rgba(5,5,6,.92); backdrop-filter: blur(4px); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: min(92vw, 1400px); max-height: 88vh; width: auto; height: auto; border-radius: var(--radius); }
.lightbox__btn { position: fixed; border: 0; background: rgba(255,255,255,.08); color: var(--text); width: 48px; height: 48px; border-radius: var(--radius); font-size: 1.8rem; line-height: 1; cursor: pointer; transition: background .2s; }
.lightbox__btn:hover { background: rgba(255,255,255,.18); }
.lightbox__close { top: 20px; right: 20px; }
.lightbox__prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 20px; top: 50%; transform: translateY(-50%); }

/* MARQUEE */
.marquee { overflow: hidden; border-block: 1px solid var(--line); margin-top: 40px; padding-block: 24px; }
/* el track se anima en su propia capa de GPU: así los logos no parpadean al moverse de a fracciones de píxel */
.marquee__track { display: flex; align-items: center; gap: 80px; width: max-content; animation: scroll 40s linear infinite; will-change: transform; backface-visibility: hidden; opacity: .85; }
.marquee__track img { height: var(--h, 44px); width: auto; max-width: none; }
@keyframes scroll { from { transform: translate3d(0,0,0); } to { transform: translate3d(calc(-50% - 40px),0,0); } }

/* FAQ */
.faq { margin-top: 32px; border-top: 1px solid var(--line); max-width: 860px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 24px 40px 24px 0; font-size: 1.15rem; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--accent); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { margin: 0; padding-bottom: 24px; color: var(--muted); max-width: 64ch; overflow: hidden; }

/* CTA + FOOTER */
.cta {
  margin-top: 96px; padding-block: 112px; text-align: center;
  /* foto del escritorio oscurecida para que el texto se lea; se funde con el negro arriba y abajo */
  background:
    linear-gradient(to bottom, var(--bg) 0%, rgba(11,11,12,.72) 22%, rgba(11,11,12,.72) 78%, var(--bg) 100%),
    url("assets/img/cta-workspace.webp") center 40% / cover no-repeat,
    var(--surface);
}
.cta h2 { margin-inline: auto; }
.cta .lead { margin-inline: auto; }
.cta__note { margin: 20px 0 0; color: var(--muted); font-size: 0.95rem; }

.footer { display: flex; justify-content: space-between; gap: 16px; padding-block: 32px; color: var(--muted); font-size: 0.9rem; font-weight: 400; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ANIMACIONES */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--delay, 0ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* los videos no arrancan transparentes: en iPhone un video invisible no hace autoplay (y tardaba en arrancar) */
.case__media.reveal { opacity: 1; transform: translateY(32px) scale(.98); }
.case__media.reveal.is-visible { transform: none; }

/* Entrada del hero al cargar */
.hero__content > * { animation: rise 1s cubic-bezier(.2,.7,.2,1) both; }
.hero__content > :nth-child(2) { animation-delay: .1s; }
.hero__content > :nth-child(3) { animation-delay: .2s; }
.hero__content > :nth-child(4) { animation-delay: .3s; }
/* el reel aparece con un velo negro que se retira (el video en sí nunca es transparente, por el autoplay en iPhone) */
.hero__shade { animation: unveil 1.6s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } }
@keyframes unveil { from { box-shadow: inset 0 0 0 200vmax var(--bg); } to { box-shadow: inset 0 0 0 200vmax rgba(11,11,12,0); } }

/* RESPONSIVE */
@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: 1fr; }
  .case { grid-template-columns: 1fr; gap: 0; margin-bottom: 64px; }
  /* en celular el título del proyecto va antes del video y el texto después:
     el cuerpo se "desarma" (display: contents) para poder ordenar sus partes alrededor del video */
  .case__body, .case--full .case__body, .case--full .case__body > div { display: contents; }
  .case__body .kicker { order: 1; margin-bottom: 10px; }
  .case__body h3 { order: 2; margin-bottom: 20px; }
  .case .case__media, .case--flip .case__media { order: 3; }
  .case__body dl { order: 4; margin-top: 4px; }
  .case .gallery { order: 5; margin-top: 24px; }
  .case--full .case__body, .case--full dl { grid-template-columns: 1fr; gap: 0; }
  .case--full dt { margin-top: 20px; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery--square { grid-template-columns: repeat(4, 1fr); gap: 6px; }   /* Vairo: 2 filas en vez de 4 */  .lightbox__prev, .lightbox__next { top: auto; bottom: 20px; transform: none; }
  .section { padding-top: 64px; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .nav { gap: 12px; }
  .nav__links { display: none; }
  .nav .btn--small { margin-left: auto; }
  .grid--4 { grid-template-columns: 1fr; }
  .footer { flex-direction: column; }
  .tabs { left: 8px; right: 8px; bottom: 8px; justify-content: space-between; }
  .tabs__btn { flex: 1; }
  .tabs__btn { padding: 7px 9px; font-size: 0.76rem; }
  .marquee__track { gap: 48px; }
  .marquee__track img { height: calc(var(--h, 44px) * .75); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track, .hero__content > *, .hero__shade { animation: none; }
  html { scroll-behavior: auto; }
}
