/* Invitación: estilos del invitado. Los colores y fuentes vienen del tema (js/themes.js → variables CSS). */
:root {
  --bg: #efe6d6; --paper: #f9f3e7; --ink: #4a3a2a; --muted: #86705a;
  --primary: #b08d57; --secondary: #d9c3a3;
  --envelope: #e9dcc4; --envelope-inner: #d6c3a2; --seal: #9b2f3b; --seal-ink: #f2d8a4; --curtain: #7a2430;
  --font-title: Georgia, serif; --font-body: Georgia, serif; --font-script: cursive;
  --texture: none; --texture-size: auto;
  --radius: 18px;
  --ease: cubic-bezier(.22, .9, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.locked, html.locked body { overflow: hidden; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, video, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
.backdrop { position: fixed; inset: 0; z-index: -1; background-image: var(--texture); background-size: var(--texture-size); pointer-events: none; }

.loading { width: 42px; height: 42px; margin: 40vh auto; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--primary) 25%, transparent); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Tarjeta ---------- */
.invite { position: relative; z-index: 1; padding: max(14px, env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom)); }
.card {
  position: relative; max-width: 600px; margin: 0 auto; overflow: hidden;
  padding: clamp(28px, 7vw, 56px) clamp(20px, 6vw, 52px);
  background: var(--paper); border-radius: var(--radius);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 30%, transparent) inset, 0 18px 50px -20px rgba(0, 0, 0, .35);
  isolation: isolate;
}
.card::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: var(--texture); background-size: var(--texture-size); opacity: .9; pointer-events: none; }
.card::after { content: ''; position: absolute; inset: 10px; border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); border-radius: calc(var(--radius) - 6px); pointer-events: none; }

.sec { padding: 10px 0 18px; text-align: center; }
.sec-title { margin: 0 0 14px; font: 400 clamp(1.45rem, 5.6vw, 1.8rem)/1.2 var(--font-title); color: var(--primary); letter-spacing: .02em; }
.divider { display: flex; justify-content: center; margin: 6px 0 14px; }
.divider svg { width: 150px; height: 20px; }
.center { text-align: center; }
.muted { color: var(--muted); }
p { margin: 0 0 .9em; }

