/* =========================================================
   Save the Date · 08.10.2027
   ========================================================= */
:root {
  --night: #05060a;
  --night-2: #0b0e18;
  --stone: #2a2c33;
  --stone-dark: #15161b;
  --silver: #dfe6f5;
  --moon: #b9c7e6;
  --gold: #d9c28c;
  --gold-soft: rgba(217, 194, 140, .35);
  --text: #e9e6df;
  --muted: #9a9aa6;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: radial-gradient(ellipse at 50% 30%, var(--night-2), var(--night) 70%);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-intro { overflow: hidden; }

#stars {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* =========================================================
   INTRO
   ========================================================= */
#intro {
  position: fixed; inset: 0;
  z-index: 10;
  background: var(--night);
  transition: opacity 1.4s ease;
}
#intro.is-done { opacity: 0; pointer-events: none; }

/* ---------- Pantalla de entrada ---------- */
.gate {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px;
  text-align: center;
  padding: 24px;
  background: radial-gradient(ellipse at center, rgba(20, 24, 40, .6), var(--night) 70%);
  transition: opacity .8s ease;
}
.gate.is-hidden { opacity: 0; pointer-events: none; }

.gate__eyebrow {
  font-family: var(--display);
  letter-spacing: .35em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--muted);
}
.gate__btn {
  position: relative;
  width: 132px; height: 132px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  font-family: var(--display);
  letter-spacing: .3em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--gold);
  padding-left: .3em;
  transition: transform .4s ease, box-shadow .4s ease, border-color .4s ease;
  animation: breathe 3.2s ease-in-out infinite;
}
.gate__btn:hover, .gate__btn:focus-visible {
  transform: scale(1.05);
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(217, 194, 140, .25), inset 0 0 30px rgba(217, 194, 140, .12);
  outline: none;
}
.gate__hint { font-style: italic; color: var(--muted); font-size: 15px; }

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 rgba(217, 194, 140, 0); }
  50%      { box-shadow: 0 0 36px rgba(217, 194, 140, .18); }
}

/* ---------- Vídeo ---------- */
.intro__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--night);
  display: none;
}
.intro__video.is-active { display: block; }

/* ---------- Botón saltar ---------- */
.skip {
  position: absolute; z-index: 6;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s ease, color .3s ease;
}
.skip.is-visible { opacity: .8; pointer-events: auto; }
.skip:hover { color: var(--text); }

/* =========================================================
   ESCENA PROVISIONAL (sustituible por el vídeo)
   ========================================================= */
.scene {
  position: absolute; inset: 0;
  overflow: hidden;
  perspective: 1200px;
  visibility: hidden;            /* oculto pero maquetado: así el fondo se pinta antes */
}
.scene.is-active { visibility: visible; }

.scene__camera {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  transform-origin: 50% 44%;
}

/* Muro de roca alrededor del arco */
.wall {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #1c1e24;
}
.wall__bg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Agua al pie de la roca: brillo que ondula encima del agua pintada */
.water {
  position: absolute; left: 0; right: 0; bottom: 0;
  top: var(--water-top, 88%);
  overflow: hidden;
  pointer-events: none;
}
.water::before {
  content: "";
  position: absolute; inset: 0 -10%;
  background: repeating-linear-gradient(180deg,
    rgba(180, 195, 225, 0) 0 9px, rgba(180, 195, 225, .035) 9px 10px, rgba(180, 195, 225, 0) 10px 23px);
  filter: blur(.6px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
          mask-image: linear-gradient(180deg, #000, transparent 85%);
  animation: ripple 7s ease-in-out infinite alternate;
}
.water__shine {
  position: absolute; left: 58%; top: 8%;
  width: 34%; height: 70%;
  background: radial-gradient(ellipse at 50% 20%, rgba(200, 212, 240, .16), transparent 60%);
  filter: blur(2px);
  animation: shimmer 4s ease-in-out infinite alternate;
}
@keyframes ripple  { from { transform: translateX(-3%) scaleY(1); } to { transform: translateX(3%) scaleY(1.15); } }
@keyframes shimmer { from { opacity: .55; transform: scaleX(1); } to { opacity: 1; transform: scaleX(1.12); } }

/* Niebla que se desliza despacio */
.fog {
  position: absolute; left: -30%; right: -30%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 30% 50% at 20% 50%, rgba(160, 170, 190, .10), transparent 70%),
    radial-gradient(ellipse 25% 45% at 55% 60%, rgba(160, 170, 190, .08), transparent 70%),
    radial-gradient(ellipse 30% 50% at 85% 45%, rgba(160, 170, 190, .10), transparent 70%);
  filter: blur(6px);
}
.fog--low  { bottom: 2%; height: 26%; animation: drift 38s linear infinite alternate; }
.fog--high { top: 0; height: 30%; opacity: .6; animation: drift 52s linear infinite alternate-reverse; }
@keyframes drift { from { transform: translateX(-8%); } to { transform: translateX(8%); } }

/* El arco con las puertas */
.arch {
  --w: min(52vw, 40vh);
  --h: calc(var(--w) * 1.55);
  position: relative;
  top: -6vh;
  width: var(--w); height: var(--h);
  border-radius: calc(var(--w) / 2) calc(var(--w) / 2) 6px 6px;
  background: #000;               /* la oscuridad del otro lado */
  perspective: calc(var(--w) * 2.2);
  perspective-origin: 50% 50%;
  box-shadow:
    0 0 0 10px #1b1d23,
    0 0 0 12px rgba(185, 199, 230, .08),
    0 30px 80px rgba(0, 0, 0, .8);
}
.arch__glow {
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 60%, rgba(120, 140, 200, .18), transparent 60%);
  opacity: 0;
}

