/* ============================================================
   Presente Dia dos Namorados — estética "premium fofo"
   ============================================================ */

:root {
  --bg: #1a1015;
  --bg-2: #2a1620;
  --gold: #f5c97b;
  --gold-soft: #f7d9a0;
  --coral: #e8a0a8;
  --rose: #d98a9a;
  --ink: #fff6ef;
  --ink-dim: rgba(255, 246, 239, 0.72);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --display: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --slide-pad: clamp(22px, 7vw, 40px);
}

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

/* o atributo [hidden] precisa vencer os display:flex/grid das classes */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: #0d080b;
  font-family: var(--sans);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  /* fundo escuro com brilho suave nas laterais (desktop) */
  background:
    radial-gradient(120% 80% at 50% -10%, #2a1620 0%, #140b10 55%, #0d080b 100%);
}

/* ---------- Moldura de celular ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

@media (min-width: 460px) {
  .phone {
    height: min(100dvh, 920px);
    border-radius: 34px;
    box-shadow: var(--shadow), 0 0 0 10px #0a0608, 0 0 0 11px rgba(245, 201, 123, 0.12);
  }
}

/* ---------- Canvas de partículas ---------- */
.fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Barras de progresso ---------- */
.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  padding: 12px 12px 0;
  padding-top: max(12px, env(safe-area-inset-top));
}
.progress .bar {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}
.progress .bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(245, 201, 123, 0.7);
}
.progress .bar.done > i { width: 100%; }

/* ---------- Botão mute ---------- */
.mute-btn {
  position: absolute;
  z-index: 40;
  top: max(20px, calc(env(safe-area-inset-top) + 10px));
  right: 14px;
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, background 0.2s ease;
}
.mute-btn:active { transform: scale(0.9); }
.mute-btn .ic-muted { display: none; }
.mute-btn.muted .ic-sound { display: none; }
.mute-btn.muted .ic-muted { display: inline; }

/* ---------- Stage / slides ---------- */
.stage {
  position: absolute;
  inset: 0;
  z-index: 10;
}
.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--slide-pad);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
}
.slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

/* ---------- Fundo gradiente romântico ---------- */
.romantic-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(130% 90% at 50% 8%, #3a1c28 0%, #241019 48%, #160c11 100%);
}
.romantic-bg::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(40% 30% at 20% 20%, rgba(232, 160, 168, 0.18), transparent 70%),
    radial-gradient(45% 35% at 82% 78%, rgba(245, 201, 123, 0.16), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

/* ---------- Capa ---------- */
.cover .eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.2s forwards;
}
.cover h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.1rem, 9vw, 3rem);
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-wrap: balance;
  opacity: 0;
  animation: fadeUp 1s ease 0.45s forwards;
}
.cover h1 .name {
  display: block;
  background: linear-gradient(100deg, var(--gold) 0%, var(--coral) 55%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  padding-bottom: 0.08em;
}
.cover .open-hint {
  margin-top: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  animation: fadeUp 1s ease 1.1s forwards;
}
.cover .open-hint .pulse {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: rgba(245, 201, 123, 0.12);
  border: 1px solid rgba(245, 201, 123, 0.4);
  animation: heartPulse 1.8s ease-in-out infinite;
}
.cover .open-hint span {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
@keyframes heartPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 201, 123, 0.35); }
  50%      { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(245, 201, 123, 0); }
}

/* ---------- Slides de foto ---------- */
.photo {
  padding: 0;
  justify-content: flex-end;
  background: #0d080b;
  overflow: hidden;
}
/* fundo desfocado (preenche as bordas em fotos panorâmicas) */
.photo .ph-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(34px) brightness(0.4) saturate(1.15);
  transform: scale(1.25);
}
/* foto em primeiro plano (mostra a imagem inteira quando panorâmica) */
.photo .ph-fg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-position: center;
  will-change: transform;
}
.photo .ph-fg.fit-cover { object-fit: cover; }
.photo .ph-fg.fit-contain { object-fit: contain; }
.photo.active .ph-fg.fit-cover { animation: kenburns 11s ease-out forwards; }
.photo.active .ph-fg.fit-contain { animation: kenburnsContain 11s ease-out forwards; }
.photo.active .ph-bg { animation: bgDrift 11s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.04) translate(0, 0); }
  to   { transform: scale(1.16) translate(-1.5%, -2%); }
}
@keyframes kenburnsContain {
  from { transform: scale(1); }
  to   { transform: scale(1.05); }
}
@keyframes bgDrift {
  from { transform: scale(1.25); }
  to   { transform: scale(1.36) translate(1%, 1%); }
}
.photo .ph-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(to top, rgba(13, 8, 11, 0.82) 0%, rgba(13, 8, 11, 0.15) 36%, rgba(13, 8, 11, 0) 60%);
}
.photo .ph-caption {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: var(--slide-pad);
  padding-bottom: calc(var(--slide-pad) + env(safe-area-inset-bottom));
  text-align: left;
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(1.3rem, 5.6vw, 1.7rem);
  line-height: 1.25;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
}
.photo.active .ph-caption {
  opacity: 0;
  animation: fadeUp 0.9s ease 0.35s forwards;
}

