/*
 * Invitación XV — Iris Marcela
 * --------------------------------------------
 * - Colores / fondos: variables :root.
 * - Tipografías: Great Vibes + Cormorant Garamond + Cinzel (--font-ticket) en index.html.
 * - Fotos: images/1.jpeg … 7.jpeg (script.js → CONFIG.FOTOS).
 * - Música: music/no_crezcas_mas.mp3 (CONFIG.AUDIO_SRC; cierre #audio-gate).
 * - Referencia visual: images/ejemplo.jpeg (ajústala a tu gusto en este archivo).
 */

:root {
  /* Paleta principal */
  --color-cream: #faf6f0;
  --color-ivory: #f3efe8;
  --color-rose-soft: #e8c4c8;
  --color-rose-deep: #c47a86;
  --color-olive: #4a5c45;
  --color-olive-light: #6d7f68;
  --color-gold: #b8956c;
  --color-gold-dark: #8a6e42;
  --color-gold-shine: #d4b896;
  --color-ink: #2c2a28;
  --color-muted: #5c5854;

  /* Superficies */
  --surface-card: #fffdf9;
  --surface-card-tint: rgba(255, 253, 249, 0.92);
  --border-gold: 1px solid rgba(184, 149, 108, 0.55);
  --shadow-soft: 0 18px 45px rgba(74, 92, 69, 0.08);
  --shadow-card: 0 12px 36px rgba(44, 42, 40, 0.06);

  /* Tipografía */
  --font-script: "Great Vibes", cursive;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  /* Espaciado */
  --space-xs: 0.35rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4.5rem;
  --radius: 12px;
  --radius-lg: 20px;
  --max-width: 38rem;
  --max-width-wide: min(92vw, 72rem);
  --header-safe: env(safe-area-inset-top, 0);
  --footer-safe: env(safe-area-inset-bottom, 0);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --inv-ancho: min(100%, 26.5rem);
  --inv-pad-x: clamp(0.85rem, 3.5vw, 1.35rem);
  --inv-pad-y: clamp(1rem, 3vw, 1.5rem);
  --font-ticket: "Cinzel", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    filter: none !important;
  }

  .reveal.is-visible .date-banner,
  .reveal.is-visible .people-block,
  .reveal.is-visible .event-card,
  .reveal.is-visible .info-card__list li,
  .reveal.is-visible .countdown__unit {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .gallery__cell,
  .gallery__cell--inview {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .hero__photo {
    animation: none !important;
  }

  .hero__inner {
    animation: none !important;
  }

  .hero__enter {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }

  .portrait__figure {
    animation: none !important;
    transform: none !important;
  }

  .portrait__frame {
    animation: none !important;
  }

  .portrait__img {
    transform: none !important;
  }

  .gallery__img {
    transform: none !important;
  }

  .audio-gate,
  .audio-gate--visible,
  .audio-gate--opening,
  .audio-gate__sobre,
  .audio-gate__persp,
  .audio-gate__cuerpo,
  .audio-gate__solapa,
  .audio-gate__backdrop,
  .audio-gate__sello,
  .audio-gate__sello-cera {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--color-ink);
  background: #e8e4dc;
  background-image:
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(255, 253, 249, 0.55), transparent 55%),
    linear-gradient(180deg, rgba(74, 92, 69, 0.06) 0%, transparent 35%),
    repeating-linear-gradient(
      -8deg,
      transparent,
      transparent 98px,
      rgba(184, 149, 108, 0.04) 98px,
      rgba(184, 149, 108, 0.04) 100px
    );
  text-rendering: optimizeLegibility;
}

body.audio-gate-abierta {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-olive);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold-dark);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: var(--space-md);
  top: var(--space-md);
  width: auto;
  height: auto;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-card);
  border: var(--border-gold);
  border-radius: var(--radius);
}

/* ---------- Invitación compacta (tarjeta centrada) ----------
 * Referencia: images/ejemplo.jpeg — ajusta colores o textura aquí si la usas.
 */
.invitacion-envoltura {
  display: flex;
  justify-content: center;
  padding: var(--space-md) var(--space-sm) calc(var(--space-xl) + var(--footer-safe));
}

.invitacion {
  width: var(--inv-ancho);
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  border-radius: 10px 10px 8px 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdf9 0%, #f6f0e8 55%, #faf6f0 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 28px 60px rgba(44, 42, 40, 0.12),
    0 0 0 1px rgba(138, 110, 66, 0.35),
    0 0 0 5px rgba(184, 149, 108, 0.12);
}

