:root {
  color-scheme: dark;
  --night: #061329;
  --ink: #fffaf0;
  --muted: rgba(255, 250, 240, 0.74);
  --gold: #ffd84a;
  --gold-soft: #fff0a2;
  --glass: rgba(7, 18, 38, 0.52);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; }

.scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: var(--night);
}

.scene__image {
  position: absolute;
  inset: -3%;
  background: url("assets/jardin-amarillo.webp") center 54% / cover no-repeat;
  transform: scale(1.035);
  animation: arrive 2.2s cubic-bezier(.2,.8,.2,1) both;
  will-change: transform;
}

.scene__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 10, 25, .82) 0%, rgba(3, 12, 28, .34) 55%, rgba(3, 10, 24, .14) 100%),
    linear-gradient(180deg, rgba(2, 9, 23, .32) 0%, transparent 48%, rgba(2, 8, 20, .52) 100%);
}

.glow {
  position: absolute;
  width: 24rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
  background: #ffbd2f;
  animation: drift 9s ease-in-out infinite alternate;
}

.glow--one { left: 8%; bottom: -12rem; }
.glow--two { right: -8rem; top: 28%; animation-delay: -4s; }

.love-letter {
  width: min(100%, 90rem);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) clamp(1.4rem, 6vw, 6rem) max(1.5rem, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: rgba(255, 250, 240, .72);
  animation: rise .9s .2s both;
}

.eyebrow span {
  width: 2.2rem;
  height: 1px;
  background: var(--gold);
  box-shadow: 0 0 12px var(--gold);
}

.hero {
  align-self: center;
  width: min(46rem, 100%);
  padding: clamp(3rem, 8vh, 7rem) 0 2rem;
}

.dedication {
  margin: 0 0 .6rem;
  color: var(--gold-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-style: italic;
  animation: rise .9s .35s both;
}

h1 {
  max-width: 11ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 10vw, 8.8rem);
  font-weight: 400;
  line-height: .79;
  letter-spacing: -.065em;
  text-wrap: balance;
  text-shadow: 0 10px 45px rgba(0, 0, 0, .38);
  animation: rise 1s .45s both;
}

h1 em {
  color: var(--gold);
  font-weight: 400;
  text-shadow: 0 0 38px rgba(255, 199, 32, .28);
}

.intro {
  max-width: 35rem;
  margin: 1.7rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
  color: var(--muted);
  text-wrap: pretty;
  animation: rise 1s .6s both;
}

.reveal-button {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  min-height: 3.5rem;
  margin-top: 1.8rem;
  padding: .65rem .75rem .65rem 1.35rem;
  border: 1px solid rgba(255, 224, 106, .58);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(7, 18, 38, .48);
  color: #fffdf5;
  box-shadow: 0 15px 45px rgba(0, 0, 0, .25), inset 0 1px rgba(255,255,255,.08);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
  animation: rise 1s .75s both;
  -webkit-tap-highlight-color: transparent;
}

.reveal-button:hover { transform: translateY(-3px); border-color: var(--gold); background: rgba(9, 22, 46, .7); }
.reveal-button:active { transform: translateY(0) scale(.98); }
.reveal-button:focus-visible { outline: 3px solid white; outline-offset: 4px; }

.reveal-button__shine {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255,255,255,.12) 45%, transparent 65%);
  transform: translateX(-110%);
  animation: shine 4s 2s infinite;
}

.reveal-button__icon {
  display: grid;
  place-items: center;
  width: 2.15rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  color: #402d00;
  box-shadow: 0 0 24px rgba(255, 212, 71, .44);
}

.secret {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1rem;
  width: min(38rem, 100%);
  max-height: 0;
  margin-top: 0;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 1.1rem;
  overflow: hidden;
  opacity: 0;
  background: var(--glass);
  backdrop-filter: blur(16px);
  transform: translateY(12px);
  transition: max-height .55s ease, opacity .45s ease, transform .45s ease, margin .45s ease, padding .45s ease, border-color .45s ease;
}

.secret.is-visible {
  max-height: 12rem;
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border-color: rgba(255, 226, 118, .24);
  opacity: 1;
  transform: translateY(0);
}

.secret.is-changing { opacity: .25; transform: translateY(5px); }

.secret p { margin: 0; }
.secret__number { font-family: Georgia, serif; font-size: 1.45rem; color: var(--gold); line-height: 1; }
.secret__label { margin-bottom: .28rem !important; color: rgba(255, 240, 177, .7); font-size: .7rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.secret__text { font-family: Georgia, serif; font-size: clamp(1rem, 2vw, 1.12rem); line-height: 1.5; color: #fffaf0; }

footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  color: rgba(255,255,255,.66);
  font-size: .82rem;
  animation: rise 1s 1s both;
}

footer p, footer span { margin: 0; }
footer span { white-space: nowrap; }
footer b { color: var(--gold); font-size: 1.1rem; }

.progress { position: fixed; right: 1.25rem; top: 50%; width: 2px; height: 5rem; transform: translateY(-50%); background: rgba(255,255,255,.18); }
.progress span { display: block; width: 100%; height: 0; background: var(--gold); box-shadow: 0 0 10px var(--gold); transition: height .45s ease; }

.firefly, .spark {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: #ffe57e;
  box-shadow: 0 0 12px 3px rgba(255, 211, 64, .55);
}

.firefly { width: 3px; height: 3px; animation: float var(--duration) ease-in-out var(--delay) infinite alternate; }
.spark-layer { position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
.spark { width: var(--size); height: var(--size); animation: burst .9s cubic-bezier(.2,.7,.2,1) forwards; }

@keyframes arrive { from { opacity: 0; transform: scale(1.12); } to { opacity: 1; transform: scale(1.035); } }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shine { 0%, 72% { transform: translateX(-110%); } 100% { transform: translateX(110%); } }
@keyframes drift { to { transform: translate(3rem, -2rem); opacity: .28; } }
@keyframes float { from { transform: translate(-12px, 18px); opacity: .15; } 60% { opacity: 1; } to { transform: translate(18px, -28px); opacity: .28; } }
@keyframes burst { to { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; } }

@media (max-width: 700px) {
  .scene__image { inset: -2%; background-position: 59% 56%; }
  .scene__shade { background: linear-gradient(180deg, rgba(2, 9, 23, .38) 0%, rgba(2, 10, 25, .2) 47%, rgba(2, 8, 20, .72) 100%); }
  .love-letter { padding-inline: 1.35rem; }
  .hero { align-self: end; padding: 5rem 0 2.4rem; }
  h1 { font-size: clamp(3.8rem, 20vw, 6.5rem); line-height: .82; }
  .intro { max-width: 29rem; margin-top: 1.35rem; line-height: 1.55; }
  .reveal-button { margin-top: 1.4rem; }
  footer { align-items: start; flex-direction: column; gap: .4rem; padding-bottom: .3rem; }
  .progress { right: .55rem; }
}

@media (max-height: 690px) and (orientation: landscape) {
  .hero { padding-block: 2rem 1rem; }
  h1 { font-size: clamp(3.5rem, 12vh, 6rem); }
  .intro { margin-top: 1rem; }
  .reveal-button { margin-top: 1rem; }
  footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .scene__image { transform: none !important; }
}