/* ---------- Slides de mensagem (entre as fotos) ---------- */
.msg .msg-text {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.55rem, 6.8vw, 2.1rem);
  line-height: 1.36;
  max-width: 17ch;
  text-wrap: balance;
  color: var(--ink);
}
.msg .msg-text .hl {
  background: linear-gradient(100deg, var(--gold) 0%, var(--coral) 60%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.msg .msg-heart {
  margin-top: 22px;
  font-size: 1.7rem;
}
.msg.active .msg-text {
  opacity: 0;
  animation: fadeUp 1s ease 0.25s forwards;
}
.msg.active .msg-heart {
  opacity: 0;
  animation: fadeUp 1s ease 0.6s forwards, heartPulse 1.8s ease-in-out 1.6s infinite;
}

/* ---------- Animações sobre as fotos: corações subindo + fogos ---------- */
.float-heart {
  position: absolute;
  bottom: -32px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  animation: floatUp var(--dur, 4s) ease-in forwards;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.55) rotate(0deg); opacity: 0; }
  12%  { opacity: 0.95; }
  100% { transform: translateY(calc(-1 * var(--rise, 820px))) scale(1.1) rotate(var(--rot, 18deg)); opacity: 0; }
}
.firework {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  width: 0; height: 0;
}
.firework .spark {
  position: absolute;
  left: 0; top: 0;
  width: 6px; height: 6px;
  border-radius: 50%;
  will-change: transform, opacity;
  box-shadow: 0 0 8px currentColor;
  animation: spark 950ms ease-out forwards;
}
@keyframes spark {
  0%   { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.2); opacity: 0; }
}

/* ---------- Telas de contador ---------- */
.counter h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 6.4vw, 2rem);
  line-height: 1.18;
  margin-bottom: 8px;
  text-wrap: balance;
}
.counter .sub {
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  margin-bottom: 30px;
}
.counter.active h2 { opacity: 0; animation: fadeUp 0.9s ease 0.2s forwards; }
.counter.active .sub { opacity: 0; animation: fadeUp 0.9s ease 0.35s forwards; }

.units {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
  width: 100%;
  max-width: 340px;
}
.units.four { grid-template-columns: repeat(4, 1fr); gap: 12px 6px; }
.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 201, 123, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.unit .num {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.7rem, 8vw, 2.4rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(245, 201, 123, 0.25);
}
.units.four .unit .num { font-size: clamp(1.5rem, 7vw, 2rem); }
.unit .num.tick { animation: tick 0.35s ease; }
@keyframes tick {
  0% { transform: translateY(2px) scale(0.96); opacity: 0.7; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.unit .lbl {
  margin-top: 7px;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.counter.active .units { opacity: 0; animation: fadeUp 1s ease 0.5s forwards; }
.heart-divider {
  margin: 26px 0 0;
  font-size: 1.1rem;
  color: var(--coral);
  opacity: 0.85;
}

/* ---------- Mensagem final ---------- */
.final h2 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  margin-bottom: 22px;
  color: var(--gold);
}
.final .letter {
  font-size: clamp(1rem, 4.4vw, 1.12rem);
  line-height: 1.7;
  color: var(--ink);
  max-width: 34ch;
  white-space: pre-line;
}
.final .sign {
  margin-top: 26px;
  font-family: var(--display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold-soft);
}
.final.active > * {
  opacity: 0;
  animation: fadeUp 1s ease forwards;
}
.final.active h2 { animation-delay: 0.2s; }
.final.active .letter { animation-delay: 0.5s; }
.final.active .sign { animation-delay: 1.1s; }
.final.active .replay { animation-delay: 1.5s; }

.replay {
  margin-top: 34px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid rgba(245, 201, 123, 0.45);
  background: rgba(245, 201, 123, 0.08);
  color: var(--gold-soft);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.replay:active { transform: scale(0.95); }
.spotify-link {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 2px;
}

/* ---------- Zonas de navegação ---------- */
.nav-zones {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
}
.nav-zones .zone { height: 100%; }
.nav-zones .zone-left { width: 32%; }
.nav-zones .zone-right { flex: 1; }

/* ---------- Spotify escondido ---------- */
.spotify-wrap {
  position: fixed;
  width: 1px; height: 1px;
  left: -9999px; top: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Animações utilitárias ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Acessibilidade: movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }
  .slide { opacity: 0; }
  .slide.active { opacity: 1; }
  .photo.active .ph-img { animation: none; transform: scale(1.06); }
}
