/* =========================================================
   1. DESIGN TOKENS  (romantic dark + glow)
========================================================= */
:root {
  --bg-0: #08030f;
  --bg-1: #0f0524;
  --bg-2: #1a0833;
  --pink: #ff5a8a;
  --pink-soft: #ffb3c7;
  --purple: #9d6bff;
  --gold: #ffd6a5;
  --text: #f4ecff;
  --text-dim: #cdb9e6;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.10);
  --stroke: rgba(255, 255, 255, 0.14);
  --shadow-glow: 0 10px 40px -10px rgba(255, 90, 138, .45),
    0 6px 24px -8px rgba(157, 107, 255, .35);
}

/* =========================================================
   2. BASE
========================================================= */
* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 88px;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(255, 90, 138, .18), transparent 60%),
    radial-gradient(1000px 700px at -10% 30%, rgba(157, 107, 255, .18), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(255, 214, 165, .10), transparent 60%),
    linear-gradient(180deg, #08030f 0%, #0f0524 50%, #08030f 100%);
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--pink-soft);
  text-decoration: none;
}

::selection {
  background: rgba(255, 90, 138, .45);
  color: #fff;
}

h1,
h2,
h3,
.serif {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: .5px;
}

.text-gradient {
  background: linear-gradient(90deg, #ffb3c7, #ff5a8a 40%, #9d6bff 80%, #ffd6a5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Glassmorphism card */
.glass {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow-glow);
}

/* Section spacing */
section {
  padding: 96px 20px;
  position: relative;
  z-index: 1;
}

.container-x {
  max-width: 1100px;
  margin: 0 auto;
}

/* =========================================================
   3. NAV
========================================================= */
.nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(15, 5, 36, .55);
  backdrop-filter: blur(12px);
  border: 1px solid var(--stroke);
  border-radius: 999px;
  font-size: 13px;
}

.nav a {
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  transition: .25s;
}

.nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

@media (max-width:520px) {
  .nav {
    font-size: 11px;
    padding: 6px 8px;
  }

  .nav a {
    padding: 5px 8px;
  }
}

/* =========================================================
   4. HERO + 3D CANVAS
========================================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 120px 20px 80px;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.hero .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--stroke);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--pink-soft);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(48px, 9vw, 104px);
  line-height: 1.02;
  margin: 0 0 18px;
  font-weight: 600;
  text-shadow: 0 4px 40px rgba(255, 90, 138, .35);
}

.hero .heart {
  display: inline-block;
  animation: beat 1.4s ease-in-out infinite;
}

@keyframes beat {

  0%,
  100% {
    transform: scale(1);
  }

  30% {
    transform: scale(1.18);
  }

  60% {
    transform: scale(.95);
  }
}

.hero p.sub {
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.hero .cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5a8a, #9d6bff);
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(255, 90, 138, .7);
  transition: .3s;
}

.hero .cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -10px rgba(255, 90, 138, .9);
}

.scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 3px;
  opacity: .8;
  animation: floatY 2.4s ease-in-out infinite;
}

@keyframes floatY {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 8px);
  }
}

/* =========================================================
   5. SECTION TITLES
========================================================= */
.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-head .kicker {
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--pink-soft);
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(34px, 5vw, 56px);
  margin: 0;
  font-weight: 600;
}

.section-head p {
  color: var(--text-dim);
  max-width: 560px;
  margin: 14px auto 0;
}

.section-head code {
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--stroke);
}

/* =========================================================
   6. TIMELINE
========================================================= */
.timeline {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(255, 90, 138, .6), rgba(157, 107, 255, .6), transparent);
  transform: translateX(-50%);
}

.tl-item {
  position: relative;
  width: 50%;
  padding: 16px 36px;
}

.tl-item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.tl-item:nth-child(even) {
  left: 50%;
  text-align: left;
}

.tl-item .dot {
  position: absolute;
  top: 36px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff5a8a, #9d6bff);
  box-shadow: 0 0 0 4px rgba(255, 90, 138, .18), 0 0 22px rgba(255, 90, 138, .7);
}

.tl-item:nth-child(odd) .dot {
  right: -7px;
}

.tl-item:nth-child(even) .dot {
  left: -7px;
}

.tl-card {
  padding: 22px 24px;
}

.tl-card .when {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--pink-soft);
  margin-bottom: 6px;
}

.tl-card h3 {
  font-size: 26px;
  margin: 0 0 10px;
  font-weight: 600;
}

.tl-card p {
  margin: 0;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.7;
}

