/* ============================================================
   Invitación Digital · Carolina & Ismael
   Diseño Cinematográfico Continuo (Estilo Video)
   Dusty Blue, Warm Ivory, Relieve 3D & Movimiento Orgánico
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Italiana&family=Pinyon+Script&display=swap');

/* ---------- Tokens ---------- */
:root {
  --ivory: #FAF7F2;
  --parchment: #F1EAE0;
  --slate: #4A607A;
  --slate-deep: #324354;
  --ice: #A8B9C9;
  --mist: #D7E1EA;
  --gold: #B6986F;
  --gold-soft: #D5C19E;
  --text: #3E5164;
  --text-soft: #6E7E8F;
  --script: "Pinyon Script", cursive;
  --display: "Italiana", "Cinzel", "Cormorant Garamond", serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --wrap: 480px; /* Basado en la invitación madre */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: 8000ms;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

body {
  background: #1C2733;
  color: var(--text);
  font-family: var(--serif);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Fondo ambiente cinematográfico */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(90, 120, 150, 0.28) 0%, rgba(15, 22, 30, 0.92) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Partículas sutiles de fondo (polvo de luz) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: .35;
  z-index: 0;
}

/* ---------- Marco Principal (Relación de aspecto: Invitación Madre) ---------- */
.stage {
  position: relative;
  width: min(100%, var(--wrap));
  height: min(94dvh, 850px);
  max-width: var(--wrap);
  border-radius: 36px;
  overflow: hidden;
  background: var(--ivory);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .15);
  isolation: isolate;
  z-index: 1;
}

@media (max-width: 640px) {
  body {
    padding: 0;
    background: var(--ivory);
  }
  .stage {
    width: 100%;
    height: 100dvh;
    max-height: none;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ---------- Fondo de Papel Acuarela Real con Movimiento Cinematográfico ---------- */
.paper {
  position: absolute;
  inset: -15px;
  z-index: 1;
  background-image: url('assets/img/paper_bg.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  transition: opacity .9s var(--ease);
  animation: paper-drift 24s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes paper-drift {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.025) translateY(-8px); }
}

.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
}

/* Fondo azul texturizado para la pantalla de cierre */
.paper-blue {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url('assets/img/blue_bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s var(--ease);
}
.stage.on-blue .paper-blue {
  opacity: 1;
}

/* ---------- Zonas Táctiles Invisibles ---------- */
.tap-zone {
  position: absolute;
  top: 56px;
  bottom: 0;
  width: 32%;
  z-index: 22;
  cursor: pointer;
}
.tap-zone.prev { left: 0; }
.tap-zone.next { right: 0; }

/* ---------- Controles Flotantes Superiores (No tapan textos ni botones) ---------- */
.controls-bar {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 14px));
  right: 14px;
  left: auto;
  bottom: auto;
  z-index: 38;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  opacity: 0.92;
  transition: opacity .4s ease, transform .3s ease;
  pointer-events: none;
}
.controls-bar:hover {
  opacity: 1;
}
.stage.on-envelope .controls-bar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}
.controls-bar button {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(74, 96, 122, .32);
  background: rgba(250, 247, 242, .85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--slate);
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 4px 14px rgba(40, 55, 70, .14);
  transition: transform .2s, background .2s;
  cursor: pointer;
}
.controls-bar button:hover {
  background: rgba(215, 225, 234, .95);
  transform: scale(1.08);
}
.controls-bar button:active {
  transform: scale(.92);
}
.controls-bar svg {
  width: 15px;
  height: 15px;
}
.controls-bar .ico-pause, .controls-bar .ico-unmute {
  display: none;
}
.stage:not(.paused) .controls-bar .ico-play {
  display: none;
}
.stage:not(.paused) .controls-bar .ico-pause {
  display: block;
}
.stage.muted .controls-bar .ico-mute {
  display: none;
}
.stage.muted .controls-bar .ico-unmute {
  display: block;
}
.stage.on-blue .controls-bar button {
  background: rgba(255, 255, 255, .25);
  border-color: rgba(255, 255, 255, .45);
  color: #FFFFFF;
}

