/* ==========================================================================
   Lalo R. Villar · Fotógrafo — estilos
   Paleta: negro #0A0A0A · blanco #FFFFFF · naranja #FF5A1F (+ grises neutros)
   ========================================================================== */

:root {
  --black: #0A0A0A;
  --white: #FFFFFF;
  --orange: #FF5A1F;

  --g-950: #0f0f0f;
  --g-900: #141414;
  --g-850: #1a1a1a;
  --g-700: #2e2e2e;
  --g-500: #6b6b6b;
  --g-400: #8f8f8f;
  --g-300: #b8b8b8;
  --g-200: #d6d6d6;
  --line: rgba(255, 255, 255, 0.14);

  --f-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --f-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(16px, 4vw, 64px);
  --section-pad: clamp(96px, 12vw, 180px);
  --header-h: 84px;
  --radius: 4px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Sin scroll-behavior: smooth: el scroll suave lo hacen Lenis/main.js y el
   suave nativo rompe las mediciones de ScrollTrigger al refrescar. */
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
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; }
[hidden] { display: none !important; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--f-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
::selection { background: var(--orange); color: var(--black); }

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

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 3000;
  padding: 10px 16px; background: var(--orange); color: var(--black); font-weight: 600;
  transform: translateY(-200%); transition: transform .3s var(--ease-out);
}
.skip-link:focus { transform: none; }

.eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  color: var(--orange);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 2500;
  display: grid; place-content: center; gap: 28px; justify-items: center;
  background: var(--black);
}
.loader__logo { display: grid; justify-items: center; gap: 6px; }
.loader__name {
  font-family: var(--f-display); font-size: clamp(36px, 7vw, 72px);
  letter-spacing: .04em; line-height: 1;
}
.loader__role { font-size: 11px; letter-spacing: .5em; text-transform: uppercase; color: var(--g-300); padding-left: .5em; }
.loader__bar { width: min(220px, 50vw); height: 1px; background: var(--line); overflow: hidden; }
.loader__bar span { display: block; height: 100%; background: var(--orange); transform-origin: left; transform: scaleX(0); }

