/* =========================================================
   Invitación DWB-002 · Digital Wedding Bolivia
   Verde musgo · papel marfil · líneas oliva — mobile first
   ========================================================= */

/* ---------- 0. Fuentes (alojadas en /fonts, subconjunto latino, variables) ---------- */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-italic.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/eb-garamond.woff2") format("woff2");
}

@font-face {
  font-family: "Great Vibes";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/great-vibes.woff2") format("woff2");
}

/* ---------- 1. Tokens ---------- */
:root {
  /* Paleta */
  --paper: #f6f1e7;
  --paper-light: #fbf8f1;
  --paper-deep: #ebe3d3;
  --moss: #5f6d43;
  --moss-dark: #4b5833;
  --moss-deep: #37421f;
  --moss-ink: #3e4a28;        /* iconos y texto verde sobre papel (AA) */
  --sage: #9aa585;
  --cream: #f6f1e6;           /* texto sobre verde */
  --ink: #2a2e22;
  --ink-soft: #4f5344;
  --line: #c9c2ae;
  --gold: #b8924f;
  --gold-soft: #cfae72;
  --gold-light: #e3cb98;

  --gold-gradient: linear-gradient(120deg, #9a7232 0%, #d9ba7c 38%, #f0dcaa 50%, #b58b45 68%, #d2b170 100%);

  /* Tipografía */
  --font-script: "Great Vibes", "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --font-text: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;

  /* Medidas */
  --invite-max: 440px;
  --gutter: clamp(1rem, 5vw, 1.5rem);
  --space-s: .75rem;
  --space-m: 1.25rem;
  --space-l: 2.2rem;
  --space-xl: 3rem;
  --line-w: 1px;
  --wave-h: clamp(34px, 11vw, 48px);

  /* Texturas (SVG inline) */
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.07'/%3E%3C/svg%3E");
  --tex-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.008' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='.1'/%3E%3C/svg%3E");
  --tex-weave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='h'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Cfilter id='v'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .012' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23h)' opacity='.04'/%3E%3Crect width='100%25' height='100%25' filter='url(%23v)' opacity='.03'/%3E%3C/svg%3E");

  /* Ondas para máscaras */
  --wave-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60V30C60 6 140 4 210 26C280 48 340 46 400 18V60Z'/%3E%3C/svg%3E");
  --wave-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 0H400V22C330 58 250 62 190 38C130 14 60 18 0 46Z'/%3E%3C/svg%3E");
  --arc-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 0H400V30C300 62 110 60 0 18Z'/%3E%3C/svg%3E");
  --solid: linear-gradient(#000 0 0);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: #e7e1d3;
  background-image:
    var(--tex-grain),
    radial-gradient(120% 80% at 50% 0%, #eee8db 0%, #dcd5c4 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Cormorant usa numerales antiguos por defecto: fechas, horas y códigos con cifras alineadas */
.hero__date, .event__time, .timeline__text, .countdown, .calendar, .design-code__code, .brand__demo-code, .player__times {
  font-variant-numeric: lining-nums;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 3. Lienzo de la invitación (papel) ---------- */
.invitation {
  position: relative;
  width: 100%;
  max-width: var(--invite-max);
  margin-inline: auto;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    var(--tex-grain),
    var(--tex-cloud),
    radial-gradient(130% 30% at 0% 20%, rgba(255, 255, 255, .6), transparent 60%),
    radial-gradient(100% 25% at 100% 55%, rgba(222, 212, 190, .35), transparent 70%),
    radial-gradient(110% 30% at 10% 85%, rgba(255, 252, 244, .55), transparent 65%);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

@media (min-width: 460px) {
  .invitation {
    margin-block: 24px;
    border-radius: 6px;
    box-shadow:
      0 0 0 1px rgba(95, 109, 67, .18),
      0 30px 60px -30px rgba(40, 45, 25, .45),
      0 8px 20px -12px rgba(40, 45, 25, .3);
  }
}

.section {
  position: relative;
  padding-inline: var(--gutter);
}

/* Paneles verde musgo con acabado de papel teñido */
.textile {
  position: relative;
  color: var(--cream);
  background-color: var(--moss);
  background-image:
    var(--tex-weave),
    var(--tex-grain),
    var(--tex-cloud),
    radial-gradient(120% 70% at 20% 10%, rgba(140, 155, 100, .35), transparent 60%),
    radial-gradient(90% 60% at 85% 95%, rgba(30, 36, 14, .35), transparent 65%),
    linear-gradient(170deg, var(--moss) 0%, var(--moss-dark) 100%);
}

/* ---------- 4. Piezas comunes ---------- */
.heading {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 4.6vw, 1.15rem);
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.6;
}

.heading span { display: block; }

.heading--small {
  font-size: clamp(.82rem, 3.7vw, .92rem);
  letter-spacing: .24em;
  text-indent: .24em;
}

.sprig {
  width: 30px;
  height: 17px;
  margin: .45rem auto 0;
  color: var(--moss);
}

.rule {
  width: min(82%, 320px);
  height: 0;
  margin: 0 auto;
  border: 0;
  border-top: var(--line-w) solid var(--line);
}

.rule--light { border-top-color: rgba(246, 241, 230, .45); }

/* --lqip: miniatura borrosa incrustada en el HTML (≈1 KB) que se ve al instante mientras llega la foto */
.photo {
  position: relative;
  overflow: hidden;
  background:
    var(--lqip, none) center / cover no-repeat,
    linear-gradient(150deg, #d7d2bf, #b3b597);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* La foto nítida aparece con un fundido sobre la miniatura (main.js añade .is-loaded) */
.js .photo img {
  opacity: 0;
  transition: opacity .6s ease;
}

.js .photo img.is-loaded { opacity: 1; }

.photo--warm img { filter: saturate(.92) sepia(.06) contrast(1.02); }

.photo--error img { visibility: hidden; }

.photo--error::after {
  content: "♡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: rgba(255, 255, 255, .85);
}

/* Botones */
.btn-outline,
.btn-ghost {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 44px;
  overflow: hidden;
  border-radius: 999px;
  font-family: var(--font-text);
  font-size: 1rem;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, color .25s ease, translate .25s ease;
}

.btn-outline {
  margin-top: .8rem;
  padding: .4rem 1.4rem;
  border: var(--line-w) solid var(--ink-soft);
  color: var(--ink);
  background: rgba(255, 255, 255, .35);
}

.btn-outline svg { width: 15px; height: 15px; color: var(--moss-ink); }

.btn-ghost {
  padding: .65rem 2.2rem;
  border: var(--line-w) solid rgba(246, 241, 230, .85);
  color: var(--cream);
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
}

.btn-ghost--arrow svg { width: 17px; height: 17px; transition: translate .25s ease; }

.btn-outline[href]:hover { background: var(--moss); color: var(--cream); border-color: var(--moss); }
.btn-outline[href]:hover svg { color: var(--cream); }
.btn-ghost:not([aria-disabled="true"]):hover { background: rgba(255, 255, 255, .12); }
.btn-ghost--arrow[href]:hover svg { translate: 3px 0; }

.btn-outline:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 4px;
}

/* Sin destino configurado: visibles, pero no se presentan como accionables */
.btn-outline[aria-disabled="true"],
.btn-ghost[aria-disabled="true"] {
  cursor: default;
  opacity: .82;
}

/* ---------- 5. Portada ---------- */
.hero {
  padding: calc(1.6rem + env(safe-area-inset-top)) var(--gutter) calc(var(--wave-h) + 2.2rem);
  text-align: center;
  overflow: hidden;
  -webkit-mask:
    var(--solid) top / 100% calc(100% - var(--wave-h) + 1px) no-repeat,
    var(--arc-bottom) bottom / 100% var(--wave-h) no-repeat;
  mask:
    var(--solid) top / 100% calc(100% - var(--wave-h) + 1px) no-repeat,
    var(--arc-bottom) bottom / 100% var(--wave-h) no-repeat;
}

.hero__leaf {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  aspect-ratio: 200 / 260;
  opacity: .55;
}

.hero__leaf--tr { top: -30px; right: -52px; width: clamp(130px, 40vw, 170px); transform: rotate(20deg); }
.hero__leaf--l { top: 42%; left: -64px; width: 120px; transform: rotate(-150deg) scaleX(-1); opacity: .4; }

.brand,
.hero__names,
.hero__rule,
.hero__date { position: relative; z-index: 1; }

/* El PNG original es cuadrado con aire transparente arriba y abajo:
   se recorta solo ese margen, sin escalar ni deformar el logo. */
.brand__logo {
  width: min(38%, 150px);
  margin-inline: auto;
  aspect-ratio: 1069 / 580;
  overflow: hidden;
}

.brand__logo img {
  width: 100%;
  height: auto;
  margin-top: -23.4%; /* 250px de 1069px */
  filter: drop-shadow(0 5px 7px rgba(20, 25, 8, .35));
}

.brand__name {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 6.6vw, 1.65rem);
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--cream);
}

.brand__name span {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand__country {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: .4rem auto 0;
  width: min(66%, 240px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 2.8vw, .72rem);
  letter-spacing: .5em;
  text-indent: .5em;
  text-transform: uppercase;
  color: rgba(246, 241, 230, .9);
}

.brand__country::before,
.brand__country::after {
  content: "";
  flex: 1;
  height: var(--line-w);
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.brand__country::after { transform: scaleX(-1); }

.brand__tagline {
  margin-top: .4rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.58rem, 2.6vw, .66rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(246, 241, 230, .85);
  line-height: 1.6;
}

.brand__tagline span { display: block; }

/* Aviso de demo: deja claro qué modelo se está viendo */
.brand__demo {
  display: inline-grid;
  justify-items: center;
  gap: .15rem;
  margin-top: .8rem;
  padding: .45rem 1.3rem .5rem;
  border: var(--line-w) solid rgba(227, 203, 152, .75);
  border-radius: 999px;
  background: rgba(30, 36, 14, .18);
}

.brand__demo-label {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(.82rem, 3.6vw, .92rem);
  line-height: 1.2;
  color: var(--gold-light);
}

.brand__demo-code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 2.8vw, .72rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(246, 241, 230, .9);
}

.brand__demo-code strong { font-weight: 700; color: var(--cream); }

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.4rem;
  font-family: var(--font-script);
  font-weight: 400;
  line-height: .95;
  color: var(--cream);
  text-shadow: 0 2px 10px rgba(20, 25, 8, .25);
}

.hero__name {
  font-size: clamp(3.3rem, 17vw, 4.4rem);
  white-space: nowrap;
}

.hero__name--first { margin-right: 14%; }
.hero__name--second { margin-left: 16%; }

.hero__amp {
  margin: -.1em 0 -.15em;
  font-size: clamp(2.2rem, 11vw, 2.8rem);
  line-height: 1;
}

.hero__rule {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: min(66%, 250px);
  margin: 1.1rem auto .5rem;
  color: var(--cream);
}

.hero__rule::before,
.hero__rule::after {
  content: "";
  flex: 1;
  height: var(--line-w);
  background: rgba(246, 241, 230, .65);
}

.hero__rule svg { width: 12px; height: 11px; flex: none; }

.hero__date {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 6.4vw, 1.6rem);
  letter-spacing: .16em;
  color: var(--cream);
}

/* ---------- 6. Foto principal ---------- */
/* Ya no se sube bajo el arco de la portada: queda completa y con aire arriba */
.feature-photo {
  padding-top: 1.4rem;
  padding-bottom: var(--space-l);
}

.feature-photo img { object-position: 50% 30%; }

/* ---- Vidrio esmerilado que se transforma (glassmorphism) ---- */
.glass {
  position: relative;
  isolation: isolate;
}

/* Manchas de color detrás del cristal: solo se animan con transform (GPU) */
.glass__blob {
  position: absolute;
  z-index: -1;
  aspect-ratio: 1;
  border-radius: 42% 58% 63% 37% / 45% 35% 65% 55%;
  filter: blur(14px);
  opacity: .85;
  animation: blob-morph-a 16s ease-in-out infinite alternate;
}

.glass__blob--a {
  top: -5%;
  left: -9%;
  width: 62%;
  background: radial-gradient(circle at 35% 35%, #8e9c68, #5f6d43 70%);
}

.glass__blob--b {
  right: -11%;
  bottom: -6%;
  width: 58%;
  border-radius: 63% 37% 45% 55% / 52% 60% 40% 48%;
  background: radial-gradient(circle at 60% 40%, #f1dfb2, #cfae72 72%);
  animation-name: blob-morph-b;
  animation-duration: 19s;
}

.glass__blob--c {
  top: 38%;
  right: -16%;
  width: 40%;
  border-radius: 55% 45% 38% 62% / 40% 58% 42% 60%;
  background: radial-gradient(circle at 40% 40%, #dfe5cf, #a9b48d 75%);
  animation-name: blob-morph-c;
  animation-duration: 13s;
}

@keyframes blob-morph-a {
  0% { transform: translate(0, 0) rotate(0deg) scale(1, 1); }
  50% { transform: translate(22px, 30px) rotate(70deg) scale(1.15, .88); }
  100% { transform: translate(-10px, 60px) rotate(150deg) scale(.92, 1.12); }
}

@keyframes blob-morph-b {
  0% { transform: translate(0, 0) rotate(0deg) scale(1, 1); }
  50% { transform: translate(-26px, -34px) rotate(-80deg) scale(.9, 1.16); }
  100% { transform: translate(-6px, -70px) rotate(-160deg) scale(1.12, .9); }
}

@keyframes blob-morph-c {
  0% { transform: translate(0, 0) rotate(0deg) scale(1, 1); }
  100% { transform: translate(-30px, 40px) rotate(120deg) scale(1.2, .85); }
}

/* Fuera de pantalla las manchas y el reflejo se pausan (ver initGlass en main.js) */
.glass:not(.is-active) .glass__blob,
.glass:not(.is-active) .glass__sheen::before { animation-play-state: paused; }

.glass__frame {
  position: relative;
  padding: 10px;
  border: var(--line-w) solid rgba(255, 255, 255, .7);
  border-radius: 26px;
  /* Vidrio simulado: las manchas ya vienen desenfocadas, así que no hace falta backdrop-filter
     (en el móvil recalcularía el desenfoque en cada fotograma mientras las manchas se mueven) */
  background: linear-gradient(140deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .22) 45%, rgba(255, 255, 255, .4));
  box-shadow:
    0 26px 44px -26px rgba(40, 45, 25, .6),
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(255, 255, 255, .3);
}

/* Sin backdrop-filter, la etiqueta se vuelve un velo oscuro translúcido */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass__caption { background: rgba(40, 45, 25, .45); }
}

.glass__frame .photo {
  aspect-ratio: 3 / 4.15;
  border-radius: 17px;
  box-shadow: 0 2px 10px rgba(40, 45, 25, .18);
}

/* Reflejo que cruza el cristal de vez en cuando */
.glass__sheen {
  position: absolute;
  inset: 10px;
  border-radius: 17px;
  overflow: hidden;
  pointer-events: none;
}

.glass__sheen::before {
  content: "";
  position: absolute;
  inset: -10% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .28) 48%, rgba(255, 255, 255, .08) 53%, transparent 60%);
  transform: translateX(-70%);
  animation: glass-sheen 8s ease-in-out 2s infinite;
}

@keyframes glass-sheen {
  0%, 60% { transform: translateX(-70%); }
  85%, 100% { transform: translateX(70%); }
}

/* Etiqueta de vidrio sobre la foto */
.glass__caption {
  position: absolute;
  left: 50%;
  bottom: 26px;
  translate: -50% 0;
  padding: .3rem 1.4rem .4rem;
  border: var(--line-w) solid rgba(255, 255, 255, .55);
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .6);
  font-family: var(--font-script);
  font-size: clamp(1.45rem, 7vw, 1.75rem);
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .3);
}