/* ============================================================
   1 · SOBRE EN RELIEVE BOTÁNICO 3D (Pantalla 0)
   ============================================================ */
.envelope {
  position: absolute;
  inset: 0;
  z-index: 25;
  cursor: pointer;
  perspective: 1200px;
}
.stage:not(.on-envelope) .envelope {
  pointer-events: none;
}

.flap {
  position: absolute;
  inset: 0;
  background-image: url('assets/img/envelope_closed.jpg');
  background-size: cover;
  background-position: center;
  transition: transform 1.7s var(--ease), opacity 1.2s ease .4s;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.flap.top {
  clip-path: polygon(0 0, 100% 0, 50% 51.5%);
  z-index: 2;
  transform-origin: top center;
}
.flap.bottom {
  clip-path: polygon(0 100%, 100% 100%, 50% 48.5%);
  z-index: 1;
  transform-origin: bottom center;
}
.flap.left {
  clip-path: polygon(0 0, 51.5% 50%, 0 100%);
  z-index: 4;
  transform-origin: left center;
}
.flap.right {
  clip-path: polygon(100% 0, 48.5% 50%, 100% 100%);
  z-index: 3;
  transform-origin: right center;
}

.flap.left::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, transparent 46%, rgba(0, 0, 0, .14) 50%, transparent 54%);
  pointer-events: none;
}

.envelope.open .flap.top {
  transform: translateY(-110%) rotateX(55deg);
  opacity: 0;
}
.envelope.open .flap.bottom {
  transform: translateY(110%) rotateX(-55deg);
  opacity: 0;
}
.envelope.open .flap.left {
  transform: translateX(-110%) rotateY(-55deg);
  opacity: 0;
}
.envelope.open .flap.right {
  transform: translateX(110%) rotateY(55deg);
  opacity: 0;
}

/* ============================================================
   TARJETA / PLACA DE INVITADO EN PAPEL VERJURADO (SOBRE)
   ============================================================ */
.env-plaque {
  position: absolute;
  top: clamp(80px, 15vh, 130px);
  left: 0;
  right: 0;
  margin: 0 auto;
  width: min(84%, 320px);
  max-width: 320px;
  z-index: 30;
  cursor: pointer;
  background: var(--ivory);
  background-image: url('assets/img/paper_bg.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 
    0 16px 36px rgba(18, 28, 42, .48),
    0 4px 10px rgba(0, 0, 0, .24),
    inset 0 0 0 1px rgba(255, 255, 255, .9);
  transition: transform .6s var(--ease), opacity .5s ease;
  will-change: transform, opacity;
  text-align: center;
}
.env-plaque:active {
  transform: scale(.98);
}

.plaque-inner {
  border: 1px solid rgba(74, 96, 122, .38);
  outline: 1px solid rgba(182, 152, 111, .55);
  outline-offset: -5px;
  border-radius: 6px;
  padding: 12px 16px 10px;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.plaque-sub {
  display: block;
  font-family: var(--serif);
  font-size: clamp(.68rem, 2.4vw, .78rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--slate);
  opacity: .85;
  margin-bottom: 3px;
}

.plaque-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.4vw, 1.48rem);
  font-weight: 600;
  color: #263544;
  letter-spacing: .06em;
  line-height: 1.25;
  text-shadow: 0 1px 1px rgba(255, 255, 255, .8);
}

.plaque-passes {
  display: inline-block;
  margin-top: 5px;
  font-family: var(--serif);
  font-size: clamp(.66rem, 2.2vw, .76rem);
  letter-spacing: .20em;
  text-transform: uppercase;
  color: #927549;
  font-weight: 600;
  border-top: 1px solid rgba(182, 152, 111, .35);
  padding-top: 4px;
}