/* ---------- Cursor (js/cursor.js) ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 2000;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--orange);
  display: grid; place-items: center;
  pointer-events: none; opacity: 0;
  transition: width .45s var(--ease-out), height .45s var(--ease-out), margin .45s var(--ease-out),
              background-color .3s, border-color .3s, opacity .3s, scale .2s;
  border: 1.5px solid transparent;
  will-change: transform;
}
.cursor.is-active { opacity: 1; }
.cursor.is-hidden { opacity: 0; }
.cursor.is-link { width: 46px; height: 46px; margin: -23px 0 0 -23px; background: transparent; border-color: var(--orange); }
.cursor.is-view { width: 96px; height: 96px; margin: -48px 0 0 -48px; background: var(--orange); border-color: var(--orange); }
.cursor.is-down { scale: .85; }
.cursor__label {
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--black); opacity: 0; transform: scale(.6); transition: opacity .3s, transform .45s var(--ease-out);
}
.cursor.is-view .cursor__label { opacity: 1; transform: none; }
html.has-cursor, html.has-cursor * { cursor: none !important; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 52px; padding: 0 30px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  transition: background-color .35s var(--ease-out), color .35s var(--ease-out), border-color .35s;
  will-change: transform;
}
.btn span { display: inline-block; pointer-events: none; }
.btn--primary { background: var(--orange); color: var(--black); }
.btn--primary:hover { background: var(--white); }
.btn--contact { height: 44px; padding: 0 22px; background: var(--white); color: var(--black); }
.btn--contact:hover, .btn--contact[aria-expanded="true"] { background: var(--orange); }

/* ---------- Cabecera ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 800;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
  transition: background-color .5s var(--ease-out), backdrop-filter .5s, height .5s var(--ease-out), border-color .5s;
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  height: 68px;
  background: rgba(10, 10, 10, .72);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: rgba(255, 255, 255, .06);
}

.logo { display: inline-grid; gap: 2px; line-height: 1; position: relative; z-index: 2; }
.logo__name { font-family: var(--f-display); font-size: 22px; letter-spacing: .05em; }
.logo__role { font-size: 9px; letter-spacing: .48em; text-transform: uppercase; color: var(--g-300); }
.logo__role::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: var(--orange); vertical-align: 1px; }

.nav__list { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav__link {
  position: relative; padding: 6px 0;
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--g-200); transition: color .3s;
}
.nav__link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--orange); transform: scaleX(0); transform-origin: right;
  transition: transform .5s var(--ease-out);
}
.nav__link:hover, .nav__link.is-current { color: var(--white); }
.nav__link:hover::after, .nav__link.is-current::after { transform: scaleX(1); transform-origin: left; }

.header__actions { display: flex; align-items: center; gap: 14px; position: relative; z-index: 2; }

.burger { display: none; width: 44px; height: 44px; position: relative; }
.burger span {
  position: absolute; left: 10px; right: 10px; height: 1.5px; background: var(--white);
  transition: transform .45s var(--ease-out), top .45s var(--ease-out);
}
.burger span:first-child { top: 17px; }
.burger span:last-child { top: 26px; }
html.nav-open .burger span:first-child { top: 21px; transform: rotate(45deg); }
html.nav-open .burger span:last-child { top: 21px; transform: rotate(-45deg); }

/* ---------- Panel de contacto ---------- */
.contact { position: fixed; inset: 0; z-index: 900; }
.contact__backdrop {
  position: absolute; inset: 0; background: rgba(10, 10, 10, .6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .5s var(--ease-out);
}
.contact__panel {
  position: absolute; inset: 0 0 auto 0;
  padding: calc(var(--header-h) + 32px) var(--gutter) clamp(40px, 6vw, 72px);
  background: var(--g-950);
  border-bottom: 2px solid var(--orange);
  transform: translateY(-100%);
  transition: transform .7s var(--ease-out);
}
.contact.is-open .contact__backdrop { opacity: 1; }
.contact.is-open .contact__panel { transform: none; }
.contact__close { position: absolute; top: 20px; right: var(--gutter); width: 44px; height: 44px; }
.contact__close span, .lb-close span {
  position: absolute; left: 10px; right: 10px; top: 21px; height: 1.5px; background: var(--white);
  transition: background-color .3s;
}
.contact__close span:first-child, .lb-close span:first-child { transform: rotate(45deg); }
.contact__close span:last-child, .lb-close span:last-child { transform: rotate(-45deg); }
.contact__close:hover span, .lb-close:hover span { background: var(--orange); }
.contact__options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.contact__option:nth-child(3) { grid-column: 1 / -1; }
.contact__option {
  display: grid; gap: 10px; padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: background-color .4s var(--ease-out), border-color .4s, color .4s;
}
.contact__kicker { font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--orange); transition: color .4s; }
.contact__value { font-family: var(--f-display); font-size: clamp(30px, 5vw, 64px); line-height: 1; letter-spacing: .01em; overflow-wrap: anywhere; }
.contact__option:hover { background: var(--orange); border-color: var(--orange); color: var(--black); }
.contact__option:hover .contact__kicker { color: var(--black); }
.contact__panel > * { opacity: 0; transform: translateY(16px); transition: opacity .5s .25s, transform .7s .25s var(--ease-out); }
.contact__panel > .contact__close { transform: none; }
.contact.is-open .contact__panel > * { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 55% 30%; opacity: 0; transition: opacity 1.1s var(--ease-out); }
.hero__img.is-active { opacity: 1; }
@media (max-width: 768px) { .hero__img--centro-movil { object-position: 50% 50%; } } /* Producto: silla centrada en móvil y tableta */
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,10,10,.55) 0%, rgba(10,10,10,0) 26%),
    linear-gradient(0deg, rgba(10,10,10,.92) 0%, rgba(10,10,10,.35) 42%, rgba(10,10,10,0) 70%);
}
.hero__content { width: 100%; padding: 0 var(--gutter) clamp(56px, 9vh, 110px); }
.hero__kicker { font-size: clamp(12px, 1.2vw, 15px); font-weight: 500; letter-spacing: .5em; text-transform: uppercase; color: var(--g-200); margin-bottom: 0; }
.hero__title {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(58px, 15.5vw, 236px); line-height: .86; letter-spacing: .005em;
  margin-bottom: clamp(24px, 4vh, 44px);
  white-space: nowrap;
  padding-top: .04em; /* pegado a «Fotografía y vídeo» */
  transition: padding-top .5s var(--ease-out);
}
.hero__title.has-accent { padding-top: .25em; } /* hueco para la tilde de FÚTBOL */
.typewriter__caret {
  display: inline-block; width: .08em; height: .78em; margin-left: .06em; vertical-align: -.02em;
  background: var(--orange); animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.hero__lead { max-width: 34ch; font-size: clamp(16px, 1.6vw, 21px); line-height: 1.4; color: var(--g-200); margin: calc(clamp(24px, 4vh, 44px) * -0.5) 0 clamp(22px, 3.5vh, 36px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn--ghost { border: 1px solid rgba(255,255,255,.55); color: var(--white); }
.btn--ghost:hover { background: var(--white); color: var(--black); border-color: var(--white); }
.hero__scroll {
  position: absolute; right: var(--gutter); bottom: clamp(56px, 9vh, 110px);
  width: 1px; height: 84px; background: var(--line); overflow: hidden;
}
.hero__scroll span { position: absolute; inset: 0; background: var(--orange); animation: scrollLine 2.2s var(--ease-in-out) infinite; }
@keyframes scrollLine { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(100%); } }

/* ---------- Secciones ---------- */
.section {
  position: relative; min-height: 100vh; min-height: 100svh;
  padding: var(--section-pad) var(--gutter);
  background: var(--black);
}
.section__head { margin-bottom: clamp(48px, 7vw, 110px); }
.section__title {
  font-family: var(--f-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(56px, 11vw, 180px); line-height: .9; letter-spacing: .005em;
  margin-top: 14px;
}
/* Máscara de letras (animations.js): deja sitio a las tildes de las mayúsculas */
[data-split="chars"] .word { padding-top: .3em; margin-top: -.3em; }
.section__rule { position: relative; display: block; height: 1px; margin-top: clamp(28px, 4vw, 48px); background: var(--line); }
.section__rule::before { content: ""; position: absolute; left: 0; top: -1px; width: 96px; height: 3px; background: var(--orange); }

/* ---------- Servicios ---------- */
.services__block {
  display: grid; grid-template-columns: minmax(180px, 22%) 1fr; gap: clamp(24px, 4vw, 64px);
  padding-top: clamp(40px, 5vw, 72px);
}
.services__block + .services__block { margin-top: clamp(72px, 9vw, 140px); border-top: 1px solid var(--line); }
.services__label { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
.services__type {
  font-family: var(--f-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(56px, 8vw, 132px); line-height: .9;
  color: transparent; -webkit-text-stroke: 1.5px var(--white);
}
.services__count { margin-top: 12px; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--g-400); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: clamp(28px, 3vw, 44px) clamp(16px, 2vw, 28px); }
.card__media {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--g-900);
  border-radius: var(--radius);
}
.card__media img, .about__media img {
  position: absolute; left: 0; top: -10%; width: 100%; height: 120%; max-width: none;
  object-fit: cover;
  transition: scale 1.6s var(--ease-out), filter .8s;
}
.card__media::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--orange); transform: scaleX(0); transform-origin: left;
  transition: transform .8s var(--ease-out);
}
.card:hover .card__media img { scale: 1.08; }
.card:hover .card__media::after { transform: scaleX(1); }
.card__badge {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: rgba(10,10,10,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
}
.card__badge::before { content: ""; border-left: 8px solid var(--orange); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.card__title {
  margin-top: 18px; font-family: var(--f-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(24px, 2vw, 30px); line-height: 1.05; letter-spacing: .01em;
  transition: color .4s;
}
.card__title::after { content: " →"; color: var(--orange); opacity: 0; display: inline-block; transform: translateX(-8px); transition: opacity .4s, transform .5s var(--ease-out); }
.card:hover .card__title { color: var(--orange); }
.card:hover .card__title::after { opacity: 1; transform: none; }
.card__text { margin-top: 8px; color: var(--g-300); font-size: 15px; line-height: 1.55; max-width: 36ch; }

/* ---------- Sobre mí ---------- */
.about { display: flex; align-items: center; }
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 110px); align-items: center; width: 100%; }
.about__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--g-900); }
.about__media img { object-position: 38% center; }
.about__text { margin-top: clamp(24px, 3vw, 40px); display: grid; gap: 1.1em; max-width: 60ch; }
.about__text p { font-size: clamp(16px, 1.25vw, 19px); line-height: 1.7; color: var(--g-200); }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 24px;
  margin-top: clamp(36px, 4vw, 56px); padding-top: 28px; border-top: 1px solid var(--line);
}
.stat__value { display: block; font-family: var(--f-display); font-size: clamp(30px, 2.8vw, 48px); line-height: 1; white-space: nowrap; }
.stat__value > span:first-child { color: var(--orange); }
.stat__label { display: block; margin-top: 10px; font-size: 13px; line-height: 1.4; color: var(--g-400); }