.invitacion__cuerpo {
  padding: var(--inv-pad-y) var(--inv-pad-x) calc(var(--inv-pad-y) + 0.25rem);
}

.invitacion__cuerpo > .section {
  padding: var(--space-md) 0;
}

.invitacion__pie {
  margin: 0;
  border-radius: 0;
  border-top: double 3px rgba(184, 149, 108, 0.35);
  background: linear-gradient(180deg, #f3efe8, #ebe4da);
  padding-inline: var(--inv-pad-x);
}

.eventos-grid {
  display: grid;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .eventos-grid {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

.invitacion .section__inner--wide {
  max-width: 100%;
  padding-inline: 0;
}

.invitacion .section--countdown {
  margin-inline: calc(-1 * var(--inv-pad-x));
  width: calc(100% + 2 * var(--inv-pad-x));
  max-width: none;
  padding-inline: var(--inv-pad-x);
  border-radius: 0;
}

.invitacion .gallery__viewport {
  margin-inline: calc(-1 * var(--inv-pad-x));
  padding-inline: var(--inv-pad-x);
}

/* Cierre de invitación: sobre a pantalla completa; un clic abre y activa audio */
.audio-gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.65s var(--ease-out-expo),
    visibility 0.65s step-end;
}

.audio-gate--visible {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.65s var(--ease-out-expo);
}

.audio-gate__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 20%, rgba(255, 253, 249, 0.35), transparent 50%),
    linear-gradient(165deg, #2d3329 0%, #1a1d18 45%, #141210 100%);
  transition: opacity 1.05s var(--ease-out-expo);
}

.audio-gate--opening .audio-gate__backdrop {
  opacity: 0;
}

.audio-gate__stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: min(22rem, 92vw);
  display: flex;
  justify-content: center;
  padding-top: clamp(2rem, 10vh, 4rem);
}

/* Perspectiva para la solapa del sobre (bisagra real) */
.audio-gate__persp {
  width: 100%;
  -webkit-perspective: 1100px;
  perspective: 1100px;
  perspective-origin: 50% 0%;
}

.audio-gate__sobre {
  position: relative;
  width: 100%;
  cursor: pointer;
  transform-style: preserve-3d;
  filter: drop-shadow(0 28px 50px rgba(0, 0, 0, 0.38));
  transition:
    opacity 0.85s ease 0.8s,
    transform 1.35s cubic-bezier(0.18, 0.92, 0.22, 1) 0.48s,
    filter 0.8s ease 0.65s;
}

.audio-gate--opening .audio-gate__sobre {
  pointer-events: none;
  opacity: 0;
  transform: translateY(-14vh) scale(0.94);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.08));
}

/* Cuerpo del sobre: papel + punta inferior clásica */
.audio-gate__cuerpo {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 7vw, 2.75rem) clamp(1.35rem, 5vw, 1.85rem) clamp(2.25rem, 7vw, 2.85rem);
  text-align: center;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.55) 0%, transparent 42%),
    linear-gradient(180deg, #fdfaf5 0%, #efe8de 55%, #e5ddd2 100%);
  border: 1px solid rgba(120, 95, 58, 0.42);
  border-radius: 3px 3px 2px 2px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 -1px 0 rgba(138, 110, 66, 0.12) inset;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.65rem), 50% 100%, 0 calc(100% - 1.65rem));
}

.audio-gate__cuerpo::before,
.audio-gate__cuerpo::after {
  content: "";
  position: absolute;
  top: 0.55rem;
  width: 0;
  height: 0;
  border-style: solid;
  opacity: 0.22;
  pointer-events: none;
}

.audio-gate__cuerpo::before {
  left: 0.35rem;
  border-width: 0 0.55rem 1.35rem 0;
  border-color: transparent rgba(138, 110, 66, 0.35) transparent transparent;
}

.audio-gate__cuerpo::after {
  right: 0.35rem;
  border-width: 0 0 1.35rem 0.55rem;
  border-color: transparent transparent transparent rgba(138, 110, 66, 0.35);
}

.audio-gate__interior {
  position: relative;
  z-index: 1;
  padding: 0.35rem 0.25rem 0;
  border: 1px dashed rgba(184, 149, 108, 0.35);
  border-radius: 6px;
  background: rgba(255, 253, 249, 0.35);
}