/* Al aparecer, el marco y la foto pasan de forma orgánica a rectángulo redondeado (una sola vez) */
.has-reveal .feature-photo .glass__frame,
.has-reveal .feature-photo .photo,
.has-reveal .feature-photo .glass__sheen {
  transition: border-radius 1.8s cubic-bezier(.45, .05, .25, 1) .15s;
}

.has-reveal .feature-photo:not(.is-visible) .glass__frame { border-radius: 58% 42% 55% 45% / 46% 58% 42% 54%; }

.has-reveal .feature-photo:not(.is-visible) .photo,
.has-reveal .feature-photo:not(.is-visible) .glass__sheen { border-radius: 55% 45% 52% 48% / 44% 56% 44% 56%; }

.has-reveal .feature-photo .glass__caption {
  opacity: 0;
  translate: -50% 12px;
  transition: opacity .9s ease 1.4s, translate .9s ease 1.4s;
}

.has-reveal .feature-photo.is-visible .glass__caption { opacity: 1; translate: -50% 0; }

/* ---------- 7. Frase y reproductor ---------- */
.song {
  padding-bottom: var(--space-l);
  text-align: center;
}

.song__quote p {
  max-width: 19em;
  margin-inline: auto;
  font-family: var(--font-text);
  font-size: clamp(1.05rem, 4.7vw, 1.18rem);
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
}