.envelope.open ~ .env-plaque,
.envelope.open ~ .env-to,
.stage:not(.on-envelope) .env-plaque,
.stage:not(.on-envelope) .env-to,
.env-plaque.hidden,
.env-to.hidden {
  display: none !important;
  opacity: 0 !important;
  transform: translateY(-20px) scale(.92) !important;
  pointer-events: none !important;
}

.env-to {
  position: absolute;
  top: 15%;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 27;
  font-family: var(--serif);
  font-size: clamp(1.02rem, 3.6vw, 1.25rem);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
  text-shadow: 0 2px 8px rgba(20, 30, 40, .6);
  pointer-events: none;
  transition: opacity .6s ease;
}
.env-to b {
  font-weight: 600;
  color: #FFFFFF;
}

.env-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12%;
  z-index: 27;
  text-align: center;
  font-family: var(--serif);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .36em;
  font-size: clamp(.92rem, 3.2vw, 1.15rem);
  color: rgba(255, 255, 255, .94);
  text-shadow: 0 2px 10px rgba(20, 30, 40, .7);
  animation: breathe 2.4s ease-in-out infinite;
  pointer-events: none;
  transition: opacity .4s ease;
}
.envelope.open ~ .env-hint,
.envelope.open ~ .env-to,
.stage:not(.on-envelope) .env-hint,
.stage:not(.on-envelope) .env-to,
.env-hint.hidden {
  display: none !important;
  opacity: 0 !important;
  animation: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@keyframes breathe {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

/* ============================================================
   MARIPOSA VIVA Y DINÁMICA (Aleteo 3D Realista)
   ============================================================ */
.butterfly {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 148px;
  margin: -74px 0 0 -110px;
  z-index: 15;
  pointer-events: none;
  transform: scale(.45);
  opacity: 0;
  transition: transform 1.6s var(--ease), top 1.5s var(--ease), opacity .9s ease;
  will-change: transform, top, opacity;
}

/* Contenedor 3D de alas y cuerpo con sombra suave dinámica */
.bf-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 750px;
  transform-style: preserve-3d;
  filter: drop-shadow(14px 18px 12px rgba(50, 40, 30, 0.32));
  will-change: transform, filter;
}

.bf-wing {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.bf-wing img, .bf-body img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Aleteo asimétrico y vivo de las alas izquierda y derecha */
.bf-wing-l {
  transform-origin: 50% 50%;
  animation: flap-wing-l 1.8s ease-in-out infinite;
}
.bf-wing-r {
  transform-origin: 50% 50%;
  animation: flap-wing-r 1.8s ease-in-out infinite;
}

.bf-body {
  position: absolute;
  inset: 0;
  z-index: 3;
  animation: bf-hover 1.8s ease-in-out infinite;
}

/* Sombra suave y orgánica sobre el papel que respira al aletear (sin bordes cortados) */
.bf-shadow {
  position: absolute;
  top: 52%;
  left: 18%;
  width: 64%;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(50, 38, 28, 0.26) 0%, rgba(50, 38, 28, 0.08) 50%, transparent 75%);
  filter: blur(8px);
  animation: shadow-pulse 1.8s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

/* Animaciones de aleteo natural (rápido - suave - planeo) */
@keyframes flap-wing-l {
  0%, 100% { transform: rotateY(4deg) rotateZ(0deg); }
  14% { transform: rotateY(52deg) rotateZ(-3deg); }
  26% { transform: rotateY(12deg) rotateZ(-1deg); }
  40% { transform: rotateY(48deg) rotateZ(-2deg); }
  58% { transform: rotateY(6deg) rotateZ(0deg); }
  78% { transform: rotateY(16deg) rotateZ(-1deg); }
}

@keyframes flap-wing-r {
  0%, 100% { transform: rotateY(-4deg) rotateZ(0deg); }
  14% { transform: rotateY(-52deg) rotateZ(3deg); }
  26% { transform: rotateY(-12deg) rotateZ(1deg); }
  40% { transform: rotateY(-48deg) rotateZ(2deg); }
  58% { transform: rotateY(-6deg) rotateZ(0deg); }
  78% { transform: rotateY(-16deg) rotateZ(1deg); }
}

@keyframes bf-hover {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  22% { transform: translateY(-7px) rotate(-1deg); }
  48% { transform: translateY(-3px) rotate(0.6deg); }
  72% { transform: translateY(-6px) rotate(-0.5deg); }
}

@keyframes shadow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.38; }
  14%, 40% { transform: scale(0.65, 0.85); opacity: 0.18; }
  58% { transform: scale(1.08); opacity: 0.46; }
}