/* Solapa superior triangular, bisagra en el borde superior del sobre */
.audio-gate__solapa {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 0;
  height: min(52%, 11.5rem);
  min-height: 7.5rem;
  transform-origin: 50% 0;
  -webkit-transform: rotateX(8deg) translateZ(0.5px);
  transform: rotateX(8deg) translateZ(0.5px);
  transform-style: preserve-3d;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background:
    linear-gradient(168deg, #fffefb 0%, #ebe4da 48%, #ddd2c6 100%);
  border: 1px solid rgba(120, 95, 58, 0.4);
  border-bottom: none;
  box-shadow:
    0 3px 0 rgba(255, 255, 255, 0.65) inset,
    0 14px 28px rgba(44, 42, 40, 0.18);
  transition: transform 1.5s cubic-bezier(0.18, 0.92, 0.22, 1), box-shadow 0.75s ease;
}

.audio-gate__solapa-doblez {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 72%;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(138, 110, 66, 0.35) 20%,
    rgba(138, 110, 66, 0.35) 80%,
    transparent
  );
  opacity: 0.85;
}

.audio-gate--opening .audio-gate__solapa {
  -webkit-transform: rotateX(-178deg) translateZ(0);
  transform: rotateX(-178deg) translateZ(0);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 6px 16px rgba(44, 42, 40, 0.08);
}

.audio-gate__kicker {
  margin: 0 0 0.35rem;
  font-family: var(--font-ticket);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--color-olive);
  opacity: 0.88;
}

.audio-gate__nombre {
  margin: 0 0 0.5rem;
  font-family: var(--font-script);
  font-size: clamp(2.35rem, 10vw, 3.1rem);
  line-height: 1.05;
  color: var(--color-rose-deep);
  text-shadow: 0 2px 18px rgba(196, 122, 134, 0.25);
}

.audio-gate__hint {
  margin: 0 0 1.35rem;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--color-muted);
}

.audio-gate__abrir {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin: 0 auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.audio-gate__sello {
  position: relative;
  display: grid;
  place-items: center;
  width: 5.65rem;
  height: 5.1rem;
  margin: 0.35rem auto 0.15rem;
}

.audio-gate__sello::before {
  content: "";
  position: absolute;
  inset: -5px -3px -7px -3px;
  border-radius: 55% 45% 48% 52% / 50% 48% 52% 50%;
  border: 1px solid rgba(184, 149, 108, 0.28);
  opacity: 0.75;
  pointer-events: none;
}

.audio-gate__sello-cera {
  position: absolute;
  width: 90%;
  height: 86%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-4deg);
  border-radius: 52% 48% 43% 57% / 45% 40% 60% 55%;
  background:
    radial-gradient(ellipse 90% 78% at 30% 18%, rgba(255, 252, 253, 0.5), transparent 52%),
    radial-gradient(ellipse 55% 40% at 78% 82%, rgba(40, 12, 22, 0.2), transparent 55%),
    linear-gradient(
      148deg,
      #e4b8c4 0%,
      #c47a86 22%,
      #9a4a5c 55%,
      #6b2f3f 88%
    );
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.55) inset,
    0 -8px 18px rgba(55, 18, 30, 0.42) inset,
    3px 4px 0 rgba(255, 255, 255, 0.1) inset,
    0 12px 26px rgba(45, 20, 28, 0.32),
    0 2px 0 rgba(0, 0, 0, 0.07);
  transition:
    transform 0.5s var(--ease-spring),
    box-shadow 0.5s ease,
    filter 0.5s ease;
}

.audio-gate__sello-inicial {
  position: relative;
  z-index: 1;
  font-family: var(--font-script);
  font-size: clamp(2.15rem, 7vw, 2.55rem);
  font-weight: 400;
  line-height: 0.85;
  color: rgba(32, 14, 20, 0.5);
  transform: translateY(-0.04em) rotate(-3deg);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 6px rgba(50, 15, 25, 0.22);
  pointer-events: none;
}

.audio-gate__abrir-texto {
  font-family: var(--font-ticket);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-olive);
}

.audio-gate__abrir:hover .audio-gate__sello-cera {
  transform: translate(-50%, -50%) rotate(-2deg) scale(1.04);
  filter: brightness(1.06);
  box-shadow:
    0 1px 2px rgba(255, 255, 255, 0.6) inset,
    0 -8px 18px rgba(55, 18, 30, 0.38) inset,
    3px 4px 0 rgba(255, 255, 255, 0.14) inset,
    0 16px 32px rgba(45, 20, 28, 0.28),
    0 2px 0 rgba(0, 0, 0, 0.06);
}

