/* =========================================================
   Invitación DWB-001 · Digital Wedding Bolivia
   Marfil · verde oliva · dorado — 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 */
  --ivory: #f3ecdf;
  --ivory-light: #faf6ee;
  --ivory-deep: #e8dcc6;
  --paper-edge: #fdfbf6;
  --olive: #4a552f;
  --olive-dark: #394324;
  --olive-deep: #2d351b;
  --sage: #9aa585;
  --sage-dark: #6f7b5c;
  --gold: #b8924f;
  --gold-soft: #cfae72;
  --gold-light: #e3cb98;
  --gold-ink: #85622d;      /* dorado oscuro para texto sobre marfil (AA) */
  --ink: #23281b;
  --ink-soft: #464b3b;
  --cream-on-olive: #f4ecdc;

  --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: 2rem;
  --space-xl: 3rem;
  --radius-s: 4px;
  --radius-m: 10px;
  --radius-l: 18px;
  --line: 1px;
  --wave-h: clamp(34px, 11vw, 48px);

  --shadow-print: 0 1px 2px rgba(60, 45, 20, .12), 0 10px 22px -8px rgba(60, 45, 20, .32);
  --shadow-soft: 0 6px 18px -10px rgba(45, 35, 15, .35);

  /* 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='.075'/%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='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='.09'/%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='.045'/%3E%3Crect width='100%25' height='100%25' filter='url(%23v)' opacity='.035'/%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");
  --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: #e4dac7;
  background-image:
    var(--tex-grain),
    radial-gradient(120% 80% at 50% 0%, #ece3d2 0%, #ddd1bb 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

/* Cormorant usa numerales antiguos por defecto: fechas y códigos con cifras alineadas */
.date, .design-code__code, .countdown, .timeline__time { font-variant-numeric: lining-nums; }
h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

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

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

/* Bordes del papel visibles en pantallas más anchas que la invitación */
@media (min-width: 460px) {
  .invitation {
    margin-block: 24px;
    border-radius: 6px;
    box-shadow:
      0 0 0 1px rgba(150, 125, 80, .18),
      0 30px 60px -30px rgba(50, 40, 20, .45),
      0 8px 20px -12px rgba(50, 40, 20, .3);
  }
}

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

/* Paneles verde oliva con acabado textil / papel teñido */
.textile {
  position: relative;
  color: var(--cream-on-olive);
  background-color: var(--olive);
  background-image:
    var(--tex-weave),
    var(--tex-grain),
    radial-gradient(120% 70% at 15% 10%, rgba(120, 135, 80, .35), transparent 60%),
    radial-gradient(90% 60% at 90% 90%, rgba(25, 30, 12, .45), transparent 65%),
    radial-gradient(70% 50% at 70% 30%, rgba(90, 100, 55, .25), transparent 70%),
    linear-gradient(160deg, var(--olive) 0%, var(--olive-dark) 60%, var(--olive-deep) 100%);
}

/* ---------- 4. Utilidades tipográficas y ornamentos ---------- */
.eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.72rem, 3.2vw, .82rem);
  letter-spacing: .34em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.7;
}

.eyebrow--gold { color: var(--gold-ink); }

.branch {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.flourish {
  position: absolute;
  pointer-events: none;
  fill: none;
  stroke: var(--gold-soft);
  stroke-width: 1;
  stroke-linecap: round;
  opacity: .8;
}

.flourish path,
.wave-line path { vector-effect: non-scaling-stroke; }

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: var(--space-m) auto var(--space-s);
  color: var(--gold);
  width: min(78%, 300px);
}

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

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

.divider svg { width: 14px; height: 13px; flex: none; }

/* ---------- 5. Fotografías ---------- */
/* --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, #d9cfbb, #b9b39b);
}

.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--bw img { filter: grayscale(1) sepia(.16) contrast(1.06) brightness(1.03); }
.photo--warm img { filter: saturate(.88) sepia(.1) contrast(1.02); }
.photo--night img { filter: saturate(1.05) sepia(.08) contrast(1.04); }

/* Alternativa visual si una imagen externa falla */
.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);
}

/* Fotografía impresa con borde blanco */
.polaroid {
  position: relative;
  padding: clamp(5px, 1.8vw, 8px);
  background: var(--paper-edge);
  box-shadow: var(--shadow-print);
}