.player {
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  border-top: var(--line-w) solid var(--line);
}

.player__title {
  font-family: var(--font-text);
  font-size: 1.05rem;
  letter-spacing: .04em;
  color: var(--ink);
}

.player__progress { margin-top: .6rem; }

/* Barra de progreso: input range nativo (accesible y con arrastre) */
.player__seek {
  --p: 0%;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.player__seek::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--moss-ink) var(--p), var(--line) var(--p));
}

.player__seek::-moz-range-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--moss-ink) var(--p), var(--line) var(--p));
}

.player__seek::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--moss-ink);
  box-shadow: 0 0 0 3px rgba(95, 109, 67, .18);
  -webkit-appearance: none;
  appearance: none;
}

.player__seek::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: var(--moss-ink);
}

.player__seek:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 4px;
}

.player__times {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--ink-soft);
}

.player__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 300px;
  margin: .5rem auto 0;
}

.player__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, scale .2s ease;
}

.player__btn svg { width: 22px; height: 22px; }
.player__btn:hover { background: rgba(95, 109, 67, .1); }
.player__btn:active { scale: .92; }

.player__btn:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

.player__btn--main {
  width: 54px;
  height: 54px;
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 8px 16px -8px rgba(30, 32, 22, .7);
}

.player__btn--main:hover { background: var(--moss-deep); }
.player__btn--main svg { width: 24px; height: 24px; }

.player__icon-pause,
.player__icon-off { display: none; }

.player.is-playing .player__icon-play { display: none; }
.player.is-playing .player__icon-pause { display: block; }
.player.is-loading .player__icon-play { animation: heartbeat 1.4s ease-in-out infinite; }

[data-player-mute][aria-pressed="true"] .player__icon-on { display: none; }
[data-player-mute][aria-pressed="true"] .player__icon-off { display: block; }

[data-player-loop][aria-pressed="false"] { opacity: .4; }

[data-player-loop][aria-pressed="true"]::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--moss);
}

/* ---------- 8. Cuenta regresiva y calendario ---------- */
.countdown-panel {
  padding: var(--space-l) var(--gutter) calc(var(--space-l) + .4rem);
  text-align: center;
}

.countdown-panel__blessing {
  max-width: 20em;
  margin: 0 auto var(--space-m);
  font-size: clamp(1rem, 4.4vw, 1.08rem);
  line-height: 1.45;
}

.countdown-panel__title {
  margin-top: var(--space-m);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.15rem, 5.2vw, 1.3rem);
  letter-spacing: .3em;
  text-indent: .3em;
  text-transform: uppercase;
}

.countdown {
  margin: .4rem 0 var(--space-m);
}

.countdown__grid {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(.15rem, 1.5vw, .4rem);
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 2.4ch;
}

.countdown__value,
.countdown__sep {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.3rem, 11.5vw, 2.9rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
}

.countdown__sep { opacity: .75; }

.countdown__label {
  font-size: .85rem;
  color: rgba(246, 241, 230, .85);
}

.countdown__value.tick { animation: tick .6s ease; }
.countdown__value.tick-alt { animation: tick-alt .6s ease; }

@keyframes tick {
  from { color: var(--gold-light); }
  to { color: var(--cream); }
}

@keyframes tick-alt {
  from { color: var(--gold-light); }
  to { color: var(--cream); }
}

.countdown__done {
  max-width: 18em;
  margin-inline: auto;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
}

.calendar { margin-top: var(--space-m); }

.calendar__month {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 4.6vw, 1.1rem);
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
}