/* Posiciones dinámicas de la mariposa */
.stage.bf-in .butterfly {
  opacity: 1;
  transform: scale(1);
}
.stage.bf-top .butterfly {
  top: 19%;
  transform: scale(1);
}
.stage.bf-out .butterfly {
  opacity: 0;
  transform: scale(1.15) translateY(-25px);
  transition-duration: 0.9s;
}

/* ============================================================
   PANTALLAS / ESCENAS CINEMATOGRÁFICAS
   ============================================================ */
.screen {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 6% 22px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s var(--ease);
}
.screen.show {
  opacity: 1;
  pointer-events: auto;
}
.screen.leaving {
  opacity: 0;
  transition-duration: .5s;
}
.screen.screen-blue {
  color: #FFFFFF;
}

/* ============================================================
   TIPOGRAFÍA Y ANIMACIÓN DE LETRAS
   ============================================================ */
.w {
  display: inline-block;
  white-space: pre-wrap;
}
.w .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .65s var(--ease), transform .65s var(--ease);
}
.show .w .ch {
  opacity: 1;
  transform: none;
}

.fade {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .95s var(--ease), transform .95s var(--ease);
}
.show .fade {
  opacity: 1;
  transform: none;
}

/* Tipografía perfeccionada */
.caps {
  font-family: var(--serif);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .34em;
  font-size: clamp(1.0rem, 3.8vw, 1.25rem);
  color: var(--slate);
}
.caps.soft {
  color: var(--text-soft);
  letter-spacing: .36em;
  font-size: clamp(1.15rem, 4.4vw, 1.55rem);
}
.caps.small {
  font-size: clamp(.82rem, 3vw, .98rem);
  letter-spacing: .26em;
}

/* Título CORDIALMENTE: una sola línea, tipografía de alta costura */
.display-cordialmente {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--slate);
  font-size: clamp(1.42rem, 6.1vw, 2.2rem) !important;
  white-space: nowrap !important;
  margin: 4px 0;
  line-height: 1.1;
  font-weight: 500;
}

.display-title {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--slate);
  line-height: 1.05;
}

.script-title {
  font-family: var(--script);
  color: var(--slate);
  line-height: 1;
  font-weight: normal;
}

/* Separadores ornamentales con glifo */
.ornament-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 150px;
  margin: 6px auto;
}
.ornament-rule::before,
.ornament-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--slate) 50%, transparent);
  opacity: .5;
}
.ornament-rule i {
  font-style: normal;
  font-size: .78rem;
  color: var(--slate);
  opacity: .8;
}

/* ---------- Pantalla 1 · Portada ---------- */
.s-cover {
  justify-content: center;
  gap: 18px;
  padding-top: 36%;
}