/* ---------- HERO ----------
 * Fondo de pantalla completa: images/6.jpeg → #foto-hero (CONFIG.FOTOS.HERO).
 * Velos en .hero__veil (degradado oscuro arriba para leer el texto).
 */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-safe) + var(--space-xl)) var(--space-md)
    calc(var(--space-xl) + var(--footer-safe));
  overflow: hidden;
}

.invitacion .hero {
  min-height: min(64svh, 520px);
  padding: calc(var(--header-safe) + var(--space-lg)) var(--inv-pad-x) var(--space-lg);
}

/* Capa de foto + velos: foto 6 como fondo principal del hero */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--color-ivory);
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  max-width: none;
  object-fit: cover;
  object-position: center 28%;
  transform: scale(1.04);
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__photo {
    animation: heroPhotoDrift 32s ease-in-out infinite alternate;
  }
}

@keyframes heroPhotoDrift {
  0% {
    transform: scale(1.05) translate3d(-1.2%, -0.6%, 0);
  }
  100% {
    transform: scale(1.1) translate3d(1%, 0.8%, 0);
  }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* Capas oscuras + degradado: legibilidad del texto sobre la foto */
  background:
    linear-gradient(
      185deg,
      rgba(10, 9, 8, 0.72) 0%,
      rgba(22, 20, 18, 0.38) 38%,
      rgba(250, 246, 240, 0.42) 72%,
      rgba(250, 246, 240, 0.94) 100%
    ),
    radial-gradient(ellipse 95% 60% at 50% 10%, rgba(0, 0, 0, 0.42), transparent 55%);
}

.hero__pattern {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.35' stroke-width='0.5'%3E%3Cpath d='M60 10c8 12 8 28 0 40-8-12-8-28 0-40z'/%3E%3Cpath d='M20 60c12-8 28-8 40 0-12 8-28 8-40 0z'/%3E%3Cpath d='M60 70c8 12 8 28 0 40'/%3E%3Cpath d='M70 60c12 8 28 8 40 0'/%3E%3C/g%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hero__frame {
  position: absolute;
  inset: var(--space-md);
  z-index: 1;
  border: double 3px rgba(212, 184, 150, 0.55);
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 253, 249, 0.35),
    0 0 50px rgba(0, 0, 0, 0.12);
}

.hero__frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: var(--border-gold);
  border-radius: calc(var(--radius-lg) - 6px);
  opacity: 0.7;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 26rem;
  margin: 0 auto;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__enter {
    opacity: 0;
    transform: translate3d(0, 1.5rem, 0) scale(0.92);
    filter: blur(8px);
    animation: heroItemIn 1.15s var(--ease-out-expo) both;
  }

  .hero__enter--1 {
    animation-delay: 0.08s;
  }

  .hero__enter--2 {
    animation-delay: 0.26s;
  }

  .hero__enter--3 {
    animation-delay: 0.44s;
  }

  .hero__enter--4 {
    animation-delay: 0.62s;
  }
}

@keyframes heroItemIn {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

.hero__kicker {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(255, 250, 245, 0.94);
  font-weight: 600;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.hero__name {
  margin: 0 0 var(--space-md);
  font-family: var(--font-script);
  font-size: clamp(3.25rem, 12vw, 4.75rem);
  font-weight: 400;
  line-height: 1.05;
  color: #fff5f7;
  text-shadow:
    0 2px 3px rgba(0, 0, 0, 0.35),
    0 12px 42px rgba(0, 0, 0, 0.38);
}

.hero__tagline {
  margin: 0 auto var(--space-lg);
  max-width: 24ch;
  font-size: 1.2rem;
  font-style: italic;
  color: rgba(255, 253, 249, 0.94);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.45);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  align-items: stretch;
}

@media (min-width: 480px) {
  .hero__actions {
    max-width: 20rem;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.35rem;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  border: var(--border-gold);
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--color-gold-shine), var(--color-gold));
  color: #2a2618;
  border-color: rgba(138, 110, 66, 0.45);
  box-shadow: var(--shadow-soft);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(184, 149, 108, 0.35);
}

.btn:active {
  transform: scale(0.98);
}

.btn--ghost {
  background: rgba(255, 253, 249, 0.75);
  color: var(--color-olive);
  backdrop-filter: blur(4px);
}

