:root{
  --plum-950: #241B3D;
  --plum-900: #34275A;
  --plum-800: #4A3980;
  --paper: #F8F6FC;
  --paper-deep: #ECE5F7;
  --paper-shadow: #D8C9F0;
  --ink: #362A55;
  --ink-soft: #7C6E97;
  --gold: #B79CE0;
  --gold-light: #E3D6F7;
  --berry: #6E45B8;
  --berry-dark: #4F2F8A;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2{
  font-family: "Fraunces", Georgia, serif;
  text-wrap: balance;
  margin: 0;
}

a{ color: inherit; }

code{
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  background: var(--paper-shadow);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

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

.music-toggle{
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--paper);
  color: var(--berry-dark);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(53, 32, 30, 0.5);
  z-index: 60;
  transition: transform 0.2s ease;
}
.music-toggle:hover{ transform: scale(1.08); }
.music-toggle.hidden{ display: none; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 45%, var(--berry) 100%);
  color: var(--plum-950);
  padding: 12vh 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.hero.leaving{
  opacity: 0;
  transform: translateY(-32px);
  pointer-events: none;
}
.hero.hidden{
  display: none;
}

.hero-inner{
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-eyebrow{
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 28px;
  color: var(--berry);
}

.balloon{
  position: absolute;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  filter: drop-shadow(0 10px 14px rgba(70, 20, 40, 0.25));
  animation: floatBalloon 6s ease-in-out infinite;
  pointer-events: none;
}
.balloon-1{ top: 18%; left: 10%; animation-delay: 0s; }
.balloon-2{ top: 14%; right: 9%; animation-delay: 1.4s; }
.balloon-3{ bottom: 20%; left: 15%; animation-delay: 0.8s; }
.balloon-4{ bottom: 14%; right: 13%; animation-delay: 2.2s; }
@keyframes floatBalloon{
  0%, 100%{ transform: translateY(0) rotate(-3deg); }
  50%{ transform: translateY(-18px) rotate(3deg); }
}

h1, .hero-title{
  font-weight: 600;
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
  color: var(--plum-950);
}
h1 em{
  font-style: italic;
  font-weight: 500;
  color: var(--berry-dark);
}
.script-name{
  font-family: "Dancing Script", "Fraunces", cursive;
  font-style: normal;
  font-weight: 700;
  font-size: 1.1em;
  color: var(--berry-dark);
}

.hero-message{
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink);
  opacity: 0.85;
  max-width: 34ch;
  margin: 0 0 36px;
}

.open-surprise{
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--berry-dark);
  background: var(--paper);
  border: none;
  border-radius: 999px;
  padding: 16px 32px;
  cursor: pointer;
  box-shadow: 0 16px 30px -14px rgba(70, 20, 40, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.open-surprise:hover{
  transform: translateY(-2px);
  box-shadow: 0 20px 34px -14px rgba(70, 20, 40, 0.55);
}
.open-surprise:focus-visible{
  outline: 2px solid var(--plum-950);
  outline-offset: 4px;
}

/* ---------- Memories / gallery ---------- */
.memories{
  padding: 11vh 24px 9vh;
  text-align: center;
  display: none;
}
.memories.revealed{
  display: block;
  animation: sectionReveal 0.7s ease forwards;
}
@keyframes sectionReveal{
  from{ opacity: 0; transform: translateY(28px); }
  to{ opacity: 1; transform: translateY(0); }
}
.memories h2{
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  color: var(--berry);
  margin-bottom: 40px;
}
.gallery{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
}
@media (min-width: 640px){
  .gallery{
    grid-template-columns: repeat(3, 1fr);
    max-width: 920px;
  }
}
@media (min-width: 980px){
  .gallery{
    grid-template-columns: repeat(4, 1fr);
    max-width: 1160px;
  }
}

.memory-photo{
  margin: 0;
  padding: 8px;
  background: var(--paper);
  border: 3px dashed var(--gold);
  border-radius: 20px;
  box-shadow: 0 16px 26px -18px rgba(53, 32, 30, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.5s ease;
  opacity: 0;
  translate: 0 16px;
}
.memory-photo.in-view{
  opacity: 1;
  translate: 0 0;
}
.memory-photo:hover{
  transform: scale(1.03);
  box-shadow: 0 22px 34px -18px rgba(53, 32, 30, 0.45);
}

.memory-photo img{
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
  background: var(--paper-deep);
}

.memory-photo .missing{
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  width: 100%;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-family: "Archivo", sans-serif;
  font-style: normal;
  font-size: 0.72rem;
  text-align: center;
  padding: 10px;
  border-radius: 14px;
  box-sizing: border-box;
}

@media (max-width: 420px){
  .gallery{ gap: 16px; }
  .memory-photo{ padding: 6px; }
}

/* ---------- Stories / motivation ---------- */
.stories{
  background: var(--paper-deep);
  padding: 11vh 24px;
  text-align: center;
  display: none;
}
.stories.revealed{
  display: block;
  animation: sectionReveal 0.7s ease forwards;
}
.stories h2{
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 40px;
}
.story-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  text-align: left;
}
.story-card{
  background: var(--paper);
  border: 1px solid var(--paper-shadow);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--ink);
  box-shadow: 0 14px 24px -18px rgba(53, 32, 30, 0.35);
}