.door {
  position: absolute; top: 0; bottom: 0;
  width: 50%;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #34363e, #22242a 60%, #1a1b20);
  backface-visibility: hidden;
  transition: transform 2.6s cubic-bezier(.55, 0, .3, 1), filter 2.6s ease;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .55);
}
.door--left  { left: 0;  border-top-left-radius:  calc(var(--w) / 2) calc(var(--w) / 2); transform-origin: left center; }
.door--right { right: 0; border-top-right-radius: calc(var(--w) / 2) calc(var(--w) / 2); transform-origin: right center; }
.door--left  { border-right: 1px solid rgba(0, 0, 0, .7); }

/* Líneas decorativas (provisional, genéricas) que se iluminan */
.door__runes {
  position: absolute; inset: 9% 12% 7%;
  border: 1px solid rgba(223, 230, 245, .06);
  transition: border-color 1.2s ease, box-shadow 1.2s ease;
}
.door--left  .door__runes { border-right: 0; border-top-left-radius:  999px 999px; }
.door--right .door__runes { border-left: 0;  border-top-right-radius: 999px 999px; }

.monogram {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  font-size: calc(var(--w) * .11);
  letter-spacing: .12em;
  white-space: nowrap;
  color: rgba(223, 230, 245, .05);
  transition: color 1.2s ease, text-shadow 1.2s ease, opacity .8s ease;
  pointer-events: none;
}

/* Puertas personalizadas (assets/doors/*): una imagen de las puertas cerradas
   que se parte en dos mitades, y opcionalmente otra "encendida" que aparece al iluminarse */
.arch.has-image .door {
  background: var(--doors-img) no-repeat;
  background-size: 200% 100%;
}
.arch.has-image .door--left  { background-position: left center; }
.arch.has-image .door--right { background-position: right center; }
.arch.has-image .door::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: var(--doors-lit, none) no-repeat;
  background-size: 200% 100%;
  background-position: inherit;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.arch.has-image .door__runes { display: none; }
/* Si solo existe puertas-luz.png: velo oscuro que desaparece al iluminarse */
.arch.lit-only .door::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: rgba(5, 6, 10, .72);
  transition: opacity 1.4s ease;
  z-index: 1;
}
.scene.is-lit .arch.lit-only .door::before { opacity: 0; }
.arch.has-image.no-monogram .monogram { display: none; }
.scene.is-lit .arch.has-image .door::after { opacity: 1; }

/* Luz que se acerca (provisional: el vídeo la sustituirá) */
.sprite {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  opacity: 0;
  z-index: 3;
}
/* Hada provisional */
.fairy {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255, 240, 200, .9)) drop-shadow(0 0 10px rgba(255, 220, 150, .6));
  animation: bob 1.6s ease-in-out infinite;
}
.fairy__wings { transform-box: fill-box; animation: flap .16s ease-in-out infinite alternate; }
.fairy__wings--left  { transform-origin: right center; }
.fairy__wings--right { transform-origin: left center; }
@keyframes flap { from { transform: scaleX(1); } to { transform: scaleX(.45); } }
@keyframes bob  { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }

/* Personaje 3D: lienzo transparente a pantalla completa */
.fairy3d {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}
.sprite.is-3d .fairy, .sprite.is-3d .sprite__custom { display: none; }
.sprite.is-3d .sprite__halo { inset: -22px; opacity: .8; }