/* ---------- Pantalla 2 · Novios ---------- */
.s-names {
  justify-content: center;
  padding-top: 36%;
  gap: 20px;
}
.s-names .caps {
  line-height: 1.9;
  font-size: clamp(1.15rem, 4.2vw, 1.5rem);
  letter-spacing: .32em;
}
.names-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 165px;
  margin: 0 auto;
}
.names-wrap .n1,
.names-wrap .n2 {
  position: absolute;
  font-family: var(--script);
  color: var(--slate);
  white-space: nowrap;
}
.names-wrap .n1 {
  left: 5%;
  top: 0;
  font-size: clamp(2.5rem, 10.5vw, 3.5rem);
}
.names-wrap .n2 {
  right: 12%;
  top: 72px;
  font-size: clamp(2.5rem, 10.5vw, 3.5rem);
}
.names-wrap .amp {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translate(-50%, -50%);
  font-family: "Cinzel", "Cormorant Garamond", Georgia, serif;
  font-style: normal;
  font-weight: 500;
  font-size: clamp(2.4rem, 10vw, 3.4rem);
  color: var(--slate);
  opacity: .75;
  line-height: 1;
  pointer-events: none;
}

/* ---------- Pantalla 3 · Foto en Arco & Fecha (Inspirado en Invitación Madre) ---------- */
.s-photo {
  justify-content: center;
  padding: max(22px, env(safe-area-inset-top, 22px)) 6% max(14px, env(safe-area-inset-bottom, 14px));
  gap: 0;
}

.arch-container {
  position: relative;
  width: min(62%, 242px);
  aspect-ratio: 3 / 3.9;
  max-height: clamp(210px, 32vh, 275px);
  margin: 0 auto;
  flex-shrink: 0;
}

.arch-stars {
  position: absolute;
  inset: -12px;
  pointer-events: none;
  z-index: 3;
}
.arch-star {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  font-size: 1.25rem;
  line-height: 1;
  animation: star-shimmer 2.5s ease-in-out infinite alternate;
}
.arch-star.left { left: -16px; }
.arch-star.right { right: -16px; }

@keyframes star-shimmer {
  0% { transform: translateY(-50%) scale(0.9); opacity: 0.75; }
  100% { transform: translateY(-50%) scale(1.15); opacity: 1; }
}

.arch-outer-frame {
  position: absolute;
  inset: -7px;
  border-radius: 999px 999px 0 0;
  border: 1px solid var(--slate);
  pointer-events: none;
  z-index: 2;
  opacity: .85;
}

.arch-pic {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  border: 1.4px solid var(--slate);
  z-index: 1;
  background: #E8EEF3;
}
.arch-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.date-section {
  margin-top: clamp(12px, 2.2vh, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.9vh, 7px);
  align-items: center;
  width: 100%;
}
#date-celebration-title {
  font-family: var(--serif);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .26em;
  font-size: clamp(.84rem, 2.9vw, 1.0rem);
  line-height: 1.4;
  color: var(--text-soft);
  margin: 0;
}
.date-section .month {
  font-family: var(--serif);
  letter-spacing: .34em;
  text-transform: uppercase;
  font-size: clamp(1.18rem, 4.2vw, 1.48rem);
  font-weight: 600;
  color: var(--slate);
  line-height: 1.15;
}
.date-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 16px);
  margin: 2px 0;
  width: 100%;
  max-width: 350px;
}
.date-row .side {
  font-family: var(--serif);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: clamp(.84rem, 2.9vw, 1.05rem);
  font-weight: 600;
  color: var(--slate);
  white-space: nowrap;
}
.date-row .day {
  font-family: "Cinzel", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(3.0rem, 11vw, 4.0rem);
  line-height: .95;
  font-weight: 700;
  color: var(--slate);
  padding: 0 clamp(10px, 2.8vw, 16px);
  border-left: 1.6px solid var(--slate);
  border-right: 1.6px solid var(--slate);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  display: inline-block;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(74, 96, 122, .12);
}
.date-section .year {
  font-family: var(--serif);
  letter-spacing: .32em;
  font-size: clamp(1.18rem, 4.2vw, 1.48rem);
  font-weight: 600;
  color: var(--slate);
  line-height: 1.15;
}
.date-section .after {
  margin-top: clamp(6px, 1.1vh, 10px);
  font-size: clamp(.78rem, 2.7vw, .92rem);
  letter-spacing: .24em;
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.2;
}