.polaroid .photo { height: 100%; }

/* ---------- 6. Sección 1 · Marca ---------- */
.brand {
  padding-top: calc(var(--space-l) + env(safe-area-inset-top));
  padding-bottom: var(--space-s);
  text-align: center;
}

.brand__inner { 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 6px 8px rgba(90, 65, 20, .18));
}

.brand__name {
  margin-top: .35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.45rem, 7.4vw, 1.9rem);
  line-height: 1;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #3b3b33;
}

.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: .45rem auto 0;
  width: min(72%, 270px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.68rem, 3vw, .78rem);
  letter-spacing: .5em;
  text-indent: .5em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

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

.brand__tagline {
  margin-top: .45rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.6rem, 2.7vw, .68rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  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) solid var(--gold-soft);
  border-radius: 999px;
  background: rgba(255, 253, 248, .6);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .45);
}

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

.brand__demo-code {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.66rem, 2.9vw, .74rem);
  letter-spacing: .22em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
  color: var(--ink-soft);
}

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

.branch--brand {
  top: -18px;
  right: -46px;
  width: clamp(120px, 38vw, 160px);
  height: auto;
  aspect-ratio: 200 / 260;
  transform: rotate(18deg);
  opacity: .8;
}

.branch--brand-left {
  top: 210px;
  left: -70px;
  width: 110px;
  aspect-ratio: 200 / 260;
  transform: rotate(-60deg) scaleX(-1);
  opacity: .55;
}

/* ---------- 7. Sección 2 · Novios ---------- */
.couple {
  padding-top: var(--space-m);
  padding-bottom: var(--space-s);
  min-height: 0;
}

.couple__names {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--ink);
  line-height: .9;
}

.couple__name {
  font-size: clamp(3.6rem, 19vw, 5rem);
  letter-spacing: .005em;
  white-space: nowrap;
}

.couple__name--first { margin-left: 4%; }

.couple__amp {
  margin: -.05em 0 -.12em 24%;
  font-size: clamp(2.6rem, 13vw, 3.4rem);
  line-height: 1;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* margen para que el recorte del degradado no corte la caligrafía */
  padding: 0 .15em;
}

.couple__name--second { margin-left: 13%; }

.couple__tagline {
  position: absolute;
  z-index: 1;
  right: var(--gutter);
  top: 41%;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.62rem, 2.8vw, .74rem);
  letter-spacing: .3em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.couple__heart {
  position: absolute;
  right: calc(var(--gutter) + 4px);
  bottom: 6%;
  width: clamp(48px, 14vw, 60px);
  height: auto;
  aspect-ratio: 64 / 48;
  color: var(--gold);
}

.flourish--couple {
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ---------- 8. Sección 3 · Fotografías ---------- */
.gallery {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  padding-top: var(--space-s);
  padding-bottom: var(--space-l);
}

.polaroid--left {
  z-index: 1;
  aspect-ratio: 1.22;
  transform: rotate(-3.2deg);
}

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

.polaroid--right {
  z-index: 2;
  aspect-ratio: .76;
  margin-left: -10%;
  transform: rotate(3.4deg) translateY(-4%);
}

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

.polaroid__heart {
  position: absolute;
  right: -10%;
  bottom: -14%;
  width: clamp(46px, 14vw, 58px);
  aspect-ratio: 64 / 48;
  height: auto;
  color: var(--gold);
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .8));
}

/* ---------- 9. Sección 4 y 5 · Mensaje y fecha ---------- */
.message {
  text-align: center;
  padding-bottom: var(--space-l);
}

.message__text {
  max-width: 21em;
  margin-inline: auto;
  font-family: var(--font-text);
  font-size: clamp(1.02rem, 4.6vw, 1.15rem);
  line-height: 1.5;
  color: var(--ink);
  text-wrap: balance;
}

.date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.3rem, 1.6vw, .5rem);
  margin-top: var(--space-m);
}

.date__box {
  padding: .5rem clamp(.4rem, 2vw, .7rem) .45rem;
  border: var(--line) solid var(--gold-soft);
  border-radius: var(--radius-s);
  background: rgba(255, 253, 248, .55);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.66rem, 3.1vw, .86rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
}

