@font-face {
  font-family: "Kaushan Script";
  src: url("./public/fonts/KaushanScript-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fcfaf4;
  --ink: #294c68;
  --soft-ink: #58758a;
  --gold: #d8a755;
  --serif-free: "Nunito", Arial, sans-serif;
  --script: "Segoe Script", "Dancing Script", cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: #e9edf0; color: var(--ink); font-family: var(--serif-free); -webkit-font-smoothing: antialiased; }

/* Una tapa celeste abre la invitación como un cuento ilustrado. */
.story-opening {
  position: fixed;
  z-index: 1000;
  inset: 0;
  width: min(100%, 480px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  perspective: 1500px;
  background: rgba(41, 76, 104, .18);
  touch-action: none;
  transition: background-color 650ms ease 480ms, visibility 0s linear 1450ms;
}
.story-cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, .58), transparent 25%),
    radial-gradient(circle at 82% 70%, rgba(255, 255, 255, .30), transparent 31%),
    linear-gradient(160deg, #c3e2f1 0%, #d5ebf5 48%, #c8e5f2 100%);
  color: var(--ink);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transform: rotateY(0deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow: 0 0 34px rgba(35, 71, 96, .12);
  transition: transform 1350ms cubic-bezier(.62, .02, .22, 1), opacity 260ms ease 1120ms, box-shadow 900ms ease;
}
.story-cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: .22;
  background-image:
    repeating-radial-gradient(circle at 25% 25%, rgba(255, 255, 255, .34) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(40, 91, 122, .13), transparent 5%, transparent 94%, rgba(255, 255, 255, .24));
  pointer-events: none;
}
.story-cover::after {
  content: "";
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  width: 44%;
  height: 100%;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(29, 66, 91, .28));
  pointer-events: none;
  transition: opacity 700ms ease;
}
.story-cover__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 34px 20px 54px;
}
.story-cover__prince {
  display: block;
  width: min(58vw, 260px);
  max-height: 52vh;
  max-height: 52dvh;
  object-fit: contain;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 8px rgba(42, 83, 105, .08));
}
.story-cover__title {
  position: relative;
  z-index: 3;
  margin: 0;
  color: #315d7d;
  font-family: var(--script);
  font-size: clamp(29px, 7.8vw, 38px);
  font-weight: 600;
  line-height: .98;
}
.story-cover__title span {
  display: block;
  margin-top: 6px;
  color: #245582;
  font-family: "Lobster Two", "Kaushan Script", "Dancing Script", cursive;
  font-size: clamp(69px, 19vw, 94px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
}
.story-cover__hint {
  display: block;
  margin-top: 25px;
  color: rgba(41, 76, 104, .72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.story-cover__cloud,
.story-cover__star { position: absolute; z-index: 2; display: block; object-fit: contain; pointer-events: none; }
.story-cover__cloud--left { top: 13%; left: -72px; width: 205px; }
.story-cover__cloud--right { top: 20%; right: -94px; width: 240px; transform: scaleX(-1); }
.story-cover__star { width: 38px; height: 38px; }
.story-cover__star--one { top: 9%; right: 14%; }
.story-cover__star--two { top: 48%; left: 9%; width: 29px; height: 29px; }
.story-cover:focus-visible { outline: 3px solid #d8a755; outline-offset: -7px; }
.story-opening.is-opening { background: rgba(41, 76, 104, 0); pointer-events: none; visibility: hidden; }
.story-opening.is-opening .story-cover { opacity: 0; transform: rotateY(-104deg) translateX(-2%); box-shadow: 22px 0 40px rgba(25, 54, 72, .28); }
.story-opening.is-opening .story-cover::after { opacity: 1; }

.invitation {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  background-image: radial-gradient(circle at 5% 5%, rgba(221, 236, 240, .26), transparent 20%),
    radial-gradient(circle at 90% 35%, rgba(232, 238, 233, .22), transparent 26%),
    radial-gradient(circle at 8% 76%, rgba(233, 226, 209, .18), transparent 23%);
}
/* El cielo ocupa toda la invitación; el contenido queda en una capa superior. */
.sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sky img { position: absolute; display: block; object-fit: contain; user-select: none; }
.sky__cloud { width: 210px; opacity: .72; }
.sky__cloud--a { top: 17%; left: -106px; transform: rotate(-5deg); }
.sky__cloud--b { top: 28%; right: -105px; width: 235px; transform: scaleX(-1); }
.sky__cloud--c { top: 39%; left: -102px; width: 218px; }
.sky__cloud--d { top: 51%; right: -111px; width: 225px; transform: rotate(5deg); }
.sky__cloud--e { top: 62%; left: -118px; width: 248px; }
.sky__cloud--f { top: 75%; right: -96px; width: 212px; transform: scaleX(-1); }
.sky__star { width: 28px; height: 28px; opacity: .86; }
.sky__star--a { top: 22%; right: 8%; }
.sky__star--b { top: 34%; left: 13%; width: 23px; height: 23px; }
.sky__star--c { top: 46%; right: -8px; width: 82px; height: 62px; }
.sky__star--d { top: 58%; left: 5%; width: 26px; height: 26px; }
.sky__star--e { top: 67%; right: -13px; width: 72px; height: 54px; }
.sky__star--f { top: 78%; left: -16px; width: 76px; height: 57px; }
.sky__star--g { top: 90%; right: -5px; width: 94px; height: 70px; }
.scene { position: relative; z-index: 1; text-align: center; }
.decor { position: absolute; display: block; pointer-events: none; user-select: none; object-fit: contain; }
.star { width: 40px; height: 40px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Apertura: la foto queda dentro del planeta y los personajes miran hacia ella. */
.hero { padding: 64px 20px 39px; }
.hero__intro { position: relative; z-index: 3; margin: 0; color: #335a78; font-size: clamp(21px, 5.4vw, 29px); font-style: italic; font-weight: 600; line-height: 1.26; }
.hero__cloud { width: 158px; height: 119px; opacity: .95; }
.hero__cloud--left { top: -51px; left: -77px; }
.hero__cloud--right { top: -55px; right: -78px; }
.hero__star--top { top: -10px; left: 18%; }
.hero__illustration { position: relative; height: 399px; margin: 8px -20px 0; }
.photo-moon { position: absolute; z-index: 2; top: 51px; left: 50%; width: 318px; height: 318px; display: grid; place-items: center; transform: translateX(-50%); }
.photo-moon::before { content: ""; position: absolute; z-index: 3; inset: 0; border-radius: 50%; background: url("./public/images/aro-lunar.png") center / contain no-repeat; }
.photo-moon > img { position: relative; z-index: 2; display: block; width: 258px; height: 258px; border-radius: 50%; object-fit: cover; object-position: 50% 31%; }
.hero__balloons { z-index: 1; top: 6px; left: -28px; width: 166px; height: 221px; }
.hero__prince { z-index: 3; top: 209px; right: -12px; width: 190px; height: 190px; transform: translate3d(var(--travel-x, 0px), var(--travel-y, 0px), 0) scaleX(-1); transform-origin: center; }
.hero__cloud--lower { z-index: 4; top: 320px; left: -29px; width: 140px; height: 105px; }
.hero__star--side { z-index: 4; top: 272px; right: 6px; width: 34px; height: 34px; }
.hero__name { position: relative; z-index: 5; width: max-content; max-width: 100%; margin: 11px auto 0; }
.hero__crown { top: -25px; left: 50%; width: 67px; height: 67px; transform: translateX(-50%); }
.hero h1 { margin: 0; padding-top: 16px; color: #245582; font-family: "Lobster Two", "Kaushan Script", "Dancing Script", cursive; font-size: clamp(71px, 19vw, 98px); font-weight: 700; letter-spacing: -.02em; line-height: 1.08; }
.hero__name p { margin: 2px auto 0; font-size: clamp(22px, 5.7vw, 27px); font-weight: 500; letter-spacing: normal; line-height: 1.2; }

/* Fecha: planeta al centro, el principito vuela hacia los números. */
.date { padding: 1px 16px 2px; }
.date__cloud { top: 115px; right: -67px; width: 135px; height: 102px; opacity: .84; }
.date__illustration { position: relative; height: 294px; }
.date__planet { position: absolute; top: 0; left: 50%; width: 270px; height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: translateX(-50%); background: url("./public/images/planeta-fecha.png") center / contain no-repeat; }
.date__day { font-size: 27px; font-weight: 600; line-height: 1.2; }
.date__number { margin: 2px 0; font-size: 48px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.date__hour { font-size: 22px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.date__prince { z-index: 2; top: 92px; left: -43px; width: 146px; height: 194px; transform: translate3d(var(--travel-x, 0px), var(--travel-y, 0px), 0) rotate(-10deg); transform-origin: center; }
.date__saturn { top: 37px; right: -8px; width: 77px; height: 61px; }
.date__star { top: 8px; right: 22%; width: 35px; height: 35px; }
.date__caption { position: relative; max-width: 250px; margin: 5px auto 20px; color: #3d6681; font-family: var(--script); font-size: clamp(24px, 6vw, 29px); font-weight: 600; line-height: 1.22; transform: rotate(-5deg); }

/* Las cintas usan la acuarela como pieza y un trazado SVG para el rótulo. */
.ribbon { position: relative; isolation: isolate; overflow: hidden; margin-inline: auto; }
.ribbon__art,
.ribbon__lettering { position: absolute; top: 50%; left: 0; display: block; width: 100%; height: auto; transform: translateY(-50%); pointer-events: none; }
.ribbon__art { z-index: 1; }
.ribbon__lettering { z-index: 2; overflow: visible; }
.ribbon__countdown-title,
.ribbon__venue-title { fill: var(--ink); font-family: var(--serif-free); }
.ribbon__countdown-title { font-size: 80px; font-style: italic; font-weight: 700; }
.ribbon__venue-title { font-size: 100px; font-weight: 800; letter-spacing: 1px; }

/* Cuenta regresiva: título arqueado y cifras claras sobre la zona central. */
.countdown { padding: 0 10px; }
.countdown__scroll { z-index: 1; width: 100%; height: 170px; }
.ribbon--countdown { overflow: visible; }
.ribbon--countdown .ribbon__art,
.ribbon--countdown .ribbon__lettering { top: 50%; left: 50%; width: auto; min-width: 100%; transform: translate(-50%, -50%); }
.ribbon--countdown .ribbon__art { height: 120%; }
.ribbon--countdown .ribbon__lettering { top: calc(50% - 4px); height: 112%; }
.countdown__numbers { position: absolute; z-index: 3; top: 79px; left: 50%; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 294px); transform: translateX(-50%); }
.countdown__numbers > div { display: flex; flex-direction: column; align-items: center; border-right: 1px solid rgba(88, 117, 138, .25); }
.countdown__numbers > div:last-child { border-right: 0; }
.countdown__numbers span { font-size: 31px; font-weight: 700; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.countdown__numbers small { color: #5e7280; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.countdown__arrival { position: absolute; z-index: 3; top: 78px; left: 50%; width: 270px; margin: 0; transform: translateX(-50%); font-family: var(--script); font-size: 25px; font-weight: 700; line-height: 1.2; }
.countdown__star { top: 5px; right: 4px; width: 34px; height: 34px; }

/* El salón acompaña al planeta; los dos botones cierran el bloque del contador. */
.ribbon--venue { width: min(100%, 354px); height: 94px; margin-bottom: 2px; }
.venue__ribbon { margin-top: -4px; }
.countdown__actions { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 20px 65px; }
.venue__cloud { top: 29px; left: -61px; width: 118px; height: 88px; opacity: .9; }
.venue__star { top: 2px; right: 11px; width: 34px; height: 34px; }
.button { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 11px; width: min(100%, 260px); min-height: 48px; padding: 10px 17px; border: 1px solid transparent; border-radius: 100px; text-decoration: none; font-size: 16px; font-weight: 700; line-height: 1.2; transition: transform .2s ease, background-color .2s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.button svg { width: 21px; height: 21px; flex: none; }
.button--maps { background: #4b8178; color: white; }
.button--maps:hover { background: #3b6d65; }
.button--maps svg { stroke: currentColor; stroke-width: 1.8; }
.button--rsvp { border-color: #e0d8ca; background: #efebe3; color: #3a657d; }
.button--rsvp:hover { background: #e8e2d7; }
.button--rsvp svg { width: 24px; height: 24px; }
.rsvp__fox { top: 24px; right: -25px; width: 106px; height: 141px; transform: scaleX(-1); }
.rsvp__star { top: 66px; left: 13px; width: 33px; height: 33px; }

/* La frase hace una pausa poética antes de los recuerdos. */
.quote { padding: 0 10px 49px; }
.quote::before { content: ""; position: absolute; top: -20px; left: -38px; width: 88px; height: 66px; background: url("./public/images/nube.png") center / contain no-repeat; opacity: .78; }
.quote__asset-wrap { position: relative; width: 100%; }
.quote__asset { display: block; width: 100%; height: auto; }
.quote__rose { z-index: 3; right: auto; bottom: 10px; left: 16px; width: 63px; height: 84px; }

/* Tres recuerdos con el aspecto de fotos impresas. */
.gallery { padding: 0 22px 64px; }
.gallery h2 { margin: 0; font-family: var(--script); font-size: 38px; line-height: 1.1; }
.gallery p { margin: 5px 0 22px; font-size: 16px; font-style: italic; }
.gallery__photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: center; }
.memory { --rotation: 0deg; position: relative; aspect-ratio: 3 / 4; min-width: 0; margin: 0; padding: 0; overflow: hidden; appearance: none; border: 5px solid white; border-bottom-width: 14px; border-radius: 3px; background: #e9eef0; box-shadow: 0 3px 9px rgba(37, 62, 75, .14); cursor: pointer; opacity: 1; filter: saturate(1); transform: rotate(var(--rotation)) scale(1); transform-origin: center center; transition: transform 350ms ease, opacity 350ms ease, filter 350ms ease; -webkit-tap-highlight-color: transparent; }
.memory img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.memory--one img { object-position: 53% 43%; }
.memory--two img { object-position: 50% 34%; }
.memory--three img { object-position: 50% 40%; }
.memory--one { --rotation: -2deg; }
.memory--three { --rotation: 2deg; }
.gallery__photos.has-active .memory { transform: rotate(var(--rotation)) scale(.9); opacity: .78; filter: saturate(.9); }
.gallery__photos.has-active .memory.is-active { z-index: 2; transform: rotate(var(--rotation)) scale(1.6); opacity: 1; filter: saturate(1); }
.memory:focus-visible { z-index: 3; outline: 2px solid #c8963e; outline-offset: 4px; }

/* El avión se dirige hacia el mensaje y las nubes cierran la lámina. */
.closing { min-height: 360px; padding: 12px 20px 210px; }
.closing h2 { position: relative; z-index: 2; max-width: 350px; margin: 0 auto; color: #2c5c83; font-family: var(--script); font-size: clamp(29px, 7vw, 34px); font-weight: 700; line-height: 1.23; transform: rotate(-4deg); }
.closing__plane { z-index: 2; bottom: 33px; right: -43px; width: 257px; height: 193px; transform: translate3d(var(--travel-x, 0px), var(--travel-y, 0px), 0); transform-origin: center; }
.closing__saturn { bottom: 89px; left: 5px; width: 75px; height: 57px; }
.closing__star { top: 49px; left: 10%; width: 35px; height: 35px; }
.closing__cloud { width: 140px; height: 105px; opacity: .85; }
.closing__cloud--left { top: -25px; left: -82px; }
.closing__cloud--right { top: 78px; right: -74px; }
.closing__cloud--base { z-index: 3; bottom: -64px; left: -33px; width: 255px; height: 191px; }

.site-credit { width: 100%; max-width: 480px; margin: 14px auto 0; padding: 13px 16px; background: #294c68; text-align: center; }
.site-credit a { display: inline-flex; align-items: center; justify-content: center; gap: 11px; color: #fffdf7; font-size: 13px; font-weight: 600; letter-spacing: .02em; text-decoration: none; }
.site-credit img { display: block; width: 66px; height: auto; filter: brightness(0) invert(1); }
.site-credit a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-credit a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 2px; }

@media (max-width: 359px) {
  .hero__illustration { height: 379px; }
  .hero__balloons { left: -35px; width: 145px; height: 194px; }
  .hero__prince { top: 203px; right: -27px; width: 178px; height: 178px; }
  .photo-moon { width: 288px; height: 288px; top: 49px; }
  .photo-moon > img { width: 234px; height: 234px; }
  .date__prince { left: -56px; width: 133px; }
  .date__planet { width: 246px; height: 246px; top: 10px; }
  .date__number { font-size: 44px; }
  .date__caption { max-width: 230px; }
  .rsvp__fox { right: -42px; }
  .quote blockquote { font-size: 15px; }
  .closing__plane { right: -59px; }
}

@media (min-width: 481px) {
  body {
    position: relative;
    isolation: isolate;
    padding: 20px 0;
    background: #dcecf4;
  }

  body::before {
    content: "";
    position: fixed;
    z-index: 0;
    inset: 0;
    pointer-events: none;
    background-image:
      url("./public/images/nubes-grupo.png"),
      url("./public/images/nubes-horizonte.png"),
      url("./public/images/nubes-suaves.png"),
      url("./public/images/estrella-brillante.png"),
      url("./public/images/estrellas-linea.png"),
      url("./public/images/estrella-fugaz.png"),
      radial-gradient(circle at 50% 24%, rgba(255, 255, 255, .66), transparent 42%);
    background-position:
      calc(50% - 410px) 7%,
      calc(50% + 390px) 31%,
      calc(50% - 430px) 76%,
      calc(50% - 315px) 39%,
      calc(50% + 350px) 63%,
      calc(50% + 365px) 88%,
      center;
    background-size:
      360px auto,
      410px auto,
      350px auto,
      52px 52px,
      120px auto,
      150px auto,
      cover;
    background-repeat: no-repeat;
    opacity: .72;
  }

  .invitation,
  .site-credit { position: relative; z-index: 1; }
  .invitation { box-shadow: 0 4px 24px rgba(38, 58, 68, .10); }
}

@media (prefers-reduced-motion: no-preference) {
  .sky {
    transform: translate3d(0, var(--sky-parallax-y, 0px), 0);
    will-change: transform;
  }

  .hero__prince,
  .date__prince,
  .closing__plane { will-change: transform, opacity, translate; }

  .hero__cloud,
  .date__cloud,
  .venue__cloud,
  .closing__cloud,
  .scene .star {
    translate: 0 var(--accent-parallax-y, 0px);
    will-change: translate;
  }

  .has-motion .reveal-item {
    opacity: 0;
    translate: 0 13px;
    transition:
      opacity 650ms cubic-bezier(.22, .61, .36, 1),
      translate 650ms cubic-bezier(.22, .61, .36, 1);
    transition-delay: var(--reveal-delay, 0ms);
    will-change: opacity, translate;
  }

  .has-motion .memory.reveal-item {
    transition:
      transform 350ms ease 0ms,
      opacity 350ms ease 0ms,
      filter 350ms ease 0ms,
      translate 650ms cubic-bezier(.22, .61, .36, 1) var(--reveal-delay, 0ms);
  }

  .has-motion .scene.is-visible .reveal-item {
    opacity: 1;
    translate: 0 0;
  }

  .has-motion .hero__balloons,
  .has-motion .date__prince,
  .has-motion .closing__saturn { translate: -10px 9px; }

  .has-motion .hero__prince,
  .has-motion .date__saturn,
  .has-motion .closing__plane { translate: 10px 9px; }

  .has-motion .scene.is-visible .hero__balloons,
  .has-motion .scene.is-visible .date__prince,
  .has-motion .scene.is-visible .closing__saturn,
  .has-motion .scene.is-visible .hero__prince,
  .has-motion .scene.is-visible .date__saturn,
  .has-motion .scene.is-visible .closing__plane { translate: 0 0; }

  .sky__cloud--a,
  .sky__cloud--c,
  .sky__cloud--e { animation: cloud-drift-left 10s ease-in-out infinite alternate; }

  .sky__cloud--b,
  .sky__cloud--d,
  .sky__cloud--f { animation: cloud-drift-right 12s ease-in-out infinite alternate; }

  .sky__star,
  .star { animation: star-glow 4.8s ease-in-out infinite; }
  .sky__star:nth-of-type(2n),
  .star:nth-of-type(2n) { animation-delay: -1.7s; }
  .sky__star:nth-of-type(3n),
  .star:nth-of-type(3n) { animation-delay: -3.1s; }

  .scene.is-visible .reveal-item { will-change: auto; }

  @keyframes cloud-drift-left {
    from { translate: 0 0; }
    to { translate: 7px 3px; }
  }

  @keyframes cloud-drift-right {
    from { translate: 0 0; }
    to { translate: -7px 3px; }
  }

  @keyframes star-glow {
    0%, 100% { opacity: .78; filter: saturate(.94); }
    50% { opacity: 1; filter: saturate(1.08) brightness(1.04); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky { transform: none; }
  .button, .memory, .reveal-item { transition: none; animation: none; }
  .story-opening { transition: visibility 0s linear 360ms; }
  .story-cover { transition: opacity 350ms ease; }
  .story-opening.is-opening .story-cover { opacity: 0; transform: none; }
}
