/* ==========================================================================
   Invitación Miren & Randy · RSVP
   Basado en el frame "RSVP" de Figma (desktop, 1728 px de ancho).
   La página se sirve desde /RSVP/, por eso todas las rutas son relativas.
   ========================================================================== */

/* ---------- Tipografías ---------- */
/* Norman (títulos) se carga desde Adobe Fonts con el <link> del index.html.
   Si el nombre de la familia en tu proyecto no es "norman", cámbialo en --font-titulo. */

/* ---------- Tokens ---------- */
:root {
  /* Paleta (variables de Figma; valores tomados de muestras, ajústalos si hace falta) */
  --borgona: #49062a;
  --verde:   #363e06;
  --azul:    #6597dc;
  --naranja: #d6561a;
  --beige:   #f2e9da;
  --negro:   #240204;
  --opalina: #f0ebe1;

  --font-titulo: "norman", "Norman", Georgia, "Times New Roman", serif;
  --font-texto:  "Alice", Georgia, "Times New Roman", serif;
  --font-ui:     "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* 1 "px de diseño" (el frame mide 1728). Se escala con el ancho y no crece más allá de 1728. */
  --u: min(1px, calc(100vw / 1728));

  /* Tamaños de texto (estilos de Figma: Header 96, Header Label 48, Body 24) */
  --fs-titulo: calc(96 * var(--u));
  --fs-label:  calc(48 * var(--u));
  --fs-texto:  calc(24 * var(--u));
  --fs-medio:  calc(20 * var(--u));
  --fs-chico:  calc(18 * var(--u));
  --fs-ui:     calc(14 * var(--u));

  /* En el prototipo cada sección ocupa una pantalla completa (1728 × 1117). */
  --alto-seccion: 100svh;
}

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

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