.ornament { display: flex; justify-content: center; }
.ornament svg { width: min(190px, 56vw); height: auto; max-height: 80px; }
.ornament.small svg { width: 110px; max-height: 48px; }
.pretitle { margin: 8px 0 2px; font-size: .95rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.salutation { margin: 6px 0 4px; }
.greeting { margin: 4px 0 2px; font-size: 1.05rem; color: var(--muted); }
.divider.small { margin: 14px 0 6px; }
.guest-name { margin: 0 0 6px; font: 400 clamp(2rem, 9vw, 2.8rem)/1.15 var(--font-name, var(--font-script)); color: var(--primary); }
.seats { display: inline-block; margin: 0 0 14px; padding: 4px 14px; border: 1px solid color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 999px; font-size: .85rem; letter-spacing: .04em; color: var(--muted); }
.title { margin: 10px 0 6px; font: 400 clamp(2rem, 8.5vw, 3.1rem)/1.1 var(--font-title); letter-spacing: .03em; text-wrap: balance; }
.names { margin: 4px 0 0; font: 400 clamp(2.3rem, 11vw, 3.6rem)/1.1 var(--font-script); color: var(--primary); text-wrap: balance; }
.names.long { font-size: clamp(1.8rem, 8vw, 2.7rem); }
.letter-names.long { font-size: clamp(1rem, 4.4vw, 1.35rem); }
/* Botánico: título grande en mayúsculas y el nombre sobre una pincelada salvia */
[data-decor="botanical"] .title { text-transform: uppercase; font-size: clamp(3.2rem, 17vw, 5rem); letter-spacing: .04em; line-height: 1; margin-top: 4px; }
[data-decor="botanical"] .letter-title { text-transform: uppercase; font-size: clamp(1.4rem, 6vw, 1.9rem); letter-spacing: .05em; }
[data-decor="botanical"] .guest-name { display: inline-block; padding: .1em .9em .15em; color: var(--ink); font-size: clamp(1.6rem, 7vw, 2.2rem);
  background: radial-gradient(60% 48% at 50% 55%, color-mix(in srgb, var(--secondary) 55%, transparent) 0 70%, transparent 100%); }
[data-decor="botanical"] .pretitle { margin-bottom: 8px; }
.lead { font-size: 1.08rem; line-height: 1.8; text-wrap: pretty; }
.farewell { margin: 6px 0 10px; font: 400 clamp(2.4rem, 11vw, 3.4rem)/1.1 var(--font-script); color: var(--primary); }
.ornament.end { margin-top: 18px; transform: scaleY(-1); opacity: .9; }
.signature { margin-top: 10px; font: 400 clamp(1.9rem, 8vw, 2.5rem)/1.2 var(--font-script); color: var(--primary); }

/* ---------- Aparición al hacer scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease), filter 1.2s var(--ease); transition-delay: calc(var(--d, 0) * 110ms); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- Imagen principal ---------- */
.hero { margin: 4px 0 6px; }
.hero-in { position: relative; overflow: hidden; border-radius: calc(var(--radius) - 6px); }
.hero img { width: 100%; height: auto; }
.fx-kenburns .hero-in, .fx-parallax .hero-in { aspect-ratio: 4 / 5; }
.fx-kenburns img, .fx-parallax img { position: absolute; inset: 0; height: 100%; object-fit: cover; }
.fx-kenburns img { animation: kenburns 22s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.16) translate(-2%, 1%); } }
.fx-parallax img { top: -15%; height: 130%; will-change: transform; }
.hero.fx-blur[data-reveal] { filter: blur(16px); transform: scale(1.04); }
.hero.fx-blur[data-reveal].in { filter: none; transform: none; }
.fx-glow .hero-in { padding: 5px; background: linear-gradient(120deg, var(--primary), color-mix(in srgb, var(--primary) 30%, #fff), var(--secondary), var(--primary)); background-size: 300% 300%; animation: glow 6s linear infinite; box-shadow: 0 0 28px -4px color-mix(in srgb, var(--primary) 70%, transparent); }
.fx-glow img { border-radius: calc(var(--radius) - 10px); }
@keyframes glow { to { background-position: 300% 0; } }

/* ---------- Video ---------- */
.video { margin: 4px 0; border-radius: calc(var(--radius) - 6px); overflow: hidden; background: #000; }
.video iframe, .video .vid-poster { width: 100%; aspect-ratio: 16 / 9; border: 0; }
.video video { width: 100%; height: auto; }
.vid-wrap { position: relative; }
.vid-sound { position: absolute; right: 10px; bottom: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 1.2rem; cursor: pointer; }
.vid-poster { display: grid; place-items: center; padding: 0; border: 0; background: #111 center / cover; cursor: pointer; }
.vid-poster .play { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: var(--paper); box-shadow: 0 8px 26px rgba(0, 0, 0, .4); transition: transform .2s; }
.vid-poster:hover .play { transform: scale(1.08); }
.ev-video { margin: 4px auto; width: min(100%, 360px); aspect-ratio: 9 / 16; border-radius: calc(var(--radius) - 6px); overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.ev-video.wide { width: 100%; max-width: 760px; aspect-ratio: 16 / 9; }
.ev-video .vid-poster, .ev-video video { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; background: #000; }
.ev-video .vid-poster { background-color: var(--primary); }
@media (min-width: 900px) { .ev-video:not(.wide) { max-width: 320px; } }
@media (prefers-reduced-motion: reduce) { .ev-video .vid-poster .play { transition: none; } .ev-video .vid-poster:hover .play { transform: none; } }
.vid-poster .play svg { width: 32px; height: 32px; margin-left: 4px; }

/* ---------- Fecha, hora, lugar ---------- */
.when-list { display: grid; gap: 16px; max-width: 380px; margin: 0 auto; text-align: left; }
.when-row { display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center; }
.when-row > div { display: flex; flex-direction: column; line-height: 1.35; }
.when-label { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.when-row strong { font-weight: 600; font-size: 1.06rem; }
.ic { display: inline-grid; place-items: center; color: var(--primary); }
.ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ic.circle { width: 48px; height: 48px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.ic.big svg { width: 38px; height: 38px; }

/* ---------- Cuenta regresiva ---------- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, 2.5vw, 14px); max-width: 420px; margin: 0 auto; }
.cd-unit { padding: 12px 4px 10px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 10%, transparent); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.cd-num { height: 1.25em; overflow: hidden; font: 400 clamp(1.7rem, 8vw, 2.4rem)/1.25 var(--font-title); font-variant-numeric: tabular-nums; color: var(--primary); }
.cd-num span { display: block; }
.cd-num .flip { animation: flip .5s var(--ease); }
@keyframes flip { from { transform: translateY(-70%); opacity: 0; } to { transform: none; opacity: 1; } }
.cd-label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cd-done { font: 400 clamp(1.8rem, 8vw, 2.4rem)/1.2 var(--font-script); color: var(--primary); animation: pop .8s var(--ease); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

/* ---------- Botones ---------- */
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 24px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--primary); background: transparent; color: var(--primary);
  font: 600 1rem/1.2 var(--font-body); letter-spacing: .02em; text-decoration: none;
  transition: transform .15s, background .2s, color .2s, box-shadow .2s;
}
.btn[hidden] { display: none; }
.btn:hover { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--primary); color: var(--paper); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.btn.solid:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn .ic { color: inherit; }
.btn .ic svg { width: 20px; height: 20px; }
.btn:focus-visible, .car-dot:focus-visible, .music-btn:focus-visible, .input:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
.input { width: min(100%, 320px); min-height: 50px; padding: 10px 18px; margin: 4px 0 6px; border: 1.5px solid color-mix(in srgb, var(--primary) 45%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--paper) 85%, #fff); color: var(--ink); font: inherit; text-align: center; }
[data-dark="1"] .input { background: color-mix(in srgb, var(--paper) 85%, #000); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.deadline { font-size: .92rem; color: var(--muted); font-style: italic; }

/* ---------- Ubicación ---------- */
.map { margin: 6px 0 16px; overflow: hidden; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); }
.map iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; }
[data-dark="1"] .map iframe { filter: grayscale(.3) contrast(.95); }

/* ---------- Vestimenta ---------- */
.swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4px color-mix(in srgb, var(--ink) 25%, transparent); }

/* ---------- Itinerario ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 420px; text-align: left; }
.timeline li { display: grid; grid-template-columns: 84px 20px 1fr; gap: 10px; position: relative; padding-bottom: 18px; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 103px; top: 18px; bottom: -2px; width: 1px; background: color-mix(in srgb, var(--primary) 45%, transparent); }
.tl-time { text-align: right; font-weight: 600; color: var(--primary); font-size: .95rem; padding-top: 1px; }
.tl-dot { width: 12px; height: 12px; margin: 6px auto 0; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 20%, transparent); }
.tl-body strong { display: block; font-weight: 600; }
.tl-body p { margin: 2px 0 0; font-size: .95rem; color: var(--muted); }

/* ---------- Galería ---------- */
.carousel { position: relative; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 14px; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; background: color-mix(in srgb, var(--primary) 10%, transparent); }
.car-slide img { width: 100%; height: 100%; object-fit: cover; }
.car-arrow { position: absolute; top: calc(50% - 30px); width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--paper) 85%, transparent); color: var(--ink); cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .2); }
.car-arrow svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.car-arrow.l { left: 8px; } .car-arrow.r { right: 8px; }
.car-dots { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.car-dot { width: 26px; height: 26px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.car-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 35%, transparent); transition: width .3s, background .3s; }
.car-dot.on::before { width: 20px; border-radius: 4px; background: var(--primary); }
@media (hover: none) { .car-arrow { display: none; } }

/* ---------- Música ---------- */
.music-btn {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--primary); color: var(--paper);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, .45);
}
.music-btn[hidden] { display: none; }
html.iv-turned .music-btn { top: max(16px, env(safe-area-inset-top)); bottom: auto; left: max(16px, env(safe-area-inset-left)); right: auto; }
.music-btn .mb-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.music-btn .bars { display: none; gap: 3px; align-items: flex-end; height: 20px; }
.music-btn .bars i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: bars 1s ease-in-out infinite; }
.music-btn .bars i:nth-child(2) { animation-delay: -.3s; } .music-btn .bars i:nth-child(3) { animation-delay: -.6s; } .music-btn .bars i:nth-child(4) { animation-delay: -.15s; }
.music-btn.playing .bars { display: flex; }
.music-btn.playing .mb-icon { display: none; }
.music-btn.playing::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--primary); animation: ring 1.8s ease-out infinite; }
@keyframes bars { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

.particles { position: fixed; inset: 0; z-index: 5; pointer-events: none; width: 100%; height: 100%; }

/* ==================== Apertura ==================== */
.intro { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow: hidden; background: var(--bg); cursor: pointer; outline: none; }
.intro::before { content: ''; position: absolute; inset: 0; background-image: var(--texture); background-size: var(--texture-size); }
.intro.opening { cursor: default; }
.scene { position: relative; display: flex; flex-direction: column; align-items: center; perspective: 1400px; }
.float { animation: float 4.5s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-.6deg); } }
.intro-hint { margin: 34px 0 0; font: 400 .85rem/1 var(--font-body); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); animation: hint 2.2s ease-in-out infinite; }
@keyframes hint { 50% { opacity: .35; } }
.intro.opening .intro-hint { animation: none; }

