:root {
  --bg: #10030c;
  --panel: rgba(33, 7, 25, .76);
  --panel-light: rgba(255, 255, 255, .07);
  --pink: #ff4f9a;
  --pink-light: #ffb5d5;
  --pink-soft: #ffd1e4;
  --white: #fff8fc;
  --muted: #d8b8c9;
  --muted-dark: #a8889b;
  --line: rgba(255, 255, 255, .13);
  --shadow: 0 25px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--white);
  font-family: "DM Sans", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 45, 130, .28), transparent 42%),
    linear-gradient(160deg, #240517 0%, #0e020a 60%, #17030f 100%);
}
.final-background { background:
  radial-gradient(circle at 50% 40%, rgba(255, 70, 150, .22), transparent 42%),
  linear-gradient(160deg, #2b061d 0%, #10030c 58%, #17030f 100%);
}
.glow {
  position: absolute;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .23;
  animation: drift 10s ease-in-out infinite alternate;
}
.glow-one { background: #ff0077; left: -15vw; top: 25%; }
.glow-two { background: #8d1cff; right: -20vw; top: 55%; animation-delay: -4s; }
@keyframes drift { to { transform: translate(7vw, -4vh) scale(1.15); } }

.hearts { position: absolute; inset: 0; pointer-events: none; }
.heart {
  position: absolute;
  bottom: -40px;
  color: rgba(255, 93, 166, .55);
  font-size: clamp(18px, 2vw, 34px);
  animation: floatUp linear forwards;
  text-shadow: 0 0 22px rgba(255, 57, 145, .55);
}
@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg) scale(.6); opacity: 0; }
  10% { opacity: .8; }
  100% { transform: translateY(-115vh) rotate(35deg) scale(1.3); opacity: 0; }
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px clamp(20px, 5vw, 70px);
  background: linear-gradient(to bottom, rgba(10, 0, 7, .72), transparent);
}
.brand {
  font-size: 11px;
  letter-spacing: .24em;
  font-weight: 700;
}
.music-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  color: white;
  padding: 10px 15px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.music-btn:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); }
.music-btn.is-playing { border-color: rgba(255, 181, 213, .55); background: rgba(255, 95, 166, .11); }
#musicIcon { display: inline-block; margin-right: 6px; }

.page-section, .section { width: min(1080px, calc(100% - 40px)); margin: auto; }
.page-main { padding: 110px 0 30px; min-height: calc(100vh - 60px); }
.page-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 45px; color: var(--muted-dark); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.page-nav a { transition: color .2s ease; }
.page-nav a:hover { color: var(--pink-light); }

.hero { min-height: 100vh; display: grid; place-content: center; text-align: center; }
.home-hero { position: relative; padding: 100px 0 50px; }
.eyebrow, .section-label { text-transform: uppercase; letter-spacing: .22em; font-size: 11px; font-weight: 700; color: var(--pink-light); }
.hero h1 {
  position: relative;
  z-index: 2;
  margin-top: 18px;
  font-family: "Playfair Display", serif;
  font-size: clamp(56px, 10vw, 120px);
  line-height: .93;
  letter-spacing: -.05em;
}
.hero h1 span { color: var(--pink-light); text-shadow: 0 0 35px rgba(255, 79, 154, .32); }
.hero-copy { width: min(590px, 100%); margin: 28px auto; color: var(--muted); line-height: 1.8; font-size: 16px; }
.hero-actions { display: flex; justify-content: center; }
.primary-btn, .wish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 15px 23px;
  font-weight: 700;
  color: #210313;
  background: linear-gradient(135deg, var(--pink-soft), #ff5ba3);
  box-shadow: 0 15px 45px rgba(255, 58, 145, .22);
  transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}
.primary-btn:hover, .wish-btn:hover { transform: translateY(-3px); box-shadow: 0 20px 55px rgba(255, 58, 145, .35); filter: brightness(1.03); }
.primary-btn span { margin-left: 8px; }
.scroll-note { margin-top: 70px; font-size: 11px; color: var(--muted-dark); letter-spacing: .12em; }