/* ---------- Galería ---------- */
.g-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: clamp(32px, 4vw, 56px); }
.g-filter {
  height: 42px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--g-200);
  transition: background-color .35s, color .35s, border-color .35s;
}
.g-filter:hover { border-color: var(--orange); color: var(--white); }
.g-filter.is-active { background: var(--orange); border-color: var(--orange); color: var(--black); }

.g-grid { column-count: 3; column-gap: 16px; }
.g-item {
  position: relative; break-inside: avoid; margin-bottom: 16px;
  overflow: hidden; border-radius: var(--radius); background: var(--g-900);
  cursor: zoom-in;
}
.g-item.is-hidden { display: none; }
.g-item img {
  width: 100%; height: auto;
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out), scale 1.4s var(--ease-out);
}
.js .g-item:not(.is-in) img { opacity: 0; transform: translateY(40px) scale(1.06); }
/* Sin zoom al pasar el ratón: la foto se ve siempre entera, sin recortes */
.g-item::after {
  content: attr(data-caption);
  position: absolute; inset: auto 0 0 0; padding: 48px 18px 16px;
  background: linear-gradient(0deg, rgba(10,10,10,.85), rgba(10,10,10,0));
  font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
  opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .5s var(--ease-out);
  pointer-events: none;
}
.g-item:hover::after, .g-item:focus-visible::after { opacity: 1; transform: none; }
.g-item:focus-visible { outline-offset: -3px; }
.g-play {
  position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; background: var(--orange); pointer-events: none;
  transition: transform .5s var(--ease-out);
}
.g-play::before {
  content: ""; position: absolute; top: 50%; left: 50%; margin: -11px 0 0 -6px;
  border-left: 19px solid var(--black); border-top: 11px solid transparent; border-bottom: 11px solid transparent;
}
.g-item:hover .g-play { transform: scale(1.12); }

