/* =========================================================================
   Design system
   ========================================================================= */
:root {
  --papel:       #FFFCFB;  /* base background, warm white */
  --nube:        #FDF2F0;  /* alternating section background */
  --rubor:       #F3CFC9;  /* borders, rules, placeholders */
  --rojo:        #DE8078;  /* primary accent */
  --carmin:      #A8453E;  /* accented text, links */
  --tinta:       #3B2B29;  /* body text */
  --tinta-suave: #7A6360;  /* secondary text, captions */

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Karla', system-ui, -apple-system, sans-serif;
  --font-firma:   'Caveat', 'Segoe Script', cursive;

  /* Tighter on phones so the page does not become an endless scroll of air */
  --espaciado-seccion: clamp(3.5rem, 11vh, 10rem);
  --margen-lateral:    clamp(1.25rem, 5vw, 3rem);

  --sombra-foto: 0 8px 24px rgba(59, 43, 41, 0.09);
  --radio-foto: 6px;
  --radio-btn: 999px;

  /* Safe areas on notched phones */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* =========================================================================
   Reset & base
   ========================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;   /* stop iOS from inflating text on rotate */
  scroll-behavior: smooth;
}

body {
  background-color: var(--papel);
  color: var(--tinta);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* hidden first: Safari below 16 drops `clip` and would otherwise fall back
     to `visible`, i.e. no horizontal-overflow protection at all. */
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-y: none;      /* no rubber-band flash of white */
  touch-action: manipulation;       /* kill the 300ms tap delay */
  width: 100%;
}

@media (min-width: 768px) {
  body { font-size: 1.125rem; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

img { max-width: 100%; }

::selection { background: var(--rubor); color: var(--carmin); }

/* =========================================================================
   Layout primitives
   ========================================================================= */
.seccion {
  padding-block: var(--espaciado-seccion);
  padding-left: max(var(--margen-lateral), var(--safe-l));
  padding-right: max(var(--margen-lateral), var(--safe-r));
  position: relative;
  width: 100%;
}

.seccion--nube { background-color: var(--nube); }

.contenedor-angosto {
  max-width: 34rem;
  margin-inline: auto;
  text-align: left;
}

.contenedor-galeria {
  max-width: 58rem;
  margin-inline: auto;
}

/* =========================================================================
   Reading progress
   ========================================================================= */
.progreso {
  position: fixed;
  /* viewport-fit=cover lets content draw under the cutout; without this the
     bar hides behind the status bar / Dynamic Island. */
  top: var(--safe-t);
  left: 0;
  right: 0;
  height: 2px;
  z-index: 90;
  background: transparent;
  pointer-events: none;
}

.progreso-barra {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--rubor), var(--rojo), var(--carmin));
}

/* =========================================================================
   Tap hearts
   ========================================================================= */
.toque-capa {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.toque-corazon {
  position: absolute;
  color: var(--rojo);
  will-change: transform, opacity;
}

.toque-corazon svg { display: block; width: 100%; height: 100%; }

/* =========================================================================
   6.1 Hero
   ========================================================================= */
#hero {
  min-height: 100vh;
  padding-block: calc(var(--safe-t) + 1rem) calc(var(--safe-b) + 1rem);
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  position: relative;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(253, 242, 240, 0.95) 0%, transparent 70%),
    var(--papel);
}

/* svh, not dvh: the box never resizes when the mobile URL bar hides, so the
   hero does not jump mid-scroll. 100vh above is the fallback. */
@supports (min-height: 100svh) {
  #hero { min-height: 100svh; }
}

.hero-ambiente {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
  will-change: transform;
}

.hero-blob--1 {
  width: min(52vw, 320px); height: min(52vw, 320px);
  background: rgba(243, 207, 201, 0.7);
  top: 6%; left: 2%;
}
.hero-blob--2 {
  width: min(46vw, 280px); height: min(46vw, 280px);
  background: rgba(222, 128, 120, 0.22);
  bottom: 10%; right: 2%;
}
.hero-blob--3 {
  width: min(36vw, 220px); height: min(36vw, 220px);
  background: rgba(253, 242, 240, 0.9);
  top: 42%; left: 46%;
}