/* Sobre */
.env { position: relative; width: min(84vw, 390px); aspect-ratio: 1.5; transform-style: preserve-3d; filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .28)); }
.env-back { position: absolute; inset: 0; border-radius: 8px; background: var(--envelope-inner); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent); }
.letter {
  position: absolute; left: 6%; right: 6%; top: 6%; height: 88%; z-index: 2; border-radius: 4px;
  display: grid; place-items: center; text-align: center; padding: 8% 6%; color: var(--letter-ink, var(--ink));
  background: var(--letter-paper, var(--paper)); box-shadow: 0 2px 10px rgba(0, 0, 0, .15); will-change: transform;
}
.letter-text { margin: 6px 0 0; font: 400 clamp(.8rem, 3.4vw, .95rem)/1.4 var(--font-body); opacity: .85; }
.letter::before { content: ''; position: absolute; inset: 0; background-image: var(--texture); background-size: var(--texture-size); border-radius: inherit; }
.letter-in { position: relative; width: 100%; min-width: 0; overflow-wrap: anywhere; }
.letter-title { margin: 6px 0 0; font: 400 clamp(1rem, 4.6vw, 1.35rem)/1.15 var(--font-title); }
.letter-names { margin: 2px 0 0; font: 400 clamp(1.3rem, 6vw, 1.8rem)/1.1 var(--font-script); color: var(--primary); }
.letter-greeting { font: 400 1.4rem/1.3 var(--font-script); color: var(--primary); padding: 0 12px; }
.env-front {
  position: absolute; inset: 0; z-index: 3; border-radius: 8px;
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  background: linear-gradient(160deg, color-mix(in srgb, var(--envelope) 92%, #fff), var(--envelope) 45%, color-mix(in srgb, var(--envelope) 90%, #000));
}
.env-bottom { position: absolute; inset: 0; z-index: 3; border-radius: 0 0 8px 8px; clip-path: polygon(0 100%, 50% 48%, 100% 100%); background: linear-gradient(0deg, color-mix(in srgb, var(--envelope) 88%, #000), color-mix(in srgb, var(--envelope) 96%, #000)); }
.env-name { position: absolute; left: 6%; right: 6%; bottom: 9%; z-index: 4; margin: 0; text-align: center; font: 400 clamp(1.5rem, 7vw, 2.3rem)/1.1 var(--font-name, var(--font-script)); color: var(--envelope-ink, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .2em; }
.flap {
  position: absolute; left: 0; right: 0; top: 0; height: 56%; z-index: 5; transform-origin: 50% 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--envelope) 94%, #000), color-mix(in srgb, var(--envelope) 86%, #000));
  border-radius: 8px 8px 0 0; will-change: transform;
}
.seal { position: absolute; left: calc(50% - 33px); top: calc(56% - 36px); z-index: 6; width: 66px; height: 66px; }
.seal-half { position: absolute; inset: 0; border-radius: 47% 53% 50% 50% / 52% 46% 54% 48%; display: grid; place-items: center;
  background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--seal) 65%, #fff), var(--seal) 48%, color-mix(in srgb, var(--seal) 70%, #000) 100%);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--seal) 80%, #000), inset 0 0 0 6px color-mix(in srgb, var(--seal) 85%, #fff), 0 3px 8px rgba(0, 0, 0, .35); }
.seal-half.l { clip-path: polygon(0 0, 54% 0, 46% 22%, 56% 40%, 44% 58%, 55% 76%, 48% 100%, 0 100%); }
.seal-half.r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 48% 100%, 55% 76%, 44% 58%, 56% 40%, 46% 22%); }
.seal-face { font: 600 1.25rem/1 var(--font-title); color: var(--seal-ink); letter-spacing: .02em; text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.seal-face.icon { display: grid; place-items: center; width: 56%; height: 56%; }
.seal-face.icon svg { width: 100%; height: 100%; }
.seal-face.img { width: 74%; height: 74%; border-radius: 50%; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .15); }
.seal-face.img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Díptico */
.dip { position: relative; width: min(60vw, 250px); aspect-ratio: .72; transform-style: preserve-3d; filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .28)); }
.dip-page { position: absolute; inset: 0; display: grid; place-items: center; padding: 12%; text-align: center; color: var(--letter-ink, var(--ink)); background: var(--letter-paper, var(--paper)); border-radius: 4px 10px 10px 4px; }
.dip-page::before { content: ''; position: absolute; inset: 0; background-image: var(--texture); background-size: var(--texture-size); border-radius: inherit; }
.dip-cover { position: absolute; inset: 0; z-index: 2; transform-origin: 0 50%; transform-style: preserve-3d; }
.dip-cover .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 4px 10px 10px 4px; display: grid; place-items: center; text-align: center; }
.dip-cover .front { background: linear-gradient(150deg, color-mix(in srgb, var(--envelope) 92%, #fff), var(--envelope) 55%, color-mix(in srgb, var(--envelope) 88%, #000)); box-shadow: inset 0 0 0 10px var(--envelope), inset 0 0 0 11px color-mix(in srgb, var(--primary) 60%, transparent); }
.dip-cover .front .ornament { position: absolute; top: 12%; left: 0; right: 0; }
.dip-cover .front .env-name { bottom: auto; top: 40%; white-space: normal; }
.dip-cover .front .seal { top: auto; bottom: 12%; }
.dip-cover .back { transform: rotateY(180deg); background: var(--paper); border-radius: 10px 4px 4px 10px; box-shadow: inset -12px 0 18px -12px rgba(0, 0, 0, .25); }

/* Telón */
.intro-curtain { background: transparent; }
.intro-curtain::before { display: none; }
.curtain-scene { position: absolute; inset: 0; perspective: none; }
.curtain {
  position: absolute; top: 0; bottom: 0; width: 51%; will-change: transform;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .25), transparent 18%, transparent 80%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--curtain) 60%, #000) 0, var(--curtain) 18px, color-mix(in srgb, var(--curtain) 80%, #fff) 30px, var(--curtain) 42px, color-mix(in srgb, var(--curtain) 60%, #000) 60px);
}
.curtain.l { left: 0; transform-origin: 0 50%; box-shadow: 8px 0 20px rgba(0, 0, 0, .35); }
.curtain.r { right: 0; transform-origin: 100% 50%; box-shadow: -8px 0 20px rgba(0, 0, 0, .35); }
.valance { position: absolute; top: 0; left: 0; right: 0; height: 13vh; z-index: 2;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--curtain) 70%, #000) 0, var(--curtain) 22px, color-mix(in srgb, var(--curtain) 70%, #000) 44px);
  border-bottom: 5px solid var(--primary); box-shadow: 0 8px 18px rgba(0, 0, 0, .35); }
