:root {
  --bg: #fff6f8; --bg2: #fbe3eb; --primary: #d0668c; --deep: #6d2443; --accent: #c9a24a; --ink: #4a2333;
  --script: 'Pinyon Script', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --caps: 'Cinzel', Georgia, serif;
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--ink);
  background: var(--bg); min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg), var(--bg2) 60%, var(--bg));
}
body.locked { overflow: hidden; height: 100vh; }
#magic { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
img { max-width: 100%; display: block; }
svg { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

.script { font-family: var(--script); font-weight: 400; line-height: 1.1; }
.kicker { font-family: var(--caps); letter-spacing: .28em; text-transform: uppercase; font-size: .78rem; color: var(--primary); margin: 0; }
.kicker.light { color: #fff; opacity: .92; }
.small { font-size: .9rem; opacity: .8; }

/* ---------------- botones ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.6em; border-radius: 999px; border: 0; text-decoration: none;
  font-family: var(--caps); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--deep));
  box-shadow: 0 8px 24px -10px var(--deep), inset 0 0 0 1px rgba(255,255,255,.25);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px var(--deep); }
.btn svg { width: 18px; height: 18px; }
.btn-ghost { background: transparent; color: var(--deep); box-shadow: inset 0 0 0 1px var(--accent); }
.btn.sm { padding: .6em 1.1em; font-size: .7rem; }
.btn:disabled { opacity: .6; pointer-events: none; }

/* ---------------- portada: sobre 3D ---------------- */
.cover {
  position: fixed; inset: 0; z-index: 50; overflow: hidden auto; overscroll-behavior: contain; color: #fff; text-align: center;
  background:
    radial-gradient(800px 520px at 50% 35%, color-mix(in srgb, var(--primary) 70%, transparent), transparent 70%),
    linear-gradient(180deg, var(--deep), color-mix(in srgb, var(--deep) 55%, var(--primary)) 70%, var(--primary));
  display: flex; transition: opacity .8s ease; will-change: opacity;
}
.cover.o4 { opacity: 0; pointer-events: none; }
.cover.gone { display: none; }
.cover-glow { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 115%, color-mix(in srgb, var(--accent) 50%, transparent), transparent 55%); }
.cover-inner {
  position: relative; z-index: 2; margin: auto; width: 100%; max-width: 560px;
  padding: max(14px, 2.5vh) 16px 70px; display: flex; flex-direction: column; align-items: center;
  transition: transform .9s cubic-bezier(.4,0,.2,1), opacity .7s ease; will-change: transform, opacity;
}
.tiara { width: clamp(90px, 15vh, 150px); filter: drop-shadow(0 4px 14px rgba(0,0,0,.25)); animation: float 4s ease-in-out infinite; }
.cover-name { font-size: clamp(3rem, min(15vw, 9vh), 5.6rem); margin: 0 0 .05em; text-shadow: 0 4px 30px rgba(0,0,0,.3); }
.cover-phrase { font-style: italic; margin: 0 0 .4rem; opacity: .92; font-size: clamp(.9rem, 2vh, 1.05rem); max-width: 440px; }
.kicker.light { animation: fadeDown 1s .2s both; }
.cover-name { animation: fadeDown 1s .4s both; }
.cover-phrase { animation: fadeDown 1s .6s both; }

/* escena */
.scene { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; perspective: 1300px; margin-top: 4px; }
.portrait { position: relative; width: clamp(150px, min(58vw, 30vh), 270px); aspect-ratio: 3/4; margin-top: clamp(26px, 5vh, 44px); margin-bottom: calc(clamp(150px, min(58vw, 30vh), 270px) * -.42); z-index: 1; animation: riseIn 1.2s .5s both; }
.portrait .arch {
  position: absolute; inset: 0; border-radius: 999px 999px 18px 18px; padding: 6px;
  background: linear-gradient(180deg, #fbeec1, var(--accent), #8a6420);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent), 0 24px 50px -18px rgba(0,0,0,.6), 0 0 60px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
.portrait .arch::after { content: ''; position: absolute; inset: 6px; border-radius: 999px 999px 13px 13px; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--primary) 50%, #fff), var(--primary) 55%, var(--deep)); }
.portrait img { position: absolute; z-index: 1; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: cover; object-position: center 25%; border-radius: 999px 999px 13px 13px; }
.portrait .crown-top { position: absolute; z-index: 3; left: 50%; top: -14%; width: 46%; translate: -50% 0; }
.portrait.cutout img { inset: auto; left: 50%; bottom: 6px; translate: -50% 0; width: auto; height: 116%; max-width: 150%; object-fit: contain; border-radius: 0; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.portrait.cutout .crown-top { display: none; }

.env-wrap { position: relative; z-index: 2; animation: envIn 1.1s .7s both; }
.env-float { animation: bob 4.5s ease-in-out infinite; transform-style: preserve-3d; }
.env3d {
  position: relative; width: min(86vw, 380px, 52vh); aspect-ratio: 1.58; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 8deg)) rotateY(var(--ry, 0deg)); transition: transform .5s ease-out;
}
.env3d > * { position: absolute; transform-style: preserve-3d; }
.e-back { inset: 0; border-radius: 8px; background: linear-gradient(180deg, color-mix(in srgb, var(--deep) 30%, var(--bg2)), color-mix(in srgb, var(--bg2) 85%, #fff)); box-shadow: 0 40px 60px -25px rgba(0,0,0,.65); transform: translateZ(0); }
.e-letter {
  left: 5%; right: 5%; top: 5%; height: 90%; transform: translateZ(1px); border-radius: 6px; color: var(--deep);
  background: linear-gradient(180deg, #fffdf8, #fbf3e4); box-shadow: 0 2px 10px rgba(0,0,0,.12); border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  display: flex; align-items: flex-start; justify-content: center; transition: transform 1s cubic-bezier(.3,1.25,.5,1);
}
.e-letter-in { display: flex; flex-direction: column; align-items: center; padding-top: 7%; gap: 1px; }
.e-letter-in .mini-tiara { width: 22%; }
.e-letter-in small { font-family: var(--caps); font-size: .55rem; letter-spacing: .22em; text-transform: uppercase; color: var(--primary); }
.e-letter-in b { font-family: var(--script); font-weight: 400; font-size: clamp(1.8rem, 9vw, 2.6rem); line-height: 1.05; }
.e-letter-in i { font-style: normal; font-family: var(--caps); font-size: .6rem; letter-spacing: .18em; }
.e-front { inset: 0; transform: translateZ(2px); pointer-events: none; }
.e-front .paper {
  position: absolute; inset: 0; border-radius: 8px;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%),
    linear-gradient(170deg, #fff, var(--bg2));
}
.e-front svg, .e-flap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.e-to { position: absolute; left: 0; right: 0; bottom: 5%; color: var(--deep); display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.e-to small { font-family: var(--caps); font-size: .5rem; vertical-align: middle; letter-spacing: .25em; text-transform: uppercase; color: var(--primary); }
.e-to span { font-family: var(--script); font-size: clamp(1.4rem, 7vw, 2rem); }
.e-to em { font-style: normal; font-family: var(--caps); font-size: .58rem; letter-spacing: .18em; color: var(--accent); filter: brightness(.8); }
.e-flap { left: 0; top: 0; width: 100%; height: 57%; transform-origin: 50% 0; transform: translateZ(3px) rotateX(0deg); }
.e-flap .face { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 8px 8px 0 0; }
.e-flap .out { background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 55%, var(--primary)), var(--bg2)); }
.e-flap .in {
  transform: rotateX(180deg);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 60%, transparent) 1.4px, transparent 1.6px) 0 0 / 14px 14px,
    linear-gradient(0deg, var(--primary), var(--deep));
}
.seal {
  position: absolute; left: 50%; top: 57%; width: clamp(58px, 18%, 76px); aspect-ratio: 1; padding: 0; border: 0; background: none;
  transform: translate(-50%, -50%) translateZ(5px); color: #fff; z-index: 5; cursor: pointer;
}
.seal .half {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--primary) 65%, #fff), var(--primary) 45%, var(--deep));
  box-shadow: 0 6px 14px rgba(0,0,0,.35), inset 0 0 0 4px color-mix(in srgb, var(--deep) 45%, transparent), inset 0 0 0 6px rgba(255,255,255,.18);
  transition: transform .6s cubic-bezier(.5,0,.7,1), opacity .6s;
}
.seal .l { clip-path: polygon(0 0, 54% 0, 44% 35%, 56% 60%, 46% 100%, 0 100%); }
.seal .r { clip-path: polygon(54% 0, 100% 0, 100% 100%, 46% 100%, 56% 60%, 44% 35%); }
.seal b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--script); font-weight: 400; font-size: clamp(1.5rem, 5vw, 2.1rem); text-shadow: 0 1px 2px rgba(0,0,0,.4); transition: opacity .3s; pointer-events: none; }
.seal::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 80%, transparent); animation: ring 2s ease-out infinite; }
.cover-hint {
  margin: 18px 0 0; padding: .7em 1.4em; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent);
  background: rgba(255,255,255,.1); backdrop-filter: blur(6px); color: #fff; font-family: var(--caps); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase;
  animation: fadeUp 1s 1.4s both, pulseSoft 2.4s 2.4s ease-in-out infinite; cursor: pointer;
}
.castle { position: fixed; left: 0; right: 0; bottom: -2px; color: color-mix(in srgb, var(--deep) 85%, #000); opacity: .85; z-index: 1; pointer-events: none; }
.castle svg { width: 100%; max-width: 760px; margin: 0 auto; height: auto; max-height: 26vh; }

/* secuencia de apertura */
.cover.o1 .seal::after { display: none; }
.cover.o1 .seal b { opacity: 0; }
.cover.o1 .seal .l { transform: translate(-60%, 40%) rotate(-35deg); opacity: 0; }
.cover.o1 .seal .r { transform: translate(60%, 50%) rotate(35deg); opacity: 0; }
.cover.o1 .env3d { --rx: 4deg !important; --ry: 0deg !important; }
.cover.o1 .env-float { animation-play-state: paused; }
.cover.o1 .cover-hint { opacity: 0; transition: opacity .3s; animation: none; }
.cover.o2 .e-flap { animation: flapOpen .9s cubic-bezier(.45,0,.3,1) forwards; }
.cover.o3 .e-letter { transform: translateZ(1px) translateY(-62%); }
.cover.o3 .portrait { transform: translateY(-6%) scale(.96); opacity: .6; transition: transform 1s, opacity 1s; }
.cover.o4 .cover-inner { transform: translateY(3vh) scale(1.18); opacity: 0; }
.cover.o4 .castle { transform: translateY(30%); opacity: 0; transition: 1s; }

/* ---------- portada temática (v3) ---------- */
.cover { background: var(--deep); }
.scene-bg { position: fixed; inset: -3%; z-index: 0; transform: scale(1.08); transition: transform .6s ease-out; animation: sceneIn 2s ease both; }
.scene-bg svg { width: 100%; height: 100%; display: block; }
.scene-veil { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--deep) 55%, transparent) 0%, transparent 38%, transparent 70%, color-mix(in srgb, var(--deep) 45%, transparent) 100%); }
.cover-inner { padding-bottom: 28px; }
.title-gold { display: flex; flex-direction: column; align-items: center; margin-top: 2vh; }
.gold-name, .gold-sub {
  background: linear-gradient(180deg, #fff8dc 0%, #f3d27a 28%, #b98728 52%, #f7e4a3 72%, #93621b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1.5px 0 #5c3a0c) drop-shadow(0 6px 14px rgba(0,0,0,.45));
}
.gold-name { font-family: var(--script); font-weight: 400; font-size: clamp(3.4rem, min(17vw, 10vh), 6.4rem); line-height: 1.15; margin: 0; padding: 0 .25em; animation: nameIn 1.4s .2s cubic-bezier(.2,1,.3,1) both; }
.name-fil { width: min(300px, 76vw); margin-top: -.6em; animation: fadeDown 1s .7s both; }
.gold-sub { font-family: var(--caps); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: clamp(1.15rem, min(6vw, 3.6vh), 1.9rem); margin: .1em 0 .2em; animation: fadeDown 1s .9s both; }
.scene { margin-top: 1.5vh; }
.env3d { width: min(92vw, 430px, 58vh); aspect-ratio: 400/260; will-change: transform; }
.env-wrap::after { content: ''; position: absolute; left: 8%; right: 8%; bottom: -16px; height: 34px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); z-index: -1; pointer-events: none; }
.e-flap, .e-letter, .seal .half, .ribbon, .scene-bg { will-change: transform; }
.cover.opening-run .env-float, .cover.o1 .env-float { animation: none; }
.e-back { background: var(--sobre-d); box-shadow: none; }
.e-front, .e-flap .face { overflow: visible; }
.e-front svg, .e-flap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.e-flap { height: 57.7%; }
.e-flap .face { clip-path: none; background: none !important; border-radius: 0; }
.e-letter { background: linear-gradient(180deg, #fffdf6, #f6ecd6); }
.mini-emb { width: 16%; display: block; }
.ribbon { left: 50%; top: 60%; width: 18%; transform: translateX(-50%) translateZ(4px); transition: transform .8s ease, opacity .6s; pointer-events: none; }
.ribbon svg { width: 100%; display: block; }
.seal { top: 56%; width: 21%; transform: translate(-50%, -50%) translateZ(6px); }
.seal .half { background: none; box-shadow: none; }
.seal .half svg { width: 100%; height: 100%; display: block; }
.seal::after { inset: -6px; border-color: color-mix(in srgb, #f7e3a0 80%, transparent); }
.cover.o1 .ribbon { transform: translateX(-50%) translateZ(4px) translateY(40%) rotate(8deg); opacity: 0; }
.guest-gold { display: flex; flex-direction: column; align-items: center; margin-top: 14px; line-height: 1.05; animation: fadeUp 1s 1.2s both; }
.guest-gold small { font-family: var(--caps); font-size: .62rem; letter-spacing: .25em; text-transform: uppercase; color: #f7e3a0; opacity: .9; }
.guest-gold span { font-family: var(--script); font-size: clamp(1.8rem, 8vw, 2.4rem); color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.guest-gold em { font-style: normal; font-family: var(--caps); font-size: .65rem; letter-spacing: .2em; color: #f7e3a0; }
.cover-hint { margin-top: 14px; background: linear-gradient(180deg, #f7e3a0, #c8952f); color: #4a2d08; border: 1px solid #fff3c4; font-weight: 600; box-shadow: 0 8px 20px -8px rgba(0,0,0,.6); }
.cover-hint .hand { display: inline-block; animation: tap 1.4s ease-in-out infinite; }
.div-emb { display: block; width: 44px; margin: -36px auto 0; position: relative; }
.divider { position: relative; }
.divider svg path { stroke-dasharray: none; }
.divider.in > svg path { stroke-dasharray: 320; animation: draw 1.6s ease forwards; }
.cover.o4 .scene-bg { transform: scale(1.12); transition: transform 1s ease; }
@keyframes sceneIn { from { opacity: 0; transform: scale(1.2); } }
@keyframes nameIn { from { opacity: 0; transform: scale(.85); } }
@keyframes tap { 50% { transform: translateY(-4px) scale(1.1); } }

/* álbum de invitados */
.album-up { display: grid; gap: 10px; justify-items: center; margin-bottom: 16px; }
.album-up .inp-name { font: inherit; font-size: 1rem; padding: .6em .9em; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); width: min(280px, 100%); text-align: center; background: #fff; color: var(--ink); }
.album-up label.btn { cursor: pointer; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album-grid .ph { position: relative; padding: 0; border: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg2); }
.album-grid .ph img { width: 100%; height: 100%; object-fit: cover; }
.album-grid .ph span { position: absolute; left: 0; right: 0; bottom: 0; font-size: .65rem; color: #fff; padding: 10px 4px 3px; background: linear-gradient(transparent, rgba(0,0,0,.6)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-grid > p { grid-column: 1 / -1; }

/* ventana con princesa + corona */
.hero-frame .hero-pw { display: block; background: none; overflow: hidden; }
.hero-frame .hero-pw svg { width: 100%; height: 100%; display: block; filter: none; opacity: 1; }
.hero-crown { width: 150px; top: -62px; }
.hero-crown svg, .crown-top svg { width: 100%; height: auto; overflow: visible; }

/* extras */
.hero-portrait { width: min(300px, 74vw); margin: 60px auto 26px; animation: none; }
main.show .hero-portrait { animation: frameIn 1.4s .2s cubic-bezier(.2,1,.3,1) both; }
.hero-frame:not(.cutout) .hero-char {
  right: -10%; bottom: -7%; width: 44%; aspect-ratio: 1; height: auto !important; object-fit: cover !important;
  border-radius: 50% !important; border: 4px solid #e9c46a; box-shadow: 0 0 0 2px #8c5c18, 0 14px 26px -8px rgba(0,0,0,.45); filter: none;
}
.hero-frame .hero-char { position: absolute; right: -22%; bottom: -6%; width: 62%; height: auto !important; object-fit: contain !important; border-radius: 0 !important; filter: drop-shadow(0 14px 18px rgba(0,0,0,.3)); pointer-events: none; }
.btn-wa { background: linear-gradient(135deg, #25d366, #128c4a) !important; }
.center { text-align: center; }

@keyframes flapOpen {
  0% { transform: translateZ(3px) rotateX(0deg); }
  49% { transform: translateZ(3px) rotateX(89deg); }
  51% { transform: translateZ(.5px) rotateX(91deg); }
  100% { transform: translateZ(.5px) rotateX(180deg); }
}
@keyframes envIn { from { opacity: 0; transform: translateY(60px) rotateX(35deg); } }
@keyframes riseIn { from { opacity: 0; transform: translateY(40px) scale(.9); } }
@keyframes bob { 50% { transform: translateY(-8px) rotateZ(-.6deg); } }
@keyframes ring { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
@keyframes pulseSoft { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent); } }

/* ---------------- contenido ---------------- */
main { opacity: 0; transition: opacity 1s .2s; max-width: 760px; margin: 0 auto; padding: 0 16px; }
main.show { opacity: 1; }
.hero { text-align: center; padding: 56px 0 24px; }
.hero-frame {
  position: relative; width: min(300px, 74vw); aspect-ratio: 3/4; margin: 40px auto 26px; padding: 10px;
  border-radius: 999px 999px 24px 24px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 50%, #fff), var(--accent));
  box-shadow: 0 30px 60px -30px var(--deep);
}
.hero-frame img, .hero-ph { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 18px 18px; }
.hero-ph { display: grid; place-items: center; background: linear-gradient(180deg, var(--bg2), var(--primary)); color: #fff; }
.hero-ph svg { width: 55%; filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); }
.hero-crown { position: absolute; left: 50%; top: -46px; width: 130px; translate: -50% 0; filter: drop-shadow(0 4px 8px rgba(0,0,0,.2)); }
.hero-name { font-size: clamp(3.8rem, 15vw, 6.4rem); color: var(--deep); margin: .1em 0 .2em; }
.dark .hero-name { color: #fff; }
.date { display: flex; align-items: center; justify-content: center; gap: 18px; font-family: var(--caps); text-transform: uppercase; letter-spacing: .2em; font-size: .82rem; }
.date-side { border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); padding: .45em .2em; min-width: 92px; }
.date-mid { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.date-mid b { font-size: 3.4rem; font-weight: 400; color: var(--primary); }
.date-mid i { font-style: normal; font-size: .82rem; margin-top: 4px; }
.date-hour { font-family: var(--caps); letter-spacing: .2em; font-size: .85rem; margin: 14px 0 0; }
.cd-label { font-family: var(--caps); letter-spacing: .3em; text-transform: uppercase; font-size: .72rem; margin: 30px 0 10px; color: var(--primary); }
.countdown { display: flex; justify-content: center; gap: 10px; }
.countdown div {
  width: 72px; padding: 12px 0 8px; border-radius: 16px; background: color-mix(in srgb, #fff 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: 0 10px 24px -18px var(--deep);
}
.dark .countdown div, .dark .card { background: color-mix(in srgb, #fff 6%, transparent); }
.countdown b { display: block; font-family: var(--caps); font-weight: 400; font-size: 1.7rem; color: var(--deep); line-height: 1; }
.dark .countdown b { color: var(--accent); }
.countdown span { font-size: .72rem; text-transform: uppercase; letter-spacing: .15em; }
.cal { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 26px; }

.blk { text-align: center; padding: 44px 0; }
.divider { width: 220px; margin: 0 auto 14px; }
.h2 { font-family: var(--caps); font-weight: 400; font-size: clamp(1.25rem, 4.6vw, 1.7rem); letter-spacing: .14em; text-transform: uppercase; color: var(--deep); margin: 0 0 12px; }
.dark .h2 { color: var(--accent); }
.lead { max-width: 520px; margin: 0 auto 22px; font-style: italic; opacity: .85; }
.card {
  position: relative; background: color-mix(in srgb, #fff 72%, transparent); border-radius: var(--radius); padding: 28px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 24px 50px -36px var(--deep);
  max-width: 560px; margin: 0 auto;
}
.card p { margin: .4em 0; }
.framed { padding: 40px 30px; }
.framed .c { position: absolute; width: 48px; }
.framed .tl { top: 10px; left: 10px; }
.framed .br { bottom: 10px; right: 10px; transform: rotate(180deg); }
.quote { font-size: 1.15rem; font-style: italic; }
.name { font-size: 2.3rem; color: var(--deep); margin: .1em 0; }
.dark .name { color: #fff; }
.pair { display: flex; flex-direction: column; align-items: center; }
.amp { font-family: var(--script); font-size: 2.6rem; color: var(--accent); line-height: 1; }
.names.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.names .name { font-size: 2rem; }
.grid-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card.mini { padding: 20px 16px; margin: 0; }
.rol { font-family: var(--caps); text-transform: uppercase; letter-spacing: .18em; font-size: .72rem; color: var(--primary); }
.card.mini .name { font-size: 1.9rem; }

.gallery { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.gallery .ph { padding: 0; border: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 3/4; background: var(--bg2); box-shadow: 0 16px 30px -24px var(--deep); }
.gallery .ph:first-child { grid-column: span 2; aspect-ratio: 4/3; }
.gallery.n2 .ph:first-child { grid-column: auto; aspect-ratio: 3/4; }
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery .ph:hover img { transform: scale(1.06); }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); } .gallery .ph:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; } .gallery.n2 { grid-template-columns: repeat(2, 1fr); } }
.empty { opacity: .6; font-style: italic; }

.places { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.place { margin: 0; display: flex; flex-direction: column; align-items: center; }
.place-ic, .dress-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--deep)); margin: 0 auto 10px; }
.place-ic svg, .dress-ic svg { width: 26px; }
.place h3 { font-family: var(--caps); font-weight: 400; font-size: 1.15rem; margin: .2em 0; color: var(--deep); }
.dark .place h3 { color: #fff; }
.place-h { font-family: var(--caps); letter-spacing: .15em; font-size: .85rem; }
.place-a { opacity: .85; margin-bottom: 1rem !important; flex: 1; }

.timeline { list-style: none; padding: 0; margin: 0 auto; max-width: 460px; position: relative; text-align: left; }
.timeline::before { content: ''; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(var(--accent), transparent); }
.timeline li { display: flex; align-items: center; gap: 18px; padding: 10px 0; }
.t-ic { flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--accent); color: var(--primary); position: relative; }
.t-ic svg { width: 26px; }
.timeline b { display: block; font-family: var(--caps); font-weight: 400; letter-spacing: .12em; font-size: .85rem; color: var(--primary); }
.timeline span { font-size: 1.2rem; }

.dress-type { font-family: var(--caps); font-size: 1.2rem; letter-spacing: .12em; color: var(--deep); }
.dark .dress-type { color: #fff; }
.swatches { display: flex; justify-content: center; gap: 12px; margin: 14px 0 6px; }
.swatches span { width: 42px; height: 42px; border-radius: 50%; box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--accent); }
.gift-box { margin-top: 14px; padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--bg2) 70%, transparent); }
.tag { font-family: var(--script); font-size: clamp(2.2rem, 9vw, 3.2rem); color: var(--primary); margin: 0 0 14px; word-break: break-word; }

.rsvp-form { display: grid; gap: 14px; text-align: left; margin-top: 10px; }
.rsvp-form label { display: grid; gap: 6px; font-family: var(--caps); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.rsvp-form input, .rsvp-form select, .rsvp-form textarea {
  font: inherit; font-family: var(--serif); font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--ink);
  padding: .7em .9em; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); background: #fff;
}
.rsvp-form [hidden] { display: none; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; text-align: center; padding: .9em .5em; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); background: #fff; color: var(--ink); text-transform: none; letter-spacing: 0; font-family: var(--serif); font-size: 1rem; transition: .2s; }
.choice input:checked + span { background: linear-gradient(135deg, var(--primary), var(--deep)); color: #fff; border-color: transparent; }
.choice input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; }
.form-msg { text-align: center; min-height: 1.2em; margin: 0; font-style: italic; }
.thanks { text-align: center; font-size: 1.15rem; }
.thanks p { margin-bottom: 1rem; }

.end { padding-bottom: 0; }
.end-phrase { font-size: clamp(2.4rem, 9vw, 3.4rem); color: var(--deep); margin: .2em 0; }
.dark .end-phrase { color: #fff; }
.castle.small { position: relative; color: var(--primary); opacity: .25; margin-top: 20px; }
.castle.small svg { max-height: 160px; }
.foot { text-align: center; font-size: .8rem; opacity: .6; padding: 20px 0 40px; }

/* música */
.music {
  position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 54px; height: 54px; border-radius: 50%; border: 0; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--deep)); box-shadow: 0 10px 24px -8px var(--deep), inset 0 0 0 2px var(--accent);
  display: grid; place-items: center;
}
.music .disc svg { width: 24px; }
.music.playing .disc { animation: spin 3s linear infinite; }
.music:not(.playing)::after { content: ''; position: absolute; width: 60%; height: 2px; background: #fff; rotate: -45deg; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 70; background: rgba(10,6,20,.92); display: flex; align-items: center; justify-content: center; }
.lb[hidden] { display: none; }
.lb img { max-width: 92vw; max-height: 86vh; border-radius: 10px; }
.lb button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; padding: 10px 16px; }
.lb-x { top: 8px; right: 8px; }
.lb-p { left: 4px; }
.lb-n { right: 4px; }

/* animaciones */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes pulse { 50% { box-shadow: 0 6px 16px rgba(0,0,0,.35), 0 0 0 10px color-mix(in srgb, var(--accent) 25%, transparent), inset 0 0 0 5px rgba(0,0,0,.15); } }
@keyframes spin { to { transform: rotate(360deg); } }
/* transiciones del contenido */
.reveal { transition-delay: var(--d, 0s); }
.reveal.zoom { transform: scale(.88); }
.reveal.left { transform: translateX(-46px); }
.reveal.right { transform: translateX(46px); }
.reveal.in { transform: none; }
.divider path { stroke-dasharray: 320; stroke-dashoffset: 320; }
.divider.in path { animation: draw 1.6s ease forwards; }
.letters span { display: inline-block; opacity: 0; transform: translateY(40px) rotate(10deg) scale(.6); }
main.show .letters span { animation: letterIn .8s calc(.6s + var(--i) * 70ms) cubic-bezier(.2,1.5,.4,1) forwards; }
main.show .hero-frame { animation: frameIn 1.4s .2s cubic-bezier(.2,1,.3,1) both; }
.hero-frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%) -200% 0 / 250% 100% no-repeat; }
main.show .hero-frame::after { animation: shine 2.2s 1.2s ease forwards; }
main.show .hero-crown { animation: crownDrop 1s 1.1s cubic-bezier(.2,1.6,.4,1) both; }
main.show .countdown div { animation: pop .7s calc(1.4s + var(--n, 0) * .1s) cubic-bezier(.2,1.6,.4,1) both; }
.countdown div:nth-child(2) { --n: 1; } .countdown div:nth-child(3) { --n: 2; } .countdown div:nth-child(4) { --n: 3; }
main { transform-origin: 50% 20%; }
main.show { animation: mainIn 1.2s cubic-bezier(.2,1,.3,1) both; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes letterIn { to { opacity: 1; transform: none; } }
@keyframes frameIn { from { opacity: 0; transform: scale(.85) translateY(30px); } }
@keyframes shine { to { background-position: 200% 0; } }
@keyframes crownDrop { from { opacity: 0; transform: translateY(-40px) rotate(-12deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.5); } }
@keyframes mainIn { from { opacity: 0; transform: translateY(24px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } }

@media (max-width: 420px) {
  body { font-size: 18px; }
  .date { gap: 10px; font-size: .7rem; }
  .date-side { min-width: 78px; }
  .countdown div { width: 64px; }
}

@media (max-height: 700px) {
  .cover-phrase { display: none; }
}