.calendar__table {
  width: 100%;
  max-width: 330px;
  margin: .7rem auto 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar__table th {
  padding-bottom: .5rem;
  font-family: var(--font-text);
  font-weight: 400;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(246, 241, 230, .85);
}

.calendar__table td {
  position: relative;
  height: 2.15rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
  text-align: center;
}

.calendar__day--event { font-weight: 700; }

.calendar__heart {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.3rem;
  height: 2.05rem;
  translate: -50% -48%;
  color: var(--cream);
  pointer-events: none;
}

.calendar__heart path {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
}

.has-reveal .calendar:not(.is-visible) .calendar__heart path { stroke-dashoffset: 100; }
.has-reveal .calendar__heart path { transition: stroke-dashoffset 1.6s ease .5s; }

/* ---------- 9. Nuestra boda ---------- */
.wedding {
  padding-top: var(--space-l);
  padding-bottom: var(--space-l);
  text-align: center;
}

.event { margin-top: var(--space-m); }

.event__icon {
  width: 46px;
  height: 46px;
  margin: 0 auto .4rem;
  color: var(--moss-ink);
}

.event__time {
  font-family: var(--font-text);
  font-size: 1.15rem;
  color: var(--ink);
}

.event__title {
  font-family: var(--font-text);
  font-weight: 400;
  font-size: clamp(1.45rem, 6.6vw, 1.65rem);
  line-height: 1.2;
  color: var(--ink);
}

.event__place {
  margin-top: .2rem;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.event__connector {
  display: block;
  width: var(--line-w);
  height: 36px;
  margin: var(--space-m) auto 0;
  background: var(--ink-soft);
  opacity: .6;
}

/* ---------- 10. Itinerario ---------- */
.itinerary {
  padding-bottom: var(--space-l);
}

.itinerary .heading { margin-top: var(--space-l); }

.timeline {
  position: relative;
  max-width: 330px;
  margin: var(--space-m) auto 0;
}

.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 26px 1.45fr;
  align-items: center;
  column-gap: .9rem;
  padding: .75rem 0;
}

/* línea vertical continua por la columna central */
.timeline__item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((100% - 1.8rem - 26px) * (1 / 2.45) + .9rem + 13px);
  width: var(--line-w);
  background: var(--ink-soft);
  opacity: .55;
  transform-origin: top;
}

.timeline__item:first-child::before { top: 50%; }
.timeline__item:last-child::before { bottom: 50%; }

.timeline__icon {
  justify-self: end;
  width: 38px;
  height: 38px;
  color: var(--ink);
}

.timeline__dot {
  position: relative;
  justify-self: center;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.timeline__text {
  font-size: 1rem;
  line-height: 1.3;
  color: var(--ink);
}

.timeline__text time { display: block; }
.timeline__text span { display: block; color: var(--ink-soft); }

/* ---------- 11. Foto caminando ---------- */
.walk-photo { padding-bottom: var(--space-l); }

.walk-photo .photo {
  aspect-ratio: 1 / 1.08;
  border-radius: 3px;
  box-shadow: 0 18px 30px -20px rgba(40, 45, 25, .55);
}

.walk-photo img { object-position: 46% 50%; }

/* ---------- 12. Código de vestimenta ---------- */
.dress {
  padding-bottom: var(--space-xl);
  text-align: center;
}

.dress__icons {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: .4rem;
  margin-top: var(--space-m);
  color: var(--moss-dark);
}

.dress__suit,
.dress__gown {
  width: 52px;
  height: 84px;
}

.dress__style {
  margin-top: .6rem;
  font-family: var(--font-text);
  font-size: clamp(1.45rem, 6.6vw, 1.65rem);
  color: var(--ink);
}

.dress__note {
  max-width: 17em;
  margin: .2rem auto 0;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

/* ---------- 13. Confirmación ---------- */
.confirm__panel {
  padding: var(--space-l) var(--gutter) calc(var(--space-l) + .2rem);
  text-align: center;
}

.confirm__icon {
  width: 46px;
  height: 46px;
  margin: 0 auto .7rem;
  color: var(--cream);
}

.confirm__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.1rem, 5vw, 1.25rem);
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
}

.confirm__text {
  max-width: 18em;
  margin: .4rem auto 1.2rem;
  font-size: 1.02rem;
  line-height: 1.4;
}

/* Formulario desplegable (sin JavaScript queda abierto) */
.js .rsvp {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .6s cubic-bezier(.3, .7, .2, 1);
}

.js .rsvp.is-open { grid-template-rows: 1fr; }

.rsvp { scroll-margin-top: 76px; }

.rsvp__inner {
  min-height: 0;
  overflow: hidden;
}

.js .rsvp:not(.is-open) .rsvp__inner {
  visibility: hidden;
  transition: visibility 0s .6s;
}

.rsvp__card {
  margin: var(--space-m) var(--gutter) 0;
  padding: 1.6rem clamp(1.1rem, 5vw, 1.5rem) 1.6rem;
  border: var(--line-w) solid var(--line);
  border-radius: 12px;
  background-color: var(--paper-light);
  background-image: var(--tex-grain);
  box-shadow: 0 20px 36px -28px rgba(40, 45, 25, .5);
}

.rsvp__form {
  display: grid;
  gap: 1.1rem;
}

.field {
  display: grid;
  gap: .4rem;
  min-width: 0;
}

.field__label {
  padding: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.7rem, 3.1vw, .76rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--moss-ink);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  border: var(--line-w) solid #bdb59f;
  border-radius: 9px;
  background: rgba(255, 255, 255, .7);
  font-family: var(--font-text);
  font-size: 1rem; /* 16px evita el zoom automático en iOS */
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.field__input::placeholder { color: #807e6c; }

.field__input:focus {
  outline: none;
  border-color: var(--moss);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(95, 109, 67, .18);
}

.field__input--area {
  min-height: 92px;
  resize: vertical;
  line-height: 1.4;
}

.field__input[aria-invalid="true"] {
  border-color: #a4473a;
  box-shadow: 0 0 0 3px rgba(164, 71, 58, .12);
}

.field__error {
  font-size: .86rem;
  line-height: 1.3;
  color: #8f3427;
}

.field__error:empty { display: none; }

.field__hint {
  font-size: .85rem;
  color: var(--ink-soft);
}

.stepper {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: var(--line-w) solid #bdb59f;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  overflow: hidden;
}

.stepper__btn {
  width: 48px;
  height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1;
  color: var(--moss-ink);
  cursor: pointer;
  transition: background-color .2s ease;
}

.stepper__btn:hover:not(:disabled) { background-color: rgba(95, 109, 67, .1); }
.stepper__btn:disabled { opacity: .3; cursor: default; }

.stepper__btn:focus-visible,
.stepper__value:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: -3px;
}

