/* =========================================================
   TOKENS
========================================================= */
:root {
  --bg: #fff3f8;
  --bg-alt: #ffe1ef;
  --rose: #e85d8a;
  --rose-dark: #c13f73;
  --plum: #4a2545;
  --gold: #f4c95d;
  --lavender: #d6b8ff;
  --white: #ffffff;

  --font-pixel: "Press Start 2P", cursive;
  --font-body: "Quicksand", sans-serif;

  --pixel-border: 4px solid var(--plum);
  --pixel-shadow: 6px 6px 0 var(--plum);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--plum);
  font-family: var(--font-body);
  cursor: none;
  overflow-x: hidden;
}

@media (max-width: 700px), (hover: none) {
  body { cursor: auto; }
  #cursor-heart { display: none; }
}

a { color: var(--rose-dark); }

.hidden { display: none !important; }

/* =========================================================
   CURSOR HEART
========================================================= */
#cursor-heart {
  position: fixed;
  top: 0; left: 0;
  font-size: 18px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.05s linear;
}

/* =========================================================
   FLOATING HEARTS BACKGROUND
========================================================= */
#floating-hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.floating-heart {
  position: absolute;
  bottom: -10%;
  font-size: 20px;
  opacity: 0.55;
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  0%   { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  100% { transform: translateY(-110vh) translateX(20px) rotate(20deg); opacity: 0; }
}

/* =========================================================
   PIXEL UI PRIMITIVES
========================================================= */
.pixel-frame {
  background: var(--white);
  border: var(--pixel-border);
  box-shadow: var(--pixel-shadow);
  image-rendering: pixelated;
  position: relative;
}

.pixel-btn {
  font-family: var(--font-pixel);
  font-size: 12px;
  background: var(--rose);
  color: var(--white);
  border: 4px solid var(--plum);
  box-shadow: 4px 4px 0 var(--plum);
  padding: 14px 20px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.pixel-btn:hover {
  background: var(--rose-dark);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--plum);
}

.pixel-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--plum);
}

/* =========================================================
   INTRO
========================================================= */
#intro {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: relative;
  z-index: 1;
  background: radial-gradient(circle at 50% 30%, var(--bg-alt), var(--bg) 70%);
}

.intro-card {
  padding: 36px 28px;
  max-width: 480px;
}

.eyebrow {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--rose-dark);
  margin: 0 0 12px;
  letter-spacing: 1px;
}

.glow-text {
  font-family: var(--font-pixel);
  font-size: clamp(20px, 5vw, 32px);
  color: var(--rose);
  text-shadow: 0 0 8px var(--gold), 3px 3px 0 var(--plum);
  margin: 0 0 16px;
  line-height: 1.5;
}

.intro-sub {
  font-size: 15px;
  margin: 0 0 24px;
  color: var(--plum);
}

.pixel-cat {
  font-size: 40px;
  margin-top: 24px;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* =========================================================
   NAV
========================================================= */
.pixel-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--white);
  border-bottom: 4px solid var(--plum);
}

