/* ==========================================================================
   Volkswagen Puerto Rico · Atlas 2026 · Landing Spotify
   Mobile-first. Filosofía de diseño: restricción tipográfica, radius 0,
   cero sombras, fotografía protagonista. Único acento: azul VW #001E50.
   ========================================================================== */

/* ---------- Fuentes locales ---------- */
@font-face {
  font-family: "VW Head";
  src: url("../fonts/VWHead-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "VW Head";
  src: url("../fonts/VWHead-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  --color-carbon: #262626;
  --color-white: #ffffff;
  --color-fog: #f1f1f1;
  --color-stone: #e6e6e6;
  --color-concrete: #bbbbbb;
  --color-muted: #555555;     /* 7.4:1 sobre blanco */
  --color-vw-blue: #001e50;   /* acento único: CTAs y foco */
  --color-vw-blue-press: #00143a;
  --color-night: 12 14 18;    /* base RGB para degradados sobre foto */

  --font: "VW Head", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --gutter: 16px;
  --max: 1200px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 900ms;
  --stagger: 120ms;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-carbon);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, figure, address, ul { margin: 0; }
ul[role="list"] { list-style: none; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-vw-blue);
  outline-offset: 3px;
}
[tabindex="-1"]:focus { outline: none; }

.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.sr-only {
  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: absolute;
  top: 8px; left: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--color-white);
  color: var(--color-carbon);
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.icon {
  width: 20px; height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: square;
  transition: transform 600ms var(--ease);
}

/* ---------- Header ---------- */
.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 10;
  padding-top: max(20px, env(safe-area-inset-top));
}
@media (min-width: 768px) {
  .site-header { padding-top: 32px; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 44px;
  text-decoration: none;
}
.brand__icon { width: 52px; height: 52px; }
.brand__wordmark { width: auto; height: 16px; }
.site-header .brand:focus-visible { outline-color: var(--color-white); }

@media (min-width: 1024px) {
  .brand__icon { width: 62px; height: 62px; }
  .brand__wordmark { height: 18px; }
}

/* ---------- Enlace con flecha (secundario) ---------- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  font-size: clamp(1.35rem, 1.2rem + 0.54vw, 1.65rem); /* 21.6px móvil → 26.4px desktop */
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.link-arrow .icon { width: 1.1em; height: 1.1em; }
.link-arrow span {
  position: relative;
  padding-bottom: 4px;
}
.link-arrow span::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
  transform-origin: left;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.link-arrow--light { color: var(--color-white); }
.link-arrow--light:focus-visible { outline-color: var(--color-white); }

@media (hover: hover) {
  .link-arrow:hover span::after { opacity: 1; }
  .link-arrow:hover .icon--down { transform: translateY(4px); }
  .link-arrow:hover .icon--up { transform: translateY(-4px); }
}

/* ---------- Botón primario ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  background: var(--color-vw-blue);
  color: var(--color-white);
  font-size: 1rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-decoration: none;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { background: var(--color-vw-blue-press); }
@media (hover: hover) {
  .btn:hover .icon--right { transform: translateX(6px); }
}

/* ==========================================================================
   1. HERO
   ========================================================================== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(100svh, 620px);
  overflow: hidden;
  color: var(--color-white);
  background: #1d1f22;
  isolation: isolate;
}

.hero__media,
.closing__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  will-change: transform;
}
.hero__media picture,
.closing__media picture { display: contents; }

.hero__img,
.closing__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__img { object-position: 50% 100%; }

/* Degradado de legibilidad: móvil, de arriba hacia el centro + base para el enlace */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgb(var(--color-night) / 0.78) 0%,
      rgb(var(--color-night) / 0.55) 30%,
      rgb(var(--color-night) / 0.12) 52%,
      rgb(var(--color-night) / 0) 62%),
    linear-gradient(0deg,
      rgb(var(--color-night) / 0.6) 0%,
      rgb(var(--color-night) / 0) 20%);
}

.hero__content {
  padding-top: calc(max(20px, env(safe-area-inset-top)) + 84px);
  padding-bottom: 96px;
}