.hero-particulas {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.hero-particula {
  position: absolute;
  bottom: -24px;
  color: var(--rojo);
  opacity: 0;
  will-change: transform, opacity;
  filter: drop-shadow(0 2px 6px rgba(222, 128, 120, 0.25));
}
.hero-particula svg { display: block; width: 100%; height: 100%; }

.hero-centro {
  grid-row: 1;
  position: relative;
  z-index: 10;
  padding-inline: 1.25rem;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-cupido-icono {
  color: var(--rojo);
  margin-bottom: 0.75rem;
  opacity: 0.85;
  animation: floatSubtle 4s ease-in-out infinite;
  filter: drop-shadow(0 2px 6px rgba(222, 128, 120, 0.25));
}

@keyframes floatSubtle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-4px) rotate(1deg); }
}

.hero-saludo {
  font-family: var(--font-display);
  font-weight: 300;
  font-variation-settings: 'opsz' 120, 'SOFT' 80;
  font-size: clamp(1.4rem, 5.5vw, 2.75rem);
  color: var(--tinta-suave);
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero-nombre {
  font-family: var(--font-display);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-size: clamp(3.4rem, 20vw, 6.5rem);
  color: var(--tinta);
  line-height: 1.05;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
}

.hero-nombre-corazon {
  color: var(--carmin);
  width: 0.34em;
  height: 0.34em;
  flex-shrink: 0;
  animation: beatSoft 3.2s ease-in-out infinite;
}

@keyframes beatSoft {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* Per-character reveal target (SplitText) */
.hero-nombre-texto .char { display: inline-block; will-change: transform, opacity; }

/* Scroll hint */
.hero-scroll-pista {
  grid-row: 2;
  z-index: 10;
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--tinta-suave);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  opacity: 0.7;
  min-height: 48px;
}

.hero-scroll-linea {
  width: 1px;
  height: 34px;
  background: linear-gradient(to bottom, var(--rojo), transparent);
  transform-origin: top center;
  animation: pistaCae 2.2s ease-in-out infinite;
}

@keyframes pistaCae {
  0%       { transform: scaleY(0); opacity: 0; }
  35%      { transform: scaleY(1); opacity: 1; }
  100%     { transform: scaleY(1) translateY(34px); opacity: 0; }
}

.hero-scroll-pista:focus-visible { outline: 2px solid var(--carmin); outline-offset: 4px; border-radius: 8px; }

/* Floating hero photos */
.hero-fotos-capa {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.hero-foto-item {
  position: absolute;
  will-change: transform, opacity;
  filter: drop-shadow(0 10px 28px rgba(59, 43, 41, 0.14));
}

.hero-foto-drift { width: 100%; will-change: transform; }
.hero-foto-item .marco-foto { will-change: transform; }

/* Desktop placement */
.hf-1 { top: 12%; left: 8%;   width: clamp(110px, 15vw, 190px); }
.hf-2 { top: 18%; right: 9%;  width: clamp(100px, 14vw, 175px); }
.hf-3 { bottom: 14%; left: 14%; width: clamp(95px, 13vw, 160px); }
.hf-4 { bottom: 12%; right: 12%; width: clamp(115px, 16vw, 195px); }
.hf-5 { top: 48%; right: 4%;  width: clamp(90px, 11vw, 140px); }

.hf-atras {
  opacity: 0.72;
  filter: blur(0.6px) drop-shadow(0 6px 14px rgba(59, 43, 41, 0.08));
}

/* Phones: four photos hugging the corners so they frame the name instead of
   colliding with it. Centring uses margin-left, never transform — GSAP owns
   the transform property on these elements. */
@media (max-width: 767px) {
  .hf-1 { top: 4%;  left: 6%;  width: 26vw; max-width: 114px; }
  .hf-2 { top: 6%;  right: 4%; width: 24vw; max-width: 104px; }
  .hf-3 { bottom: 15%; left: 5%;  width: 25vw; max-width: 108px; }
  .hf-4 { bottom: 17%; right: 5%; width: 22vw; max-width: 96px; }
  .hf-5 { display: none; }
}

/* Very short screens (landscape phones): photos would swallow the name */
@media (max-height: 560px) and (max-width: 900px) {
  .hero-foto-item { display: none; }
  .hero-scroll-pista { display: none; }
  #hero { min-height: 30rem; }
}

/* =========================================================================
   Photo frame — print-on-a-table look
   ========================================================================= */
.marco-foto {
  --ar: 0.8;                       /* overridden per photo from datos.js */
  background-color: #ffffff;
  padding: 7px 7px 10px;
  border-radius: var(--radio-foto);
  box-shadow: var(--sombra-foto);
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid rgba(243, 207, 201, 0.5);
}

@media (min-width: 768px) {
  .marco-foto { padding: 9px 9px 13px; }
}

/* The canvas holds the photo at its REAL aspect ratio, so nothing is cropped */
.marco-lienzo {
  aspect-ratio: var(--ar);
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(253, 242, 240, 0.9) 0%, rgba(243, 207, 201, 0.45) 100%);
}

.marco-lienzo img,
.marco-lienzo picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.marco-lienzo img {
  object-fit: cover;
  z-index: 1;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* Placeholder, only visible when the photo fails to load */
.marco-placeholder-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--carmin);
  opacity: 0.4;
  pointer-events: none;
}
.marco-placeholder-visual svg { width: 26px; height: 26px; }