.btn--ghost:hover {
  background: var(--surface-card);
  transform: translateY(-1px);
}

/* Botones secundarios sobre la foto del hero (mejor contraste) */
.hero .btn--ghost {
  background: rgba(255, 253, 249, 0.14);
  color: #fffdf9;
  border-color: rgba(255, 253, 249, 0.42);
  backdrop-filter: blur(12px);
}

.hero .btn--ghost:hover {
  background: rgba(255, 253, 249, 0.26);
  color: #fffdf9;
}

.hero .btn--primary {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.22),
    var(--shadow-soft);
}

.btn--outline {
  background: transparent;
  color: var(--color-olive);
}

.btn--outline:hover {
  background: rgba(74, 92, 69, 0.06);
}

.btn--block {
  width: 100%;
}

button.btn {
  border-style: solid;
}

/* ---------- Secciones ---------- */
.section {
  padding: var(--space-xl) var(--space-md);
}

.section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section__inner--wide {
  max-width: var(--max-width-wide);
}

/* ---------- Retrato destacado ----------
 * Imagen editorial: images/1.jpeg → #foto-retrato (CONFIG.FOTOS.RETRATO).
 */
.section--portrait {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-md);
}

.portrait__title {
  margin: 0 0 var(--space-lg);
  font-family: var(--font-serif);
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 600;
  text-align: center;
  color: var(--color-olive);
  letter-spacing: 0.02em;
}

.portrait__figure {
  margin: 0 auto;
  max-width: min(100%, 22rem);
}

@media (min-width: 700px) {
  .portrait__figure {
    max-width: min(100%, 26rem);
  }
}

.portrait__frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: double 3px rgba(184, 149, 108, 0.55);
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px rgba(255, 253, 249, 0.5) inset;
  background: var(--color-ivory);
}

.portrait__frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: calc(var(--radius-lg) - 8px);
  border: 1px solid rgba(255, 253, 249, 0.35);
  pointer-events: none;
  z-index: 1;
}

.portrait__img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
  display: block;
  transform: scale(1.04);
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.section--portrait.reveal.is-visible .portrait__img {
  transform: scale(1);
}

.portrait__frame:hover .portrait__img,
.portrait__frame:focus-within .portrait__img {
  transform: scale(1.03);
}

.portrait__caption {
  margin: var(--space-md) 0 0;
  text-align: center;
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--color-muted);
  max-width: 32ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Galería ----------
 * Las 7 fotos: images/1.jpeg … images/7.jpeg
 * - Hero y retrato: #foto-hero, #foto-retrato + CONFIG.FOTOS.
 * - Galería: 2, 3, 4, 5 y 7 (mosaico / carrusel).
 * - Animación al scroll: clase .gallery__cell--inview (la añade script.js → initGaleriaObserver).
 * - Bordes redondeados, marco dorado y object-fit en .gallery__img.
 */
.section--gallery {
  padding-top: var(--space-md);
  position: relative;
  background:
    radial-gradient(ellipse 75% 45% at 85% 15%, rgba(232, 196, 200, 0.22), transparent 52%),
    radial-gradient(ellipse 55% 40% at 12% 88%, rgba(109, 127, 104, 0.14), transparent 50%);
}

.gallery__intro {
  margin: 0 auto var(--space-lg);
  max-width: 38ch;
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 3.8vw, 1.55rem);
  font-weight: 600;
  font-style: italic;
  color: var(--color-olive);
}

/* Carrusel horizontal (móvil / pantallas estrechas) */
.gallery__viewport {
  margin-inline: calc(-1 * var(--space-md));
  padding-inline: var(--space-md);
  outline: none;
}

@media (max-width: 767px) {
  .gallery__viewport {
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--space-md);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: var(--space-sm);
    mask-image: linear-gradient(90deg, transparent 0%, #000 4%, #000 96%, transparent 100%);
  }

  .gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--space-md);
    width: max-content;
    padding-inline: var(--space-xs) var(--space-md);
    min-height: min(72vw, 420px);
  }

  .gallery__cell {
    flex: 0 0 min(88vw, 420px);
    width: min(88vw, 420px);
    min-height: min(72vw, 420px);
    max-height: 78vh;
    scroll-snap-align: center;
    border-radius: var(--radius-lg);
  }

  .gallery__img {
    min-height: min(72vw, 420px);
    height: 100%;
  }
}