@media (max-height: 650px) {
  .s-photo {
    padding-top: max(16px, env(safe-area-inset-top, 16px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }
  .arch-container {
    max-height: 185px;
    width: min(52%, 195px);
  }
  .date-section {
    margin-top: 8px;
    gap: 3px;
  }
  .date-row .day {
    font-size: 2.5rem;
  }
}



/* ---------- Pantalla 4 · Cronograma / Itinerario ---------- */
.s-timeline {
  padding-top: 54px;
}
.bouquet-wrap {
  width: 72%;
  max-width: 290px;
  margin: 0 auto;
  animation: bouquet-float 6s ease-in-out infinite alternate;
}
@keyframes bouquet-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}
.bouquet-wrap img {
  width: 100%;
  height: auto;
  display: block;
}
.s-timeline .script-title {
  font-size: clamp(3.4rem, 16vw, 4.6rem);
  margin: 4px 0 14px;
}
.tl-schedule {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.tl-schedule li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
}
.tl-schedule li + li {
  position: relative;
}
.tl-schedule li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 130px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--slate) 20%, var(--slate) 80%, transparent);
  opacity: .45;
}
.tl-schedule li + li::after {
  content: "❧";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .78rem;
  color: var(--slate);
  background: var(--ivory);
  padding: 0 6px;
  opacity: .75;
}
.tl-schedule .what {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: clamp(.88rem, 3.2vw, 1.08rem);
  font-weight: 600;
  color: var(--slate);
}
.tl-schedule .when {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.18rem, 4.4vw, 1.45rem);
  color: var(--slate);
  letter-spacing: .10em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Pantalla 5 · Detalles ---------- */
.s-details {
  padding-top: 54px;
  gap: 6px;
}
.the-details-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .9;
  margin-bottom: 6px;
}
.the-details-header .display-title {
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  letter-spacing: .20em;
}
.the-details-header .script-title {
  font-size: clamp(3.2rem, 14vw, 4.2rem);
  margin-top: -10px;
}

.detail-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}
.detail-block.detail-regalos {
  gap: 3px;
  margin-top: 8px;
}
.detail-block h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: clamp(.92rem, 3.4vw, 1.15rem);
  color: var(--slate);
}
.regalo-script {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(1.42rem, 5.2vw, 1.95rem);
  color: var(--slate);
  line-height: 1.15;
  font-weight: normal;
  max-width: 96%;
  text-align: center;
}
.detail-block h3.regalo-sub {
  margin: 4px 0 2px;
  font-size: clamp(.64rem, 2.2vw, .76rem);
  letter-spacing: .15em;
  color: var(--text-soft);
  max-width: 310px;
  line-height: 1.45;
  font-weight: 600;
}
.qrs-box {
  display: flex;
  gap: 28px;
  justify-content: center;
  margin-top: 4px;
}
.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: transform .2s ease;
}
.qr-item:hover {
  transform: scale(1.05);
}
.qr-item canvas {
  width: 86px;
  height: 86px;
  image-rendering: pixelated;
  background: #FFFFFF;
  padding: 5px;
  box-shadow: 0 4px 12px rgba(58, 75, 89, .15);
  border-radius: 4px;
}
.qr-item .caps {
  font-size: clamp(.78rem, 2.9vw, .92rem);
  font-weight: 600;
}
#det-dress-val {
  font-size: clamp(1.1rem, 4.0vw, 1.35rem);
  font-weight: 600;
  letter-spacing: .24em;
}
.hotel-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  margin-top: 2px;
}
.hotel-box .name {
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: clamp(.92rem, 3.4vw, 1.15rem);
  color: var(--slate);
}
.hotel-box .addr {
  font-family: var(--serif);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: clamp(.84rem, 3.0vw, 1.02rem);
  color: var(--text-soft);
  line-height: 1.8;
}
.btn-hotel-link {
  margin-top: 8px;
  border: 1px solid rgba(74, 96, 122, .45);
  background: transparent;
  color: var(--slate);
  border-radius: 999px;
  padding: 9px 22px;
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: clamp(.78rem, 2.8vw, .92rem);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, color .2s;
}
.btn-hotel-link:hover {
  background: var(--mist);
}