.date__day {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: clamp(62px, 19vw, 80px);
  aspect-ratio: 32 / 28;
}

.date__day svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 4px 6px rgba(45, 53, 27, .3));
}

.date__day path {
  fill: url(#g-olive);
  stroke: var(--gold-soft);
  stroke-width: .7;
}

.date__day span {
  position: relative;
  margin-top: -8%;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.45rem, 7vw, 1.85rem);
  line-height: 1;
  color: var(--cream-on-olive);
}

/* ---------- 10. Sección 6 · Cronograma ---------- */
.schedule {
  padding-bottom: var(--space-l);
}

.timeline {
  --icon: clamp(46px, 13vw, 54px);
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(1.1rem, 5vw, 1.5rem);
  padding-left: clamp(0px, 2vw, .5rem);
}

/* línea vertical que une los iconos */
.timeline::before {
  content: "";
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: calc(clamp(0px, 2vw, .5rem) + var(--icon) / 2);
  width: 1.5px;
  background: linear-gradient(var(--olive), var(--olive-dark));
  opacity: .85;
}

.timeline__item {
  display: grid;
  grid-template-columns: var(--icon) auto 1fr;
  align-items: center;
  column-gap: clamp(.65rem, 3.5vw, 1rem);
}

.timeline__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--icon);
  aspect-ratio: 1;
  border: 1.5px solid var(--olive);
  border-radius: 50%;
  background: var(--ivory-light);
  box-shadow: 0 0 0 4px var(--ivory), var(--shadow-soft);
  color: var(--olive-dark);
}

.timeline__icon svg { width: 52%; height: 52%; }

.timeline__time {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 6vw, 1.55rem);
  font-variant-numeric: lining-nums;
  color: var(--gold-ink);
  letter-spacing: .02em;
}

.timeline__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.74rem, 3.2vw, .84rem);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: .15rem;
}

.timeline__body p {
  font-size: clamp(.86rem, 3.8vw, .95rem);
  line-height: 1.38;
  color: var(--ink-soft);
}

.branch--schedule {
  left: -62px;
  top: 4%;
  width: 130px;
  aspect-ratio: 200 / 260;
  transform: rotate(150deg) scaleX(-1);
  opacity: .5;
}

.flourish--schedule {
  right: 0;
  top: 0;
  width: 22%;
  height: 100%;
  opacity: .55;
}

/* ---------- 11. Sección 7 · Ubicación ---------- */
.venue {
  padding-bottom: var(--space-xl);
}

.venue__card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: .75rem;
  padding: 1.2rem 1.25rem 1.3rem;
  border-radius: var(--radius-l);
  box-shadow: 0 18px 30px -18px rgba(35, 42, 18, .65);
  text-align: center;
}

/* filete dorado interior */
.venue__card::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: var(--line) solid rgba(227, 203, 152, .45);
  border-radius: calc(var(--radius-l) - 5px);
  pointer-events: none;
}

.venue__pin {
  width: clamp(30px, 9vw, 38px);
  height: auto;
  aspect-ratio: 1;
  color: var(--gold-light);
}

.venue__text { padding-right: clamp(.5rem, 6vw, 2rem); }

.venue__label {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(1.7rem, 8vw, 2.1rem);
  line-height: 1.1;
  color: var(--gold-light);
}

.venue__name {
  margin-top: .2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.98rem, 4.6vw, 1.15rem);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.venue__city {
  margin-top: .1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.64rem, 2.9vw, .72rem);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: rgba(244, 236, 220, .82);
}

/* ---------- 12. Sección 8 · Mensaje romántico ---------- */
.romance {
  padding-bottom: calc(var(--space-xl) + var(--wave-h));
  -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;
}

.romance__photo {
  aspect-ratio: 1 / 1.02;
  -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;
}

.romance__photo img { object-position: 50% 12%; }

.wave-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--wave-h);
  fill: none;
  stroke: var(--gold-soft);
  stroke-width: 1.2;
  pointer-events: none;
}

.wave-line--bottom { bottom: 0; }
.wave-line--top { top: 0; }

.romance__content {
  position: relative;
  z-index: 1;
  padding: var(--space-m) var(--gutter) 0;
  text-align: center;
}