body {
  margin: 0;
  background: var(--beige);
  color: var(--negro);
  font-family: var(--font-texto);
  font-size: var(--fs-texto);
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
p, h1, h2, h3, ol { margin: 0; padding: 0; }
ol { list-style: none; }

main { overflow-x: clip; }

section { position: relative; }

/* ---------- Piezas reutilizables ---------- */
.titulo {
  font-family: var(--font-titulo);
  font-weight: 500;
  font-size: var(--fs-titulo);
  line-height: 1.06;
  text-align: center;
  text-wrap: balance;
}

.texto { font-size: var(--fs-texto); line-height: 1.2; text-align: center; text-wrap: balance; }

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(18 * var(--u)) calc(46 * var(--u));
  font-family: var(--font-texto);
  font-size: max(16px, calc(22 * var(--u)));
  line-height: 1.2;
  text-decoration: none;
  color: var(--beige);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.boton--naranja { background: var(--naranja); }
.boton--naranja:hover { background: #bd4912; }
.boton--contorno { border-color: var(--beige); }
.boton--contorno:hover { background: var(--beige); color: var(--naranja); }
.boton:focus-visible { outline: 2px solid var(--beige); outline-offset: 4px; }

/* Perla decorativa (esquinas de la portada): img/perla.png */
.perla {
  position: absolute;
  width: calc(16 * var(--u));
  height: auto;
}
.perla--tl { top: calc(48 * var(--u)); left:  calc(48 * var(--u)); }
.perla--tr { top: calc(48 * var(--u)); right: calc(48 * var(--u)); }
.perla--bl { bottom: calc(48 * var(--u)); left:  calc(48 * var(--u)); }
.perla--br { bottom: calc(48 * var(--u)); right: calc(48 * var(--u)); }

/* ==========================================================================
   Efecto de capas (prototipo de Figma)
   - Portada y Nuestra boda quedan fijas; la siguiente sección sube encima.
   - La foto queda fija; la tarjeta de detalles sube sobre ella.
   Requiere que ningún ancestro tenga overflow: hidden (main usa clip).
   ========================================================================== */
.portada, .boda, .foto { position: sticky; top: 0; }
.portada   { z-index: 1; }
.boda      { z-index: 2; }  /* transparente: deja ver la portada */
.intro     { z-index: 3; }
.foto      { z-index: 4; }
.detalles  { z-index: 5; }  /* transparente: deja ver la foto */
.reservar  { z-index: 6; }
.confirmar { z-index: 7; }

/* ==========================================================================
   Splash / loading (sobre). Una variante para escritorio y otra para móvil.
   ========================================================================== */
html.con-splash { overflow: hidden; }
.solo-movil { display: none; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background-color: var(--borgona);
  background-image: url("../img/fondo-borgona.png");
  background-size: cover;
  background-position: center;
  transition: opacity .8s ease .1s, visibility 0s linear .9s;
  /* Respaldo sin JS */
  animation: splash-respaldo .8s ease 9s forwards;
}
.splash--fuera { opacity: 0; visibility: hidden; }
.splash--fuera .splash__sobre { transform: scale(1.18); }

.splash__sobre {
  grid-area: 1 / 1;
  transition: transform .9s cubic-bezier(.2, .7, .2, 1);
  animation: splash-entra 1s cubic-bezier(.2, .7, .2, 1) both;
}
.splash__sobre img { width: 100%; height: auto; animation: splash-latido 2.2s ease-in-out 1s infinite; }
.splash__sobre--escritorio { width: calc(420 * var(--u)); }
.splash__sobre--movil { display: none; width: min(72vw, 320px); }

@keyframes splash-entra {
  from { opacity: 0; transform: translateY(24px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes splash-latido {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}
@keyframes splash-respaldo { to { opacity: 0; visibility: hidden; } }

/* ==========================================================================
   1. Portada (sobre)
   ========================================================================== */
.portada {
  min-height: var(--alto-seccion);
  display: grid;
  place-items: center;
  background-color: var(--borgona);
  background-image: url("../img/fondo-borgona.png");
  background-size: cover;
  background-position: center;
}
.portada__contenido {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(40 * var(--u));
}
.portada__sobre { width: calc(583 * var(--u)); height: auto; }

/* ==========================================================================
   2. Nuestra boda
   ========================================================================== */
.boda {
  min-height: var(--alto-seccion);
  display: grid;
  place-items: center;
  background: transparent;
}
.boda__marco {
  position: relative;
  width: calc(1097 * var(--u));
  aspect-ratio: 1097 / 625;
}
.boda__marco-img { width: 100%; height: 100%; object-fit: contain; }
.boda__texto {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--u));
  color: var(--beige);
  text-align: center;
}
.boda__fecha, .boda__lugar { font-size: max(16px, calc(32 * var(--u))); line-height: 1.2; }

/* ==========================================================================
   3. Intro
   ========================================================================== */
.intro {
  min-height: var(--alto-seccion);
  display: grid;
  place-items: center;
  background: var(--beige);
  color: var(--negro);
  overflow: hidden;
}
.intro__contenido {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(28 * var(--u));
  padding-inline: calc(24 * var(--u));
}
.intro .titulo { max-width: calc(1062 * var(--u)); }
.intro .texto  { max-width: calc(660 * var(--u)); font-size: var(--fs-medio); }

/* Flores decorativas (posición según el frame de 1728 × 1117) */
.flor {
  position: absolute;
  width: calc(300 * var(--u));
  aspect-ratio: 1;
  background: url("../img/flor-intro.png") center / contain no-repeat;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.flor--1 { left: 12.8%; top: 23.4%; }
.flor--2 { left: 89.2%; top: 16.2%; transform: translate(-50%, -50%) rotate(40deg); }
.flor--3 { left: 73.4%; top: 69.1%; transform: translate(-50%, -50%) rotate(-25deg); }
.flor--4 { left: 22.8%; top: 83.8%; transform: translate(-50%, -50%) rotate(15deg); }

/* ==========================================================================
   4. Foto
   ========================================================================== */
.foto {
  height: var(--alto-seccion);
  background: var(--negro);
}
.foto__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* ==========================================================================
   5. Los detalles
   ========================================================================== */
.detalles {
  /* En Figma la sección mide 2270 px: la foto queda fija ~500 px antes de que suba la tarjeta. */
  padding: calc(500 * var(--u)) 0 calc(220 * var(--u));
  background: transparent; /* deja ver la foto fija detrás */
  display: flex;
  justify-content: center;
}
.detalles__tarjeta {
  width: calc(933 * var(--u));
  padding: calc(150 * var(--u)) calc(78 * var(--u)) calc(210 * var(--u));
  background-color: var(--opalina);
  background-image: url("../img/papel-detalles.png");
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--negro);
}
.detalles .titulo { margin-bottom: calc(36 * var(--u)); }
.detalles .texto  { max-width: calc(620 * var(--u)); }

/* Hilera de perlas (19 imágenes de img/perla.png repartidas) */
.perlas {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(628 * var(--u));
  margin: calc(85 * var(--u)) 0 calc(90 * var(--u));
}
.perlas img { width: calc(12 * var(--u)); height: auto; }

.insignias {
  display: grid;
  grid-template-columns: repeat(2, calc(372 * var(--u)));
  column-gap: calc(33 * var(--u));
  row-gap: calc(60 * var(--u));
  align-items: center;
}

.insignia {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(10 * var(--u));
  width: calc(372 * var(--u));
  padding: calc(40 * var(--u)) calc(56 * var(--u));
  text-align: center;
  color: var(--beige);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
}
.insignia--naranja { min-height: calc(372 * var(--u)); background-image: url("../img/forma-naranja.png"); }
.insignia--azul    { min-height: calc(305 * var(--u)); background-image: url("../img/forma-azul.png"); }
.insignia--verde   { min-height: calc(300 * var(--u)); background-image: url("../img/forma-verde.png"); }
.insignia--borgona { min-height: calc(241 * var(--u)); background-image: url("../img/forma-borgona.png"); }

.insignia__label {
  padding-bottom: calc(4 * var(--u));
  border-bottom: 1px solid currentColor;
  font-size: max(13px, calc(24 * var(--u)));
  line-height: 1.2;
}
.insignia__dato {
  font-family: var(--font-titulo);
  font-weight: 500;
  font-size: max(22px, calc(52 * var(--u)));
  line-height: 1.04;
}
.insignia__dato small { font-size: .55em; }
.insignia__nota {
  font-family: var(--font-ui);
  font-size: max(11px, calc(16 * var(--u)));
  line-height: 1.2;
}

/* ==========================================================================
   6. Cómo reservar
   ========================================================================== */
.reservar {
  min-height: var(--alto-seccion);
  display: flex;
  flex-direction: column;
  padding: calc(240 * var(--u)) 0 calc(90 * var(--u));
  background-color: var(--borgona);
  background-image: url("../img/fondo-borgona.png");
  background-size: cover;
  background-position: center;
  color: var(--beige);
}
.reservar__contenido { flex: 1; }
.reservar__intro {
  margin-top: calc(70 * var(--u));
  text-align: center;
  font-size: var(--fs-texto);
}

.pasos {
  display: grid;
  row-gap: calc(40 * var(--u));
  margin-top: calc(40 * var(--u));
}
.paso {
  display: grid;
  grid-template-columns: calc(530 * var(--u)) minmax(0, 1fr);
  align-items: center;
  padding-left: calc(217 * var(--u));
  padding-right: calc(284 * var(--u));
}
.paso:first-child { align-items: start; row-gap: calc(24 * var(--u)); }

.paso__titulo {
  font-family: var(--font-titulo);
  font-weight: 500;
  font-size: var(--fs-label);
  line-height: 1.06;
}
.paso__num { margin-right: .15em; }
.paso__texto { max-width: calc(620 * var(--u)); font-size: var(--fs-medio); line-height: 1.2; }
.paso:nth-child(2) .paso__texto { max-width: calc(450 * var(--u)); }
.paso__texto a { color: var(--naranja); text-decoration: none; }
.paso__texto a:hover { text-decoration: underline; }
.resalte { color: var(--naranja); }

/* Opciones de habitación: fila centrada en la página */
.habitaciones {
  grid-column: 1 / -1;
  margin-inline: calc(-217 * var(--u)) calc(-284 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(18 * var(--u));
  text-align: center;
}
.habitaciones__titulo { font-size: var(--fs-texto); }
.habitaciones__lista { display: flex; gap: calc(16 * var(--u)); }
.habitacion {
  width: calc(300 * var(--u));
  padding: calc(14 * var(--u)) calc(16 * var(--u));
  border: 1px solid rgba(242, 233, 218, .55);
}
.habitacion__nombre { font-size: var(--fs-texto); }
.habitacion__nota {
  margin-top: calc(6 * var(--u));
  font-family: var(--font-ui);
  font-size: max(11px, var(--fs-ui));
}

.reservar__nota {
  max-width: calc(780 * var(--u));
  margin: calc(80 * var(--u)) auto 0;
  padding-inline: calc(24 * var(--u));
  text-align: center;
  font-size: max(13px, var(--fs-chico));
  line-height: 1.2;
}

/* ==========================================================================
   7. ¿Nos acompañas?
   ========================================================================== */
.confirmar {
  min-height: var(--alto-seccion);
  display: grid;
  place-items: center;
  overflow: hidden;
  background-color: var(--naranja);
  background-image: url("../img/fondo-naranja.png");
  background-size: cover;
  background-position: center;
  color: var(--beige);
}
.confirmar__contenido {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(40 * var(--u));
}
.confirmar__flor {
  position: absolute;
  top: 50%;
  height: calc(700 * var(--u));
  width: auto;
  transform: translateY(-50%);
  pointer-events: none;
}
.confirmar__flor--izq { left: 0; }
.confirmar__flor--der { right: 0; }
.confirmar__flor-movil { display: none; }
.confirmar__monograma {
  position: absolute;
  left: 50%;
  bottom: calc(110 * var(--u));
  width: calc(170 * var(--u));
  height: auto;
  transform: translateX(-50%);
  opacity: .35;
}

/* ==========================================================================
   Móvil (frame de Figma de 402 px). Solo se cambia lo que no se adapta solo.
   Imágenes móviles: marco-nuestra-boda-movil, manos-movil, flor-naranja-movil.
   ========================================================================== */
@media (max-width: 900px) {
  :root {
    --u: 0.1vw;
    --fs-titulo: 40px;   /* Header 40 / 106 % */
    --fs-label:  40px;   /* Header Label 40 / 106 % */
    --fs-texto:  18px;   /* Body 18 */
    --fs-medio:  18px;
    --fs-chico:  14px;
    --fs-ui:     12px;
    --alto-seccion: 100svh;
  }
  .solo-movil { display: inline; }

  /* Splash móvil */
  .splash__sobre--escritorio { display: none; }
  .splash__sobre--movil { display: block; }

  /* Portada */
  .portada__sobre { width: min(80vw, 420px); }
  .perla { width: 12px; }
  .perla--tl, .perla--tr { top: 24px; }
  .perla--bl, .perla--br { bottom: 24px; }
  .perla--tl, .perla--bl { left: 24px; }
  .perla--tr, .perla--br { right: 24px; }

  /* Nuestra boda: marco vertical, título en dos líneas */
  .boda__marco { width: min(86vw, 420px); aspect-ratio: auto; }
  .boda__marco-img { height: auto; }
  .boda__fecha, .boda__lugar { font-size: 16px; }

  /* Intro: una sola flor centrada */
  .intro__contenido { padding-inline: 24px; }
  .intro .titulo { max-width: 100%; }
  .intro .texto { max-width: 100%; font-size: var(--fs-texto); }
  .flor--2, .flor--3, .flor--4 { display: none; }
  .flor--1 { width: 56vw; left: 50%; top: 14%; transform: translate(-50%, -50%); }

  /* Detalles: tarjeta a lo ancho, insignias en una columna, 10 perlas */
  .detalles { padding: 60svh 16px 80px; }
  .detalles__tarjeta { width: 100%; max-width: 560px; padding: 64px 24px 80px; }
  .detalles .titulo { margin-bottom: 24px; }
  .detalles .texto { max-width: 100%; }
  .perlas { width: 70%; margin: 40px 0; }
  .perlas img { width: 10px; }
  .perlas img:nth-child(n+11) { display: none; }
  .insignias { grid-template-columns: 1fr; row-gap: 32px; justify-items: center; }
  .insignia { width: min(320px, 100%); padding: 32px 40px; }
  .insignia--naranja { min-height: 320px; }
  .insignia--azul    { min-height: 260px; }
  .insignia--verde   { min-height: 260px; }
  .insignia--borgona { min-height: 210px; }
  .insignia__dato { font-size: 34px; }
  .insignia__label { font-size: 16px; }
  .insignia__nota { font-size: 12px; }

  /* Cómo reservar: una columna, título arriba del texto, cajas apiladas */
  .reservar { padding: 96px 0 56px; }
  .reservar__intro { padding-inline: 24px; margin-top: 24px; }
  .pasos { row-gap: 40px; margin-top: 32px; }
  .paso__texto, .paso:nth-child(2) .paso__texto { max-width: none; }
  .paso, .paso:first-child { grid-template-columns: 1fr; row-gap: 12px; padding-inline: 24px; align-items: start; }
  .habitaciones { margin-inline: 0; }
  .habitaciones__lista { flex-direction: column; width: 100%; }
  .habitacion { width: 100%; }
  .reservar__nota { margin-top: 48px; }

  /* ¿Nos acompañas?: monograma arriba del título, flor inferior */
  .boton { padding: 14px 32px; }
  .confirmar { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; }
  .confirmar__flor { display: none; }
  .confirmar__flor-movil {
    display: block;
    position: absolute;
    left: 50%;
    bottom: 0;
    width: min(100%, 560px);
    max-height: 45%;
    object-fit: contain;
    object-position: bottom;
    transform: translateX(-50%);
    pointer-events: none;
  }
  .confirmar__contenido { display: contents; }
  .confirmar__contenido > * { position: relative; z-index: 1; }
  .confirmar__monograma {
    position: relative;
    z-index: 1;
    width: 96px;
    transform: none;
    opacity: 1;
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boton { transition: none; }
}
