:root {
  --black: #0a0a0a;
  --black-2: #141414;
  --black-3: #1e1e1e;
  --red: #e0112b;
  --red-2: #ff3b55;
  --red-dark: #8b0a1a;
  --pink: #ffb3c1;
  --white: #fff5f6;
  --muted: #c9a9ae;
  --script: 'Dancing Script', cursive;
  --sans: 'Poppins', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(224, 17, 43, .18), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(224, 17, 43, .14), transparent 50%);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

h2 {
  font-family: var(--script);
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  color: var(--red-2);
  text-align: center;
  line-height: 1.2;
  margin-bottom: .4rem;
  text-shadow: 0 0 18px rgba(224, 17, 43, .45);
}

.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

section, header, footer { position: relative; z-index: 1; }
main { overflow-x: hidden; overflow-x: clip; }
section { max-width: 1100px; margin-left: auto; margin-right: auto; }

.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: none;
  border-radius: 999px;
  padding: .8rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(224, 17, 43, .4);
  transition: transform .2s;
}
.btn:active { transform: scale(.95); }

/* ---------- Corações de fundo ---------- */
#hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.falling-heart {
  position: absolute;
  top: -40px;
  color: var(--red);
  opacity: .55;
  animation: fall linear forwards;
  will-change: transform;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); }
}

/* ---------- Intro ---------- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, #1a0508 0%, var(--black) 70%);
  transition: opacity .8s ease;
}
#intro.fade { opacity: 0; pointer-events: none; }

.intro-content { text-align: center; padding: 16px; }
.intro-small {
  font-family: var(--script);
  font-size: 1.8rem;
  color: var(--pink);
  margin-bottom: 2rem;
}
.intro-tap {
  margin-top: 2rem;
  color: var(--muted);
  animation: pulse 1.6s ease-in-out infinite;
}

#gift {
  position: relative;
  width: 150px;
  height: 150px;
  background: none;
  border: none;
  cursor: pointer;
  animation: wiggle 2.2s ease-in-out infinite;
}
.gift-box {
  position: absolute;
  bottom: 0; left: 10px;
  width: 130px; height: 95px;
  background: var(--red);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(224, 17, 43, .5);
}
.gift-box::before, .gift-lid::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 22px;
  transform: translateX(-50%);
  background: var(--black);
}
.gift-lid {
  position: absolute;
  bottom: 92px; left: 0;
  width: 150px; height: 32px;
  background: var(--red-2);
  border-radius: 6px;
  transition: transform .6s cubic-bezier(.5, -0.5, .5, 1.5);
  z-index: 2;
}
.gift-bow {
  position: absolute;
  bottom: 112px; left: 50%;
  transform: translateX(-50%);
  font-size: 3rem;
  z-index: 3;
  transition: transform .6s cubic-bezier(.5, -0.5, .5, 1.5);
}
#gift.open .gift-lid { transform: translateY(-80px) rotate(-25deg); }
#gift.open .gift-bow { transform: translate(-120%, -90px) rotate(-35deg); }
#gift.open { animation: none; }

@keyframes wiggle {
  0%, 80%, 100% { transform: rotate(0); }
  85% { transform: rotate(-6deg); }
  90% { transform: rotate(6deg); }
  95% { transform: rotate(-4deg); }
}
@keyframes pulse {
  0%, 100% { opacity: .5; }
  50% { opacity: 1; }
}

/* ---------- Botão música ---------- */
#music-btn {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2px solid var(--red);
  background: rgba(10, 10, 10, .85);
  color: var(--red-2);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(224, 17, 43, .5);
  backdrop-filter: blur(6px);
}
#music-btn.playing .music-icon { display: inline-block; animation: spin 3s linear infinite; }
#music-btn.paused { opacity: .6; }
#music-btn.paused::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 60%; height: 2px;
  background: var(--red-2);
  transform: translate(-50%, -50%) rotate(-45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Revelar ao rolar ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .9s ease, transform .9s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 16px 80px;
}
.hero-photo {
  position: relative;
  width: 190px; height: 190px;
  margin-bottom: 1.8rem;
  animation: pop 1s ease both;
}
.hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 50%;
  border: 4px solid var(--red);
  position: relative;
  z-index: 1;
}
.hero-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px dashed var(--red-2);
  animation: spin 18s linear infinite;
}
.hero-pre {
  text-transform: uppercase;
  letter-spacing: .35em;
  font-size: .75rem;
  color: var(--muted);
  animation: fadeUp 1s .3s ease both;
}
.hero h1 {
  font-family: var(--script);
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  line-height: 1.1;
  margin: .5rem 0 1rem;
  animation: fadeUp 1s .5s ease both;
}
.hero h1 span {
  color: var(--red-2);
  text-shadow: 0 0 25px rgba(224, 17, 43, .7);
}
.hero-sub {
  max-width: 420px;
  color: var(--pink);
  animation: fadeUp 1s .7s ease both;
}
.scroll-down {
  position: absolute;
  bottom: 28px;
  width: 26px; height: 42px;
  border: 2px solid var(--red);
  border-radius: 14px;
}
.scroll-down span {
  position: absolute;
  left: 50%; top: 8px;
  width: 4px; height: 8px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--red-2);
  animation: scrollDot 1.6s infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}