@media (max-width:760px) {
  .timeline::before {
    left: 18px;
  }

  .tl-item,
  .tl-item:nth-child(even) {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 48px;
    padding-right: 8px;
  }

  .tl-item:nth-child(odd) {
    text-align: left;
  }

  .tl-item .dot,
  .tl-item:nth-child(odd) .dot,
  .tl-item:nth-child(even) .dot {
    left: 11px;
    right: auto;
  }
}

/* =========================================================
   7. 3D GALLERY (CSS Coverflow — performant, no overlap)
========================================================= */
.gallery-wrap {
  position: relative;
  perspective: 1400px;
  height: 440px;
  margin: 0 auto;
  max-width: 1100px;
  user-select: none;
  touch-action: pan-y;
}

.gallery-stage {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.g-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 280px;
  height: 380px;
  margin: -190px 0 0 -140px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 90, 138, .18), rgba(157, 107, 255, .18));
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 0 30px rgba(255, 90, 138, .15);
  transition: transform .7s cubic-bezier(.2, .8, .2, 1), opacity .5s, filter .5s;
  will-change: transform, opacity;
}

.g-card:focus-visible {
  outline: 2px solid var(--pink-soft);
  outline-offset: 4px;
}

.g-card .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: #fff;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .18), transparent 50%),
    linear-gradient(135deg, rgba(255, 90, 138, .55), rgba(157, 107, 255, .55));
}

.g-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -60%;
  height: 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent);
  transform: scaleY(-1);
  filter: blur(2px);
  opacity: .4;
}

.g-controls {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 32px;
}

.g-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: .25s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.g-btn:hover {
  background: linear-gradient(135deg, #ff5a8a, #9d6bff);
  transform: translateY(-2px);
}

.g-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
  letter-spacing: 1px;
}

@media (max-width:520px) {
  .gallery-wrap {
    height: 380px;
  }

  .g-card {
    width: 220px;
    height: 300px;
    margin: -150px 0 0 -110px;
  }
}

/* =========================================================
   8. LOVE LETTER
========================================================= */
.letter {
  max-width: 760px;
  margin: 0 auto;
  padding: 42px 32px;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.7;
  color: #fff;
  text-align: left;
  position: relative;
}

.letter .salute {
  font-style: italic;
  color: var(--pink-soft);
  margin-bottom: 18px;
  font-size: .9em;
}

#typed {
  white-space: pre-wrap;
  min-height: 240px;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--pink);
  vertical-align: -3px;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.signoff {
  margin-top: 24px;
  text-align: right;
  font-style: italic;
  color: var(--gold);
}

/* =========================================================
   9. COUNTER
========================================================= */
.counter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}

.c-cell {
  padding: 22px 10px;
  text-align: center;
}

.c-cell .num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 600;
  background: linear-gradient(180deg, #fff, #ffb3c7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.c-cell .lbl {
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 4px;
}

@media (max-width:480px) {
  .counter {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   10. FOOTER + MUSIC TOGGLE
========================================================= */
footer {
  padding: 60px 20px 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  position: relative;
  z-index: 1;
}

footer .made {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  color: #fff;
  margin-bottom: 8px;
}

footer .made .h {
  color: #ff5a8a;
  animation: beat 1.4s ease-in-out infinite;
  display: inline-block;
}

.music-toggle {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: linear-gradient(135deg, rgba(255, 90, 138, .85), rgba(157, 107, 255, .85));
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(255, 90, 138, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .3s;
}

.music-toggle:hover {
  transform: scale(1.06);
}

.music-toggle.playing {
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 90, 138, .5);
  }

  50% {
    box-shadow: 0 0 0 14px rgba(255, 90, 138, 0);
  }
}

/* Muted autoplay: subtle cue until user taps (browser unmutes) */
.music-toggle.needs-unmute {
  box-shadow: 0 0 0 2px rgba(255, 214, 165, .55), 0 10px 30px -8px rgba(255, 90, 138, .6);
}

/* =========================================================
   11. FIRST-OPEN MUSIC POPUP
========================================================= */
.music-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
}

.music-modal.show {
  display: flex;
}

.music-modal-card {
  width: min(520px, 92vw);
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: rgba(15, 5, 36, .82);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-glow);
}

.music-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.music-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  margin: 0;
  line-height: 1.1;
}

.music-modal-sub {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.5;
}

.music-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.music-modal-primary {
  flex: 1;
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5a8a, #9d6bff);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.music-modal-secondary {
  border: 1px solid var(--stroke);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
}

.music-modal-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 18px;
}
