/* Mobile-first Valentine page for iPhone Safari */
:root{
  --bg1:#ffe6f0;
  --bg2:#fff3df;
  --card:#ffffffcc;
  --ink:#2b2b2b;
  --muted:#6a6a6a;
  --pink:#ff4d88;
  --pink2:#ff77a8;
  --shadow: 0 10px 26px rgba(0,0,0,.08);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--ink);
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 900px at 20% 10%, var(--bg1), transparent 60%),
              radial-gradient(900px 700px at 80% 20%, #ffeef6, transparent 55%),
              linear-gradient(180deg, var(--bg1), var(--bg2));
  overflow-x:hidden;
}

h1,h2,h3{
  font-family: Fraunces, Georgia, serif;
  margin:0 0 10px 0;
  letter-spacing: .2px;
}
h1{ font-size: 2rem; line-height: 1.12; }
h2{ font-size: 1.55rem; }
h3{ font-size: 1.2rem; }

p{ margin: 0 0 12px 0; line-height: 1.6; }
.muted{ color: var(--muted); }

.container{
  width:min(920px, calc(100% - 32px));
  margin:0 auto;
}

.section{
  padding: 56px 0;
  position: relative;
}

.card{
  background: var(--card);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px;
}

/* Hearts background */
.hearts-layer{
  position: fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  overflow:hidden;
}
.heart{
  position:absolute;
  font-size: 14px;
  opacity:.22;
  filter: blur(.2px);
  animation: floatUp linear forwards;
  transform: translate3d(0,0,0);
}
@keyframes floatUp{
  from{ transform: translate3d(0, 40px, 0) scale(.85); opacity: 0; }
  15%{ opacity:.22; }
  to{ transform: translate3d(0, -120vh, 0) scale(1.08); opacity: 0; }
}

/* Hero */
.hero{
  padding: 24px 0 36px;
  position: relative;
  z-index: 1;
}
.hero-inner{
  min-height: 92vh;
  display:flex;
  align-items:center;
}
.hero-text{
  width:100%;
  text-align:center;
}
.subtitle{
  font-weight:500;
  color: var(--muted);
  margin-bottom: 18px;
}
.hero-img-wrap{
  margin: 18px auto 18px;
  width: min(440px, 92vw);
  position: relative;
  border-radius: 22px;
  overflow:hidden;
  box-shadow: 0 14px 34px rgba(255,77,136,.18);
  background: rgba(255,255,255,.45);
}
.hero-img{
  width:100%;
  height: auto;
  display:block;
  border-radius: 22px;
}
.img-fallback{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px;
  text-align:center;
  color: rgba(60,60,60,.7);
  background: linear-gradient(135deg, rgba(255,255,255,.52), rgba(255,255,255,.28));
  opacity:0;
  transition: opacity .25s ease;
}
.hero-img:not([src]), .hero-img[src=""]{ display:none; }
.hero-img-wrap.missing .img-fallback{ opacity:1; }
.hero-img-wrap.missing .hero-img{ opacity:0; }

.scroll-hint{
  margin-top: 12px;
  display:inline-flex;
  gap: 10px;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 10px 22px rgba(0,0,0,.06);
  user-select:none;
  cursor:pointer;
  transition: transform .15s ease;
}
.scroll-hint:active{ transform: scale(.98); }
.scroll-pill{ font-weight:600; color:#3a3a3a; }
.scroll-arrow{
  font-size: 18px;
  animation: nudge 1.6s ease-in-out infinite;
}
@keyframes nudge{
  0%,100%{ transform: translateY(0); opacity:.9; }
  50%{ transform: translateY(4px); opacity:.6; }
}

/* Story */
.story-line{
  font-weight:600;
  margin: 10px 0 12px;
}
.story-notes{
  padding: 14px 14px 4px;
  border-left: 3px solid rgba(255,77,136,.35);
  background: rgba(255,255,255,.35);
  border-radius: 14px;
}

/* Chapter */
.chapter{
  margin-top: 24px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.48);
  box-shadow: 0 10px 26px rgba(0,0,0,.05);
}
.chapter-big{ padding: 18px; }
.chapter-head{ margin-bottom: 12px; }
.chapter-sub{ color: var(--muted); margin-top: -2px; }

/* Carousel */
.carousel{
  position: relative;
  margin: 12px 0 12px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.7);
}
.track{
  display:flex;
  gap: 0;
  overflow:hidden;
  scroll-behavior:smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.slide{
  min-width:100%;
  scroll-snap-align:center;
  position: relative;
  aspect-ratio: 4 / 5;
  background: rgba(255,255,255,.25);
}
.slide img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}
.slide .missing{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 16px;
  color: rgba(60,60,60,.65);
  font-size: .95rem;
  background: linear-gradient(135deg, rgba(255,255,255,.5), rgba(255,255,255,.25));
}

