/* ==========================================================================
   Trofeos El Águila Real — Header + Hero
   ========================================================================== */

/* ---------- Fuentes (autoalojadas) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-600-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
}

/* ---------- Variables globales ---------- */
:root {
  --color-navy: #142A43;
  --color-navy-deep: #0B1729;
  --color-gold: #B89A5E;          /* dorado antiguo: líneas y acentos */
  --color-gold-dark: #91652D;     /* dorado oscuro: iconos */
  --color-gold-text: #7A5424;     /* dorado oscuro reforzado para texto sobre el video (contraste AA) */
  --color-ivory: #F4F0E7;
  --color-graphite: #41454B;
  --color-white: #FFFFFF;

  --font-display: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --font-body: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 4px;
  --container-max: 1440px;
  --gutter: clamp(20px, 6.6vw, 112px);
  --header-h: clamp(68px, 9.4vh, 96px);

  /* Altura real del video con object-fit: cover (16:9) */
  --video-h: max(100vh, 56.25vw);
  /* Línea segura: el terciopelo del video sube hasta ~70 % de su altura.
     El contenido termina por encima del 68 %. */
  --safe-bottom: calc(50vh - .18 * var(--video-h));

  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --reveal-duration: 800ms;
  --reveal-step: 100ms;
}
@supports (height: 100svh) {
  :root {
    --video-h: max(100svh, 56.25vw);
    --safe-bottom: calc(50svh - .18 * var(--video-h));
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-navy);
  background: var(--color-ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }

a { color: inherit; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--color-navy);
  color: var(--color-white);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip-link:focus { transform: none; }

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

/* ==========================================================================
   Botones
   ========================================================================== */
.btn {
  --btn-h: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: var(--btn-h);
  padding: 0 1.5em;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .005em;
  text-decoration: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 200ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.btn--primary {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
}
.btn--primary:hover { background: var(--color-navy-deep); border-color: var(--color-navy-deep); }
.btn--primary:active { background: #07101d; }

.btn--outline {
  background: transparent;
  border-color: var(--color-navy);
  color: var(--color-navy);
}
.btn--outline:hover { background: rgba(20, 42, 67, .07); }
.btn--outline:active { background: rgba(20, 42, 67, .13); }

.btn__icon { flex: none; width: 1.2em; height: 1.2em; }
.btn__arrow { flex: none; width: 1.15em; height: 1.15em; transition: transform 200ms var(--ease-out); }
.btn:hover .btn__arrow { transform: translateX(3px); }

.btn--header {
  --btn-h: 46px;
  font-size: .97rem;
  padding: 0 1.3em;
}

.btn--lg {
  --btn-h: clamp(50px, 6.2vh, 60px);
  font-size: clamp(1rem, .45vw + .78rem, 1.2rem);
  padding: 0 1.9em;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 20;
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 2 * var(--gutter), var(--container-max));
  height: var(--header-h);
  margin-inline: auto;
  border-bottom: 1px solid rgba(20, 42, 67, .16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 1.6vw, 26px);
  text-decoration: none;
  color: var(--color-navy);
  flex: none;
}

.brand__logo {
  height: clamp(34px, 3vw, 48px);
  width: auto;
}

.brand__divider {
  width: 1px;
  height: clamp(30px, 2.8vw, 44px);
  background: rgba(20, 42, 67, .28);
}

.brand__since {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.05rem, .55vw + .8rem, 1.45rem);
  line-height: 1;
  white-space: nowrap;
  color: var(--color-navy);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.3vw, 38px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 8px 0;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--color-navy);
  text-decoration: none;
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--color-gold-dark);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-out);
}
.site-nav__link:hover::after,
.site-nav__link:focus-visible::after { transform: scaleX(1); }