.romance__quote p {
  max-width: 17em;
  margin-inline: auto;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.18rem, 5.4vw, 1.35rem);
  line-height: 1.45;
  letter-spacing: .02em;
  text-wrap: balance;
}

.romance__heart {
  width: 16px;
  height: 14px;
  margin: 1rem auto .6rem;
  color: var(--gold-soft);
}

.romance__script {
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 12vw, 3rem);
  line-height: 1.2;
  color: var(--cream-on-olive);
}

.flourish--romance {
  left: 0;
  bottom: .4rem;
  width: 100%;
  height: 48px;
  stroke: var(--gold-light);
  opacity: .6;
}

.branch--romance {
  right: -38px;
  bottom: calc(var(--wave-h) - 34px);
  width: clamp(84px, 25vw, 106px);
  aspect-ratio: 200 / 260;
  transform: rotate(68deg);
  opacity: .55;
  filter: brightness(1.25) saturate(.8);
}

/* ---------- 13. Sección 9 · Juntos es mejor + cuenta regresiva ---------- */
.together {
  padding-top: var(--space-m);
  padding-bottom: var(--space-l);
  margin-top: calc(var(--wave-h) * -0.4);
}

.together .eyebrow {
  font-size: clamp(.66rem, 2.9vw, .76rem);
  letter-spacing: .36em;
  margin-bottom: var(--space-s);
}

.together__photo {
  aspect-ratio: 1 / 1.05;
  margin-inline: calc(var(--gutter) * -1);
  -webkit-mask:
    var(--wave-top) top / 100% var(--wave-h) no-repeat,
    var(--solid) center / 100% calc(100% - 2 * var(--wave-h) + 2px) no-repeat,
    var(--wave-bottom) bottom / 100% var(--wave-h) no-repeat;
  mask:
    var(--wave-top) top / 100% var(--wave-h) no-repeat,
    var(--solid) center / 100% calc(100% - 2 * var(--wave-h) + 2px) no-repeat,
    var(--wave-bottom) bottom / 100% var(--wave-h) no-repeat;
}

.together__photo img { object-position: 50% 22%; }

.together__title {
  position: relative;
  display: flex;
  flex-direction: column;
  width: fit-content;
  margin: var(--space-s) auto 0;
  padding-right: 2.6rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 12.5vw, 3.1rem);
  line-height: .95;
  color: var(--ink);
}

.together__title span:last-of-type { margin-left: 1.6em; }

.together__heart {
  position: absolute;
  right: -.4rem;
  top: 30%;
  width: 46px;
  aspect-ratio: 64 / 48;
  height: auto;
  color: var(--gold);
}

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

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.4rem, 2.4vw, .7rem);
  max-width: 340px;
  margin-inline: auto;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}

.countdown__value {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / .88;
  border: var(--line) solid var(--gold-soft);
  border-radius: 7px;
  background: rgba(255, 253, 248, .6);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4), 0 4px 10px -8px rgba(60, 45, 20, .5);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.3rem, 6.4vw, 1.7rem);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
}

.countdown__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.56rem, 2.5vw, .64rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

/* ---------- 14. Sección 10 · Código del diseño ---------- */
.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));
  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 .wave-line { stroke: var(--gold-light); }

.design-code__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.82rem, 3.8vw, .95rem);
  letter-spacing: .24em;
  text-transform: uppercase;
}

.design-code__code {
  position: relative;
  margin-top: var(--space-s);
  padding: .5rem clamp(2rem, 11vw, 3rem) .55rem;
  border: var(--line) solid var(--gold-soft);
  border-radius: 999px;
  background:
    radial-gradient(100% 140% at 50% 0%, rgba(255, 255, 255, .1), transparent 60%),
    rgba(30, 36, 16, .25);
  box-shadow:
    inset 0 0 0 3px rgba(45, 53, 27, .6),
    inset 0 0 0 4px rgba(227, 203, 152, .25),
    0 0 18px rgba(227, 203, 152, .12);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.7rem, 8.5vw, 2.1rem);
  letter-spacing: .08em;
  line-height: 1.2;
  color: var(--cream-on-olive);
}

.design-code__leaf {
  width: 38px;
  height: 38px;
  margin: var(--space-m) auto;
  color: var(--gold-light);
  opacity: .9;
}