.stepper__value {
  width: 3.2rem;
  height: 46px;
  border: 0;
  border-inline: var(--line-w) solid rgba(189, 181, 159, .6);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  font-variant-numeric: lining-nums;
  text-align: center;
  color: var(--ink);
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper__value::-webkit-inner-spin-button,
.stepper__value::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.companions {
  display: grid;
  gap: .4rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.companions[hidden] { display: none; }

.companions__list {
  display: grid;
  gap: .7rem;
  padding-left: .9rem;
  border-left: var(--line-w) solid var(--sage);
}

.companion {
  gap: .25rem;
  animation: field-in .5s ease both;
}

.companion__label {
  font-family: var(--font-text);
  font-size: .95rem;
  color: var(--ink-soft);
}

@keyframes field-in {
  from { opacity: 0; translate: 0 -6px; }
}

.btn-solid {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  min-height: 52px;
  margin-top: .4rem;
  padding: .8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-text);
  font-size: 1.05rem;
  letter-spacing: .04em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--cream);
  box-shadow: 0 14px 24px -14px rgba(40, 45, 25, .9);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: translate .25s ease, box-shadow .25s ease, opacity .25s ease;
}

.btn-solid svg { width: 17px; height: 15px; flex: none; }
.btn-solid:hover { translate: 0 -2px; }
.btn-solid:hover svg { animation: heartbeat 1.4s ease-in-out infinite; }
.btn-solid:active { translate: 0 0; }
.btn-solid:disabled { opacity: .7; cursor: progress; }

.btn-solid:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 4px;
}

.rsvp__status {
  text-align: center;
  font-size: .95rem;
  line-height: 1.4;
  color: var(--moss-ink);
}

.rsvp__status:empty { display: none; }
.rsvp__status.is-error { color: #8f3427; }

.rsvp__success {
  display: grid;
  justify-items: center;
  gap: .6rem;
  text-align: center;
  animation: field-in .8s ease both;
}

.rsvp__success[hidden] { display: none; }
.rsvp__success:focus { outline: none; }

.rsvp__success-heart {
  width: 72px;
  aspect-ratio: 64 / 48;
  height: auto;
  color: var(--moss);
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: draw-heart 1.8s ease .2s forwards;
}

@keyframes draw-heart { to { stroke-dashoffset: 0; } }

.rsvp__success-title {
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 11vw, 2.9rem);
  line-height: 1.1;
}

.rsvp__success-text {
  max-width: 20em;
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* ---------- 14. Información importante ---------- */
.info {
  padding-top: var(--space-l);
  padding-bottom: var(--space-l);
  text-align: center;
}

.info__list {
  display: grid;
  gap: 1.5rem;
  margin: var(--space-m) auto var(--space-l);
  max-width: 340px;
  text-align: left;
}

.info__item {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  column-gap: 1rem;
}

.info__icon {
  width: 36px;
  height: 36px;
  margin-top: .1rem;
  color: var(--moss-ink);
}

.info__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .86rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
}

.info__item p {
  margin-top: .15rem;
  font-size: .98rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.thanks {
  margin-top: var(--space-m);
  font-family: var(--font-script);
  font-size: clamp(1.9rem, 9vw, 2.3rem);
  line-height: 1.15;
  color: var(--ink);
  rotate: -4deg;
}

.thanks span { display: block; }

.thanks__heart {
  width: 18px;
  height: 16px;
  margin: .9rem auto 0;
  color: var(--ink);
}

/* ---------- 15. Foto final y código del diseño ---------- */
.closing-photo .photo {
  aspect-ratio: 1 / 1.18;
  -webkit-mask:
    var(--solid) top / 100% calc(100% - var(--wave-h) + 1px) no-repeat,
    var(--wave-bottom) bottom / 100% var(--wave-h) no-repeat;
  mask:
    var(--solid) top / 100% calc(100% - var(--wave-h) + 1px) no-repeat,
    var(--wave-bottom) bottom / 100% var(--wave-h) no-repeat;
}

.closing-photo img { object-position: 50% 25%; }

.design-code {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: calc(var(--wave-h) * -1);
  padding: calc(var(--wave-h) + var(--space-l)) var(--gutter) calc(var(--space-xl) + env(safe-area-inset-bottom));
  overflow: hidden;
  text-align: center;
  -webkit-mask:
    var(--wave-top) top / 100% var(--wave-h) no-repeat,
    var(--solid) bottom / 100% calc(100% - var(--wave-h) + 1px) no-repeat;
  mask:
    var(--wave-top) top / 100% var(--wave-h) no-repeat,
    var(--solid) bottom / 100% calc(100% - var(--wave-h) + 1px) no-repeat;
}

.design-code__leaf {
  position: absolute;
  aspect-ratio: 200 / 260;
  opacity: .45;
  pointer-events: none;
}

.design-code__leaf--l { left: -48px; bottom: -20px; width: 140px; transform: rotate(10deg); }

.design-code__title {
  position: relative;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 4.6vw, 1.12rem);
  letter-spacing: .24em;
  text-indent: .24em;
  text-transform: uppercase;
}

.design-code__code {
  position: relative;
  margin: var(--space-s) 0 var(--space-l);
  padding: .45rem clamp(2.2rem, 12vw, 3.2rem) .5rem;
  border: 1.2px solid rgba(246, 241, 230, .9);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 9vw, 2.15rem);
  letter-spacing: .1em;
  line-height: 1.2;
}

/* Destello que cruza el código: se mueve con transform (lo resuelve la GPU) */
.shimmer { overflow: hidden; }

.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 250, 235, .2) 50%, transparent 70%);
  transform: translateX(-110%);
  animation: sheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sheen {
  0%, 25% { transform: translateX(-110%); }
  70%, 100% { transform: translateX(110%); }
}

/* ---------- 16. Animaciones de aparición ---------- */
.has-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}

.has-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* Nombres: aparecen como escritos a mano */
.has-reveal .hero__names[data-reveal] { opacity: 1; transform: none; }

.has-reveal .hero__name,
.has-reveal .hero__amp {
  clip-path: inset(-30% 108% -40% -15%);
  transition: clip-path 1.15s cubic-bezier(.55, .1, .3, 1);
}

.has-reveal .hero__amp { transition-delay: .6s; transition-duration: .7s; }
.has-reveal .hero__name--second { transition-delay: .85s; }

.has-reveal .hero__names.is-visible .hero__name,
.has-reveal .hero__names.is-visible .hero__amp { clip-path: inset(-30% -15% -40% -15%); }

/* Foto principal: acercamiento suave al aparecer */
.has-reveal .feature-photo img {
  scale: 1.12;
  transition: scale 1.8s cubic-bezier(.2, .7, .2, 1), opacity .6s ease;
}

.has-reveal .feature-photo.is-visible img { scale: 1; }

/* Fotos grandes: se descubren como un telón.
   Se recorta la imagen y no el contenedor, que es el que observa el IntersectionObserver. */
.has-reveal [data-reveal="curtain"] { opacity: 1; transform: none; }

.has-reveal [data-reveal="curtain"] img {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s cubic-bezier(.65, 0, .25, 1), opacity .6s ease;
}

.has-reveal [data-reveal="curtain"].is-visible img { clip-path: inset(0); }

/* Itinerario: los puntos aparecen escalonados */
.timeline__item:nth-child(2) { --i: 1; }
.timeline__item:nth-child(3) { --i: 2; }
.timeline__item:nth-child(4) { --i: 3; }
.timeline__item:nth-child(5) { --i: 4; }
.timeline__item:nth-child(6) { --i: 5; }