@media (min-width: 768px) {
  .gallery__viewport {
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
    mask-image: none;
  }

  .gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(100px, 11vw);
    gap: var(--space-md);
    width: 100%;
    max-width: 100%;
    min-height: 0;
  }

  /* Mosaico: piezas de distinto tamaño (tablet y escritorio) */
  .gallery__cell:nth-child(1) {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
  }

  .gallery__cell:nth-child(2) {
    grid-column: 8 / 13;
    grid-row: 1 / 2;
  }

  .gallery__cell:nth-child(3) {
    grid-column: 8 / 13;
    grid-row: 2 / 3;
  }

  .gallery__cell:nth-child(4) {
    grid-column: 1 / 5;
    grid-row: 3 / 5;
  }

  .gallery__cell:nth-child(5) {
    grid-column: 5 / 13;
    grid-row: 3 / 5;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .gallery {
    grid-auto-rows: minmax(90px, 14vw);
    gap: var(--space-sm);
  }
}

.gallery__cell {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(184, 149, 108, 0.55);
  box-shadow:
    0 4px 0 rgba(212, 184, 150, 0.25) inset,
    var(--shadow-card);
  opacity: 0;
  transform: translate3d(0, 1.75rem, 0) scale(0.94) rotate(-0.4deg);
  transition:
    opacity 0.85s var(--ease-out-expo),
    transform 0.85s var(--ease-spring),
    box-shadow 0.5s var(--ease-out-expo);
}

.gallery__cell--inview {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
}

.gallery__cell:focus-visible {
  outline: 2px solid var(--color-gold-dark);
  outline-offset: 3px;
  z-index: 2;
}

.gallery__shine {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.26) 0%,
    transparent 40%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.55s ease;
}

.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (min-width: 768px) {
  .gallery__img {
    min-height: 0;
  }
}

/* Hover elegante: principalmente en puntero fino (escritorio) */
@media (hover: hover) and (pointer: fine) {
  .gallery__cell:hover {
    box-shadow:
      0 22px 50px rgba(74, 92, 69, 0.12),
      0 4px 0 rgba(212, 184, 150, 0.3) inset;
    transform: translate3d(0, -3px, 0) scale(1);
  }

  .gallery__cell--inview:hover {
    transform: translate3d(0, -3px, 0) scale(1);
  }

  .gallery__cell:hover .gallery__shine {
    opacity: 1;
  }

  .gallery__cell:hover .gallery__img {
    transform: scale(1.05);
  }
}

.gallery__cell:focus-within:not(:hover) .gallery__shine {
  opacity: 0.85;
}

.gallery__cell:focus-within .gallery__img {
  transform: scale(1.03);
}

.section__title {
  margin: 0 0 var(--space-md);
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  font-weight: 600;
  color: var(--color-olive);
  text-align: center;
  letter-spacing: 0.02em;
}

.section__title--light {
  color: var(--color-cream);
}

.section--intro {
  padding-top: var(--space-lg);
}

.section--date {
  padding-top: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.section--countdown {
  background: linear-gradient(
    160deg,
    var(--color-olive) 0%,
    #3d4a39 45%,
    var(--color-olive-light) 100%
  );
  color: var(--color-cream);
  box-shadow: inset 0 1px 0 rgba(212, 184, 150, 0.25);
}

/* Tarjetas */
.card {
  position: relative;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: var(--border-gold);
  background: var(--surface-card-tint);
  box-shadow: var(--shadow-card);
}

.card--soft::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: calc(var(--radius-lg) - 4px);
  border: 1px solid rgba(184, 149, 108, 0.2);
  pointer-events: none;
}

.ornament {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-gold) 20%,
    var(--color-gold) 80%,
    transparent
  );
  margin: var(--space-md) auto;
  max-width: 12rem;
  opacity: 0.7;
  transform-origin: center;
}

.lead {
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
  color: var(--color-muted);
}

.lead strong {
  color: var(--color-rose-deep);
  font-weight: 600;
}

/* Fecha */
.date-banner {
  text-align: center;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: double 3px rgba(184, 149, 108, 0.4);
  background: linear-gradient(180deg, #fffdf9, #f7f0e8);
  box-shadow: var(--shadow-card);
}

.date-banner__label {
  margin: 0 0 var(--space-xs);
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-olive-light);
  font-weight: 600;
}

.date-banner__value {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 5vw, 2rem);
  font-weight: 700;
  color: var(--color-olive);
}