.plaque { position: absolute; left: 50%; top: 50%; z-index: 3; width: min(80vw, 330px); transform: translate(-50%, -50%);
  padding: 26px 20px 22px; text-align: center; border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 2px var(--primary), 0 20px 40px rgba(0, 0, 0, .4); }
.plaque .env-name { color: var(--ink); position: static; margin: 0 0 14px; white-space: normal; }
.plaque .seal { position: relative; left: auto; top: auto; margin: 0 auto; }
.plaque .intro-hint { margin-top: 18px; }

/* Video o imagen que ES la invitación: limpio, sin marcos, sobre el fondo del tema */
.intro-video { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; overflow: hidden; background: var(--bg); }
.intro-video::before { content: ''; position: absolute; inset: 0; background-image: var(--texture); background-size: var(--texture-size); pointer-events: none; }
.iv-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; max-width: 100%; animation: ivIn .9s var(--ease) both; }
.iv-frame { position: relative; overflow: hidden; border-radius: 10px; line-height: 0; box-shadow: 0 30px 70px -28px rgba(0, 0, 0, .5); }
.iv-frame video, .iv-frame img { display: block; width: auto; height: auto; max-width: min(96vw, 1600px); max-height: calc(100dvh - 88px); object-fit: contain; }
.iv-continue { min-height: 38px; padding: 7px 18px; font-size: .9rem; }
.iv-frame video { pointer-events: none; }
.iv-frame.embed iframe { display: block; width: min(94vw, 1200px); aspect-ratio: 16 / 9; max-height: calc(100dvh - 120px); border: 0; }
.iv-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.iv-actions .btn[hidden] { display: none; }
.iv-continue.ready { animation: pulse 1.6s ease-in-out infinite; }
.iv-sound { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 40px; min-width: 40px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(0, 0, 0, .4); color: #fff; backdrop-filter: blur(6px); font: 600 .85rem/1 var(--font-body); }
.iv-sound svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iv-sound.muted { background: var(--primary); color: var(--paper); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); animation: pulse 1.8s ease-in-out infinite; }
.iv-x { display: none; position: absolute; z-index: 4; top: 8px; right: 10px; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255, 255, 255, .95); color: #111; box-shadow: 0 6px 20px rgba(0, 0, 0, .45); place-items: center; }
.iv-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.intro-video.leaving { animation: ivOut .6s var(--ease) forwards; }
@keyframes ivIn { from { opacity: 0; transform: scale(.96) translateY(14px); } }
@keyframes ivOut { to { opacity: 0; transform: scale(1.03); } }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* Pantalla completa: el celular giró solo (.full) o la página gira el video (.rotated, sin depender del giro automático) */
.full .iv-stage, .rotated .iv-stage { padding: 0; gap: 0; background: #000; animation: none; justify-content: center; }
/* the buttons get their own strip under the video: nothing covers it */
.full .iv-frame, .rotated .iv-frame { flex: 1; min-height: 0; }
.full .iv-stage { width: 100%; height: 100%; }
.rotated .iv-stage { position: fixed; top: 50%; left: 50%; max-width: none; width: 100vh; height: 100vw; width: 100dvh; height: 100dvw; transform: translate(-50%, -50%) rotate(90deg); }
.full .iv-frame, .rotated .iv-frame { width: 100%; display: grid; place-items: center; border-radius: 0; box-shadow: none; background: #000; }
.full .iv-frame video, .full .iv-frame img { max-width: 100vw; max-height: calc(100vh - 50px); max-height: calc(100dvh - 50px); }
.rotated .iv-frame video, .rotated .iv-frame img { max-width: 100vh; max-height: calc(100vw - 50px); max-width: 100dvh; max-height: calc(100dvw - 50px); }
.full .iv-frame.embed iframe, .rotated .iv-frame.embed iframe { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
.full .iv-actions, .rotated .iv-actions { flex: none; position: relative; z-index: 3; height: 50px; width: 100%; align-items: center; justify-content: center; }
.full .iv-continue, .rotated .iv-continue { min-height: 34px; padding: 5px 14px; font-size: .82rem; background: rgba(0, 0, 0, .45); color: #fff; border: 1px solid rgba(255, 255, 255, .55); box-shadow: none; backdrop-filter: blur(6px); }
.full .iv-x, .rotated .iv-x { display: grid; top: auto; bottom: 6px; right: 12px; }
.full .iv-sound, .rotated .iv-sound { left: 14px; bottom: 14px; }

/* Aviso para girar el celular (no bloquea: se va solo) */
.rotate-hint { position: fixed; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); animation: fadeIn .4s ease both; }
.rotate-hint[hidden] { display: none; }
.rotate-hint .btn[hidden] { display: none; }
.rh-phone { width: 110px; height: 110px; color: var(--primary); }
.rh-phone svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.rh-phone.to-landscape svg { animation: turnL 2.2s cubic-bezier(.6, 0, .3, 1) infinite; }
.rh-phone.to-portrait svg { animation: turnP 1.6s cubic-bezier(.6, 0, .3, 1) both; }
@keyframes turnL { 0%, 15% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@keyframes turnP { from { transform: rotate(-90deg); } to { transform: rotate(0); } }
@keyframes fadeIn { from { opacity: 0; } }
.rh-text { margin: 0; max-width: 280px; font: 600 1.2rem/1.4 var(--font-body); color: var(--ink); }

/* Esquinas botánicas */
.corner { position: absolute; z-index: 0; width: min(42%, 230px); pointer-events: none; }
.corner svg { width: 100%; height: auto; display: block; }
.corner.tl { top: -4px; left: -4px; }
.corner.br { bottom: -4px; right: -4px; transform: rotate(180deg); }
.card > .sec, .card > .divider { position: relative; z-index: 1; }

/* Movimiento reducido: todo aparece sin desplazamientos */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; filter: none; }
}

/* Pie de marca (plan gratis) y confirmación inline */
.brand-foot { margin: 22px 0 -6px; padding-top: 12px; text-align: center; font-size: .78rem; letter-spacing: .04em; border-top: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); position: relative; z-index: 1; }
.brand-foot a { color: var(--muted); text-decoration: none; }
.brand-foot a:hover, .brand-foot a:focus-visible { color: var(--primary); text-decoration: underline; }
.rsvp-ok { display: none; margin: 12px 0 0; font-size: .95rem; color: var(--primary); font-weight: 600; }
.rsvp-ok.on { display: block; }

/* Álbum del evento */
.sec-album .lead { margin: 0 0 14px; }
.album-status { min-height: 1.4em; margin: 10px 0 4px; font-size: .95rem; color: var(--primary); font-weight: 600; }
.album-status.err { color: var(--seal, #9b2f3b); }
.album-empty { margin: 8px 0 0; font-size: .98rem; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.album-ph { display: block; padding: 0; border: 0; cursor: pointer; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: color-mix(in srgb, var(--primary) 10%, transparent); }
.album-ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.album-ph:hover img { transform: scale(1.05); }
.album-ph:focus-visible, .lb-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 70%, transparent); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: progress; }
html.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(0, 0, 0, .92); }
.lb figure { margin: 0; max-width: 100vw; display: grid; justify-items: center; gap: 10px; }
.lb img { max-width: 100vw; max-height: calc(100dvh - 90px); object-fit: contain; }
.lb-cap { margin: 0; color: #fff; font: 400 .9rem/1.3 var(--font-body); opacity: .85; }
.lb-btn { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; }
.lb-btn .ic { color: #fff; }
.lb-btn:hover { background: rgba(255, 255, 255, .28); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (min-width: 560px) { .album-grid { grid-template-columns: repeat(4, 1fr); } }

/* Retos de la fiesta */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.retos { margin: 4px 0 18px; text-align: left; }
.retos-h { margin: 0 0 8px; font: 400 1.15rem/1.3 var(--font-title); color: var(--primary); text-align: center; }
.retos-prog { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.retos-bar { flex: 1; height: 8px; border-radius: 99px; overflow: hidden; background: color-mix(in srgb, var(--primary) 18%, transparent); }
.retos-bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .5s var(--ease); }
.retos-n { font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.retos-win { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; font-weight: 600; font-size: .98rem; text-align: center; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); animation: retoIn .5s var(--ease) both; }
.retos-win .ic { flex: none; }
@keyframes retoIn { from { opacity: 0; transform: translateY(6px); } }
.retos-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.reto { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); background: color-mix(in srgb, var(--paper) 70%, transparent); }
.reto.ok { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.reto-mark { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); }
.reto.ok .reto-mark { background: var(--primary); border-color: var(--primary); color: var(--paper); }
.reto-mark .ic { color: inherit; }
.reto-mark .ic, .retos-win .ic { display: inline-flex; width: 16px; height: 16px; }
.reto-mark svg, .retos-win svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.reto-txt { flex: 1; min-width: 0; font-size: .98rem; line-height: 1.35; overflow-wrap: anywhere; }
.reto-go { flex: none; min-height: 40px; padding: 6px 12px; font-size: .86rem; }
.reto-go .ic { display: inline-flex; width: 18px; height: 18px; }
.reto-go svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.album-ph { position: relative; }
.album-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 6px 4px; font: 500 .66rem/1.2 var(--font-body); color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
@media (max-width: 380px) { .reto { flex-wrap: wrap; } .reto-go { width: 100%; } }