.nav-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.nav-toggle {
  display: none;
  background: var(--rose);
  color: var(--white);
  border: 3px solid var(--plum);
  font-size: 16px;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.pixel-nav a {
  font-family: var(--font-pixel);
  font-size: 9px;
  text-decoration: none;
  color: var(--plum);
  background: var(--bg-alt);
  border: 2px solid var(--plum);
  padding: 8px 10px;
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

.pixel-nav a:hover,
.pixel-nav a.active-link {
  background: var(--rose);
  color: var(--white);
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 4px solid var(--plum);
    flex-direction: column;
    padding: 10px;
  }
  .nav-links.open { display: flex; }
  .pixel-nav a { text-align: left; }
}

/* =========================================================
   SECTIONS
========================================================= */
.section {
  position: relative;
  z-index: 1;
  padding: 70px 20px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.alt-bg { background: var(--bg-alt); max-width: 100%; }
.alt-bg > * { max-width: 900px; margin-left: auto; margin-right: auto; }

.section-title {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 4vw, 22px);
  color: var(--rose-dark);
  margin-bottom: 10px;
}

.section-sub {
  font-size: 14px;
  color: var(--plum);
  opacity: 0.75;
  margin-bottom: 36px;
}

/* =========================================================
   ENVELOPE / LETTER
========================================================= */
.envelope {
  width: 220px;
  margin: 0 auto 30px;
  cursor: pointer;
  perspective: 600px;
}

.envelope-body {
  width: 220px;
  height: 140px;
  background: var(--rose);
  border: 4px solid var(--plum);
  box-shadow: var(--pixel-shadow);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  overflow: hidden;
}

.envelope-flap {
  position: absolute;
  top: -4px; left: -4px;
  width: 228px;
  height: 90px;
  background: var(--rose-dark);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 0.4s ease;
  border: 4px solid var(--plum);
  z-index: 2;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.envelope-heart {
  font-size: 26px;
  z-index: 1;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.envelope-hint {
  font-size: 12px;
  color: var(--rose-dark);
  margin-top: 8px;
}

.letter {
  max-width: 560px;
  margin: 0 auto;
  animation: unfold 0.5s ease;
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.letter-paper {
  padding: 30px 26px;
  text-align: left;
  font-size: 16px;
  line-height: 1.7;
}

.letter-paper .signature {
  text-align: right;
  font-weight: 700;
  color: var(--rose-dark);
}

/* =========================================================
   REASONS GRID (flip cards)
========================================================= */
.reasons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.reason-card {
  height: 130px;
  perspective: 800px;
  cursor: pointer;
}

.reason-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.reason-card.flipped .reason-card-inner {
  transform: rotateY(180deg);
}

.reason-front, .reason-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border: 4px solid var(--plum);
  box-shadow: var(--pixel-shadow);
  padding: 10px;
  text-align: center;
}

.reason-front {
  background: var(--rose);
  font-size: 26px;
}

.reason-back {
  background: var(--white);
  transform: rotateY(180deg);
  font-size: 13px;
  line-height: 1.4;
}

/* =========================================================
   FAVORITOS (sobre ela)
========================================================= */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}

.favorite-card {
  background: var(--white);
  border: 4px solid var(--plum);
  box-shadow: var(--pixel-shadow);
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease;
}

.favorite-card:hover { transform: translateY(-4px); }

.favorite-card i, .favorite-card .fav-emoji {
  font-size: 22px;
  color: var(--rose);
}

.favorite-card span {
  font-size: 12.5px;
  line-height: 1.3;
}

/* =========================================================
   DISTÂNCIA / MAPA
========================================================= */
.map-strip {
  max-width: 620px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 18px;
  gap: 10px;
}

.map-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.map-pin i { font-size: 22px; color: var(--rose-dark); }

.map-line {
  flex: 1;
  position: relative;
  height: 2px;
  border-top: 3px dashed var(--rose);
  margin: 0 6px;
}

.map-plane {
  position: absolute;
  top: -12px;
  left: 0;
  color: var(--plum);
  font-size: 16px;
  animation: flyAcross 4s ease-in-out infinite;
}

@keyframes flyAcross {
  0%   { left: 0%; }
  50%  { left: calc(100% - 16px); }
  100% { left: 0%; }
}

.distance-note {
  font-size: 13px;
  opacity: 0.75;
  margin-bottom: 30px;
}

.countdown {
  max-width: 420px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: space-around;
  padding: 20px 10px;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-num {
  font-family: var(--font-pixel);
  font-size: clamp(16px, 4vw, 22px);
  color: var(--rose-dark);
}

.countdown-label {
  font-size: 10px;
  margin-top: 6px;
  opacity: 0.7;
}

.countdown-caption {
  font-size: 13px;
  opacity: 0.75;
}

/* =========================================================
   COFRINHO DA VIAGEM
========================================================= */
.savings-box {
  max-width: 480px;
  margin: 0 auto;
  padding: 26px 24px;
}

.savings-bar-track {
  width: 100%;
  height: 26px;
  background: var(--bg-alt);
  border: 3px solid var(--plum);
  overflow: hidden;
}

.savings-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    45deg,
    var(--rose),
    var(--rose) 10px,
    var(--rose-dark) 10px,
    var(--rose-dark) 20px
  );
  transition: width 1.2s ease;
}

.savings-numbers {
  margin: 14px 0 4px;
  font-size: 14px;
  font-weight: 700;
}

.savings-percent {
  font-family: var(--font-pixel);
  font-size: 18px;
  color: var(--rose-dark);
  margin: 0;
}

/* =========================================================
   PLANOS
========================================================= */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}