/* Sprite personalizado (assets/sprite/*) */
.sprite__custom {
  position: absolute; left: 50%; top: 50%;
  width: 260%; height: auto;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 8px rgba(255, 236, 180, .7));
  pointer-events: none;
}
.sprite__halo {
  position: absolute; inset: -32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 180, .45), rgba(255, 220, 140, 0) 65%);
  animation: flicker 1.1s ease-in-out infinite alternate;
}
.spark {
  --c: #fff3c8;
  position: absolute;
  width: 3px; height: 3px;
  margin: -1.5px 0 0 -1.5px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px 2px rgba(255, 225, 150, .65);
  pointer-events: none;
  z-index: 2;
  animation: spark 1.4s ease-out forwards, twinkle .3s ease-in-out infinite alternate;
}
.spark--front { z-index: 4; }          /* algunas por delante del hada 3D */
/* Destellos en forma de estrella de 4 puntas */
.spark--star {
  border-radius: 0;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 0 3px rgba(255, 230, 160, .9));
}
.spark--star::before, .spark--star::after {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: 260%; height: 22%;
  background: var(--c);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.spark--star::after { transform: translate(-50%, -50%) rotate(90deg); }
@keyframes twinkle { from { filter: brightness(1.4); } to { filter: brightness(.6); } }
.spark--star { animation-name: spark, twinkle-star; }
@keyframes twinkle-star {
  from { filter: brightness(1.5) drop-shadow(0 0 3px rgba(255, 230, 160, .9)); }
  to   { filter: brightness(.7)  drop-shadow(0 0 1px rgba(255, 230, 160, .6)); }
}

.flash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 55%, rgba(220, 230, 255, .9), rgba(5, 6, 10, 1) 60%);
  opacity: 0;
  pointer-events: none;
  z-index: 4;
}

@keyframes flicker {
  from { transform: scale(.9); opacity: .75; }
  to   { transform: scale(1.12); opacity: 1; }
}
@keyframes spark {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to   { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); }
}

/* ---------- Coreografía (se activa con .is-playing) ---------- */
.scene.is-playing .sprite {
  animation:
    sprite-approach 5.2s linear .2s forwards,
    sprite-enter    1.6s cubic-bezier(.6, 0, .4, 1) 6.2s forwards;
}
/* Llega desde el fondo hasta quedarse MUY cerca del espectador (en foco),
   hace el gesto de "sígueme" y se aleja hasta flotar delante de las puertas.
   (Tiempos: llega ~2.2s, gesto 2.4–4.3s, se va 4.3–5.4s) */
@keyframes sprite-approach {
  0%   { opacity: 0; transform: translate(-38vw, -34vh) scale(.15); animation-timing-function: ease-in-out; }
  6%   { opacity: 1; }
  20%  { transform: translate(26vw, -20vh) scale(.6);  animation-timing-function: ease-in-out; }
  38%  { transform: translate(5vw, 10vh)   scale(3.6); animation-timing-function: ease-in-out; }
  58%  { transform: translate(3vw, 9vh)    scale(3.8); animation-timing-function: ease-in-out; }
  79%  { transform: translate(4vw, 10vh)   scale(3.7); animation-timing-function: cubic-bezier(.5, 0, .3, 1); }
  100% { opacity: 1; transform: translate(0, -16vh) scale(1.5); }
}

/* Mientras el hada está cerca, el fondo se desenfoca: ella es el foco */
.wall { transition: filter 1s ease; }
.scene.is-close .wall { filter: blur(4px) brightness(.75); }
@keyframes sprite-enter {
  from { opacity: 1; transform: translate(0, -16vh) scale(1.5); }
  to   { opacity: 0; transform: translate(0, 2vh) scale(.08); }
}

.scene.is-lit .door__runes {
  border-color: rgba(223, 230, 245, .55);
  box-shadow: 0 0 14px rgba(185, 199, 230, .35), inset 0 0 14px rgba(185, 199, 230, .2);
}
.scene.is-lit .monogram {
  color: rgba(235, 240, 255, .95);
  text-shadow: 0 0 12px rgba(185, 199, 230, .9), 0 0 36px rgba(120, 140, 220, .6);
}

/* Las hojas se abren HACIA DENTRO (hacia la oscuridad) y se oscurecen al girar */
.scene.is-open .door--left  { transform: rotateY(88deg); filter: brightness(.35); }
.scene.is-open .door--right { transform: rotateY(-88deg); filter: brightness(.35); }
.scene.is-open .monogram    { opacity: 0; }
.scene.is-open .arch__glow  { animation: glow 2.4s ease forwards; }
@keyframes glow { to { opacity: 1; } }