/* ---------- Lightbox (js/gallery.js) ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1500;
  display: grid; grid-template-columns: 80px 1fr 80px; grid-template-rows: 1fr auto;
  background: rgba(10, 10, 10, .97);
  opacity: 0; transition: opacity .4s var(--ease-out);
}
.lightbox.is-open { opacity: 1; }
.lb-stage { grid-column: 2; grid-row: 1; display: grid; place-items: center; min-height: 0; padding: 72px 0 12px; position: relative; }
.lb-media { display: grid; place-items: center; max-width: 100%; max-height: 100%; min-height: 0; }
.lb-media img, .lb-media video {
  max-width: min(100%, 1600px); max-height: calc(100vh - 160px); max-height: calc(100svh - 160px);
  width: auto; height: auto; object-fit: contain; border-radius: 2px;
}
.lb-media video { background: var(--black); }
.lb-note { margin-top: 16px; text-align: center; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--orange); }
.lb-stage.is-loading::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--orange);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.lb-close { position: absolute; top: 16px; right: 16px; width: 48px; height: 48px; z-index: 2; }
.lb-nav { grid-row: 1; align-self: center; justify-self: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: border-color .3s, background-color .3s; }
.lb-nav::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-top: 1.5px solid var(--white); border-right: 1.5px solid var(--white);
}
.lb-prev { grid-column: 1; }
.lb-prev::before { transform: translateX(2px) rotate(-135deg); }
.lb-next { grid-column: 3; }
.lb-next::before { transform: translateX(-2px) rotate(45deg); }
.lb-nav:hover { border-color: var(--orange); background: var(--orange); }
.lb-nav:hover::before { border-color: var(--black); }
.lb-bar { grid-column: 1 / -1; grid-row: 2; display: flex; justify-content: space-between; gap: 16px; padding: 14px 24px 22px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--g-300); }
.lb-count { color: var(--orange); font-variant-numeric: tabular-nums; }

/* ---------- Clientes ---------- */
.clients { display: flex; flex-direction: column; justify-content: center; }
.marquee { display: grid; gap: 18px; margin: 0 calc(var(--gutter) * -1); }
.marquee__row {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track { display: flex; gap: 18px; width: max-content; animation: marquee 48s linear infinite; }
.marquee__row--reverse .marquee__track { animation-direction: reverse; animation-duration: 54s; }
.marquee__row:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 9px)); } }
.logo-tile {
  flex: none; width: 210px; height: 118px; padding: 18px 24px;
  display: grid; place-items: center; grid-template: 100% / 100%;
  background: var(--white); border-radius: var(--radius);
}
/* Todas las cajas iguales; cada logo (ya recortado) se centra con contain y
   --s ajusta su escala para igualar el peso visual entre logos anchos y compactos. */