.nav{
  position:absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.8);
  background: rgba(255,255,255,.6);
  box-shadow: 0 10px 22px rgba(0,0,0,.08);
  z-index: 2;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 22px;
  color: rgba(0,0,0,.65);
  transition: transform .15s ease, opacity .2s ease;
  user-select:none;
}
.nav:active{ transform: translateY(-50%) scale(.97); }
.nav.prev{ left: 10px; }
.nav.next{ right: 10px; }

.dots{
  position:absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display:flex;
  justify-content:center;
  gap: 7px;
  padding: 0 12px;
  z-index: 2;
}
.dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(255,77,136,.22);
  opacity: .7;
  transform: scale(.98);
  transition: opacity .2s ease, transform .2s ease;
}
.dot.active{
  opacity: 1;
  transform: scale(1.15);
  background: rgba(255,77,136,.65);
}

.chapter-notes{
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,77,136,.22);
}

/* Chips */
.chips{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 14px;
}
.chip{
  border: 1px solid rgba(255,77,136,.18);
  background: rgba(255,255,255,.62);
  border-radius: 999px;
  padding: 10px 12px;
  font-size: .95rem;
  color: rgba(20,20,20,.85);
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
  cursor:pointer;
  transition: transform .16s ease, background .2s ease;
}
.chip:active{ transform: scale(.98); }
.chip.pop{ animation: pop .26s ease; }
@keyframes pop{
  0%{ transform: scale(1); }
  50%{ transform: scale(1.04); }
  100%{ transform: scale(1); }
}
.chip-reveal{
  margin-top: 14px;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 10px 20px rgba(0,0,0,.05);
}

/* Chat bubbles */
.chat{ display:flex; flex-direction:column; gap: 10px; margin-top: 14px; }
.bubble{
  max-width: 92%;
  padding: 12px 12px 10px;
  border-radius: 18px;
  box-shadow: 0 10px 18px rgba(0,0,0,.06);
  border: 1px solid rgba(255,255,255,.6);
}
.bubble.left{
  align-self:flex-start;
  background: rgba(255,255,255,.62);
}
.bubble.right{
  align-self:flex-end;
  background: rgba(255,77,136,.14);
}
.bubble-text{ font-size: 1rem; }
.bubble-meta{ margin-top: 6px; font-size: .78rem; color: rgba(0,0,0,.5); }

/* Buttons */
.btn-row{ display:flex; gap: 12px; justify-content:center; flex-wrap:wrap; margin-top: 16px; }
.btn{
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
  cursor:pointer;
  box-shadow: 0 12px 24px rgba(0,0,0,.08);
  transition: transform .15s ease, filter .2s ease;
}
.btn:active{ transform: scale(.98); }
.btn.primary{
  background: linear-gradient(135deg, var(--pink), var(--pink2));
  color: white;
}
.btn.secondary{
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,77,136,.18);
  color: rgba(30,30,30,.9);
}
.btn.big{ padding: 14px 20px; font-size: 1.02rem; }

.big-question{
  font-size: 1.9rem;
  text-align:center;
}

.final-message{
  margin-top: 16px;
  text-align:center;
  font-weight: 600;
  font-size: 1.1rem;
  min-height: 28px;
}
.footer-note{
  margin-top: 18px;
  text-align:center;
  font-size: .9rem;
}
.hint{ text-align:center; margin-top: 6px; }

.song-card .song-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.song-title{ font-weight:700; font-size: 1.05rem; }
.song-sub{ color: var(--muted); margin-top: 2px; }
.song-help{ color: rgba(0,0,0,.55); font-size: .9rem; margin-top: 6px; }

.howto{
  margin-top: 12px;
  color: rgba(0,0,0,.75);
}
.howto summary{
  cursor:pointer;
  font-weight: 600;
}
.howto ol{ margin: 8px 0 0 18px; }

/* Back to top */
.to-top{
  position: fixed;
  right: 14px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 14px 26px rgba(0,0,0,.10);
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  color: rgba(0,0,0,.65);
  z-index: 9;
}

/* Burst canvas */
#burstCanvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}

/* Larger screens */
@media (min-width: 820px){
  h1{ font-size: 2.5rem; }
  h2{ font-size: 1.8rem; }
  .section{ padding: 70px 0; }
  .slide{ aspect-ratio: 16 / 9; }
  .hero-img-wrap{ width: min(560px, 70vw); }
}
