@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/PPNeueMontreal-Book.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/PPNeueMontreal-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PP Neue Montreal";
  src: url("assets/fonts/PPNeueMontreal-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* Medidas del diseño: frame de 1440px */
:root {
  --bg: #000;
  --fg: #fff;
  --rule: rgba(255, 255, 255, 0.45);
  --red: #9e2a27;
  --gutter: clamp(16px, 4.17vw, 60px);
  --fs-small: clamp(14px, 1.53vw, 22px);
  --fs-display: clamp(40px, 6.4vw, 92px);
  --fs-hero: clamp(48px, 8.4vw, 121px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "PP Neue Montreal", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
figure { margin: 0; }
u { text-decoration-thickness: 0.05em; text-underline-offset: 0.12em; }

/* Texto pequeño con línea horizontal */
.rule-row {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  font-size: var(--fs-small);
  white-space: nowrap;
}
.rule { flex: 1; height: 1px; background: var(--rule); }

/* HERO */
.hero {
  --hero-fg: #fff;
  --hero-rule: rgba(255, 255, 255, 0.5);
  position: relative;
  height: min(100svh, 62.7vw);
  min-height: 520px;
  background: var(--red);
  color: var(--hero-fg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: color 1.2s ease;
}
.hero[data-tone="dark"] {
  --hero-fg: #000;
  --hero-rule: rgba(0, 0, 0, 0.45);
}
.hero .rule { background: var(--hero-rule); transition: background-color 1.2s ease; }

/* Slider con fundido: las imágenes se apilan y cambia la opacidad */
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__slide.is-active { opacity: 1; }
.hero__top, .hero__bottom { position: relative; z-index: 1; }
.hero__top { padding: clamp(20px, 2.1vw, 30px) var(--gutter) 0; }
.hero__logo {
  flex-shrink: 0;
  height: clamp(40px, 5.1vw, 74px);
  width: auto;
  transition: color 1.2s ease;
}
.hero__bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 20px 8px;
}
.hero__title {
  margin: 0;
  font-size: var(--fs-hero);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.85;
}
.small { font-size: var(--fs-small); }

/* SECCIONES */
.section { padding: clamp(64px, 7.8vw, 112px) var(--gutter) 0; }
.section--tight { padding-top: clamp(64px, 9vw, 130px); }
.eyebrow { margin: 0 0 clamp(28px, 3.5vw, 50px); font-size: var(--fs-small); }
.eyebrow em { font-style: italic; }
.eyebrow--plain .rule { margin: 0 clamp(0px, 1.5vw, 20px); }
.display {
  margin: 0;
  font-size: var(--fs-display);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* CARRUSEL */
.marquee {
  margin-top: clamp(56px, 7vw, 100px);
  overflow: hidden;
}
.marquee__track {
  display: flex;
  gap: clamp(20px, 3.7vw, 53px);
  width: max-content;
  animation: marquee 40s linear infinite;
}
/* Misma altura para todas; el ancho sale de la proporción de cada imagen */
.marquee__track img {
  height: clamp(164px, 23.1vw, 333px);
  width: auto;
  flex-shrink: 0;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translateX(calc(-50% - var(--gap-half, 0px))); }
}

/* COLLAGE: posiciones exactas del diseño (unidades del frame de 1440 × 1480) */
.collage {
  position: relative;
  width: 100%;
  aspect-ratio: 1440 / 1480;
  margin-top: clamp(40px, 6vw, 90px);
}
.collage__item {
  position: absolute;
  left: calc(var(--x) / 1440 * 100%);
  top: calc(var(--y) / 1480 * 100%);
  width: calc(var(--w) / 1440 * 100%);
  height: calc(var(--h) / 1480 * 100%);
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  z-index: 0;
  /* al salir, espera a que la imagen encoja antes de volver a su capa */
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.8,.2,1), z-index 0s 0.5s;
}
.collage__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1), box-shadow 0.5s ease;
}
.collage__item:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
/* Mismo pop up que "Mis especialidades" */
@media (hover: hover) {
  .collage__item:hover { z-index: 2; transition-delay: 0s; }
  .collage__item:hover img {
    transform: scale(1.05);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  }
}