.has-reveal .timeline__item[data-reveal] { transition-delay: calc(var(--i, 0) * 90ms); }

.has-reveal .timeline__dot {
  scale: 0;
  transition: scale .5s cubic-bezier(.3, 1.6, .5, 1) .35s;
}

.has-reveal .timeline__item.is-visible .timeline__dot { scale: 1; }

.info__item:nth-child(2) { --i: 1; }
.info__item:nth-child(3) { --i: 2; }
.has-reveal .info__item[data-reveal] { transition-delay: calc(var(--i, 0) * 120ms); }

/* Brillo dorado de la marca: un solo paso de ida y vuelta */
.brand__name span {
  background-size: 220% auto;
  animation: gold-shimmer 5s ease-in-out 1.5s 2 alternate both;
}

@keyframes gold-shimmer {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* Efectos ligados al scroll (navegadores con scroll-driven animations) */
@supports (animation-timeline: view()) {
  .photo--parallax img {
    scale: 1.14;
    animation: photo-parallax linear both;
    animation-timeline: view();
  }

  @keyframes photo-parallax {
    from { translate: 0 -6%; }
    to { translate: 0 6%; }
  }

  .timeline__item::before {
    animation: draw-line linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 45%;
  }

  @keyframes draw-line {
    from { scale: 1 0; }
    to { scale: 1 1; }
  }

  .hero__leaf {
    animation: leaf-drift linear both;
    animation-timeline: view();
  }

  @keyframes leaf-drift {
    from { translate: 0 0; }
    to { translate: 0 40px; }
  }
}

/* ---------- 17. Efecto gota (botones) ---------- */
.drop {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 235, .55) 0%, rgba(255, 250, 235, .2) 45%, rgba(255, 250, 235, 0) 70%);
  pointer-events: none;
  animation: drop-spread .75s cubic-bezier(.2, .6, .3, 1) forwards;
}

@keyframes drop-spread {
  from { transform: scale(0); opacity: 1; }
  to { transform: scale(16); opacity: 0; }
}

@keyframes heartbeat {
  0%, 60%, 100% { scale: 1; }
  15% { scale: 1.25; }
  30% { scale: 1.05; }
  45% { scale: 1.2; }
}

/* ---------- 18. Intro · invitación de doble puerta (exclusiva de DWB-002) ---------- */
.intro { display: none; }

html.intro-active { overflow: hidden; }

.js .intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(.8rem, 3.2vh, 1.9rem);
  padding: calc(1.2rem + env(safe-area-inset-top)) var(--gutter) calc(1.2rem + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  background-color: var(--paper);
  /* luz de jardín: un haz cálido en diagonal y verdes suaves arriba y abajo */
  background-image:
    linear-gradient(115deg, transparent 28%, rgba(255, 251, 240, .75) 44%, transparent 60%),
    radial-gradient(70% 40% at 50% 0%, rgba(154, 165, 133, .3), transparent 70%),
    radial-gradient(80% 45% at 50% 100%, rgba(154, 165, 133, .34), transparent 70%),
    var(--tex-grain),
    var(--tex-cloud);
  transition: opacity .8s ease;
}

.intro.is-leaving { opacity: 0; pointer-events: none; }

.intro__couple,
.intro__hint {
  position: relative;
  z-index: 3;
  text-align: center;
  transition: opacity .6s ease, translate .6s ease;
}

.intro__couple {
  display: grid;
  justify-items: center;
  gap: .3rem;
  width: min(84vw, 330px);
}

/* Letras doradas "bordadas con hilo": se dibuja el contorno y después se rellena de oro */
.thread {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7));
}

.thread text {
  font-family: var(--font-script);
  text-anchor: middle;
  fill: url(#g-thread);
  fill-opacity: 0;
  stroke: #a98242;
  stroke-width: .75;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
}

.intro.is-ready .thread:not(.thread--inside) text {
  animation:
    thread-stitch 1.7s cubic-bezier(.45, .05, .35, 1) forwards,
    thread-gild 1s ease 1s forwards;
}

/* el nombre interior se borda cuando se abren las puertas */
.gate.is-revealed .thread--inside text {
  animation:
    thread-stitch 1.2s cubic-bezier(.45, .05, .35, 1) .2s forwards,
    thread-gild .7s ease .8s forwards;
}

@keyframes thread-stitch { to { stroke-dashoffset: 0; } }

@keyframes thread-gild {
  to { fill-opacity: 1; stroke-opacity: .35; }
}

.intro__rule {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 58%;
  color: var(--gold);
  opacity: 0;
  transition: opacity 1s ease 1.6s;
}

.intro.is-ready .intro__rule { opacity: .9; }

.intro__rule::before,
.intro__rule::after {
  content: "";
  flex: 1;
  height: var(--line-w);
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}

.intro__rule::after { transform: scaleX(-1); }
.intro__rule svg { width: 11px; height: 10px; flex: none; }

.intro__hint {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 4.4vw, 1.12rem);
  letter-spacing: .04em;
  color: var(--moss-ink);
}

.intro__hint svg {
  width: 13px;
  height: 12px;
  color: var(--moss);
  animation: heartbeat 1.6s ease-in-out infinite;
}

.intro.is-opening .intro__couple { opacity: 0; translate: 0 -10px; }
.intro.is-opening .intro__hint { opacity: 0; translate: 0 10px; }

.intro__branch {
  position: absolute;
  z-index: 1;
  width: clamp(150px, 42vw, 220px);
  aspect-ratio: 200 / 260;
  opacity: .5;
  pointer-events: none;
}

.intro__branch--tl { top: -40px; left: -50px; transform: rotate(160deg); }
.intro__branch--br { bottom: -40px; right: -50px; transform: rotate(-20deg); }

/* Esferas de cristal que flotan (luz de jardín) */
.intro__orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  aspect-ratio: 1;
  border-radius: 50%;
  border: var(--line-w) solid rgba(255, 255, 255, .7);
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .2) 38%, rgba(207, 174, 114, .14) 70%, rgba(95, 109, 67, .12));
  box-shadow: inset -6px -8px 16px rgba(95, 109, 67, .14), 0 12px 26px -14px rgba(60, 70, 40, .3);
  opacity: .75;
  animation: orb-float 15s ease-in-out infinite alternate;
}

.orb--1 { width: 118px; left: 4%; top: 13%; }
.orb--2 { width: 58px; right: 9%; top: 22%; animation-name: orb-float-b; animation-duration: 12s; }
.orb--3 { width: 150px; right: -34px; bottom: 15%; animation-duration: 18s; }
.orb--4 { width: 44px; left: 13%; bottom: 23%; animation-name: orb-float-b; animation-duration: 11s; }
.orb--5 { width: 76px; left: 44%; top: 3%; animation-duration: 16s; }
.orb--6 { width: 32px; right: 25%; bottom: 7%; animation-name: orb-float-b; animation-duration: 13s; }

@keyframes orb-float {
  from { transform: translate(0, 0); }
  to { transform: translate(14px, -26px); }
}