/* Botón hamburguesa (solo móvil / tablet) */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--color-navy);
  cursor: pointer;
}
.nav-toggle__bar {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 240ms var(--ease-out), opacity 200ms var(--ease-out);
}
.nav-toggle__bar:nth-of-type(2) { top: 15px; }
.nav-toggle__bar:nth-of-type(3) { top: 21.25px; }
.nav-toggle__bar:nth-of-type(4) { top: 27.5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-of-type(2) { transform: translateY(6.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-of-type(3) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-of-type(4) { transform: translateY(-6.25px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #ECCDAA; /* tono del muro del video: evita destellos mientras carga */
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100% - 2 * var(--gutter), 44vw, 760px);
  margin-inline: auto;
  padding-top: calc(var(--header-h) + clamp(10px, 2.2vh, 32px));
  padding-bottom: max(var(--safe-bottom), 24px);
  text-align: center;
}

/* Etiqueta superior */
.hero__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2vw, 30px);
  margin: 0 0 clamp(10px, 2vh, 24px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.05rem, .85vw + .55rem, 1.6rem);
  line-height: 1.1;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--color-gold-text);
  /* compensa el tracking del último carácter para centrar ópticamente */
  padding-left: .22em;
}
.hero__eyebrow::before,
.hero__eyebrow::after {
  content: "";
  flex: none;
  width: clamp(36px, 4.8vw, 82px);
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
}
.hero__eyebrow::after { margin-left: -.22em; }

/* Titular */
.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, min(5.5vw, 8.3vh), 6.25rem);
  line-height: .92;
  letter-spacing: -.012em;
  color: var(--color-navy);
  text-wrap: balance;
}
.hero__line { display: block; }
.hero__title em {
  font-style: italic;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* Descripción */
.hero__lead {
  max-width: 40ch;
  margin: clamp(12px, 2.2vh, 26px) auto 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.02rem, min(.5vw + .78rem, 2.3vh), 1.4rem);
  line-height: 1.42;
  color: var(--color-graphite);
  text-wrap: balance;
}

/* Botones */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(14px, 2vw, 34px);
  margin-top: clamp(18px, 3.4vh, 38px);
}
.hero__actions .btn { min-width: clamp(220px, 15vw, 280px); }
.hero__actions .btn--outline { min-width: clamp(200px, 13vw, 240px); }

/* Indicadores de confianza */
.hero__trust {
  display: flex;
  justify-content: center;
  margin: clamp(18px, 3.6vh, 42px) 0 0;
  padding: 0;
  list-style: none;
}

.trust {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px clamp(16px, 2.2vw, 40px);
  text-align: left;
}
.trust + .trust { border-left: 1px solid rgba(20, 42, 67, .2); }
.trust:first-child { padding-left: 0; }
.trust:last-child { padding-right: 0; }

.trust__icon {
  flex: none;
  width: clamp(30px, 2.3vw, 40px);
  height: clamp(30px, 2.3vw, 40px);
  color: var(--color-gold-dark);
}

.trust__label {
  font-size: clamp(.92rem, .35vw + .72rem, 1.1rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-navy);
}

/* Control de pausa del video */
.hero__motion-toggle {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(16px, 3vh, 28px);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(244, 240, 231, .55);
  border-radius: var(--radius);
  color: var(--color-ivory);
  opacity: .6;
  cursor: pointer;
  transition: opacity 200ms var(--ease-out);
}
.hero__motion-toggle:hover,
.hero__motion-toggle:focus-visible { opacity: 1; }
.hero__motion-toggle:focus-visible { outline-color: var(--color-ivory); }
.hero__motion-toggle[hidden] { display: none; }
.hero__motion-toggle .icon-play { display: none; }
.hero__motion-toggle[aria-pressed="true"] .icon-play { display: block; }
.hero__motion-toggle[aria-pressed="true"] .icon-pause { display: none; }

/* ==========================================================================
   Animación de entrada (una sola vez)
   ========================================================================== */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
}
.js .hero__line.reveal { transform: translate3d(0, .32em, 0); }
.js .hero__eyebrow.reveal { transform: none; }