.hero__title {
  max-width: 13ch;
  font-weight: 400;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero__model {
  margin-top: 12px;
  font-size: clamp(1.125rem, 0.95rem + 0.8vw, 1.625rem);
  line-height: 1.2;
  letter-spacing: 0.04em;
}

/* La oferta: el elemento dominante */
.offer {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  line-height: 1;
}
.offer__rate {
  font-weight: 800;
  font-size: clamp(6.5rem, 3rem + 17vw, 11rem);
  line-height: 0.86;
  letter-spacing: -0.045em;
}
.offer__label {
  font-size: clamp(1.375rem, 1rem + 1.5vw, 2.25rem);
  letter-spacing: 0.01em;
}

.hero__cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(20px, env(safe-area-inset-bottom));
}

@media (orientation: landscape) {
  .hero__img { object-position: 62% 100%; }
}

/* Móvil y tablet en vertical: la foto va a todo el ancho debajo del texto para que se vean
   las tres camionetas (recorte 870 × 718: Tiguan casi completa, Jetta completa, Atlas desde la mitad).
   Su parte superior se funde con el fondo y queda detrás de la oferta. */
@media (orientation: portrait) and (max-width: 1023.98px) {
  .hero {
    min-height: 0;
    background: #2b2d2a;
  }
  .hero__content { padding-bottom: 0; }
  .hero__media {
    position: relative;
    inset: auto;
    order: 1;
    margin-top: calc(-1 * clamp(96px, 26vw, 220px));
    aspect-ratio: 870 / 718;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 34%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 34%);
  }
  .hero__cue { bottom: 8px; }
}

@media (min-width: 1024px) {
  .hero {
    min-height: 0;
    height: clamp(640px, 92svh, 980px);
  }
  .hero::after {
    background:
      linear-gradient(90deg,
        rgb(var(--color-night) / 0.72) 0%,
        rgb(var(--color-night) / 0.45) 32%,
        rgb(var(--color-night) / 0) 58%),
      linear-gradient(180deg,
        rgb(var(--color-night) / 0.45) 0%,
        rgb(var(--color-night) / 0) 26%),
      linear-gradient(0deg,
        rgb(var(--color-night) / 0.45) 0%,
        rgb(var(--color-night) / 0) 18%);
  }
  /* Titular en una línea: el bloque de texto queda sobre el cielo, por encima de los autos */
  .hero__content { padding-block: 152px 120px; }
  .hero__title { max-width: none; font-size: clamp(3rem, 1.5rem + 2.6vw, 4.25rem); }
  .offer__rate { font-size: clamp(8rem, 3rem + 7vw, 10.5rem); }
  .hero__cue { bottom: 40px; }
}

/* ==========================================================================
   2 + 3. INTRO Y CONCESIONARIOS
   ========================================================================== */
.intro {
  padding-block: 72px 56px;
  text-align: center;
}
.intro__text {
  max-width: 30ch;
  margin-inline: auto;
  font-weight: 400;
  font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.intro__text::before {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 0 auto 28px;
  background: var(--color-vw-blue);
}

.dealers__band {
  padding-block: 40px 72px;
  background: var(--color-fog);
}
.dealers__grid {
  display: grid;
  gap: 16px;
}

.dealer__card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px 24px 24px;
  background: var(--color-white);
}

/* Línea superior: hairline gris con un tramo azul que se extiende en hover */
.dealer__card::before,
.dealer__card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.dealer__card::before { background: var(--color-stone); }
.dealer__card::after {
  background: var(--color-vw-blue);
  transform: scaleX(0.18);
  transform-origin: left;
  transition: transform 900ms var(--ease);
}

.dealer__head {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-stone);
}
.dealer__index {
  display: block;
  margin-bottom: 12px;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  color: var(--color-vw-blue);
}
.dealer__city {
  font-weight: 400;
  font-size: clamp(2.5rem, 2rem + 2.2vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: transform 900ms var(--ease);
}

.dealer__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.dealer__name {
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.005em;
}
.dealer__address {
  margin: 10px 0 28px;
  font-style: normal;
  color: var(--color-muted);
  line-height: 1.5;
}
.dealer__body .btn { margin-top: auto; }

@media (hover: hover) {
  .dealer__card:hover::after { transform: scaleX(1); }
  .dealer__card:hover .dealer__city { transform: translateX(6px); }
}
.dealer__card:focus-within::after { transform: scaleX(1); }

/* Tablet: ciudad a la izquierda, datos y botón a la derecha */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .dealer__card {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: 40px;
    padding: 36px 32px 32px;
  }
  .dealer__head {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
    border-right: 1px solid var(--color-stone);
    padding-right: 24px;
  }
}

@media (min-width: 768px) {
  .intro { padding-block: 112px 72px; }
  .dealers__band { padding-block: 64px 112px; }
  .dealers__grid { gap: 24px; }
}