/* ---------- Letter ---------- */
.letter{
  background: var(--paper-deep);
  padding: 11vh 24px;
  justify-content: center;
  display: none;
}
.letter.revealed{
  display: flex;
  animation: sectionReveal 0.7s ease forwards;
}
.letter-card{
  max-width: 42ch;
  background: var(--paper);
  border: 1px solid var(--paper-shadow);
  padding: 48px 36px;
  box-shadow: 0 26px 40px -26px rgba(53, 32, 30, 0.4);
}
.letter-card p{
  font-size: 0.98rem;
  line-height: 1.75;
  margin: 0 0 18px;
}
.letter-kicker{
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--berry);
  margin-bottom: 22px !important;
}
.letter-sign{
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  margin-bottom: 0 !important;
}
.letter-sign span{
  display: block;
  font-family: "Archivo", sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 6px;
}

/* ---------- Extra surprise ---------- */
.extra-surprise{
  padding: 11vh 24px;
  text-align: center;
  flex-direction: column;
  align-items: center;
  display: none;
}
.extra-surprise.revealed{
  display: flex;
  animation: sectionReveal 0.7s ease forwards;
}
.extra-surprise h2{
  font-weight: 600;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 12px;
  color: var(--ink);
}
.extra-surprise .hero-message{
  color: var(--ink-soft);
  opacity: 1;
  margin-bottom: 28px;
}
.extra-surprise .open-surprise{
  background: var(--berry);
  color: var(--paper);
  box-shadow: 0 16px 30px -14px rgba(78, 47, 138, 0.5);
}
.extra-surprise .open-surprise:hover{
  box-shadow: 0 20px 34px -14px rgba(78, 47, 138, 0.55);
}
.extra-message{
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--berry-dark);
  max-width: 40ch;
  margin: 28px 0 0;
  min-height: 1.6em;
  opacity: 0;
}
.extra-message.show{
  animation: messagePop 0.5s ease forwards;
}
@keyframes messagePop{
  from{ opacity: 0; transform: translateY(10px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ---------- Footer ---------- */
.site-footer{
  background: var(--plum-950);
  color: #C9B8CC;
  text-align: center;
  padding: 26px 24px;
  font-size: 0.85rem;
}
.site-footer p{ margin: 0; }

@media (prefers-reduced-motion: reduce){
  .hero{ transition: none; }
  .balloon{ animation: none; }
  .memory-photo{ transition: none; }
  .memories.revealed{ animation: none; }
  .stories.revealed{ animation: none; }
  .letter.revealed{ animation: none; }
  .extra-surprise.revealed{ animation: none; }
  .extra-message.show{ animation: none; opacity: 1; }
  html{ scroll-behavior: auto; }
}