.logo-tile img {
  width: calc(100% * var(--s, 1)); height: calc(100% * var(--s, 1));
  min-width: 0; min-height: 0; object-fit: contain;
  filter: grayscale(1) contrast(1.05); opacity: .78;
  transition: filter .5s var(--ease-out), opacity .5s, transform .6s var(--ease-out);
}
.logo-tile:hover img { filter: none; opacity: 1; transform: scale(1.05); }

/* ---------- Pie ---------- */
.footer { padding: clamp(64px, 8vw, 110px) var(--gutter) 28px; border-top: 1px solid var(--line); background: var(--black); }
.footer__top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; align-items: start; }
.logo--footer .logo__name { font-size: clamp(32px, 4vw, 56px); }
.footer__contact, .footer__social { display: grid; gap: 10px; }
.footer__link { justify-self: start; font-size: 15px; color: var(--g-200); position: relative; transition: color .3s; }
.footer__link:hover { color: var(--orange); }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(48px, 6vw, 88px); padding-top: 22px;
  border-top: 1px solid var(--line); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--g-400);
}

/* ---------- Barra de progreso de scroll ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 2400; pointer-events: none; }
.progress__bar { display: block; height: 100%; background: var(--orange); transform-origin: left center; transform: scaleX(0); }

/* ---------- Selector de idioma ---------- */
.lang { display: flex; align-items: center; gap: 1px; margin-right: 6px; }
.lang__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 32px; padding: 0 4px;
  font-size: 12px; font-weight: 600; letter-spacing: .12em; color: var(--g-300);
  transition: color .3s;
}
.lang__btn:hover { color: var(--white); }
.lang__btn.is-active { color: var(--orange); }
.lang__sep { color: var(--g-500); font-size: 12px; }