@media (prefers-reduced-motion: no-preference) {
  .reveal:not(.is-visible) .date-banner {
    opacity: 0;
    transform: scale(0.94) translateY(1rem);
  }

  .reveal.is-visible .date-banner {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition:
      opacity 0.75s var(--ease-out-expo) 0.12s,
      transform 0.8s var(--ease-spring) 0.12s;
  }
}

/* Familia */
.grid-people {
  display: grid;
  gap: var(--space-md);
  perspective: 960px;
}

@media (min-width: 600px) {
  .grid-people {
    grid-template-columns: 1fr 1fr;
  }

  .people-block--wide {
    grid-column: 1 / -1;
  }
}

.people-block {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  border: var(--border-gold);
  background: var(--surface-card);
  text-align: center;
  box-shadow: var(--shadow-card);
  transform-style: preserve-3d;
}

.people-block__role {
  margin: 0 0 var(--space-sm);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  font-weight: 700;
}

.people-block__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.2rem;
  color: var(--color-ink);
}

.people-block__list li + li {
  margin-top: 0.35rem;
}

.people-block__list--cols {
  display: grid;
  gap: 0.35rem;
}

@media (min-width: 480px) {
  .people-block__list--cols {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }
}

.people-block__single {
  margin: 0;
  font-size: 1.25rem;
}

/* Event cards */
.event-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: var(--border-gold);
  background: linear-gradient(145deg, #fffdf9, #f5ebe3);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.event-card--alt {
  background: linear-gradient(145deg, #faf3f4, #f0ebe4);
}

.event-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.event-card__icon {
  color: var(--color-gold);
  font-size: 1rem;
  letter-spacing: 0.2em;
}

.event-card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-olive);
}

.event-card__place {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink);
}

.event-card__address {
  margin: 0 0 var(--space-md);
  font-style: normal;
  font-size: 1.05rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.event-card__time {
  margin: 0 0 var(--space-md);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-rose-deep);
}

.event-card .btn {
  min-width: 12rem;
}

/* Indicaciones */
.info-card {
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(184, 149, 108, 0.55);
  background:
    linear-gradient(rgba(255, 253, 249, 0.97), rgba(255, 253, 249, 0.97)),
    linear-gradient(135deg, rgba(232, 196, 200, 0.35), rgba(109, 127, 104, 0.15));
  box-shadow: var(--shadow-soft);
}

.info-card__title {
  margin: 0 0 var(--space-md);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  color: var(--color-olive);
}

.info-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-sm);
}

.info-card__list li {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius);
  border: 1px solid rgba(184, 149, 108, 0.25);
  background: rgba(255, 255, 255, 0.65);
  font-size: 1.1rem;
}

.info-card__accent {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

/* Countdown */
.countdown {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  max-width: 28rem;
  margin: 0 auto;
}

@media (min-width: 520px) {
  .countdown {
    grid-template-columns: repeat(4, 1fr);
  }
}

.countdown__unit {
  text-align: center;
  padding: var(--space-md);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(212, 184, 150, 0.25);
}

.countdown__value {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-gold-shine);
}

.countdown__label {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.9;
}