.btn-catalog {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  min-height: 52px;
  padding: .75rem 1.6rem .75rem 2rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbf7ef, #efe5d2);
  box-shadow:
    inset 0 0 0 1px rgba(184, 146, 79, .55),
    0 10px 22px -12px rgba(0, 0, 0, .55);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.9rem, 4.2vw, 1.02rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-ink);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.btn-catalog svg {
  width: 18px;
  height: 18px;
  transition: transform .25s ease;
}

.btn-catalog[href] { cursor: pointer; }

.btn-catalog[href]:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #fffdf8, #f3eadb);
  box-shadow:
    inset 0 0 0 1px rgba(184, 146, 79, .8),
    0 14px 26px -12px rgba(0, 0, 0, .6);
}

.btn-catalog[href]:hover svg { transform: translateX(3px); }

.btn-catalog[href]:active { transform: translateY(0); }

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

/* Sin destino configurado: se muestra, pero no se presenta como accionable */
.btn-catalog[aria-disabled="true"] {
  cursor: default;
  opacity: .92;
}

/* ---------- 15. Animación 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 .polaroid[data-reveal] {
  transition:
    opacity .9s ease,
    transform 1.1s cubic-bezier(.2, .7, .2, 1),
    rotate .5s ease,
    scale .5s ease,
    box-shadow .5s ease;
}

.has-reveal .polaroid--left[data-reveal] { transform: rotate(-3.2deg) translateY(16px); }
.has-reveal .polaroid--right[data-reveal] { transform: rotate(3.4deg) translateY(12%); }

.has-reveal [data-reveal].is-visible { opacity: 1; transform: none; }
.has-reveal .polaroid--left[data-reveal].is-visible { transform: rotate(-3.2deg); }
.has-reveal .polaroid--right[data-reveal].is-visible { transform: rotate(3.4deg) translateY(-4%); transition-delay: .15s; }

/* Fotografías impresas: se "revelan" como una instantánea */
.has-reveal .polaroid .photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at 50% 40%, #faf6ee, #e6dece);
  pointer-events: none;
  transition: opacity 1.4s ease .2s;
}

.has-reveal .polaroid .photo img {
  scale: 1.08;
  transition: scale 1.8s cubic-bezier(.2, .7, .2, 1) .2s, opacity .6s ease;
}

.has-reveal .polaroid.is-visible .photo::before { opacity: 0; }
.has-reveal .polaroid.is-visible .photo img { scale: 1; }

@media (hover: hover) {
  .polaroid--left:hover { rotate: 2.6deg; scale: 1.03; }
  .polaroid--right:hover { rotate: -2.8deg; scale: 1.03; }
  .polaroid:hover { box-shadow: 0 2px 4px rgba(60, 45, 20, .12), 0 22px 34px -12px rgba(60, 45, 20, .38); }
}

/* 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); }

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

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

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

.has-reveal .couple__names.is-visible .couple__name,
.has-reveal .couple__names.is-visible .couple__amp { clip-path: inset(-30% -15% -40% -15%); }

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

/* Brillo dorado que recorre los acentos (un solo paso de ida y vuelta: no repinta indefinidamente) */
.brand__name span,
.couple__amp {
  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%; }
}

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

.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 240, 205, .22) 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%); }
}

/* Cuenta regresiva: destello dorado cuando cambia la cifra */
.countdown__value.tick { animation: tick .6s ease; }
.countdown__value.tick-alt { animation: tick-alt .6s ease; }

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

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

/* 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%; }
  }

  .polaroid--left {
    animation: drift-up linear both;
    animation-timeline: view();
  }

  .polaroid--right {
    animation: drift-down linear both;
    animation-timeline: view();
  }

  @keyframes drift-up {
    from { translate: 0 14px; }
    to { translate: 0 -14px; }
  }

  @keyframes drift-down {
    from { translate: 0 -10px; }
    to { translate: 0 18px; }
  }

  .timeline::before {
    transform-origin: top;
    animation: draw-line linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 60%;
  }

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

  .section > .branch {
    animation: branch-sway linear both;
    animation-timeline: view();
  }

  @keyframes branch-sway {
    from { translate: 0 18px; }
    to { translate: 0 -18px; }
  }
}

/* ---------- 16. Efecto gota (botones) ---------- */
.drop {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 220, 170, .6) 0%, rgba(240, 220, 170, .25) 45%, rgba(240, 220, 170, 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; }
}