/* Tappable photo */
.foto-enlace {
  display: block;
  position: relative;
  width: 100%;
  border-radius: var(--radio-foto);
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.foto-enlace:focus-visible { outline: 2px solid var(--carmin); outline-offset: 5px; }

.foto-lupa {
  position: absolute;
  right: 14px;
  bottom: 18px;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--carmin);
  background: rgba(255, 252, 251, 0.82);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(59, 43, 41, 0.14);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.foto-lupa svg { width: 15px; height: 15px; }

/* Show the affordance permanently on touch, on hover for mice */
@media (hover: none) {
  .foto-lupa { opacity: 0.9; transform: none; }
}
@media (hover: hover) {
  .foto-enlace:hover .foto-lupa,
  .foto-enlace:focus-visible .foto-lupa { opacity: 1; transform: none; }
  .foto-enlace:hover .marco-lienzo img { transform: scale(1.035); }
}
.foto-enlace:active .marco-lienzo img { transform: scale(1.02); }

/* =========================================================================
   6.2 Opening message
   ========================================================================= */
.mensaje-apertura-wrapper { position: relative; }

.icono-adorno-seccion {
  display: inline-flex;
  margin-bottom: 1.25rem;
  color: var(--rojo);
}

.mensaje-apertura p {
  font-size: clamp(1.15rem, 4.4vw, 1.45rem);
  color: var(--tinta);
  line-height: 1.7;
  margin-bottom: 1.1rem;
  text-wrap: pretty;
}
.mensaje-apertura p:last-child { margin-bottom: 0; }

/* =========================================================================
   6.3 Gallery
   ========================================================================= */
.galeria-cabecera {
  text-align: center;
  margin-bottom: clamp(2.25rem, 7vw, 3.5rem);
}

.galeria-subtitulo {
  font-family: var(--font-firma);
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  color: var(--rojo);
  display: block;
  line-height: 1.2;
}

.galeria-ayuda {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  opacity: 0.65;
}

.galeria-item { margin-bottom: clamp(3rem, 10vw, 7rem); }
.galeria-item:last-child { margin-bottom: 0; }

/* Featured — the hero of the gallery */
.tratamiento-destacada {
  margin-top: clamp(0.5rem, 3vw, 3rem);
  margin-bottom: clamp(4rem, 13vw, 9rem);
}
.destacada-wrapper {
  max-width: 26rem;
  margin-inline: auto;
}
@media (min-width: 768px) { .destacada-wrapper { max-width: 30rem; } }

.tratamiento-destacada .marco-foto { box-shadow: 0 18px 48px rgba(59, 43, 41, 0.16); }
.tratamiento-destacada .pie-de-foto {
  font-size: 1rem;
  color: var(--carmin);
  justify-content: center;
  text-align: center;
  margin-top: 1.2rem;
}

/* A — single large photo */
.tratamiento-grande {
  max-width: 40rem;
  margin-inline: auto;
}

/* B — pair, staggered on wider screens */
.tratamiento-par {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.25rem, 8vw, 4rem);
  align-items: start;
  max-width: 26rem;
  margin-inline: auto;
}
@media (min-width: 640px) {
  .tratamiento-par {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }
  .tratamiento-par > .par-col:nth-child(2) { margin-top: 3.5rem; }
}

/* C — parallax */
.tratamiento-parallax {
  max-width: 34rem;
  margin-inline: auto;
}
.parallax-wrapper { border-radius: var(--radio-foto); }

