/* Base: colores, tipografía, cielo, botones y piezas comunes */
:root {
  --noche: #0e1b26;
  --noche-2: #16293a;
  --pino: #1d4a45;
  --nieve: #f7f4ee;
  --papel: #fffdf9;
  --glaciar: #a8cbd9;
  --coral: #e9694a;
  --coral-osc: #c94f33;
  --oro: #e0a93b;
  --tinta: #14222e;
  --tinta-2: #52626e;
  --linea: rgba(20, 34, 46, .12);
  --p-verde: #2e9e5b; --p-azul: #2d7dd2; --p-roja: #d8432f; --p-negra: #16181d;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radio: 26px;
  --sombra: 0 1px 2px rgba(10, 25, 40, .06), 0 12px 40px -12px rgba(10, 25, 40, .28);
  --ancho: 1120px;

  /* El cielo cambia con el scroll (app.js): amanecer → día → atardecer → noche */
  --cielo-1: #f6c9a8; --cielo-2: #f9e3cf; --cielo-3: #cfe3ea;
  --sobre-cielo: #14222e; --sobre-cielo-2: rgba(20, 34, 46, .72);
  --estrellas: 0;
  --m-lejos-1: #b9cdd8; --m-lejos-2: #d9e3e6;
  --m-medio-1: #6f93a3; --m-medio-2: #9ab5bf;
  --m-cerca-1: #2b5560; --m-cerca-2: #1d4a45;
  --ibon-1: #cfe8ee; --ibon-2: #7fb3c4;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.55; color: var(--tinta);
  background: var(--noche); overflow-x: hidden; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; border-radius: 8px; }

.ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── Cielo fijo y nieve ── */
.cielo { position: fixed; inset: 0; z-index: -2; background: linear-gradient(180deg, var(--cielo-1) 0%, var(--cielo-2) 48%, var(--cielo-3) 100%); }
.estrellas {
  position: absolute; inset: 0; opacity: var(--estrellas);
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 27% 42%, #fff 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 41% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 58% 33%, #fff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 73% 21%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 86% 47%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 93% 9%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 6% 61%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 34% 71%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 66% 64%, #fff 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 80% 78%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 49% 86%, #fff 50%, transparent 51%);
  background-size: 620px 620px; animation: titilar 5s ease-in-out infinite alternate;
}
@keyframes titilar { to { filter: brightness(.7); } }
.astro {
  position: absolute; width: 150px; height: 150px; border-radius: 50%; left: var(--astro-x, 72%); top: var(--astro-y, 16%);
  background: radial-gradient(circle, var(--astro-c, #fff3d6) 0 34%, color-mix(in srgb, var(--astro-c, #fff3d6) 40%, transparent) 36%, transparent 70%);
  transform: translate(-50%, -50%); filter: blur(.4px);
}
@media (max-width: 700px) { .astro { width: 92px; height: 92px; top: calc(var(--astro-y, 16%) * .22); opacity: .9; } /* en el móvil el astro se queda en la franja de arriba, por encima de los títulos, para no tapar texto */ }
.nieve { position: fixed; inset: 0; z-index: 5; pointer-events: none; width: 100%; height: 100%; }
.lluvia-emojis { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.lluvia-emojis span { position: absolute; bottom: -40px; font-size: 30px; animation: sube var(--dur, 2.4s) cubic-bezier(.2, .7, .3, 1) forwards; will-change: transform, opacity; }
@keyframes sube { 0% { transform: translate(0, 0) scale(.6) rotate(0); opacity: 0; } 12% { opacity: 1; } 100% { transform: translate(var(--dx, 0), -92vh) scale(1.25) rotate(var(--rot, 20deg)); opacity: 0; } }

/* ── Secciones ── */
.seccion { position: relative; max-width: var(--ancho); margin: 0 auto; padding: clamp(64px, 11vw, 132px) clamp(18px, 4vw, 36px) 0; }
.cabecera { max-width: 640px; margin-bottom: clamp(26px, 4vw, 44px); color: var(--sobre-cielo); transition: color .6s; }
.sobretitulo { font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--coral-osc); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.sobretitulo::before { content: ''; width: 26px; height: 2px; background: currentColor; border-radius: 2px; }
:root[data-fase="noche"] .sobretitulo, :root[data-fase="ocaso"] .sobretitulo { color: var(--oro); }
h2 { font-family: var(--serif); font-weight: 400; font-variation-settings: 'SOFT' 60, 'opsz' 110; font-size: clamp(38px, 7.2vw, 68px); line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; }
h3 { font-family: var(--serif); font-weight: 500; font-variation-settings: 'SOFT' 50, 'opsz' 40; font-size: 25px; line-height: 1.15; letter-spacing: -.01em; }
.entradilla { margin-top: 16px; font-size: clamp(17px, 2.1vw, 19.5px); color: var(--sobre-cielo-2); transition: color .6s; text-wrap: pretty; }
.sobre-cielo { color: var(--sobre-cielo); transition: color .6s; }
.credito { margin-top: 12px; font-size: 12.5px; color: var(--sobre-cielo-2); }

.panel { background: var(--papel); border-radius: var(--radio); padding: clamp(20px, 3.4vw, 34px); box-shadow: var(--sombra); }
.panel-noche { background: var(--noche); color: var(--nieve); }
.panel > h3 + p { margin-top: 8px; color: var(--tinta-2); }
.dos-col { display: grid; gap: 18px; }
@media (min-width: 860px) { .dos-col { grid-template-columns: 1.1fr .9fr; align-items: start; } }

/* ── Botones ── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px; border-radius: 999px; border: 0;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap; transition: transform .18s, box-shadow .18s, background .18s; -webkit-tap-highlight-color: transparent;
}
.boton:active { transform: scale(.96); }
.boton-coral { background: var(--coral); color: #fff; box-shadow: 0 8px 22px -8px rgba(233, 105, 74, .8); }
.boton-coral:hover { background: var(--coral-osc); }
.boton-noche { background: var(--noche); color: var(--nieve); }
.boton-noche:hover { background: var(--noche-2); }
.boton-linea { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.boton-cristal { background: rgba(255, 255, 255, .22); color: var(--tinta); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55); }
.boton[disabled] { opacity: .55; pointer-events: none; }
.fila-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.fila-botones.centro { justify-content: center; margin-top: 26px; }
.enlace-discreto { background: none; border: 0; padding: 10px 0 0; font-size: 14px; color: var(--tinta-2); text-decoration: underline; text-underline-offset: 3px; }

.campo { display: grid; gap: 6px; }
.campo > span { font-size: 13px; font-weight: 600; color: var(--tinta-2); }
input:not([type]), input[type=text], input[type=search], input[type=tel], input[type=number], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--linea); background: #fff; transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--coral); box-shadow: 0 0 0 4px rgba(233, 105, 74, .16); }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2352626e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }

.aviso { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; font-size: 15.5px; max-width: 640px; }
.aviso .ico { margin-top: 2px; color: var(--coral); }
.por-confirmar { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: rgba(224, 169, 59, .2); color: #7a5607; vertical-align: middle; white-space: nowrap; }
.vacio { color: var(--tinta-2); font-size: 15.5px; }

/* ── Aparición al hacer scroll ── */
.aparece { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2, .7, .2, 1), transform .7s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--retardo, 0s); }
.aparece.visto { opacity: 1; transform: none; }

/* ── Barra inferior ── */
.barra {
  position: fixed; z-index: 40; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(140%);
  display: flex; align-items: center; gap: 2px; padding: 6px; border-radius: 999px; background: rgba(14, 27, 38, .86); color: var(--nieve);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 14px 40px -10px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.barra.visible { transform: translateX(-50%); }
.barra a { display: grid; justify-items: center; gap: 2px; min-width: 62px; padding: 8px 6px; border-radius: 999px; text-decoration: none; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; opacity: .78; transition: opacity .2s, background .2s; }
.barra a .ico { width: 21px; height: 21px; }
.barra a.activa { opacity: 1; background: rgba(255, 255, 255, .12); }
.barra a.barra-centro { background: var(--coral); opacity: 1; padding-inline: 12px; }

/* ── Avisos y visor ── */
.tostada { position: fixed; z-index: 70; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; max-width: min(92vw, 420px); padding: 13px 20px; border-radius: 16px; background: var(--noche); color: var(--nieve); font-size: 15px; font-weight: 500; text-align: center; box-shadow: var(--sombra); transition: opacity .3s, transform .3s; }
.tostada.ver { opacity: 1; transform: translate(-50%, 0); }
.tostada.mal { background: #8f2a1a; }
.visor { position: fixed; inset: 0; z-index: 80; background: rgba(8, 14, 20, .94); display: grid; grid-template-rows: 1fr auto; place-items: center; padding: 16px; }
.visor img { max-width: 100%; max-height: calc(100dvh - 150px); border-radius: 14px; object-fit: contain; }
.visor-cerrar { position: absolute; top: 14px; right: 14px; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 28px; line-height: 1; }
.visor-pie { color: var(--nieve); display: grid; gap: 10px; justify-items: center; padding: 14px 0 6px; }
.visor-emojis { display: flex; gap: 6px; justify-content: center; }
.visor-emojis .emoji-b { padding: 8px 10px; }
@media (max-width: 420px) { .visor-emojis .emoji-b { padding: 8px 8px; font-size: 17px; gap: 3px; } }
.emoji-b { border: 0; border-radius: 999px; padding: 8px 13px; min-height: 44px; background: rgba(255, 255, 255, .12); color: inherit; font-size: 18px; display: inline-flex; gap: 6px; align-items: center; transition: transform .15s, background .15s; }
.emoji-b small { font-size: 13px; font-weight: 600; opacity: .85; }
.emoji-b:active { transform: scale(1.25); }

/* ── Pie ── */
.pie { position: relative; text-align: center; color: var(--nieve); padding: clamp(90px, 14vw, 170px) 20px 60px; }
.pie-grande { font-family: var(--serif); font-size: clamp(46px, 10vw, 104px); font-weight: 300; font-variation-settings: 'SOFT' 100, 'opsz' 144; letter-spacing: -.03em; line-height: 1; }
.pie-firma { margin-top: 22px; font-family: var(--serif); font-style: italic; font-size: 24px; }
.pie-firma em { color: var(--coral); }
.pie-hashtag { margin-top: 10px; font-size: 14px; letter-spacing: .08em; opacity: .7; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .aparece { opacity: 1; transform: none; }
}

/* ── Estación: verano (mayo-octubre, como el día de la boda) o invierno ── */
.estacion { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 30; display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(14, 27, 38, .42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5); }
.estacion button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: rgba(255, 255, 255, .78); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .25s, color .25s; -webkit-tap-highlight-color: transparent; }
.estacion button .ico { width: 17px; height: 17px; }
.estacion button span { display: none; }
.estacion button[aria-pressed=true] { background: #fffdf9; color: #14222e; padding: 0 12px 0 10px; }
.estacion button[aria-pressed=true] span { display: inline; }
.estacion button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.nieve-cumbre, .flores, .aves { transition: opacity .9s ease; }
.flores, .aves { opacity: 0; }
.aves { stroke: var(--sobre-cielo, #14222e); stroke-width: 2.4; }
html[data-estacion=verano] .nieve-cumbre { opacity: .2; }               /* en septiembre solo quedan neveros */
html[data-estacion=verano] .flores { opacity: .95; }
html[data-estacion=verano] .aves { opacity: .55; animation: planeo 46s linear infinite; }
html[data-estacion=verano][data-fase=noche] .aves { opacity: 0; }
html[data-estacion=verano][data-fase=noche] .flores, html[data-estacion=verano][data-fase=ocaso] .flores { opacity: .45; }
@keyframes planeo { from { transform: translate(-80px, 330px); } 50% { transform: translate(760px, 250px); } to { transform: translate(1560px, 300px); } }
@media (prefers-reduced-motion: reduce) { html[data-estacion=verano] .aves { animation: none; transform: translate(980px, 250px); } .nieve-cumbre, .flores, .aves { transition: none; } }