/* ---------- Showreel ---------- */
/* Base (móvil y movimiento reducido): carrusel horizontal nativo con scroll-snap */
.showreel { position: relative; padding: var(--section-pad) 0; background: var(--black); overflow: hidden; }
.showreel__pin { position: relative; }
.showreel__head {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 0 var(--gutter); margin-bottom: 20px;
}
.showreel__count { font-family: var(--f-display); font-size: clamp(28px, 3vw, 44px); line-height: 1; color: var(--orange); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.showreel__title {
  position: relative; z-index: 0; margin: 0 0 28px; padding: 0 var(--gutter);
  font-family: var(--f-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(56px, 16vw, 380px); line-height: 1; letter-spacing: .01em;
  color: transparent; -webkit-text-stroke: 1.5px rgba(255, 255, 255, .4);
  pointer-events: none;
}
.showreel__track {
  position: relative; z-index: 1;
  display: flex; gap: 16px; padding: 0 var(--gutter);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter);
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.showreel__track::-webkit-scrollbar { display: none; }
.showreel__item { flex: none; width: 82vw; scroll-snap-align: start; }
.showreel__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--g-900); }
.showreel__media img { width: 100%; height: 100%; object-fit: cover; transform-origin: center; }
.showreel__cap { margin-top: 12px; font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--g-300); }
.showreel__hint { padding: 18px var(--gutter) 0; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--g-400); }
.showreel__hint::after { content: "  →"; color: var(--orange); }

@media (min-width: 900px) {
  .showreel__item { width: 40vw; }
  .showreel__hint { display: none; }
}

/* Escritorio con pin (clase puesta por gsap.matchMedia en animations.js) */
.showreel.is-pinned { height: 100vh; height: 100svh; padding: 0; }
.showreel.is-pinned .showreel__pin { height: 100%; display: flex; flex-direction: column; justify-content: center; }
.showreel.is-pinned .showreel__head { position: absolute; top: calc(var(--header-h) + 20px); left: 0; right: 0; margin: 0; }
.showreel.is-pinned .showreel__title {
  position: absolute; left: 0; top: 50%; margin: -.5em 0 0; padding: 0 0 0 var(--gutter);
  white-space: nowrap; font-size: clamp(160px, 24vw, 420px);
}
.showreel.is-pinned .showreel__track {
  width: max-content; overflow: visible; scroll-snap-type: none;
  align-items: flex-start; gap: 5vw; padding: 0 12vw 0 30vw;
}
.showreel.is-pinned .showreel__item { width: clamp(380px, 38vw, 680px); }
.showreel.is-pinned .showreel__item:nth-child(even) { margin-top: 9vh; }

/* ---------- Chat con el asistente (js/chat.js) ---------- */
.chat-fab {
  position: fixed; right: var(--gutter); bottom: 24px; z-index: 850;
  width: 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--orange); color: var(--black);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transition: transform .4s var(--ease-out), background-color .3s;
}
.chat-fab svg { width: 32px; height: 32px; }
.chat-fab:hover { background: var(--white); transform: scale(1.06); }
html.chat-open .chat-fab { background: var(--white); }
html.nav-open .chat-fab, html.lb-open .chat-fab, body.is-loading .chat-fab { opacity: 0; pointer-events: none; }