/* ---------- 17. Intro · sobre ---------- */
.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(1rem, 4.4vh, 2.4rem);
  padding: calc(1.5rem + env(safe-area-inset-top)) var(--gutter) calc(1.5rem + env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  transition: opacity .8s ease;
}

/* viñeta suave para dar profundidad */
.intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 45%, transparent 35%, rgba(15, 20, 6, .45) 100%);
  pointer-events: none;
}

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

.intro__title,
.intro__couple,
.intro__hint {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--cream-on-olive);
  transition: opacity .6s ease, translate .6s ease;
}

.intro__title {
  width: min(88vw, 360px);
  margin: 0;
  font-weight: 400;
}

.intro__couple {
  display: grid;
  justify-items: center;
  gap: .35rem;
  width: min(86vw, 340px);
}

/* 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(30, 22, 6, .55));
}

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

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

.intro.is-ready .thread--names text { animation-delay: .5s, 1.5s; }

@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: 62%;
  color: var(--gold-light);
  opacity: 0;
  transition: opacity 1s ease 1.9s;
}

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

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

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

.intro__rule svg { width: 11px; height: 10px; flex: none; }

.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;
}

.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;
  opacity: .85;
}

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

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

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

.intro__branch {
  width: clamp(150px, 42vw, 220px);
  aspect-ratio: 200 / 260;
  opacity: .32;
  filter: brightness(1.35) saturate(.7);
}

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

/* Pétalos que flotan */
.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 75% 0 75%;
  background: linear-gradient(135deg, #fffaf2 0%, #f1e3d3 60%, #e3cdb6 100%);
  box-shadow: inset -1px -1px 2px rgba(150, 120, 80, .25);
  opacity: var(--o, .8);
  animation: petal-fall var(--dur, 12s) linear var(--delay, 0s) infinite;
}

.petal--leaf {
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, #c7cfb3, #8e9b76);
}

/* Valores fijos (sin variables) para que la GPU anime los pétalos 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); }
}

/* Sobre */
.envelope {
  position: relative;
  z-index: 3;
  width: min(84vw, 360px);
  aspect-ratio: 4 / 3;
  perspective: 1100px;
  cursor: pointer;
  animation: envelope-float 6s ease-in-out infinite;
  transition: scale 1.1s cubic-bezier(.4, 0, .2, 1), opacity 1s ease;
}

@keyframes envelope-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.intro.is-leaving .envelope { scale: 1.12; opacity: 0; }

.envelope__back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background-color: #e6d9c2;
  background-image:
    var(--tex-grain),
    linear-gradient(180deg, #ddcfb6, #e9dec9);
  box-shadow:
    0 28px 40px -18px rgba(10, 14, 4, .7),
    0 2px 5px rgba(10, 14, 4, .25);
}

.envelope__letter {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 5%;
  height: 88%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: .2rem;
  padding: 9% 6% 0;
  border-radius: 4px;
  background-color: var(--ivory-light);
  background-image:
    var(--tex-grain),
    radial-gradient(120% 70% at 50% 0%, #fffdf8, transparent 70%);
  box-shadow: 0 -2px 10px rgba(60, 45, 20, .15);
  text-align: center;
  color: var(--ink);
  transition: translate .85s cubic-bezier(.3, .7, .2, 1);
}

.envelope__letter::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: var(--line) solid rgba(201, 166, 107, .55);
  border-radius: 3px;
  pointer-events: none;
}

.envelope__letter-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.58rem, 2.6vw, .68rem);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-ink);
}

.envelope__letter-names {
  font-family: var(--font-script);
  font-size: clamp(1.7rem, 8vw, 2.2rem);
  line-height: 1.15;
  white-space: nowrap;
}

.envelope__letter-names span { color: var(--gold); }

.envelope__letter-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(.72rem, 3.2vw, .82rem);
  letter-spacing: .26em;
  font-variant-numeric: lining-nums;
  color: var(--ink-soft);
}

.envelope__pocket {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
  filter: drop-shadow(0 -1px 1px rgba(80, 60, 30, .12));
}

.envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56%;
  z-index: 3;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.45, 0, .2, 1) .1s;
}