@keyframes pop {
  from { transform: scale(0); }
  70% { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Frase ---------- */
.phrase-section {
  padding: 60px 16px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.phrase-label {
  text-transform: uppercase;
  letter-spacing: .25em;
  font-size: .72rem;
  color: var(--muted);
}
.phrase {
  font-family: var(--script);
  font-size: clamp(1.8rem, 7.5vw, 2.4rem);
  line-height: 1.3;
  margin: 1rem 0 1.6rem;
  min-height: 3.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease, transform .4s ease;
}
.phrase.swap { opacity: 0; transform: scale(.95); }

/* ---------- Carta ---------- */
.letter-section { padding: 60px 16px; }
.letter {
  position: relative;
  max-width: 560px;
  margin: 1.5rem auto 0;
  padding: 2.4rem 1.5rem 2rem;
  background: linear-gradient(180deg, var(--black-2), var(--black-3));
  border: 1px solid rgba(224, 17, 43, .45);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .6), inset 0 0 40px rgba(224, 17, 43, .06);
}
.letter p { margin-bottom: 1rem; font-size: .98rem; }
.letter p:first-of-type {
  font-family: var(--script);
  font-size: 1.8rem;
  color: var(--red-2);
}
.letter-seal {
  position: absolute;
  top: -24px; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-size: 1.4rem;
  box-shadow: 0 4px 14px rgba(224, 17, 43, .6);
}
.letter-sign { text-align: right; margin-top: 1.5rem; }
.letter-sign span {
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--red-2);
}

/* ---------- Galeria ---------- */
.gallery-section { padding: 60px 0; }
.gallery-section h2, .gallery-section .section-sub { padding: 0 16px; }
.carousel {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 10px calc(50% - 130px) 30px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { display: none; }
.polaroid {
  flex: 0 0 260px;
  scroll-snap-align: center;
  background: #fdf7f7;
  padding: 12px 12px 0;
  border-radius: 4px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .7);
  transform: rotate(-2deg);
  transition: transform .4s;
}
.polaroid:nth-child(even) { transform: rotate(2deg); }
.polaroid.active { transform: rotate(0) scale(1.04); }
.polaroid img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 2px;
}
.polaroid figcaption {
  font-family: var(--script);
  color: var(--red-dark);
  font-size: 1.35rem;
  text-align: center;
  line-height: 1.2;
  padding: .7rem .2rem .9rem;
}
.dots { display: flex; justify-content: center; gap: 8px; }
.dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--black-3);
  border: 1px solid var(--red);
  transition: all .3s;
}
.dots span.on { background: var(--red); width: 22px; border-radius: 4px; }

/* ---------- Contador ---------- */
.counter-section { padding: 60px 16px; }
.counter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 480px;
  margin: 1.5rem auto 1rem;
}
.counter div {
  background: var(--black-2);
  border: 1px solid rgba(224, 17, 43, .45);
  border-radius: 14px;
  padding: .9rem .2rem;
  text-align: center;
}
.counter strong {
  display: block;
  font-size: clamp(1.3rem, 6vw, 1.9rem);
  font-weight: 600;
  color: var(--red-2);
  line-height: 1.2;
}
.counter span { font-size: .72rem; color: var(--muted); }