.js.is-ready .reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
  transition-delay: calc(var(--d, 0) * var(--reveal-step));
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal,
  .js .hero__line.reveal { opacity: 1; transform: none; }
  .js.is-ready .reveal { transition: none; }
  .btn__arrow, .site-nav__link::after, .nav-toggle__bar { transition: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Escritorio compacto: la leyenda cede espacio a la navegación */
@media (max-width: 1240px) and (min-width: 1024px) {
  .site-nav { gap: 22px; }
  .site-nav__list { gap: 20px; }
  .site-nav__link { font-size: .96rem; }
  .btn--header { padding: 0 1.05em; }
}

/* Escritorio pequeño y tablet horizontal: más ancho para que los botones no se apilen */
@media (max-width: 1279.98px) and (min-aspect-ratio: 1/1) {
  .hero__content { width: min(100% - 2 * var(--gutter), 54vw, 620px); }
  .hero__actions .btn { min-width: 0; }
  .hero__actions { gap: 14px; }
  .trust { padding-inline: 16px; }
}

/* Tablet y móvil: menú hamburguesa */
@media (max-width: 1023.98px) {
  :root { --header-h: 72px; }

  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 32px;
    padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
    background: var(--color-ivory);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 240ms var(--ease-out), visibility 0s linear 240ms;
  }
  .site-header.is-open .site-nav {
    visibility: visible;
    opacity: 1;
    transition: opacity 240ms var(--ease-out), visibility 0s;
  }
  .site-header.is-open .brand { position: relative; z-index: 2; }

  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-nav__list li { border-bottom: 1px solid rgba(20, 42, 67, .12); }
  .site-nav__link {
    display: block;
    padding: 18px 0;
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 600;
  }
  .site-nav__link::after { display: none; }

  .btn--header {
    --btn-h: 54px;
    width: 100%;
    font-size: 1.05rem;
  }

  .hero__content { width: min(100% - 2 * var(--gutter), 620px); }
}

/* ---------- Pantallas verticales (tablet vertical y móvil) ----------
   El video horizontal no se recorta para llenar la pantalla: se muestra
   completo como franja inferior, de modo que los productos de ambos
   lados siguen visibles y el texto queda sobre un fondo liso. */
@media (max-aspect-ratio: 1/1), (max-height: 520px) {
  .hero { background: #EED3B2; }

  .hero__media {
    position: relative;
    inset: auto;
    z-index: 0;
    order: 2;
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    /* la franja superior del video (muro) queda detrás de los indicadores */
    margin-top: -7.5vw;
    /* funde el borde superior del video con el fondo, sin alterar sus colores */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 16%);
  }

  .hero__content {
    order: 1;
    flex: 1 0 auto;
    justify-content: center;
    padding-top: calc(var(--header-h) + clamp(20px, 3.5vh, 48px));
    padding-bottom: clamp(16px, 2.5vh, 32px);
  }

  .hero__title { font-size: clamp(2.6rem, 9.6vw, 4.6rem); }
  .hero__lead { font-size: clamp(1.05rem, 2.2vw + .5rem, 1.4rem); }
  .hero__trust { margin-top: clamp(26px, 4vh, 44px); }

  .hero__motion-toggle { bottom: 12px; }

  /* Cuando exista un video vertical, vuelve a cubrir toda la pantalla */
  .hero--vertical-video .hero__media {
    position: absolute;
    inset: 0;
    z-index: -1;
    order: 0;
    margin-top: 0;
    aspect-ratio: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* Móvil */
@media (max-width: 640px) {
  :root { --header-h: 64px; }

  .brand { gap: 12px; }
  .brand__logo { height: 32px; }
  .brand__divider { height: 26px; }
  .brand__since { font-size: 1rem; }

  .hero__eyebrow {
    font-size: .98rem;
    letter-spacing: .2em;
    gap: 14px;
  }
  .hero__eyebrow::before,
  .hero__eyebrow::after { width: 30px; }

  .hero__lead { max-width: 26ch; }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 360px;
    gap: 12px;
  }
  .hero__actions .btn,
  .hero__actions .btn--outline { min-width: 0; width: 100%; }

  /* Indicadores simplificados: icono sobre texto, tres columnas iguales */
  .hero__trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    max-width: 380px;
  }
  .trust {
    flex-direction: column;
    gap: 8px;
    padding: 0 6px;
    text-align: center;
  }
  .trust:first-child { padding-left: 0; }
  .trust:last-child { padding-right: 0; }
  .trust__icon { width: 28px; height: 28px; }
  .trust__label { font-size: .84rem; }
}

/* Móviles muy estrechos: se prioriza el logotipo */
@media (max-width: 374px) {
  .brand__divider,
  .brand__since { display: none; }

  .hero__eyebrow { font-size: .9rem; letter-spacing: .16em; padding-left: .16em; gap: 10px; }
  .hero__eyebrow::before,
  .hero__eyebrow::after { width: 20px; }
  .hero__eyebrow::after { margin-left: -.16em; }
}