.envelope__flap-face {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.envelope__flap-face svg {
  width: 100%;
  height: 100%;
}

.envelope__flap-face--front {
  background-color: #efe5d3;
  background-image:
    var(--tex-grain),
    linear-gradient(180deg, #f6eee0 0%, #eadcc5 100%);
}

/* forro interior verde oliva */
.envelope__flap-face--back {
  transform: rotateX(180deg);
  background-color: var(--olive);
  background-image:
    var(--tex-weave),
    var(--tex-grain),
    linear-gradient(0deg, var(--olive-dark), var(--olive));
}

.envelope.is-open .envelope__flap { transform: rotateX(180deg); }
.envelope.is-flap-behind .envelope__flap { z-index: 0; }
.envelope.is-letter-out .envelope__letter { translate: 0 -54%; }

.envelope__flora {
  position: absolute;
  z-index: 5;
  width: 50%;
  aspect-ratio: 180 / 160;
  pointer-events: none;
  filter: drop-shadow(0 4px 5px rgba(15, 20, 6, .3));
  transition: opacity .7s ease, scale .7s ease;
}

.envelope__flora--bl { left: -16%; bottom: -18%; }
.envelope__flora--tr { right: -14%; top: -16%; transform: rotate(180deg) scale(.72); }

.envelope.is-open .envelope__flora { opacity: 0; scale: .85; }

/* Sello de lacre */
.envelope__seal {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 6;
  width: clamp(66px, 19vw, 80px);
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 47% 53% 51% 49% / 52% 46% 54% 48%;
  background: radial-gradient(circle at 34% 28%, #84915b 0%, #5a6740 32%, #3c4726 72%, #2a321a 100%);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, .25),
    inset 0 -5px 9px rgba(0, 0, 0, .4),
    0 8px 14px rgba(10, 14, 4, .4),
    0 0 0 3px rgba(74, 85, 47, .6);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .45s ease, scale .5s cubic-bezier(.5, 0, .7, .4), rotate .5s ease;
}

.envelope__seal::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1.5px solid rgba(227, 203, 152, .75);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .12);
}

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

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

.envelope__seal-mark {
  position: relative;
  font-family: var(--font-script);
  font-size: clamp(1.45rem, 6.4vw, 1.8rem);
  line-height: 1;
  color: #ecd7a6;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 -1px 0 rgba(255, 240, 205, .2);
}

.envelope__seal-mark span { font-size: .78em; margin: 0 .04em; }

.envelope__seal:hover { scale: 1.05; }

.envelope__seal:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 6px;
}

.envelope.is-open .envelope__seal {
  opacity: 0;
  scale: .4;
  rotate: -25deg;
  pointer-events: none;
}

/* Mientras el sobre está cerrado, la invitación no se dibuja (ahorra trabajo en la carga).
   Se prepara al tocar el sello, durante la animación de apertura, que la resuelve la GPU.
   No se anima la invitación completa: sería una capa enorme para la memoria del móvil. */
.js.intro-active:not(.intro-opening) .invitation { content-visibility: hidden; }

/* ---------- 18. Música 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: var(--gold-gradient);
  box-shadow: 0 0 6px rgba(227, 203, 152, .7);
  transform: scaleX(0);
  transform-origin: left;
}

.music {
  --size: 52px;
  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(201, 166, 107, .9);
  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) solid var(--gold-soft);
  border-radius: 50%;
  overflow: hidden;
  color: var(--gold-light);
  background-color: var(--olive);
  background-image:
    var(--tex-grain),
    radial-gradient(circle at 35% 28%, rgba(140, 155, 95, .55), transparent 60%),
    linear-gradient(160deg, var(--olive), var(--olive-deep));
  box-shadow:
    inset 0 0 0 3px rgba(45, 53, 27, .55),
    inset 0 0 0 4px rgba(227, 203, 152, .25),
    0 10px 20px -8px rgba(30, 36, 16, .65);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .3s ease, box-shadow .3s ease;
}

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

.music__btn:focus-visible {
  outline: 2px solid var(--gold);
  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(--gold-light);
  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; }
}

/* mientras la canción carga tras pedirla */
.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(201, 166, 107, .85);
  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; }
}