@media (min-width: 1024px) {
  .dealers__grid { grid-template-columns: repeat(3, 1fr); }
  .dealer__card { padding: 36px 32px 32px; }
  .dealer__name { font-size: 1.375rem; }
}

/* ==========================================================================
   4. BANNER DE CIERRE
   ========================================================================== */
.closing {
  position: relative;
  display: flex;
  min-height: clamp(620px, 92svh, 760px);
  overflow: hidden;
  color: var(--color-white);
  background: #1d1f22;
  isolation: isolate;
}
.closing__img { object-position: 64% 100%; }

.closing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgb(var(--color-night) / 0.8) 0%,
    rgb(var(--color-night) / 0.5) 34%,
    rgb(var(--color-night) / 0) 60%);
}

.closing__content {
  padding-block: 64px;
}
.closing__title {
  max-width: 12ch;
  font-weight: 400;
  font-size: clamp(2.25rem, 1.3rem + 4vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.closing__model {
  margin: 12px 0 20px;
  font-weight: 800;
  font-size: clamp(1.375rem, 1rem + 1.4vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* Logotipo completo: ancho similar al del enlace para que el bloque se lea como una unidad */
.closing__logo {
  width: clamp(218px, 143px + 10.4vw, 281px);
  height: auto;
  margin-top: 28px;
}

/* Móvil y tablet en vertical: mismo tratamiento que el hero. Foto a todo el ancho debajo del texto
   para que se vean los tres autos; su parte superior se funde con el fondo detrás del logo. */
@media (orientation: portrait) and (max-width: 1023.98px) {
  .closing {
    flex-direction: column;
    min-height: 0;
    background: #2b2d2a;
  }
  .closing__content { padding-bottom: 0; }
  .closing__media {
    position: relative;
    inset: auto;
    order: 1;
    margin-top: calc(-1 * clamp(64px, 18vw, 160px));
    aspect-ratio: 870 / 718;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 34%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 34%);
  }
  .closing__img { object-position: 50% 100%; }
}

@media (min-width: 1024px) {
  .closing {
    min-height: 0;
    /* Altura ligada al ancho (no al alto de pantalla): la foto mantiene el mismo encuadre
       en 1024, 1440 o 2560 y el Atlas nunca queda cortado por abajo */
    height: clamp(640px, 50vw, 1100px);
  }
  /* Texto y logo arriba, sobre el cielo; los autos quedan completos en la mitad inferior */
  .closing__content { padding-block: 64px; }
  .closing__logo { margin-top: 24px; }
  .closing__title { max-width: none; font-size: clamp(2.75rem, 1.5rem + 2.6vw, 4.25rem); }
  .closing__img { object-position: 70% 50%; }
  .closing::after {
    background:
      linear-gradient(90deg,
        rgb(var(--color-night) / 0.6) 0%,
        rgb(var(--color-night) / 0.25) 40%,
        rgb(var(--color-night) / 0) 65%),
      linear-gradient(180deg,
        rgb(var(--color-night) / 0.6) 0%,
        rgb(var(--color-night) / 0.3) 35%,
        rgb(var(--color-night) / 0) 55%);
  }
}

/* ==========================================================================
   5. FOOTER
   ========================================================================== */
.site-footer {
  padding-block: 48px max(48px, env(safe-area-inset-bottom));
  background: var(--color-carbon);
  color: var(--color-concrete);
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.site-footer__copy { font-size: 0.875rem; line-height: 1.5; }

/* Aviso legal: letra pequeña legible (14px, #bbb sobre #262626 = 8.3:1) separada por una línea fina */
.site-footer__legal {
  max-width: 90ch;
  margin-bottom: 48px;
  font-size: 0.875rem;
  line-height: 1.6;
}
.site-footer__legal + .site-footer__inner {
  padding-top: 48px;
  border-top: 1px solid rgb(255 255 255 / 0.14);
}
@media (min-width: 768px) {
  .site-footer__legal { margin-bottom: 56px; }
  .site-footer__legal + .site-footer__inner { padding-top: 56px; }
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ==========================================================================
   Animaciones (solo transform + opacity)
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes settle {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}

.hero__img { animation: settle 2400ms var(--ease) both; }
.anim-in {
  animation: rise var(--dur) var(--ease) both;
  animation-delay: calc(200ms + var(--i, 0) * var(--stagger));
}

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .hero__media, .closing__media { transform: none !important; }
}