/* Pantallas verticales bajas (móviles pequeños) */
@media (max-aspect-ratio: 1/1) and (max-height: 760px) {
  .hero__content { padding-top: calc(var(--header-h) + 16px); }
  .hero__eyebrow { margin-bottom: 10px; }
  .hero__title { font-size: clamp(2.35rem, 10.5vw, 2.6rem); }
  .hero__lead { margin-top: 12px; font-size: 1rem; }
  .hero__actions { margin-top: 18px; }
  .hero__actions .btn { --btn-h: 48px; }
  .hero__trust { margin-top: 20px; }
}

/* Móvil apaisado: contenido compacto sobre la franja de video */
@media (min-aspect-ratio: 1/1) and (max-height: 520px) {
  .hero__title { font-size: clamp(2.2rem, 5vw, 3rem); }
  .hero__actions { flex-direction: row; max-width: none; width: auto; }
  .hero__actions .btn { width: auto; }
}

/* ==========================================================================
   Variante oscura del Hero (video v2: showroom)
   El video tiene mucho detalle y luz al centro; un tinte navy uniforme
   (sin degradados) y textos claros garantizan la lectura.
   ========================================================================== */
.brand__logo--light { display: none; }

.hero-dark .hero { background: var(--color-navy-deep); }

.hero-dark .hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 23, 41, .62);
  pointer-events: none;
}

/* Header sobre el video */
.hero-dark .site-header:not(.is-open) .brand__logo--navy { display: none; }
.hero-dark .site-header:not(.is-open) .brand__logo--light { display: block; }
.hero-dark .site-header:not(.is-open) .site-header__inner { border-bottom-color: rgba(244, 240, 231, .2); }
.hero-dark .site-header:not(.is-open) .brand__divider { background: rgba(244, 240, 231, .35); }
.hero-dark .site-header:not(.is-open) .brand__since,
.hero-dark .site-header:not(.is-open) .nav-toggle { color: var(--color-ivory); }
@media (min-width: 1024px) {
  .hero-dark .site-nav__link { color: var(--color-ivory); }
  .hero-dark .site-nav__link::after { background: var(--color-gold); }
}

/* Botón principal sobre fondo oscuro: dorado con texto navy */
.hero-dark .hero .btn--primary,
.hero-dark .site-header:not(.is-open) .btn--primary {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-navy-deep);
}
.hero-dark .hero .btn--primary:hover,
.hero-dark .site-header:not(.is-open) .btn--primary:hover {
  background: #CBB07A;
  border-color: #CBB07A;
}
.hero-dark .hero .btn--outline {
  border-color: rgba(244, 240, 231, .85);
  color: var(--color-ivory);
}
.hero-dark .hero .btn--outline:hover { background: rgba(244, 240, 231, .1); }

/* Textos */
.hero-dark .hero__eyebrow { color: var(--color-gold); }
.hero-dark .hero__title { color: var(--color-ivory); }
.hero-dark .hero__lead { color: rgba(244, 240, 231, .88); }
.hero-dark .trust__label { color: var(--color-ivory); }
.hero-dark .trust__icon { color: var(--color-gold); }
.hero-dark .trust + .trust { border-left-color: rgba(244, 240, 231, .25); }
.hero-dark .hero :focus-visible,
.hero-dark .site-header:not(.is-open) :focus-visible { outline-color: var(--color-ivory); }

/* El terciopelo ya no existe: el contenido se centra en toda la altura */
.hero-dark .hero__content { padding-bottom: clamp(48px, 9vh, 104px); }
.hero-dark .hero__title { font-size: clamp(2.6rem, min(5.8vw, 9.6vh), 6.5rem); }

@media (max-aspect-ratio: 1/1), (max-height: 520px) {
  .hero-dark .hero { background: var(--color-navy-deep); }
  .hero-dark .hero__content { padding-bottom: clamp(16px, 2.5vh, 32px); }
  .hero-dark .hero__title { font-size: clamp(2.6rem, 9.6vw, 4.6rem); }
  /* en la franja inferior el tinte es más ligero: no hay texto encima */
  .hero-dark .hero__media::after { background: rgba(11, 23, 41, .25); }
}
@media (max-aspect-ratio: 1/1) and (max-height: 760px) {
  .hero-dark .hero__title { font-size: clamp(2.35rem, 10.5vw, 2.6rem); }
}