/* ---------- Pantalla 6 · RSVP ---------- */
.s-rsvp {
  justify-content: center;
  gap: 12px;
}
.leaf-corner {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  width: 36%;
  opacity: 0;
  transition: opacity 1.4s ease .3s, transform 1.6s var(--ease) .3s;
}
.leaf-corner.tl {
  top: -2%;
  left: -2%;
  transform: translate(-10px, -10px);
  animation: branch-sway-tl 5s ease-in-out infinite alternate;
}
.leaf-corner.br {
  bottom: 4%;
  right: -2%;
  transform: translate(10px, 10px);
  animation: branch-sway-br 5s ease-in-out infinite alternate;
}
.show .leaf-corner {
  opacity: 1;
}

@keyframes branch-sway-tl {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(2deg) translateY(3px); }
}
@keyframes branch-sway-br {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-2deg) translateY(-3px); }
}

.rsvp-block {
  position: relative;
  display: flex;
  flex-direction: column;
  line-height: .85;
}
.rsvp-block .display-title {
  font-size: clamp(4.4rem, 22vw, 6.4rem);
  letter-spacing: .16em;
}
.rsvp-block .please {
  position: absolute;
  left: -12%;
  top: -38px;
  font-family: var(--script);
  font-size: clamp(2.8rem, 13vw, 3.8rem);
  color: var(--ice);
  transform: rotate(-8deg);
}
.rsvp-by {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: .05em;
  color: var(--slate);
  margin-top: 24px;
}
.rsvp-mail {
  font-family: var(--serif);
  color: var(--slate);
  text-decoration: none;
  font-size: clamp(1.05rem, 3.8vw, 1.3rem);
  font-weight: 500;
  letter-spacing: .06em;
}
.rsvp-mail:hover {
  text-decoration: underline;
}

.btn-rsvp-action {
  margin-top: 16px;
  border: 0;
  background: var(--slate);
  color: var(--ivory);
  border-radius: 999px;
  padding: 15px 36px;
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .24em;
  font-size: clamp(.88rem, 3.2vw, 1.05rem);
  box-shadow: 0 8px 24px rgba(58, 75, 89, .28);
  transition: transform .2s, background .2s;
  cursor: pointer;
}
.btn-rsvp-action:hover {
  background: var(--slate-deep);
  transform: translateY(-1px);
}
.btn-rsvp-action:active {
  transform: scale(.97);
}

.rsvp-note {
  margin-top: 24px;
  max-width: 290px;
  line-height: 1.8;
  font-size: clamp(.82rem, 3.0vw, .96rem);
}