/* ---------- Motivos ---------- */
.reasons-section { padding: 60px 16px; }
.reasons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
.reason {
  perspective: 900px;
  height: 150px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.reason-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.4, .2, .2, 1);
}
.reason.flipped .reason-inner { transform: rotateY(180deg); }
.reason-front, .reason-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .8rem;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.reason-front {
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  box-shadow: 0 8px 22px rgba(224, 17, 43, .35);
}
.reason-front b { font-size: 2.2rem; line-height: 1; }
.reason-front small { font-size: .75rem; opacity: .85; margin-top: .4rem; }
.reason-back {
  background: var(--black-2);
  border: 1px solid var(--red);
  transform: rotateY(180deg);
  font-size: .88rem;
  line-height: 1.45;
  text-align: center;
}

/* ---------- Bolo ---------- */
.cake-section { padding: 60px 16px 80px; text-align: center; }
.cake {
  position: relative;
  width: 220px;
  margin: 2.5rem auto 1.5rem;
  padding-top: 70px;
}
.candles {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 34px;
}
.candle {
  position: relative;
  width: 14px; height: 60px;
  margin-top: 20px;
  border: none;
  border-radius: 3px;
  background: repeating-linear-gradient(45deg, var(--white) 0 6px, var(--red) 6px 12px);
  cursor: pointer;
}
.candle::before { /* área de toque maior */
  content: '';
  position: absolute;
  inset: -30px -16px -4px;
}
.flame {
  position: absolute;
  left: 50%; top: -26px;
  width: 16px; height: 24px;
  margin-left: -8px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 70%, #fff6a8 0 25%, #ffb300 45%, #ff4d00 80%);
  box-shadow: 0 0 20px 6px rgba(255, 170, 0, .6);
  animation: flicker .15s infinite alternate;
  transform-origin: bottom center;
  transition: opacity .4s, transform .4s;
}
.candle.out .flame { opacity: 0; transform: scale(.2) translateY(-10px); animation: none; }
.candle.out::after {
  content: '';
  position: absolute;
  left: 50%; top: -20px;
  width: 6px; height: 20px;
  margin-left: -3px;
  background: linear-gradient(to top, rgba(200, 200, 200, .6), transparent);
  border-radius: 50%;
  filter: blur(2px);
  animation: smoke 1.5s ease-out forwards;
}
@keyframes flicker {
  from { transform: rotate(-3deg) scaleY(1); }
  to { transform: rotate(3deg) scaleY(1.08); }
}
@keyframes smoke {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-40px) scaleX(2); }
}
.layer { position: relative; margin: 0 auto; border-radius: 10px 10px 4px 4px; }
.layer-top {
  width: 170px; height: 60px;
  background: var(--black-3);
  border-top: 12px solid var(--red);
}
.layer-top::after, .layer-bottom::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -2px;
  height: 14px;
  background: radial-gradient(circle at 10px 0, var(--red) 9px, transparent 10px) 0 0 / 20px 14px repeat-x;
}
.layer-bottom {
  width: 220px; height: 75px;
  background: var(--black-2);
  border-top: 12px solid var(--red-2);
}
.layer-bottom::after {
  background: radial-gradient(circle at 10px 0, var(--red-2) 9px, transparent 10px) 0 0 / 20px 14px repeat-x;
}
.plate {
  width: 260px; height: 14px;
  margin: 0 -20px;
  border-radius: 50%;
  background: #3a3a3a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .6);
}
.wish {
  font-family: var(--script);
  font-size: 1.7rem;
  line-height: 1.35;
  color: var(--pink);
  animation: fadeUp .8s ease both;
}

/* confete */
.confetti {
  position: fixed;
  top: -20px;
  width: 9px; height: 14px;
  z-index: 60;
  pointer-events: none;
  animation: confetti linear forwards;
}
@keyframes confetti {
  to { transform: translateY(110vh) rotate(720deg); }
}

/* ---------- Rodapé ---------- */
footer {
  text-align: center;
  padding: 50px 16px calc(100px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(224, 17, 43, .3);
  color: var(--muted);
}
.footer-big {
  font-family: var(--script);
  font-size: 3.2rem;
  color: var(--red-2);
  line-height: 1.2;
  animation: heartbeat 1.4s ease-in-out infinite;
}
.footer-small { font-size: .78rem; margin-top: 1rem; opacity: .7; }
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.1); }
  30% { transform: scale(1); }
  45% { transform: scale(1.07); }
}


/* ---------- Carrossel: polaroid clicável ---------- */
.polaroid { cursor: zoom-in; }