/* GALERÍA A PANTALLA COMPLETA */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #161616;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0s 0.4s;
}
.lightbox.is-open { opacity: 1; visibility: visible; transition: opacity 0.4s ease; }
.lightbox:focus { outline: none; }
.lightbox__stage { position: absolute; inset: 0; overflow: hidden; }
.lightbox__slide {
  position: absolute;
  left: 50%;
  top: 46%;
  object-fit: cover;
  cursor: pointer;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.7s cubic-bezier(.2,.8,.2,1), filter 0.7s ease, opacity 0.7s ease;
}
.lightbox__slide.is-current { cursor: default; }
.lightbox button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.lightbox__close {
  position: absolute;
  top: 24px;
  right: var(--gutter);
  z-index: 1;
  font-size: var(--fs-small) !important;
}
.lightbox__close span { opacity: 0.5; margin-left: 6px; }
.lightbox__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(20px, 4vh, 40px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  font-size: var(--fs-small);
}
.lightbox__nav { font-size: clamp(20px, 1.8vw, 26px) !important; opacity: 0.7; transition: opacity 0.2s; }
.lightbox__nav:hover { opacity: 1; }
.lightbox__counter { margin: 0; min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; }
.lightbox button:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
body.is-locked { overflow: hidden; }

/* ESPECIALIDADES */
.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 3.4vw, 49px);
  margin-top: clamp(28px, 4vw, 60px);
  align-items: start;
}
.specs figure:not(.specs__mid) { margin-top: clamp(0px, 6.2vw, 89px); }
.specs img {
  width: 100%;
  aspect-ratio: 406 / 513;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(.2,.8,.2,1), box-shadow 0.5s ease;
}
/* Pop up al pasar el cursor: la imagen se adelanta un poco y vuelve al salir */
@media (hover: hover) {
  .specs figure:hover img {
    transform: scale(1.05);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
  }
}
.specs figcaption {
  margin-top: clamp(14px, 2vw, 30px);
  text-align: center;
  font-size: clamp(16px, 1.95vw, 28px);
}

/* POSIBILIDADES */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 1.1vw, 16px);
  margin-top: clamp(40px, 4vw, 60px);
}
.cards img { width: 100%; aspect-ratio: 320 / 403; object-fit: cover; }
.cards figcaption { margin-top: clamp(12px, 2vw, 30px); font-size: var(--fs-small); padding-left: 4px; }

/* Aparición tipo "persiana": cada imagen empieza como una línea fina arriba
   y se despliega hacia abajo; las tarjetas van escalonadas y el texto llega al final */
.cards figure.reveal { opacity: 1; transform: none; }
.cards figure:nth-child(1) { --delay: 0s; }
.cards figure:nth-child(2) { --delay: 0.12s; }
.cards figure:nth-child(3) { --delay: 0.24s; }
.cards figure:nth-child(4) { --delay: 0.36s; }
.cards .reveal img {
  clip-path: inset(0 0 calc(100% - 3px) 0);
  transition: clip-path 1.2s cubic-bezier(.77, 0, .18, 1) var(--delay);
}
.cards .reveal figcaption {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--delay) + 0.8s);
}
.cards .reveal.is-visible img { clip-path: inset(0); }
.cards .reveal.is-visible figcaption { opacity: 1; transform: none; }

/* PACKS */
.packs {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3.5vw, 50px);
  margin-top: clamp(56px, 8vw, 120px);
}
.packs__buttons { display: flex; gap: clamp(12px, 1.8vw, 26px); flex-shrink: 0; }
.pack {
  position: relative;
  display: block;
  width: clamp(90px, 14.9vw, 214px);
}
.pack img {
  position: relative;
  width: 100%;
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1), opacity 0.45s ease, filter 0.45s ease;
}
/* Luz de color detrás del pack */
.pack::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 30%;
  background: var(--glow);
  filter: blur(34px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(.2,.8,.2,1);
}
.pack:focus-visible { outline: none; }
/* Pop up: el pack elegido sube con luz detrás y los otros dos se quedan atrás */
.pack:hover img, .pack:focus-visible img { transform: translateY(-8px) scale(1.08); }
.pack:hover::before, .pack:focus-visible::before { opacity: 0.75; transform: scale(1.15); }
.packs__buttons:has(.pack:hover) .pack:not(:hover) img,
.packs__buttons:has(.pack:focus-visible) .pack:not(:focus-visible) img {
  transform: scale(0.94);
  opacity: 0.45;
  filter: saturate(0.6);
}