.hero-orbit { position: absolute; inset: 50% auto auto 50%; width: min(440px, 78vw); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; opacity: .55; }
.hero-orbit span { position: absolute; color: rgba(255, 181, 213, .22); font-size: clamp(20px, 4vw, 40px); animation: orbit 10s linear infinite; }
.hero-orbit span:nth-child(1) { top: 0; left: 48%; }
.hero-orbit span:nth-child(2) { right: 0; bottom: 25%; animation-delay: -3s; }
.hero-orbit span:nth-child(3) { left: 10%; bottom: 12%; animation-delay: -6s; }
@keyframes orbit { 50% { transform: scale(1.25) rotate(15deg); opacity: 1; } }
.chapter-preview { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 40px; color: rgba(255,255,255,.35); font-size: 10px; letter-spacing: .1em; }
.chapter-preview i { width: 22px; height: 1px; background: rgba(255,255,255,.18); }
.chapter-preview .active { color: var(--pink-light); }

.message-page, .memories-page, .wish-page, .final-page { padding-bottom: 40px; }
.reveal { animation: pageIn .8s cubic-bezier(.22,1,.36,1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
.message-card {
  margin-top: 22px;
  max-width: 800px;
  padding: clamp(28px, 6vw, 62px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(145deg, rgba(74, 11, 49, .82), rgba(21, 5, 18, .78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.card-top { display: flex; justify-content: space-between; color: #b990a6; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.message-card h1 { margin: 34px 0 20px; font-family: "Playfair Display", serif; font-size: clamp(35px, 5vw, 62px); line-height: 1.02; }
.message-card h1 em, .wish-box h1 em { color: var(--pink-light); font-style: normal; }
.message-card p { max-width: 650px; margin-top: 16px; color: var(--muted); line-height: 1.8; }
.signature { margin-top: 30px; color: var(--pink-soft); font-family: "Playfair Display", serif; }
.next-btn { margin-top: 32px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin: 20px 0 35px; }
.section-heading h1 { font-family: "Playfair Display", serif; font-size: clamp(42px, 6vw, 74px); line-height: 1; }
.section-heading p { color: var(--muted); max-width: 520px; line-height: 1.7; margin-top: 14px; }
.photo-count { color: var(--pink-light); font-size: 22px; font-family: "Playfair Display", serif; white-space: nowrap; }
.photo-count span { display: block; color: var(--muted-dark); font-family: "DM Sans", sans-serif; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; text-align: right; }
.photo-grid { display: grid; grid-template-columns: 1.15fr .85fr .85fr; grid-auto-rows: 290px; gap: 17px; }
.photo-card { border: 1px solid var(--line); border-radius: 25px; overflow: hidden; background: #230719; position: relative; box-shadow: var(--shadow); padding: 0; cursor: zoom-in; isolation: isolate; }
.photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .6s cubic-bezier(.22,1,.36,1), filter .45s ease; }
.photo-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7, 0, 5, .72), transparent 50%); z-index: 1; }
.photo-card:hover img { transform: scale(1.045); filter: saturate(1.05); }
.photo-card span { position: absolute; left: 18px; bottom: 16px; z-index: 2; font-size: 12px; padding: 8px 11px; border-radius: 999px; background: rgba(12, 1, 9, .62); backdrop-filter: blur(10px); }
.photo-one { grid-row: span 2; }
.photo-three { grid-column: span 1; }
.photo-four { grid-column: span 1; }
.photo-five { grid-column: span 2; }
.photo-seven { grid-column: 2 / span 2; }

.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 25px; opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(5, 0, 4, .84); backdrop-filter: blur(12px); }
.lightbox-content { position: relative; z-index: 1; width: min(1000px, 94vw); max-height: 90vh; display: grid; place-items: center; }
.lightbox-content img { max-width: 100%; max-height: 78vh; width: auto; height: auto; border-radius: 18px; box-shadow: 0 30px 100px rgba(0,0,0,.6); object-fit: contain; }
.lightbox-close, .lightbox-arrow { position: absolute; z-index: 3; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: rgba(20, 2, 14, .72); color: white; cursor: pointer; backdrop-filter: blur(10px); }
.lightbox-close { right: 0; top: -10px; font-size: 30px; }
.lightbox-arrow { top: 50%; transform: translateY(-50%); font-size: 30px; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-caption { margin-top: 13px; color: var(--pink-soft); font-size: 13px; text-align: center; }

.wish-page { display: grid; place-items: center; min-height: 68vh; }
.wish-box { position: relative; width: min(860px, 100%); text-align: center; padding: clamp(45px, 8vw, 90px) 20px; border: 1px solid var(--line); border-radius: 36px; background: rgba(255,255,255,.045); overflow: hidden; box-shadow: var(--shadow); }
.wish-box::before { content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(255, 79, 154, .12), transparent 68%); pointer-events: none; }
.mini-heart { position: relative; font-size: 55px; color: var(--pink); margin-bottom: 20px; animation: beat 1.5s ease-in-out infinite; text-shadow: 0 0 35px rgba(255, 61, 150, .7); }
@keyframes beat { 50% { transform: scale(1.15); } }
.wish-box h1 { position: relative; margin: 18px 0 14px; font-family: "Playfair Display", serif; font-size: clamp(42px, 6vw, 70px); line-height: 1; }
.wish-intro { position: relative; max-width: 560px; margin: 0 auto 30px; color: var(--muted); line-height: 1.7; }
.wish-text { min-height: 25px; margin-top: 25px; color: var(--pink-light); font-weight: 600; }
.wish-secret { margin-top: 12px; color: #ffe4ef; font-family: "Playfair Display", serif; opacity: 0; transform: translateY(8px); transition: opacity .5s ease, transform .5s ease; }
.wish-secret.visible { opacity: 1; transform: translateY(0); }
.wish-btn:disabled { cursor: default; opacity: .9; }
#wishNext[aria-disabled="true"] { pointer-events: none; opacity: .45; filter: grayscale(.2); }

.confetti { position: fixed; z-index: 90; top: 50%; left: 50%; width: 7px; height: 14px; border-radius: 2px; animation: confettiFly 1.25s cubic-bezier(.1,.8,.2,1) forwards; pointer-events: none; }
@keyframes confettiFly { 0% { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; } 100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)); opacity: 0; } }

.final-page { min-height: 72vh; display: grid; place-items: center; align-content: center; text-align: center; max-width: 820px; margin: auto; }
.final-heart { font-size: 105px; color: var(--pink); animation: beat 1.3s ease-in-out infinite; filter: drop-shadow(0 0 25px rgba(255,79,154,.45)); }
.final-page h1 { margin: 22px 0 14px; font-family: "Playfair Display", serif; font-size: clamp(48px, 7vw, 82px); line-height: 1; }
.final-copy { color: var(--muted); line-height: 1.8; max-width: 650px; margin-bottom: 12px; }
.final-note { color: var(--pink-soft); font-family: "Playfair Display", serif; font-size: 18px; margin-bottom: 30px; }

footer { padding: 25px 20px 40px; text-align: center; color: #806176; font-size: 11px; letter-spacing: .06em; }

@media (max-width: 820px) {
  .section-heading { display: block; }
  .photo-count { margin-top: 14px; text-align: left; }
  .photo-count span { text-align: left; }
  .photo-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 250px; }
  .photo-one { grid-row: span 2; }
  .photo-five, .photo-seven { grid-column: span 1; }
}

@media (max-width: 620px) {
  .page-section, .section { width: min(100% - 28px, 1080px); }
  .topbar { padding: 18px 16px; }
  .brand { font-size: 9px; letter-spacing: .18em; }
  .music-btn { padding: 9px 12px; }
  .hero-copy br { display: none; }
  .chapter-preview { gap: 6px; }
  .chapter-preview i { width: 12px; }
  .page-main { padding-top: 95px; }
  .photo-grid { grid-template-columns: 1fr; grid-auto-rows: 340px; }
  .photo-card, .photo-one, .photo-five, .photo-seven { grid-column: auto; grid-row: span 1; }
  .photo-one { grid-row: span 1; }
  .lightbox-arrow { width: 38px; height: 38px; }
  .lightbox-prev { left: -2px; }
  .lightbox-next { right: -2px; }
}

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