@keyframes orb-float-b {
  from { transform: translate(0, 0); }
  to { transform: translate(-18px, 20px); }
}

/* Hojas de eucalipto que caen */
.intro__petals {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -6%;
  width: var(--s);
  height: calc(var(--s) * .78);
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #c4cdab, #7a8856);
  box-shadow: 0 1px 2px rgba(80, 80, 50, .15);
  opacity: var(--o, .8);
  animation: petal-fall var(--dur, 12s) linear var(--delay, 0s) infinite;
}

.petal--light { background: linear-gradient(135deg, #e3e8d6, #a7b38b); }

/* Valores fijos (sin variables) para que la GPU anime las hojas sin pasar por el hilo principal */
.petal--b { animation-name: petal-fall-b; }
.petal--c { animation-name: petal-fall-c; }

@keyframes petal-fall {
  0% { transform: translate3d(0, -5vh, 0) rotate3d(1, .4, .2, 0deg); }
  25% { transform: translate3d(28px, 25vh, 0) rotate3d(1, .4, .2, 120deg); }
  50% { transform: translate3d(-28px, 55vh, 0) rotate3d(1, .4, .2, 220deg); }
  75% { transform: translate3d(28px, 85vh, 0) rotate3d(1, .4, .2, 300deg); }
  100% { transform: translate3d(0, 112vh, 0) rotate3d(1, .4, .2, 400deg); }
}

@keyframes petal-fall-b {
  0% { transform: translate3d(0, -5vh, 0) rotate3d(.3, 1, .2, 0deg); }
  25% { transform: translate3d(-22px, 25vh, 0) rotate3d(.3, 1, .2, -110deg); }
  50% { transform: translate3d(18px, 55vh, 0) rotate3d(.3, 1, .2, -200deg); }
  75% { transform: translate3d(-22px, 85vh, 0) rotate3d(.3, 1, .2, -290deg); }
  100% { transform: translate3d(0, 112vh, 0) rotate3d(.3, 1, .2, -380deg); }
}

@keyframes petal-fall-c {
  0% { transform: translate3d(0, -5vh, 0) rotate3d(1, .2, .6, 0deg); }
  25% { transform: translate3d(12px, 25vh, 0) rotate3d(1, .2, .6, 90deg); }
  50% { transform: translate3d(-34px, 55vh, 0) rotate3d(1, .2, .6, 200deg); }
  75% { transform: translate3d(10px, 85vh, 0) rotate3d(1, .2, .6, 280deg); }
  100% { transform: translate3d(-6px, 112vh, 0) rotate3d(1, .2, .6, 360deg); }
}

/* Tarjeta en arco con dos puertas */
.gate {
  position: relative;
  z-index: 3;
  width: min(74vw, 310px, calc(56vh * .68));
  aspect-ratio: .68;
  perspective: 1500px;
  cursor: pointer;
  animation: gate-float 7s ease-in-out infinite;
  transition: scale 1.1s cubic-bezier(.4, 0, .2, 1), opacity 1s ease;
}

@keyframes gate-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -7px; }
}

/* sombra sobre el "suelo" (sin filter: no aplanaría el 3D de las puertas) */
.gate::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -22px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 45, 25, .38), transparent);
}

.intro.is-leaving .gate { scale: 1.1; opacity: 0; }

.gate__inside {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: 18% 9% 8%;
  border-radius: 50% 50% 12px 12px / 34% 34% 12px 12px;
  background-color: var(--paper-light);
  background-image:
    var(--tex-grain),
    radial-gradient(90% 60% at 50% 30%, #fffdf8, transparent 75%);
  box-shadow:
    inset 0 0 0 1px rgba(95, 109, 67, .3),
    inset 0 0 34px rgba(120, 110, 80, .18),
    0 24px 40px -22px rgba(40, 45, 25, .55);
  text-align: center;
  color: var(--ink);
}

.gate__inside::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: var(--line-w) solid rgba(184, 146, 79, .55);
  border-radius: 50% 50% 8px 8px / 33% 33% 8px 8px;
  pointer-events: none;
}

.gate__sprig { width: 36px; height: 20px; color: var(--moss); }

.gate__eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 2.8vw, .72rem);
  letter-spacing: .32em;
  text-indent: .32em;
  text-transform: uppercase;
  color: var(--moss-ink);
}

.thread--inside { width: 100%; filter: none; }

.gate__date {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1rem, 4.6vw, 1.15rem);
  letter-spacing: .2em;
  font-variant-numeric: lining-nums;
}

.gate__place {
  font-size: clamp(.82rem, 3.6vw, .92rem);
  color: var(--ink-soft);
}

/* Puertas */
.gate__door {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 50%;
  transform-style: preserve-3d;
  transition: transform 1.05s cubic-bezier(.6, .05, .25, 1);
}

.gate__door--left { left: 0; transform-origin: left center; }
.gate__door--right { right: 0; transform-origin: right center; }

.gate.is-revealed .gate__door--left { transform: rotateY(-108deg); }
.gate.is-revealed .gate__door--right { transform: rotateY(108deg); }

.gate__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gate__door--left .gate__face { border-radius: 100% 0 0 12px / 34% 0 0 12px; }
.gate__door--right .gate__face { border-radius: 0 100% 12px 0 / 0 34% 12px 0; }

.gate__face--front {
  color: var(--cream);
  background-color: var(--moss);
  background-image:
    var(--tex-weave),
    var(--tex-grain),
    radial-gradient(130% 70% at 50% 15%, rgba(150, 165, 105, .4), transparent 65%),
    linear-gradient(175deg, var(--moss) 0%, var(--moss-dark) 100%);
}

/* línea de unión entre puertas */
.gate__door--left .gate__face--front { box-shadow: inset -1px 0 0 rgba(20, 25, 8, .4), inset -3px 0 6px rgba(20, 25, 8, .18); }
.gate__door--right .gate__face--front { box-shadow: inset 1px 0 0 rgba(255, 255, 255, .12), inset 3px 0 6px rgba(20, 25, 8, .18); }