/* TITULAR QUE SE ESCRIBE */
.typewriter .ch { opacity: 0; }
.typewriter .ch.is-typed { opacity: 1; }
.typewriter.is-done .ch { opacity: 1; }
.caret {
  position: relative;
  display: inline-block;
  width: 0;
}
.caret::after {
  content: "";
  position: absolute;
  left: 0.04em;
  bottom: -0.12em;
  width: 0.05em;
  height: 1em;
  background: currentColor;
  animation: caret-blink 0.9s steps(1) infinite;
}
.typewriter.is-typing .caret::after { animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }
/* Subrayado que se dibuja de izquierda a derecha al terminar de escribir */
.draw-underline {
  background: linear-gradient(currentColor, currentColor) no-repeat 0 calc(100% - 0.1em) / 0% 0.05em;
  transition: background-size 0.9s cubic-bezier(.77, 0, .18, 1);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.typewriter.is-underlined .draw-underline { background-size: 100% 0.05em; }
.packs__text p { margin: 0; font-size: clamp(14px, 1.46vw, 21px); }
.packs__text h3 {
  margin: clamp(10px, 1.6vw, 24px) 0 clamp(14px, 2.2vw, 32px);
  font-size: clamp(28px, 3.9vw, 56px);
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* FOOTER */
/* 3 columnas iguales para que la flecha quede justo en el centro */
.footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: clamp(80px, 11vw, 160px) 20px 30px;
  font-size: var(--fs-small);
}
.footer > span:last-child { justify-self: end; }
.to-top {
  padding: 4px 12px;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: clamp(22px, 1.9vw, 28px);
  line-height: 1;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), opacity 0.35s ease;
  opacity: 0.8;
}
.to-top:hover { transform: translateY(-5px); opacity: 1; }
.to-top:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }

/* Animación de entrada al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(.2,.8,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__slide, .hero, .hero .rule { transition: none; }
  .lightbox, .lightbox__slide { transition: none; }
  .cards .reveal img { clip-path: none; transition: none; }
  .cards .reveal figcaption { opacity: 1; transform: none; transition: none; }
  .pack img, .pack::before { transition: none; }
  .marquee__track { animation: none; }
}

/* MÓVIL */
@media (max-width: 767px) {
  .hero { height: 88svh; }
  .hero__slide { object-position: var(--pos-m, 50%) center; }
  /* en móvil solo el logo, centrado */
  .hero__top .hero__claim, .hero__top .rule { display: none; }
  .hero__top { justify-content: center; }
  .hero__logo { height: 44px; }
  .hero__bottom { flex-wrap: wrap; padding: 0 16px 16px; }
  .hero__title { order: -1; width: 100%; margin-bottom: 12px; font-size: 13.5vw; }
  .rule-row { white-space: normal; }
  .display br { display: none; }

  .collage {
    aspect-ratio: auto;
    columns: 2;
    column-gap: 8px;
    padding: 0 var(--gutter);
  }
  .collage__item {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--w) / var(--h);
    margin-bottom: 8px;
    break-inside: avoid;
  }

  .specs { grid-template-columns: 1fr; gap: 40px; }
  .specs figure:not(.specs__mid) { margin-top: 0; }
  .cards { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .packs { flex-direction: column; align-items: flex-start; }
  .packs__buttons { width: 100%; }
  .pack { flex: 1; width: auto; }
  .footer { padding-top: 80px; padding-inline: 16px; }
}