/* Oversize the image so the scrub can travel without exposing the edges */
.marco-foto--parallax .marco-lienzo img {
  height: 116%;
  top: -8%;
  will-change: transform;
}

/* Caption */
.pie-de-foto {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--tinta-suave);
  margin-top: 0.85rem;
  line-height: 1.5;
  text-align: left;
  padding-left: 2px;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  text-wrap: pretty;
}

.corazoncito-pie {
  flex-shrink: 0;
  color: var(--rojo);
  width: 13px;
  height: 13px;
  margin-top: 0.32em;
}

/* =========================================================================
   6.4 / 6.5 Lists
   ========================================================================= */
.titulo-con-adorno {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: clamp(1.75rem, 6vw, 2.5rem);
}

.seccion-titulo {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6.5vw, 2.5rem);
  font-weight: 300;
  font-variation-settings: 'opsz' 60, 'SOFT' 80;
  color: var(--carmin);
  letter-spacing: -0.015em;
  line-height: 1.15;
  text-wrap: balance;
}

.icono-titulo-svg { color: var(--rojo); flex-shrink: 0; }

.lista-cosas {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.item-cosa {
  position: relative;
  padding-bottom: 1.1rem;
  font-size: clamp(1.05rem, 4.2vw, 1.25rem);
  color: var(--tinta);
  line-height: 1.55;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  text-wrap: pretty;
}

.item-cosa-bullet {
  color: var(--rojo);
  font-size: 0.7rem;
  transform: translateY(-2px);
  flex-shrink: 0;
  opacity: 0.85;
}

.linea-rubor {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--rubor);
  transform-origin: left center;
  transform: scaleX(0);
}

.lista-deseos {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.item-deseo {
  font-size: clamp(1.1rem, 4.4vw, 1.35rem);
  color: var(--tinta);
  line-height: 1.6;
  position: relative;
  padding-left: 1.8rem;
  text-wrap: pretty;
}

.item-deseo::before {
  content: '♡';
  position: absolute;
  left: 0;
  top: -0.05em;
  color: var(--rojo);
  font-size: 1.15rem;
  font-family: var(--font-firma);
}

/* =========================================================================
   6.6 Closing
   ========================================================================= */
.seccion-cierre {
  text-align: center;
  padding-bottom: calc(var(--espaciado-seccion) + var(--safe-b));
}

.cierre-contenedor {
  max-width: 26rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.marco-foto--cierre { max-width: 20rem; }

.cierre-adorno-cupido {
  margin-top: 2rem;
  color: var(--rojo);
  opacity: 0.9;
}

.firma-texto {
  font-family: var(--font-firma);
  /* vw-capped so the signature never overflows a narrow phone */
  font-size: clamp(1.9rem, 9vw, 3.25rem);
  color: var(--carmin);
  line-height: 1.15;
  font-weight: 500;
  margin-top: 0.5rem;
  max-width: 100%;
  text-wrap: balance;
}

.firma-corazon {
  color: var(--rojo);
  margin-top: 0.35rem;
  animation: beatSoft 3.2s ease-in-out infinite;
}

.cierre-acciones {
  margin-top: 2.75rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

/* =========================================================================
   Buttons — 48px minimum touch target
   ========================================================================= */
.btn {
  appearance: none;
  min-height: 48px;
  background: transparent;
  border: 1px solid var(--rubor);
  color: var(--tinta-suave);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radio-btn);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .btn:hover { background-color: var(--rubor); color: var(--carmin); border-color: var(--rojo); }
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--carmin); outline-offset: 3px; }

/* =========================================================================
   PhotoSwipe theming
   ========================================================================= */
.pswp {
  --pswp-bg: #241a19;
  --pswp-placeholder-bg: #3B2B29;
  --pswp-icon-color: #FFFCFB;
  --pswp-icon-color-secondary: #3B2B29;
}

.pswp__custom-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  padding: 0 1.5rem;
  font-family: var(--font-firma);
  font-size: 1.35rem;
  line-height: 1.3;
  color: #FFFCFB;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-foto-item,
  .item-cosa,
  .item-deseo,
  .pie-de-foto,
  .linea-rubor,
  .mensaje-apertura p {
    transform: none !important;
    opacity: 1 !important;
  }

  .linea-rubor { transform: scaleX(1) !important; }

  .hero-particulas,
  .hero-ambiente,
  .toque-capa,
  .hero-scroll-linea { display: none !important; }
}