/* cara interior de las puertas (se ve al abrirlas) */
.gate__face--back {
  transform: rotateY(180deg);
  background-color: var(--paper-deep);
  background-image:
    var(--tex-grain),
    linear-gradient(90deg, #e9e1cf, #f4efe3);
  box-shadow: inset 0 0 0 1px rgba(184, 146, 79, .45);
}

/* El dibujo del frente ocupa toda la tarjeta y cada puerta muestra su mitad:
   al abrirse, el texto se parte por el centro */
.gate__art {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 200%;
  text-align: center;
}

.gate__door--left .gate__art { left: 0; }
.gate__door--right .gate__art { left: -100%; }

.gate__frame {
  position: absolute;
  inset: 10px;
  border: var(--line-w) solid rgba(227, 203, 152, .8);
  border-radius: 50% 50% 8px 8px / 33% 33% 8px 8px;
}

.gate__script {
  position: relative;
  margin-top: 26%;
  font-family: var(--font-script);
  font-size: clamp(2.3rem, 11vw, 2.85rem);
  line-height: 1;
  text-shadow: 0 2px 10px rgba(20, 25, 8, .3);
}

.gate__script--small {
  margin-top: .1em;
  font-size: clamp(1.45rem, 7vw, 1.8rem);
}

.gate__sprig-front {
  position: absolute;
  left: 50%;
  bottom: 21%;
  width: 34px;
  height: 19px;
  translate: -50% 0;
  color: var(--gold-light);
}

.gate__front-date {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11%;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(.95rem, 4.4vw, 1.1rem);
  letter-spacing: .22em;
  font-variant-numeric: lining-nums;
}

/* Faja de lino que cruza las puertas */
.gate__band {
  position: absolute;
  left: -3%;
  right: -3%;
  top: 55%;
  z-index: 4;
  height: 42px;
  background-color: #efe7d6;
  background-image:
    var(--tex-weave),
    var(--tex-grain),
    linear-gradient(180deg, #f6f0e3, #e4d9c3);
  border-block: var(--line-w) solid rgba(184, 146, 79, .65);
  box-shadow: 0 7px 12px -6px rgba(30, 35, 15, .45);
  transition: translate .8s cubic-bezier(.5, 0, .3, 1), opacity .6s ease .15s;
}

.gate.is-open .gate__band { translate: 0 240%; opacity: 0; }

/* Medallón de cristal */
.gate__seal {
  position: absolute;
  left: 50%;
  top: calc(55% + 21px);
  z-index: 5;
  width: clamp(76px, 22vw, 88px);
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1.5px solid rgba(227, 203, 152, .95);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .2) 45%, rgba(255, 255, 255, .08));
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  backdrop-filter: blur(8px) saturate(150%);
  box-shadow:
    0 12px 24px -8px rgba(30, 35, 15, .55),
    inset 0 1px 0 rgba(255, 255, 255, .95),
    inset 0 -6px 12px rgba(95, 109, 67, .2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .45s ease, scale .5s cubic-bezier(.5, 0, .7, .4);
}

.gate__seal::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: var(--line-w) solid rgba(184, 146, 79, .75);
}

/* halo que invita a tocar */
.gate__seal::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: var(--line-w) solid rgba(227, 203, 152, .9);
  animation: seal-halo 2.6s ease-out infinite;
}

@keyframes seal-halo {
  from { transform: scale(.88); opacity: .9; }
  to { transform: scale(1.4); opacity: 0; }
}

.gate__seal-mark {
  position: relative;
  font-family: var(--font-script);
  font-size: clamp(1.55rem, 7vw, 1.85rem);
  line-height: 1;
  color: var(--moss-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
}

.gate__seal-mark span { font-size: .78em; margin: 0 .04em; }
.gate__seal:hover { scale: 1.05; }

.gate__seal:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 6px;
}

.gate.is-open .gate__seal {
  opacity: 0;
  scale: .5;
  pointer-events: none;
}

/* Sin backdrop-filter, el medallón se vuelve marfil translúcido */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gate__seal { background: rgba(251, 248, 241, .85); }
}

/* Mientras la tarjeta está cerrada, la invitación no se dibuja (ahorra trabajo en la carga).
   Se prepara al tocar el medallón, durante la animación de apertura, que la resuelve la GPU. */
.js.intro-active:not(.intro-opening) .invitation { content-visibility: hidden; }

/* ---------- 19. Música flotante y progreso ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 60;
  width: min(100%, var(--invite-max));
  height: 2px;
  translate: -50% 0;
  pointer-events: none;
  transition: opacity .6s ease;
}

.scroll-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--moss), var(--gold-soft));
  transform: scaleX(0);
  transform-origin: left;
}

.music {
  --size: 50px;
  position: fixed;
  z-index: 60;
  left: calc(50% + min(50%, var(--invite-max) / 2) - var(--size) - 14px - env(safe-area-inset-right));
  top: calc(14px + env(safe-area-inset-top));
  width: var(--size);
  height: var(--size);
  transition: opacity .6s ease .5s, scale .6s cubic-bezier(.3, 1.4, .5, 1) .5s;
}

.intro-active .music,
.intro-active .scroll-progress {
  opacity: 0;
  scale: .6;
  pointer-events: none;
}

/* anillo punteado que gira mientras suena */
.music::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dotted rgba(246, 241, 230, .95);
  opacity: 0;
  transition: opacity .5s ease;
}

.music.is-playing::before {
  opacity: 1;
  animation: spin 14s linear infinite;
}

@keyframes spin { to { rotate: 360deg; } }

.music__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: var(--line-w) solid rgba(246, 241, 230, .8);
  border-radius: 50%;
  overflow: hidden;
  color: var(--cream);
  background-color: var(--moss);
  background-image:
    var(--tex-grain),
    radial-gradient(circle at 35% 28%, rgba(160, 175, 115, .55), transparent 60%),
    linear-gradient(160deg, var(--moss), var(--moss-deep));
  box-shadow:
    inset 0 0 0 3px rgba(55, 66, 31, .5),
    0 10px 20px -8px rgba(30, 36, 16, .6);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .3s ease;
}

.music__btn:hover { scale: 1.06; }
.music__btn:active { scale: .94; }

.music__btn:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 5px;
}

.music__icon { width: 22px; height: 22px; }

.music__bars {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.music__bars i {
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: var(--cream);
  transform-origin: bottom;
  animation: eq 1.1s ease-in-out infinite alternate;
}

.music__bars i:nth-child(2) { animation-duration: .8s; animation-delay: -.3s; }
.music__bars i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.6s; }
.music__bars i:nth-child(4) { animation-duration: .95s; animation-delay: -.2s; }

@keyframes eq {
  from { scale: 1 .25; }
  to { scale: 1 1; }
}

.music.is-loading .music__icon { animation: heartbeat 1.4s ease-in-out infinite; }
.music.is-playing .music__icon { display: none; }
.music.is-playing .music__bars { display: flex; }

/* ondas de gota alrededor del botón */
.music__wave {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(95, 109, 67, .8);
  pointer-events: none;
  animation: wave-out 1.3s cubic-bezier(.2, .6, .3, 1) var(--delay, 0s) both;
}

@keyframes wave-out {
  from { transform: scale(1); opacity: .9; }
  to { transform: scale(2.2); opacity: 0; }
}

/* ---------- 20. Rendimiento ---------- */
/* Las secciones lejanas no se procesan hasta acercarse al viewport.
   "auto" recuerda la altura real una vez dibujadas, así la barra de scroll no salta. */
.wedding,
.itinerary,
.walk-photo,
.dress,
.info {
  content-visibility: auto;
  contain-intrinsic-size: auto 700px;
}

/* ---------- 21. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }

  .photo--parallax img,
  .timeline__item::before,
  .hero__leaf,
  .gate,
  .orb,
  .brand__name span,
  .glass__blob,
  .glass__sheen::before,
  .shimmer::after { animation: none !important; }

  .has-reveal [data-reveal] { opacity: 1; }

  .thread text { fill-opacity: 1; stroke-opacity: .35; stroke-dashoffset: 0; }
  .intro__rule { opacity: .9; }
}
