:root {
  --bg: #071013;
  --brand: #d70913;
  --text: #ededed;
  --muted: #8b949e;
  --accent: #d70913;
}

html.light {
  --bg: #f5f0eb;
  --text: #171717;
  --muted: #5a5a5a;
}

html.light .navbar {
  background: rgba(245, 240, 235, 0.92);
}

html.light .password-gate {
  background: #f5f0eb;
  color: #171717;
}

html.light .password-gate input {
  background: #fff;
  color: #171717;
  border-color: #ccc;
}

html.light .stat-bar {
  background: rgba(0, 0, 0, 0.08);
}

.theme-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--text);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: border-color 0.3s, color 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover { border-color: var(--brand); }

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Ubuntu", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
}

/* Hide initially */
.hidden {
  display: none !important;
}

.content {
  max-width: 680px;
  margin: auto;
  padding: 80px 20px;
}

/* Text styles */
.line {
  font-family: "Mynerve", cursive;
  margin-bottom: 32px;
  font-size: 1.5rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.6s ease;
}
.line.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.emphasis {
  color: var(--accent);
  font-weight: 400;
  font-size: 1.5rem;
}
.soft {
  font-family: "Mynerve", cursive;
  font-size: 1.5rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* Image moments */
.moments {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 40px 0;
}
.moments img {
  width: calc(50% - 8px);
  border-radius: 12px;
  object-fit: cover;
}

/* Vows */
.vows p {
  font-family: "Mynerve", cursive;
  margin-bottom: 24px;
  font-size: 1.5rem;
  line-height: 1.5;
}

/* Signature */
.signature {
  text-align: right;
  margin-top: 60px;
}
.signature span {
  font-family: "Mynerve", cursive;
  font-size: 1.2rem;
}
.signature p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 8px;
}

/* Footer */
.seal {
  text-align: center;
  margin-top: 80px;
  color: var(--muted);
  font-size: 0.8rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(7, 16, 19, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 40px;
  height: 64px;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.logo:hover {
  opacity: 0.8;
}
.buy-btn {
  background: var(--brand);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  display: inline-block;
  border: 2px solid var(--brand);
}

.buy-btn:hover {
  background: white;
  color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(215, 9, 19, 0.4);
}

/* Password Gate */
.password-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  z-index: 10000;
}
.password-gate input {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--accent);
  color: white;
  border-radius: 8px;
}
.password-gate button {
  padding: 12px 28px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.hint-text {
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0.7;
  margin-bottom: 8px;
  text-align: center;
  max-width: 300px;
}

.gate-error {
  display: none;
  background: rgba(215, 9, 19, 0.10);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 8px;
  max-width: 300px;
  text-align: center;
  margin-bottom: 4px;
}

/* Hearts */
.hearts span {
  position: fixed;
  top: -10%;
  font-size: 14px;
  color: var(--accent);
  animation: fall linear infinite;
  opacity: 0.6;
}
@keyframes fall {
  to {
    transform: translateY(110vh);
  }
}

/* ADD-ON SECTIONS */
.love-stats-section,
.voice-note-section,
.qr-code-section {
  margin: 80px 0;
  text-align: center;
}

.addon-title {
  font-family: "Mynerve", cursive;
  font-size: 1.5rem;
  margin-bottom: 28px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* LOVE STATS */
.stats-display {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
}

.stat-item {
  text-align: left;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.stat-trait {
  font-family: "Mynerve", cursive;
  font-weight: 400;
  font-size: 1.2rem;
}

.stat-value {
  color: var(--muted);
}

.stat-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 1.2s ease;
  width: 0;
}

.stat-comment {
  font-family: "Mynerve", cursive;
  font-size: 1.15rem;
  color: var(--muted);
  margin-top: 4px;
}

/* VOICE NOTE */
.audio-player-wrap {
  max-width: 400px;
  margin: 0 auto;
}

.audio-player-wrap audio {
  width: 100%;
  border-radius: 8px;
  outline: none;
}

/* QR CODE */
/* ─── BACKGROUND MUSIC CONTROL ─── */
.music-control {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 900;
}

.music-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--brand);
  background: var(--bg);
  color: var(--brand);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.music-btn:hover {
  opacity: 1;
  transform: scale(1.06);
}

.music-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.music-bars i {
  width: 3px;
  height: 4px;
  background: currentColor;
  border-radius: 1px;
  transition: height 0.2s ease;
}

.music-control.is-playing .music-bars i {
  animation: musicBar 0.9s ease-in-out infinite;
}

.music-control.is-playing .music-bars i:nth-child(2) { animation-delay: 0.15s; }
.music-control.is-playing .music-bars i:nth-child(3) { animation-delay: 0.3s; }

@keyframes musicBar {
  0%, 100% { height: 4px; }
  50%      { height: 15px; }
}

/* Autoplay was blocked — draw a little attention so they tap it */
.music-control.needs-tap .music-btn {
  opacity: 1;
  animation: musicPulse 2s ease-out infinite;
}

@keyframes musicPulse {
  0%   { box-shadow: 0 0 0 0 currentColor; }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 600px) {
  .music-control { left: 14px; bottom: 14px; }
  .music-btn { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .music-control.is-playing .music-bars i,
  .music-control.needs-tap .music-btn { animation: none; }
}

.qr-display {
  display: inline-block;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
}

.qr-display canvas,
.qr-display img {
  display: block;
}

.qr-caption {
  font-family: "Mynerve", cursive;
  margin-top: 12px;
  font-size: 1.3rem;
  color: var(--muted);
}

.qr-fallback-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-family: "Mynerve", cursive;
  font-size: 1.2rem;
  text-decoration: underline;
  transition: opacity 0.3s ease;
}

.qr-fallback-link:hover {
  opacity: 0.7;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .moments img {
    width: 100%;
  }
  .line, .soft, .vows p {
    font-size: 1.2rem;
  }
  .emphasis {
    font-size: 1.2rem;
  }
  .addon-title {
    font-size: 1.2rem;
  }
}
