@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --bg-dark: #070509;
  --bg-card: rgba(22, 12, 19, 0.65);
  --burgundy: #2a0b16;
  --burgundy-glow: rgba(131, 34, 50, 0.25);
  --gold: #d8bc98;
  --gold-muted: rgba(216, 188, 152, 0.4);
  --text-cream: #f6f1ea;
  --text-muted: #9e8e81;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-dark);
  color: var(--text-cream);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-cream);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #070509;
}

::-webkit-scrollbar-thumb {
  background: rgba(216, 188, 152, 0.2);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(216, 188, 152, 0.5);
}

/* Selection */
::selection {
  background: rgba(131, 34, 50, 0.7);
  color: #fff;
}

/* Film Grain Texture Overlay */
.film-grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Atmospheric Glows */
.ambient-glow-burgundy {
  position: absolute;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(131, 34, 50, 0.16) 0%, rgba(131, 34, 50, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-gold {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(216, 188, 152, 0.10) 0%, rgba(216, 188, 152, 0) 70%);
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* Typography Classes */
.font-editorial {
  font-family: var(--font-serif);
}

.font-display {
  font-family: var(--font-display);
}

.text-gold {
  color: var(--gold);
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fff 0%, #ecd9c4 40%, #cba77d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-burgundy {
  background: linear-gradient(135deg, #f6f1ea 0%, #d8a2aa 50%, #832232 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Editorial Glass Panel */
.editorial-panel {
  background: rgba(18, 11, 16, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(216, 188, 152, 0.12);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7);
}

.editorial-card-hover {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.editorial-card-hover:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 188, 152, 0.35);
  box-shadow: 0 25px 50px -12px rgba(131, 34, 50, 0.25);
}

/* Prologue Screen */
#prologue-screen {
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#prologue-screen.faded-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

/* Apology Interactive Cards (Tap to reveal depth) */
.apology-card {
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.apology-card:hover {
  border-color: rgba(216, 188, 152, 0.4);
}

.apology-card.is-expanded {
  border-color: rgba(216, 188, 152, 0.55);
  background: rgba(32, 16, 24, 0.85);
  box-shadow: 0 20px 45px rgba(131, 34, 50, 0.35);
}

.apology-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

.apology-card.is-expanded .apology-details {
  max-height: 250px;
  opacity: 1;
}

.expand-chevron {
  transition: transform 0.3s ease;
}

.apology-card.is-expanded .expand-chevron {
  transform: rotate(180deg);
}

/* 35mm Film Frame */
.film-frame {
  position: relative;
  background: #11090f;
  padding: 12px 12px 20px 12px;
  border: 1px solid rgba(216, 188, 152, 0.15);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  transition: all 0.4s ease;
}

.film-frame:hover {
  border-color: rgba(216, 188, 152, 0.4);
  transform: scale(1.02);
}

.film-timestamp {
  font-family: monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: rgba(216, 188, 152, 0.6);
  text-transform: uppercase;
}

/* Interactive Note Envelopes */
.envelope-card {
  background: linear-gradient(145deg, #1f0b13 0%, #13070d 100%);
  border: 1px solid rgba(216, 188, 152, 0.2);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.envelope-card:hover {
  border-color: rgba(216, 188, 152, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(131, 34, 50, 0.3);
}

.envelope-seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #a3384a, #5c1422);
  border: 1px solid rgba(216, 188, 152, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: transform 0.3s ease;
}

.envelope-card:hover .envelope-seal {
  transform: scale(1.1);
}

.note-expanded-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.envelope-card.opened .note-expanded-content {
  max-height: 400px;
  opacity: 1;
}

/* Wax Seal Stamp on Final Letter */
.wax-seal-stamp {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #b91c1c 0%, #881337 60%, #450a0a 100%);
  border: 2px solid rgba(216, 188, 152, 0.5);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7), inset 0 2px 5px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s ease;
  user-select: none;
}

.wax-seal-stamp:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 30px rgba(185, 28, 28, 0.5);
}

.wax-seal-stamp.broken {
  opacity: 0.2;
  transform: scale(0.8) rotate(15deg);
  pointer-events: none;
}

/* Parchment Inset Letter */
.parchment-letter {
  background: #fbf7f0;
  color: #2b1c18;
  border: 1px solid #ebd9c5;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  position: relative;
}

.parchment-letter::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(179, 137, 95, 0.2);
  pointer-events: none;
}

/* Commitment Items */
.vow-item {
  cursor: pointer;
  transition: all 0.3s ease;
}

.vow-item:hover {
  border-color: rgba(216, 188, 152, 0.4);
  background: rgba(255, 255, 255, 0.04);
}

.vow-item.active {
  border-color: rgba(216, 188, 152, 0.6);
  background: rgba(131, 34, 50, 0.15);
}

/* Floating Heart Spawner */
.floating-heart {
  position: fixed;
  pointer-events: none;
  font-size: 20px;
  z-index: 999;
  animation: floatHeart 1.8s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}

@keyframes floatHeart {
  0% {
    transform: translateY(0) scale(0.6) rotate(0deg);
    opacity: 0.9;
  }

  50% {
    transform: translateY(-70px) scale(1.2) rotate(10deg);
    opacity: 1;
  }

  100% {
    transform: translateY(-150px) scale(0.8) rotate(-10deg);
    opacity: 0;
  }
}

/* Scroll Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Ambient Audio Pill */
.audio-floating-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 80;
  background: rgba(18, 11, 16, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(216, 188, 152, 0.25);
  border-radius: 9999px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.audio-floating-pill:hover {
  border-color: rgba(216, 188, 152, 0.5);
  transform: scale(1.04);
}

.soundwave-bar {
  width: 2.5px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
  transform-origin: bottom center;
}

.playing .soundwave-bar:nth-child(1) {
  animation: wavePulse 0.9s ease-in-out infinite alternate;
}

.playing .soundwave-bar:nth-child(2) {
  animation: wavePulse 0.7s ease-in-out 0.2s infinite alternate;
}

.playing .soundwave-bar:nth-child(3) {
  animation: wavePulse 1.1s ease-in-out 0.4s infinite alternate;
}

@keyframes wavePulse {
  0% {
    transform: scaleY(0.2);
  }

  100% {
    transform: scaleY(1.2);
  }
}

/* ========================================== */
/* Voice Notes Experience — Bespoke Audio Player */
/* ========================================== */
.voice-note-card {
  background: radial-gradient(circle at 15% 20%, rgba(55, 14, 28, 0.45) 0%, rgba(18, 10, 16, 0.75) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(216, 188, 152, 0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.voice-note-card:hover {
  border-color: rgba(216, 188, 152, 0.45);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(131, 34, 50, 0.2);
}

.voice-note-card.is-active {
  border-color: rgba(216, 188, 152, 0.65);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 45px rgba(216, 188, 152, 0.2);
}

.voice-ambient-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(216, 188, 152, 0.22) 0%, rgba(131, 34, 50, 0.12) 50%, rgba(0, 0, 0, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.voice-note-card.is-active .voice-ambient-glow {
  opacity: 1;
  animation: ambientBreathe 3s ease-in-out infinite alternate;
}

@keyframes ambientBreathe {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 1; }
}

.play-circle-btn {
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2b111a 0%, #170910 100%);
  border: 1.5px solid rgba(216, 188, 152, 0.4);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.play-circle-btn:hover {
  transform: scale(1.08);
  border-color: var(--gold);
  background: linear-gradient(135deg, #421626 0%, #220b16 100%);
  box-shadow: 0 0 25px rgba(216, 188, 152, 0.35);
}

.voice-note-card.is-active .play-circle-btn {
  border-color: #ffd299;
  background: linear-gradient(135deg, #501b2f 0%, #2c0e1c 100%);
  box-shadow: 0 0 30px rgba(216, 188, 152, 0.5);
}

/* Dynamic Waveform Visualizer */
.waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 38px;
  cursor: pointer;
  padding: 4px 0;
}

.wf-bar {
  flex: 1;
  background: rgba(216, 188, 152, 0.22);
  border-radius: 99px;
  transition: background 0.2s ease, transform 0.2s ease;
  min-height: 4px;
}

.wf-bar.active {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(216, 188, 152, 0.5);
}

.voice-note-card.is-active .wf-bar.animating {
  animation: wfPulse 1.2s ease-in-out infinite alternate;
}

@keyframes wfPulse {
  0% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.35); }
  100% { transform: scaleY(0.65); }
}

/* Scrub line */
.scrub-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  cursor: pointer;
}

.scrub-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #d8bc98 0%, #ffd8a8 100%);
  border-radius: 99px;
  width: 0%;
  transition: width 0.1s linear;
}

.scrub-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  background: #fff;
  border: 2px solid #d8bc98;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(216, 188, 152, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.scrub-track:hover .scrub-handle,
.voice-note-card.is-active .scrub-handle {
  opacity: 1;
}

/* Transcript Drawer */
.transcript-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
}

.transcript-drawer.open {
  max-height: 350px;
  opacity: 1;
}


/* ========================================== */
/* Voice Notes Experience — Bespoke Audio Player */
/* ========================================== */
.voice-note-card {
  background: radial-gradient(circle at 15% 20%, rgba(55, 14, 28, 0.45) 0%, rgba(18, 10, 16, 0.75) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(216, 188, 152, 0.2);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.voice-note-card:hover {
  border-color: rgba(216, 188, 152, 0.45);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(131, 34, 50, 0.2);
}

.voice-note-card.is-active {
  border-color: rgba(216, 188, 152, 0.65);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 45px rgba(216, 188, 152, 0.2);
}

.voice-ambient-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(216, 188, 152, 0.22) 0%, rgba(131, 34, 50, 0.12) 50%, rgba(0, 0, 0, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.voice-note-card.is-active .voice-ambient-glow {
  opacity: 1;
  animation: ambientBreathe 3s ease-in-out infinite alternate;
}

@keyframes ambientBreathe {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 1; }
}

.play-circle-btn {
  width: 58px;
  height: 58px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2b111a 0%, #170910 100%);
  border: 1.5px solid rgba(216, 188, 152, 0.4);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.play-circle-btn:hover {
  transform: scale(1.08);
  border-color: var(--gold);
  background: linear-gradient(135deg, #421626 0%, #220b16 100%);
  box-shadow: 0 0 25px rgba(216, 188, 152, 0.35);
}

.voice-note-card.is-active .play-circle-btn {
  border-color: #ffd299;
  background: linear-gradient(135deg, #501b2f 0%, #2c0e1c 100%);
  box-shadow: 0 0 30px rgba(216, 188, 152, 0.5);
}

/* Dynamic Waveform Visualizer */
.waveform-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 38px;
  cursor: pointer;
  padding: 4px 0;
}

.wf-bar {
  flex: 1;
  background: rgba(216, 188, 152, 0.22);
  border-radius: 99px;
  transition: background 0.2s ease, transform 0.2s ease;
  min-height: 4px;
}

.wf-bar.active {
  background: var(--gold);
  box-shadow: 0 0 6px rgba(216, 188, 152, 0.5);
}

.voice-note-card.is-active .wf-bar.animating {
  animation: wfPulse 1.2s ease-in-out infinite alternate;
}

@keyframes wfPulse {
  0% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.35); }
  100% { transform: scaleY(0.65); }
}

/* Scrub line */
.scrub-track {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  cursor: pointer;
}

.scrub-progress {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #d8bc98 0%, #ffd8a8 100%);
  border-radius: 99px;
  width: 0%;
  transition: width 0.1s linear;
}

.scrub-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 11px;
  height: 11px;
  background: #fff;
  border: 2px solid #d8bc98;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(216, 188, 152, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.scrub-track:hover .scrub-handle,
.voice-note-card.is-active .scrub-handle {
  opacity: 1;
}

/* Transcript Drawer */
.transcript-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  opacity: 0;
}

.transcript-drawer.open {
  max-height: 350px;
  opacity: 1;
}