.chat {
  position: fixed; right: var(--gutter); bottom: 108px; z-index: 850;
  width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100svh - 140px));
  display: flex; flex-direction: column;
  background: var(--g-950); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); overflow: hidden;
  animation: chatIn .35s var(--ease-out) both;
}
@keyframes chatIn { from { opacity: 0; transform: translateY(16px); } }
.chat__head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  background: var(--black);
}
.chat__title { font-family: var(--f-display); font-size: 20px; letter-spacing: .04em; line-height: 1.1; }
.chat__subtitle { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--orange); }
.chat__close { position: relative; width: 40px; height: 40px; flex: none; }
.chat__close span { position: absolute; left: 10px; right: 10px; top: 19px; height: 1.5px; background: var(--white); transition: background-color .3s; }
.chat__close span:first-child { transform: rotate(45deg); }
.chat__close span:last-child { transform: rotate(-45deg); }
.chat__close:hover span { background: var(--orange); }
.chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat__msg { max-width: 86%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat__msg--bot { align-self: flex-start; background: var(--g-850); color: var(--g-200); border-bottom-left-radius: 4px; }
.chat__msg--mine { align-self: flex-end; background: var(--orange); color: var(--black); border-bottom-right-radius: 4px; }
.chat__msg--typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.chat__msg--typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--g-400); animation: chatDot 1.2s infinite ease-in-out; }
.chat__msg--typing span:nth-child(2) { animation-delay: .15s; }
.chat__msg--typing span:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--black); }
.chat__form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  background: var(--g-900); color: var(--white); border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: 16px;
}
.chat__form input::placeholder { color: var(--g-500); }
.chat__form input:focus { outline: none; border-color: var(--orange); }
.chat__send { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--orange); color: var(--black); display: grid; place-items: center; transition: background-color .3s; }
.chat__send svg { width: 20px; height: 20px; }
.chat__send:hover { background: var(--white); }
.chat__send:disabled { opacity: .5; }