/* ---------- Microanimaciones al mostrar secciones (prefers-reduced-motion las omite vía reglas globales) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal:not(.is-visible) .ornament {
    opacity: 0;
    transform: scaleX(0.15);
  }

  .reveal.is-visible .ornament {
    opacity: 0.75;
    transform: scaleX(1);
    transition:
      opacity 0.75s var(--ease-out-expo),
      transform 0.95s var(--ease-out-expo);
  }

  .reveal.is-visible .ornament--top {
    transition-delay: 0.15s;
  }

  .reveal.is-visible .ornament--bottom {
    transition-delay: 0.32s;
  }

  .reveal:not(.is-visible) .grid-people .people-block {
    opacity: 0;
    transform: translate3d(0, 1.75rem, 0) rotateX(6deg);
  }

  .reveal.is-visible .grid-people .people-block {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0);
    transition:
      opacity 0.7s var(--ease-out-expo),
      transform 0.75s var(--ease-spring);
  }

  .reveal.is-visible .grid-people .people-block:nth-child(1) {
    transition-delay: 0.08s;
  }

  .reveal.is-visible .grid-people .people-block:nth-child(2) {
    transition-delay: 0.18s;
  }

  .reveal.is-visible .grid-people .people-block:nth-child(3) {
    transition-delay: 0.28s;
  }

  .reveal:not(.is-visible) .event-card {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.96);
  }

  .reveal.is-visible .event-card {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
      opacity 0.75s var(--ease-out-expo),
      transform 0.85s var(--ease-spring);
  }

  .reveal:not(.is-visible) .info-card__list li {
    opacity: 0;
    transform: translateX(-0.75rem);
  }

  .reveal.is-visible .info-card__list li {
    opacity: 1;
    transform: translateX(0);
    transition:
      opacity 0.55s var(--ease-out-expo),
      transform 0.55s var(--ease-out-expo);
  }

  .reveal.is-visible .info-card__list li:nth-child(1) {
    transition-delay: 0.06s;
  }

  .reveal.is-visible .info-card__list li:nth-child(2) {
    transition-delay: 0.12s;
  }

  .reveal.is-visible .info-card__list li:nth-child(3) {
    transition-delay: 0.18s;
  }

  .reveal.is-visible .info-card__list li:nth-child(4) {
    transition-delay: 0.24s;
  }

  .reveal:not(.is-visible) .countdown__unit {
    opacity: 0;
    transform: translateY(1rem) scale(0.9);
  }

  .reveal.is-visible .countdown__unit {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
      opacity 0.6s var(--ease-out-expo),
      transform 0.65s var(--ease-spring);
  }

  .reveal.is-visible .countdown__unit:nth-child(1) {
    transition-delay: 0.05s;
  }

  .reveal.is-visible .countdown__unit:nth-child(2) {
    transition-delay: 0.12s;
  }

  .reveal.is-visible .countdown__unit:nth-child(3) {
    transition-delay: 0.19s;
  }

  .reveal.is-visible .countdown__unit:nth-child(4) {
    transition-delay: 0.26s;
  }

  .section--portrait.reveal.is-visible .portrait__figure {
    animation: portraitFloatIn 1.1s var(--ease-out-expo) both;
  }

  .section--portrait.reveal.is-visible .portrait__title {
    animation: fadeRise 0.8s var(--ease-out-expo) 0.05s both;
  }
}

@keyframes portraitFloatIn {
  from {
    opacity: 0;
    transform: translate3d(0, 2rem, 0) scale(0.94);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes fadeRise {
  from {
    opacity: 0;
    transform: translate3d(0, 0.75rem, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .section--portrait.reveal.is-visible .portrait__frame {
    animation: portraitGlow 4.5s ease-in-out infinite alternate;
  }
}

@keyframes portraitGlow {
  from {
    box-shadow:
      var(--shadow-soft),
      0 0 0 1px rgba(255, 253, 249, 0.5) inset;
  }
  to {
    box-shadow:
      0 24px 56px rgba(196, 122, 134, 0.12),
      0 0 0 1px rgba(255, 253, 249, 0.55) inset;
  }
}

/* Footer */
.footer {
  text-align: center;
  padding: var(--space-xl) var(--space-md) calc(var(--space-xl) + var(--footer-safe));
  background: var(--color-ivory);
  border-top: var(--border-gold);
}

.footer__ornament {
  width: 3rem;
  height: 3px;
  margin: 0 auto var(--space-md);
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  border-radius: 2px;
}

.footer__text {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-olive);
}

.footer__sub {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-muted);
}

/* Animación al scroll: secciones + retardo escalonado (--reveal-order lo asigna script.js) */
.reveal {
  opacity: 0;
  transform: translate3d(0, 40px, 0) scale(0.97);
  filter: blur(10px);
  transition:
    opacity 0.95s var(--ease-out-expo),
    transform 0.95s var(--ease-out-expo),
    filter 0.75s var(--ease-out-expo);
  transition-delay: calc(var(--reveal-order, 0) * 0.05s);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  filter: blur(0);
}

/* ---------- Reproductor de música (botón fijo; audio en music/) ---------- */
.music-player {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 320;
}

.music-player__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.55rem 0.65rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-olive);
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(184, 149, 108, 0.65);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.music-player__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.music-player__btn--playing {
  background: linear-gradient(135deg, rgba(232, 196, 200, 0.35), rgba(255, 253, 249, 0.95));
  border-color: var(--color-gold);
}

.music-player__glyph {
  font-size: 1.15rem;
  line-height: 1;
  color: var(--color-gold-dark);
}

.music-player__btn--playing .music-player__glyph {
  animation: musicPulse 1.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .music-player__btn--playing .music-player__glyph {
    animation: none;
  }
}

@keyframes musicPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(0.92);
  }
}