/* ---------- Contagem aniversário ---------- */
.counter-section { padding: 50px 16px 20px; text-align: center; }
.bday-big {
  font-family: var(--script);
  font-size: clamp(3rem, 14vw, 4.6rem);
  line-height: 1.1;
  color: var(--white);
  text-shadow: 0 0 25px rgba(224, 17, 43, .7);
  margin: .3rem 0 .6rem;
}

/* ---------- Motivos (texto maior no verso) ---------- */
.reason-back { font-size: .85rem; }

/* ---------- Abre quando ---------- */
.open-section { padding: 60px 16px; }
.envelopes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
.envelope {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 1rem 1.2rem;
  font-family: var(--sans);
  font-size: .98rem;
  color: var(--white);
  text-align: left;
  background: linear-gradient(145deg, var(--red), var(--red-dark));
  border: none;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(224, 17, 43, .3);
  cursor: pointer;
  transition: transform .2s;
}
.envelope:active { transform: scale(.97); }
.envelope .env-icon { font-size: 1.8rem; line-height: 1; }
.envelope b { display: block; font-family: var(--script); font-size: 1.5rem; line-height: 1.1; }
.envelope small { opacity: .8; font-size: .75rem; }
.envelope.read { background: var(--black-2); border: 1px solid var(--red); box-shadow: none; }

/* ---------- Vales ---------- */
.coupons-section { padding: 60px 16px; }
.coupons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
.coupon {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 1rem 1.1rem;
  background: var(--black-2);
  border: 2px dashed var(--red);
  border-radius: 16px;
}
.coupon-emoji { font-size: 2rem; line-height: 1; }
.coupon-body { flex: 1; min-width: 0; }
.coupon-body strong { display: block; font-family: var(--script); font-size: 1.45rem; line-height: 1.15; color: var(--red-2); }
.coupon-body p { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.coupon-use {
  flex: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .8rem;
  color: var(--white);
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: none;
  border-radius: 999px;
  padding: .5rem 1rem;
  cursor: pointer;
}
.coupon.used { opacity: .5; border-style: solid; }
.coupon.used .coupon-use { background: none; border: 1px solid var(--muted); color: var(--muted); pointer-events: none; }

/* ---------- Janela (modal) ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  animation: fadeIn .3s ease both;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  padding-top: 26px;
  animation: pop .45s ease both;
}
.modal-box.is-photo { max-width: 900px; overflow: visible; text-align: center; padding-top: 0; }
.modal-box img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 8px;
  border: 3px solid var(--red);
}
.modal-caption { font-family: var(--script); font-size: 1.6rem; color: var(--pink); margin-top: .5rem; }
.modal-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--red);
  background: rgba(10, 10, 10, .85);
  color: var(--white);
  font-size: 1rem;
  cursor: pointer;
}
.note {
  position: relative;
  padding: 2.4rem 1.5rem 1.8rem;
  background: linear-gradient(180deg, var(--black-2), var(--black-3));
  border: 1px solid rgba(224, 17, 43, .6);
  border-radius: 18px;
  box-shadow: 0 0 40px rgba(224, 17, 43, .25);
}
.note h3 {
  font-family: var(--script);
  font-size: 2rem;
  line-height: 1.2;
  color: var(--red-2);
  margin-bottom: .8rem;
}
.note p { margin-bottom: .9rem; }
.note .note-sign { text-align: right; font-family: var(--script); font-size: 1.6rem; color: var(--red-2); margin: 0; }
.note-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 1rem; }
.btn-ghost { background: none; border: 1px solid var(--red); box-shadow: none; }

/* ---------- PC ---------- */
@media (min-width: 700px) {
  .reasons { grid-template-columns: repeat(4, 1fr); max-width: 900px; }
  .reason { height: 170px; }
  .envelopes, .coupons { grid-template-columns: repeat(2, 1fr); max-width: 900px; }
  .polaroid { flex-basis: 300px; }
  .polaroid img { height: 380px; }
  .carousel { padding-left: calc(50% - 150px); padding-right: calc(50% - 150px); }
  .hero-photo { width: 230px; height: 230px; }
  .letter { max-width: 640px; padding: 3rem 2.6rem 2.4rem; }
  .letter p { font-size: 1.05rem; }
}
@media (min-width: 1100px) {
  .polaroid:hover { transform: rotate(0) scale(1.04); }
  .envelope:hover, .coupon:hover { transform: translateY(-3px); }
  .envelope, .coupon { transition: transform .2s; }
}

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