@media (max-width: 600px) {
  .chat-fab { width: 62px; height: 62px; bottom: 16px; }
  .chat-fab svg { width: 28px; height: 28px; }
  .chat { right: 16px; bottom: 90px; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .g-grid { column-count: 2; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 899px) {
  :root { --header-h: 72px; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: 0; z-index: 1;
    display: flex; align-items: center; padding: 0 var(--gutter);
    background: var(--black);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path .8s var(--ease-in-out), visibility 0s .8s;
  }
  html.nav-open .nav { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .8s var(--ease-in-out), visibility 0s; }
  html.nav-open { overflow: hidden; }
  .nav__list { flex-direction: column; gap: 4px; }
  .nav__link {
    display: inline-block; font-family: var(--f-display); font-weight: 400; letter-spacing: .01em;
    font-size: clamp(52px, 15vw, 110px); line-height: 1.05; color: var(--white);
    opacity: 0; transform: translateY(40px); transition: opacity .5s, transform .7s var(--ease-out), color .3s;
  }
  .nav__link::after { height: 3px; }
  html.nav-open .nav__link { opacity: 1; transform: none; }
  html.nav-open .nav__list li:nth-child(1) .nav__link { transition-delay: .25s; }
  html.nav-open .nav__list li:nth-child(2) .nav__link { transition-delay: .32s; }
  html.nav-open .nav__list li:nth-child(3) .nav__link { transition-delay: .39s; }
  html.nav-open .nav__list li:nth-child(4) .nav__link { transition-delay: .46s; }
  html.nav-open .nav__list li:nth-child(5) .nav__link { transition-delay: .53s; }
  html.nav-open .header { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom-color: transparent; }

  .services__block { grid-template-columns: 1fr; }
  .services__label { position: static; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
  .about__grid { grid-template-columns: 1fr; }
  .about__media { aspect-ratio: 4 / 3; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__top .logo { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .header { gap: 8px; }
  .logo__name { font-size: 16px; }
  .logo__role { font-size: 7px; letter-spacing: .36em; }
  .btn--contact { height: 38px; padding: 0 12px; font-size: 10px; letter-spacing: .1em; }
  .header__actions { gap: 2px; }
  .lang { margin-right: 4px; }
  .lang__btn { min-width: 24px; padding: 0 2px; font-size: 11px; letter-spacing: .06em; }
  .lang__sep { font-size: 10px; }
  .burger { width: 40px; }
  .hero__scroll { display: none; }
  .hero__kicker { letter-spacing: .36em; }
  .contact__options { grid-template-columns: 1fr; }
  .contact__value { font-size: clamp(28px, 9vw, 40px); }
  .cards { grid-template-columns: 1fr; }
  .cards--video, .cards:not(.cards--video) { grid-template-columns: 1fr; }
  .g-grid { column-count: 1; }
  .g-filters { flex-wrap: nowrap; overflow-x: auto; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .g-filters::-webkit-scrollbar { display: none; }
  .g-filter { flex: none; }
  .lightbox { grid-template-columns: 1fr; }
  .lb-stage { grid-column: 1; padding: 64px 12px 8px; }
  .lb-nav { position: absolute; bottom: 58px; z-index: 2; width: 48px; height: 48px; background: rgba(10,10,10,.6); }
  .lb-prev { left: 16px; }
  .lb-next { right: 16px; }
  .lb-bar { padding: 12px 16px 20px; }
  .logo-tile { width: 160px; height: 92px; padding: 14px 18px; }
  .footer__top { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; }
}

@media (min-width: 601px) and (max-width: 899px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Movimiento reducido
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .2s !important; transition-delay: 0s !important; }
  .typewriter__caret { animation: none; }
  .hero__scroll span { animation: none; transform: none; }
  .marquee__track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; padding: 0 var(--gutter); }
  .marquee__row { -webkit-mask-image: none; mask-image: none; }
  .marquee__track [aria-hidden="true"] { display: none; }
  .showreel__track { scroll-behavior: auto; }
  .js .g-item:not(.is-in) img { opacity: 1; transform: none; }
  .card:hover .card__media img { scale: 1; }
}

/* ==========================================================================
   Huecos pendientes (TODO): solo visibles en la vista previa local (html.is-dev)
   ========================================================================== */
html:not(.is-dev) .todo-slot { display: none !important; }
.is-dev .todo-slot { outline: 1px dashed var(--orange); outline-offset: 6px; }


/* ---------- Vídeo (js/videos.js) ---------- */
.v-grid { display: grid; grid-template-columns: 16fr 9fr; gap: clamp(16px, 2vw, 28px); align-items: start; }
.v-item--main { grid-column: 1 / -1; }
.v-frame { position: relative; aspect-ratio: var(--ar, 16 / 9); overflow: hidden; border-radius: var(--radius); background: var(--g-900); }
.v-frame video, .v-frame iframe, .v-embed, .v-frame .v-still { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: var(--black); }
.v-cap { margin-top: 12px; font-size: 12px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--g-300); }
.v-embed { display: block; padding: 0; cursor: pointer; }
.v-embed img { width: 100%; height: 100%; object-fit: contain; }
.v-embed__play {
  position: absolute; top: 50%; left: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  border-radius: 50%; background: var(--orange); transition: transform .5s var(--ease-out);
}
.v-embed__play::before {
  content: ""; position: absolute; top: 50%; left: 50%; margin: -11px 0 0 -6px;
  border-left: 19px solid var(--black); border-top: 11px solid transparent; border-bottom: 11px solid transparent;
}
.v-embed:hover .v-embed__play { transform: scale(1.12); }
/* Móvil: una columna */
@media (max-width: 600px) {
  .v-grid { grid-template-columns: 1fr; }
}

/* ---------- Redes sociales (sección y pie) ---------- */
.social { padding: clamp(56px, 7vw, 96px) var(--gutter); border-top: 1px solid var(--line); background: var(--black); text-align: center; }
.social__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.social__link {
  display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px 0 18px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--g-200);
  transition: background-color .35s, color .35s, border-color .35s;
}
.social__link svg, .footer__social-link svg { width: 22px; height: 22px; flex: none; }
.social__link:hover { background: var(--orange); border-color: var(--orange); color: var(--black); }
.footer__social-link { display: inline-flex; align-items: center; gap: 10px; }
.footer__social-link svg { width: 18px; height: 18px; }

/* ==========================================================================
   Móvil (≤768 px): fotos de tarjetas y showreel sin recortar
   ========================================================================== */
@media (max-width: 768px) {
  /* Tarjetas de servicios y showreel: la foto con su proporción original */
  .card__media, .showreel__media { aspect-ratio: auto; }
  .card__media img, .showreel__media img {
    position: static; width: 100%; height: auto; aspect-ratio: var(--ar, auto); top: auto; object-fit: contain;
  }
  .card:hover .card__media img { scale: 1; }
}