/* ---------- Pantalla 7 · Cierre (Marco Rococó sobre Papel Azul) ---------- */
.s-closing {
  justify-content: center;
  align-items: center;
}
.rococo-box {
  position: relative;
  width: 84%;
  max-width: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rococo-box img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .28));
}
.rococo-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2px;
  padding-top: 12px;
}
.rococo-text .name {
  font-family: var(--script);
  font-size: clamp(3.2rem, 15vw, 4.2rem);
  color: #FFFFFF;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.rococo-text .amp {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2.4rem, 11vw, 3.2rem);
  color: var(--ice);
  margin: -6px 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

/* ============================================================
   MODALES (RSVP Y TRANSFERENCIA)
   ============================================================ */
.modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(30, 45, 60, .55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.modal-overlay.open {
  display: flex;
}

.modal-sheet {
  width: 100%;
  background: var(--ivory);
  border-radius: 28px 28px 0 0;
  padding: 24px 22px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .24);
  animation: sheetUp .45s var(--ease);
  max-height: 88%;
  overflow-y: auto;
}
@keyframes sheetUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal-sheet h2 {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: 2.7rem;
  color: var(--slate);
  text-align: center;
}

.rsvp-welcome-badge {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 2px;
}
.rsvp-script-welcome {
  font-family: var(--script);
  font-size: clamp(2.4rem, 9.5vw, 3.2rem);
  color: var(--slate);
  line-height: 1;
}
.rsvp-guest-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 5.0vw, 1.6rem);
  font-weight: 600;
  color: #263544;
  letter-spacing: .05em;
  line-height: 1.25;
}
.rsvp-passes-badge {
  display: inline-block;
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: clamp(.72rem, 2.7vw, .84rem);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #927549;
  font-weight: 600;
}
.rsvp-thanks-sub {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(.92rem, 3.2vw, 1.08rem);
  color: var(--text-soft);
  line-height: 1.4;
}
.rsvp-already-box {
  background: rgba(215, 225, 234, .38);
  border: 1px solid rgba(74, 96, 122, .25);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
  margin: 6px 0 10px;
}
.rsvp-already-box p {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--slate);
  line-height: 1.4;
}
.btn-reopen-form {
  border: 1px solid var(--slate);
  background: transparent;
  color: var(--slate);
  border-radius: 999px;
  padding: 6px 18px;
  font-family: var(--serif);
  font-size: .8rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field label {
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: clamp(.84rem, 2.9vw, .96rem);
  color: var(--slate);
}
.form-field input,
.form-field select,
.form-field textarea {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid rgba(74, 96, 122, .4);
  background: transparent;
  padding: 8px 2px;
  border-radius: 0;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-bottom-color: var(--slate);
}
.form-field textarea {
  resize: none;
  min-height: 48px;
}

.segmented-control {
  display: flex;
  border: 1px solid rgba(74, 96, 122, .4);
  border-radius: 999px;
  overflow: hidden;
}
.segmented-control label {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: clamp(.84rem, 2.9vw, .96rem);
  color: var(--slate);
  cursor: pointer;
}
.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented-control input:checked + label {
  background: var(--slate);
  color: var(--ivory);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-ghost {
  flex: 1;
  border: 1px solid rgba(74, 96, 122, .4);
  background: transparent;
  color: var(--slate);
  border-radius: 999px;
  padding: 13px;
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: clamp(.82rem, 2.8vw, .95rem);
  cursor: pointer;
}
.modal-actions .btn-rsvp-action {
  flex: 1;
  margin: 0;
}

.thanks-view {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px 0 6px;
  text-align: center;
}
.thanks-view p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--slate);
  line-height: 1.5;
}
.modal-sheet.sent form {
  display: none;
}
.modal-sheet.sent .thanks-view {
  display: flex;
}

.bank-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bank-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(215, 225, 234, .38);
  border-radius: 14px;
}
.bank-k {
  font-size: clamp(.80rem, 2.8vw, .92rem);
  text-transform: uppercase;
  letter-spacing: .20em;
  font-weight: 600;
  color: var(--text-soft);
}
.bank-v {
  font-size: clamp(1.15rem, 4.0vw, 1.35rem);
  font-weight: 600;
  color: var(--slate);
}
.btn-copy-rut {
  border: 1px solid rgba(74, 96, 122, .45);
  background: transparent;
  color: var(--slate);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: clamp(.80rem, 2.8vw, .92rem);
  font-family: var(--serif);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-copy-rut:hover {
  background: var(--slate);
  color: #fff;
}

.copied-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(50, 67, 84, .94);
  color: #fff;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .15em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}
.copied-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .15s !important;
  }
  .w .ch, .fade {
    opacity: 1 !important;
    transform: none !important;
  }
}