/* ---------- 19. Confirmación de asistencia ---------- */
.rsvp {
  padding-top: var(--space-m);
  padding-bottom: calc(var(--space-xl) + var(--wave-h));
}

.rsvp__card {
  position: relative;
  z-index: 1;
  padding: 2rem clamp(1.1rem, 5vw, 1.6rem) 1.8rem;
  border: var(--line) solid rgba(201, 166, 107, .6);
  border-radius: 14px;
  background-color: rgba(255, 253, 248, .6);
  background-image:
    var(--tex-grain),
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, .7), transparent 70%);
  box-shadow: 0 24px 40px -30px rgba(60, 45, 20, .55);
  text-align: center;
}

.rsvp__card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: var(--line) solid rgba(201, 166, 107, .28);
  border-radius: 10px;
  pointer-events: none;
}

.rsvp__title {
  margin-top: .2rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.4rem, 11vw, 2.9rem);
  line-height: 1.15;
  color: var(--ink);
}

.rsvp__intro {
  max-width: 20em;
  margin: .3rem auto 1.5rem;
  font-size: clamp(.95rem, 4.2vw, 1.02rem);
  line-height: 1.45;
  color: var(--ink-soft);
}

.rsvp__form {
  position: relative;
  display: grid;
  gap: 1.15rem;
  text-align: left;
}

.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(--olive-dark);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  border: var(--line) solid rgba(184, 146, 79, .5);
  border-radius: 9px;
  background: rgba(255, 255, 255, .65);
  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: #85836f; }

.field__input:focus {
  outline: none;
  border-color: var(--olive);
  background-color: #fffdf8;
  box-shadow: 0 0 0 3px rgba(74, 85, 47, .16);
}

.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) solid rgba(184, 146, 79, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  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(--olive-dark);
  cursor: pointer;
  transition: background-color .2s ease;
}

.stepper__btn:hover:not(:disabled) { background-color: rgba(74, 85, 47, .09); }
.stepper__btn:disabled { opacity: .3; cursor: default; }

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

.stepper__value {
  width: 3.2rem;
  height: 46px;
  border: 0;
  border-inline: var(--line) solid rgba(184, 146, 79, .3);
  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) solid var(--gold-soft);
}

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

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

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

.btn-rsvp {
  position: relative;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  width: 100%;
  min-height: 54px;
  margin-top: .5rem;
  padding: .8rem 1.2rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.84rem, 3.8vw, .96rem);
  letter-spacing: .15em;
  white-space: nowrap;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-light);
  box-shadow:
    inset 0 0 0 1px rgba(227, 203, 152, .55),
    inset 0 0 0 4px rgba(45, 53, 27, .5),
    0 16px 26px -14px rgba(35, 42, 18, .85);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: translate .25s ease, box-shadow .25s ease, opacity .25s ease;
}

.btn-rsvp svg {
  width: 17px;
  height: 15px;
  flex: none;
}

.btn-rsvp:hover {
  translate: 0 -2px;
  box-shadow:
    inset 0 0 0 1px rgba(227, 203, 152, .85),
    inset 0 0 0 4px rgba(45, 53, 27, .5),
    0 20px 30px -14px rgba(35, 42, 18, .9);
}

.btn-rsvp:hover svg { animation: heartbeat 1.4s ease-in-out infinite; }
.btn-rsvp:active { translate: 0 0; }

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

.btn-rsvp:disabled { opacity: .7; cursor: progress; }

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

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

.rsvp__success {
  display: grid;
  justify-items: center;
  gap: .6rem;
  padding: .5rem 0;
  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(--gold);
  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);
}

.branch--rsvp {
  right: -54px;
  top: 0;
  width: 128px;
  aspect-ratio: 200 / 260;
  transform: rotate(200deg);
  opacity: .5;
}

.flower-accent {
  position: absolute;
  z-index: 2;
  left: calc(var(--gutter) - 14px);
  top: calc(var(--space-m) - 14px);
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 3px 4px rgba(60, 45, 20, .25));
}

/* ---------- 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. */
.schedule,
.venue,
.romance,
.together,
.rsvp {
  content-visibility: auto;
  contain-intrinsic-size: auto 720px;
}

/* ---------- 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,
  .polaroid,
  .timeline::before,
  .section > .branch,
  .envelope,
  .brand__name span,
  .couple__amp,
  .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; }
}