.plan-card {
  background: var(--white);
  border: 4px solid var(--plum);
  box-shadow: var(--pixel-shadow);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.plan-card i {
  font-size: 24px;
  color: var(--rose);
}

.plan-card span {
  font-size: 13px;
  font-weight: 600;
}

/* =========================================================
   TIMELINE
========================================================= */
.timeline {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 30px;
  border-left: 4px dashed var(--rose);
  text-align: left;
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item::before {
  content: "💗";
  position: absolute;
  left: -43px;
  top: -2px;
  font-size: 18px;
}

.timeline-date {
  font-family: var(--font-pixel);
  font-size: 10px;
  color: var(--rose-dark);
  display: block;
  margin-bottom: 6px;
}

.timeline-title {
  font-weight: 700;
  margin: 0 0 4px;
}

.timeline-text {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}

/* =========================================================
   GALLERY
========================================================= */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.gallery-item {
  border: 4px solid var(--plum);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.gallery-item:hover img { transform: scale(1.08); }

.gallery-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-align: center;
  padding: 8px;
  background: var(--bg-alt);
  color: var(--rose-dark);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(74, 37, 69, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.lightbox img {
  max-width: 90%;
  max-height: 70vh;
  border: 4px solid var(--white);
}

.lightbox-caption {
  color: var(--white);
  margin-top: 12px;
  font-size: 14px;
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 30px;
  color: var(--white);
  font-size: 26px;
  cursor: pointer;
}

/* =========================================================
   SECRET HEARTS
========================================================= */
.secret-status {
  font-family: var(--font-pixel);
  font-size: 12px;
  color: var(--rose-dark);
  margin-bottom: 20px;
}

.secret-heart {
  position: absolute;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 5;
  user-select: none;
}

.secret-heart:hover { transform: scale(1.3); }
.secret-heart.found { opacity: 0; pointer-events: none; }

.secret-message {
  max-width: 500px;
  margin: 0 auto;
  padding: 24px;
  font-size: 14px;
  line-height: 1.6;
}

/* =========================================================
   FOOTER
========================================================= */
.pixel-footer {
  text-align: center;
  padding: 30px 20px;
  font-size: 13px;
  color: var(--rose-dark);
  background: var(--white);
  border-top: 4px solid var(--plum);
}

.pixel-footer .small { opacity: 0.6; font-size: 11px; margin-top: 4px; }

/* =========================================================
   CONTROLES FLUTUANTES (música / kuromi / topo)
========================================================= */
.floating-controls {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pixel-icon-btn {
  width: 46px;
  height: 46px;
  border: 4px solid var(--plum);
  background: var(--rose);
  color: var(--white);
  font-size: 17px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--plum);
  transition: transform 0.15s ease;
}

.pixel-icon-btn:hover { transform: translate(-2px, -2px); }

/* =========================================================
   MODO KUROMI (tema escuro rosa/preto/vermelho)
========================================================= */
body.kuromi-mode {
  --bg: #17111c;
  --bg-alt: #241a2b;
  --rose: #ff4d7d;
  --rose-dark: #d6002e;
  --plum: #ffd6e8;
  --gold: #ff8fb3;
  --white: #221a27;
}

body.kuromi-mode .pixel-nav,
body.kuromi-mode .nav-links {
  background: var(--white);
}

body.kuromi-mode .letter-paper,
body.kuromi-mode .reason-back,
body.kuromi-mode .favorite-card,
body.kuromi-mode .plan-card,
body.kuromi-mode .gallery-item,
body.kuromi-mode .pixel-footer {
  background: var(--white);
  color: var(--plum);
}

/* =========================================================
   REVELAÇÃO AO ROLAR A PÁGINA
========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   DIVISOR DECORATIVO EM PIXEL
========================================================= */
.pixel-divider {
  height: 14px;
  width: 100%;
  background-image:
    linear-gradient(135deg, var(--rose) 25%, transparent 25%),
    linear-gradient(225deg, var(--rose) 25%, transparent 25%),
    linear-gradient(45deg, var(--rose) 25%, transparent 25%),
    linear-gradient(315deg, var(--rose) 25%, transparent 25%);
  background-position: 14px 0, 14px 0, 0 0, 0 0;
  background-size: 14px 14px;
  background-repeat: repeat-x;
  background-color: var(--bg);
}

/* =========================================================
   CONFETE DE CORAÇÕES
========================================================= */
#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  overflow: hidden;
}

.confetti-heart {
  position: absolute;
  top: -5%;
  font-size: 18px;
  animation: confettiFall 2.2s ease-in forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* =========================================================
   CAIXINHA DE MÚSICA COM BAILARINA
========================================================= */
.music-box {
  width: 220px;
  margin: 0 auto 14px;
  cursor: pointer;
  user-select: none;
}

.music-box-lid {
  height: 26px;
  background: var(--rose-dark);
  border: 4px solid var(--plum);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: left center;
  transition: transform 0.5s ease;
  position: relative;
  z-index: 3;
}

.music-box-lid-heart { font-size: 12px; }

.music-box.open .music-box-lid {
  transform: rotateZ(-35deg) translateY(-6px);
}

.music-box-stage {
  height: 170px;
  background: linear-gradient(var(--bg-alt), var(--white));
  border-left: 4px solid var(--plum);
  border-right: 4px solid var(--plum);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.music-box-platform {
  width: 120px;
  height: 16px;
  background: var(--rose);
  border: 3px solid var(--plum);
  border-radius: 50%;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  animation-play-state: paused;
  animation: spinPlatform 3.6s linear infinite;
}

.music-box.open .music-box-platform {
  animation-play-state: running;
}

@keyframes spinPlatform {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.ballerina {
  position: absolute;
  bottom: 12px;
  width: 34px;
  height: 70px;
  animation: sway 1.8s ease-in-out infinite;
}

.music-box.open .ballerina { animation-play-state: running; }
.ballerina { animation-play-state: paused; }

@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}

.ballerina-head {
  width: 12px;
  height: 12px;
  background: #f6c9a0;
  border: 2px solid var(--plum);
  border-radius: 50%;
  margin: 0 auto;
}

.ballerina-torso {
  width: 8px;
  height: 16px;
  background: var(--rose-dark);
  border: 2px solid var(--plum);
  margin: -2px auto 0;
}

.ballerina-tutu {
  width: 34px;
  height: 14px;
  background: var(--gold);
  border: 2px solid var(--plum);
  border-radius: 50% 50% 20% 20%;
  margin: -3px auto 0;
}

.ballerina-legs {
  width: 4px;
  height: 20px;
  background: #f6c9a0;
  border: 2px solid var(--plum);
  margin: -2px auto 0;
}

.ballerina-arms {
  width: 26px;
  height: 10px;
  border-top: 3px solid var(--plum);
  border-radius: 50% 50% 0 0;
  margin: 8px auto 0;
}

.music-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.music-note {
  position: absolute;
  bottom: 40px;
  font-size: 14px;
  color: var(--rose-dark);
  animation: noteFloat 2.4s ease-out forwards;
}

@keyframes noteFloat {
  0%   { transform: translateY(0) translateX(0); opacity: 1; }
  100% { transform: translateY(-90px) translateX(18px); opacity: 0; }
}

.music-box-base {
  height: 18px;
  background: var(--rose-dark);
  border: 4px solid var(--plum);
  border-top: none;
}

.music-box-hint {
  font-size: 12px;
  opacity: 0.7;
}

/* =========================================================
   BACK TO TOP
========================================================= */

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 500px) {
  .pixel-nav a { font-size: 8px; padding: 6px 8px; }
  .section { padding: 50px 14px; }
}

/* respeita usuários que preferem menos movimento */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