.scene.is-through .scene__camera {
  animation: through 2.2s cubic-bezier(.7, 0, .3, 1) forwards;
}
@keyframes through {
  0%   { transform: scale(1);   filter: brightness(1); }
  100% { transform: scale(7);   filter: brightness(.2); }
}
.scene.is-through .flash { animation: flash 2.4s ease forwards; }
@keyframes flash {
  0%   { opacity: 0; }
  55%  { opacity: .35; }
  100% { opacity: 1; background: var(--night); }
}

/* =========================================================
   CONTENIDO
   ========================================================= */
.content {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(56px, 12vh, 120px) 16px 48px;
  text-align: center;
  opacity: 0;
  transform: scale(1.06);
  filter: blur(8px);
  transition: opacity 2s ease, transform 2.4s cubic-bezier(.2, .7, .2, 1), filter 2s ease;
}
.content.is-visible { opacity: 1; transform: none; filter: none; }

.content > * { opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease, transform 1.2s ease; }
.content.is-visible > * { opacity: 1; transform: none; }
.content.is-visible > *:nth-child(1) { transition-delay: .5s; }
.content.is-visible > *:nth-child(2) { transition-delay: 1.1s; }
.content.is-visible > *:nth-child(3) { transition-delay: 1.5s; }
.content.is-visible > *:nth-child(4) { transition-delay: 1.9s; }

/* ---------- Hero ---------- */
.hero { max-width: 760px; }
.hero__eyebrow {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: var(--gold);
  padding-left: .5em;
}
.hero__names {
  margin: 22px 0 10px;
  font-weight: 300;
  font-size: clamp(48px, 11vw, 104px);
  line-height: 1.02;
  color: var(--silver);
  text-shadow: 0 0 40px rgba(185, 199, 230, .2);
}
.hero__names span { display: inline-block; }
.hero__amp {
  font-style: italic;
  color: var(--gold);
  margin: 0 .15em;
  font-size: .8em;
}
.hero__tagline {
  font-style: italic;
  font-size: clamp(18px, 2.4vw, 22px);
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}

/* ---------- Fecha ---------- */
.date {
  margin: clamp(36px, 7vh, 64px) auto 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(14px, 4vw, 36px);
  max-width: 560px;
}
.date__side {
  font-family: var(--display);
  font-size: clamp(11px, 2.4vw, 14px);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--text);
  padding: 10px 0;
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
}
.date__main { display: flex; flex-direction: column; align-items: center; }
.date__month, .date__year {
  font-family: var(--display);
  font-size: clamp(11px, 2.4vw, 14px);
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--gold);
  padding-left: .35em;
}
.date__day {
  font-family: var(--display);
  font-size: clamp(64px, 16vw, 112px);
  line-height: 1;
  color: var(--silver);
  margin: 6px 0;
}

/* ---------- Cuenta atrás ---------- */
.countdown {
  margin-top: clamp(40px, 8vh, 72px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 3vw, 28px);
  width: 100%;
  max-width: 560px;
}
.countdown__item {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 4px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 4px;
  background: rgba(255, 255, 255, .02);
}
.countdown__item span {
  font-family: var(--display);
  font-size: clamp(24px, 6vw, 38px);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.countdown__item small {
  font-size: clamp(10px, 2.6vw, 12px);
  letter-spacing: clamp(.06em, .6vw, .2em);
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Acciones ---------- */
.actions { margin-top: clamp(40px, 8vh, 72px); max-width: 560px; }
.actions__text { font-size: 19px; color: var(--text); }
.actions__buttons {
  margin-top: 24px;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.btn {
  display: inline-block;
  padding: 13px 22px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--night);
  background: var(--gold);
  text-decoration: none;
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
}
.btn:hover { box-shadow: 0 0 24px rgba(217, 194, 140, .35); }
.btn--ghost { background: transparent; color: var(--gold); }
.btn--ghost:hover { background: rgba(217, 194, 140, .1); }

/* ---------- Footer ---------- */
.footer { margin-top: auto; padding-top: 64px; color: var(--muted); }
.divider {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--gold);
  margin-bottom: 18px;
  font-size: 12px;
}
.divider span { width: 60px; height: 1px; background: var(--gold-soft); }
.footer p { font-style: italic; font-size: 19px; color: var(--text); }
.link {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.link:hover { color: var(--text); }
.credits { margin-top: 28px; font-size: 12px; font-style: normal !important; color: var(--muted) !important; opacity: .6; }
.credits a { color: inherit; }

/* ---------- Accesibilidad ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
