/* ============================================
   THEME — clean, lovely, with maroon as accent
   ============================================ */
:root {
  --bg: #fdf6f4;
  --bg-2: #f7e6e3;
  --cream: #fffaf7;
  --maroon: #5a1a2c;
  --maroon-deep: #3d0f1e;
  --maroon-soft: #84304a;
  --rose: #d28a99;
  --blush: #f4cfd2;
  --gold: #c9a26b;
  --ink: #2a1820;
  --muted: #8a6c75;

  --shadow-soft: 0 20px 50px -25px rgba(90, 26, 44, 0.25);
  --shadow-card: 0 30px 60px -30px rgba(90, 26, 44, 0.35);

  --radius: 22px;
  --radius-lg: 32px;

  --serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --serif-soft: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --script: "Dancing Script", cursive;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

.cursive {
  font-family: var(--script);
  font-weight: 600;
  color: var(--maroon);
  font-style: normal;
}

.cursive-mix {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
}

/* ============================================
   SCREENS — game vs main
   ============================================ */
.screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.screen.is-leaving {
  pointer-events: none;
  animation: fadeOut 1.2s ease forwards;
}

.screen.is-gone {
  display: none;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: scale(1.04);
  }
}

/* ============================================
   GAME SCREEN
   ============================================ */
.game-screen {
  background: linear-gradient(160deg, #fff5f1 0%, #f9e1de 55%, #efc7c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.game-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: blob-float 18s ease-in-out infinite;
}

.blob-1 {
  width: 460px;
  height: 460px;
  top: -120px;
  left: -120px;
  background: radial-gradient(circle at 30% 30%, #f8c3c3, transparent 70%);
}
.blob-2 {
  width: 380px;
  height: 380px;
  bottom: -100px;
  right: -80px;
  background: radial-gradient(circle at 60% 60%, #e8a5b2, transparent 70%);
  animation-delay: -6s;
}
.blob-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  right: 30%;
  background: radial-gradient(circle, #c97987, transparent 70%);
  opacity: 0.3;
  animation-delay: -12s;
}

@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.08); }
}

.game-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 12px;
  max-width: 560px;
  width: 100%;
  margin: auto;
}

.game-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--maroon-soft);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.2s forwards;
}

.game-title {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--maroon-deep);
  font-size: clamp(34px, 7vw, 56px);
  line-height: 1.05;
  letter-spacing: -1px;
  opacity: 0;
  animation: fadeUp 0.9s ease 0.4s forwards;
}

.game-title .cursive {
  font-size: 1.18em;
  margin-left: 4px;
}

.game-sub {
  margin-top: 10px;
  font-size: clamp(13px, 1.5vw, 16px);
  color: var(--maroon-soft);
  opacity: 0;
  animation: fadeUp 0.9s ease 0.6s forwards;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--serif);
  font-style: italic;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* GAME STATS */
.game-stats {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  margin: 22px auto 0;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  border: 1px solid rgba(90, 26, 44, 0.08);
  box-shadow: 0 10px 30px -18px rgba(90, 26, 44, 0.4);
  opacity: 0;
  animation: fadeUp 0.9s ease 0.8s forwards;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.stat-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--maroon-soft);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--maroon-deep);
  letter-spacing: -0.5px;
}

.stat-total {
  color: var(--rose);
  font-weight: 400;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: rgba(90, 26, 44, 0.18);
}

/* CARDS GRID */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 460px;
  margin: 22px auto 0;
  padding: 6px;
  opacity: 0;
  animation: fadeUp 0.9s ease 1s forwards;
}

.game-hint {
  margin-top: 18px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--maroon-soft);
  opacity: 0;
  animation: fadeUp 0.9s ease 1.2s forwards, hint-pulse 2.6s ease-in-out 2s infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* MEMORY CARDS */
.card {
  position: relative;
  aspect-ratio: 1 / 1;
  perspective: 900px;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 16px;
}

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

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px -14px rgba(90, 26, 44, 0.35);
  overflow: hidden;
}

.card-back {
  background:
    radial-gradient(circle at 30% 25%, rgba(244, 207, 210, 0.3), transparent 60%),
    linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%);
  color: var(--blush);
  position: relative;
}

.card-back::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px dashed rgba(244, 207, 210, 0.35);
  border-radius: 11px;
  pointer-events: none;
}

.card-back-mark {
  font-family: var(--script);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.card-front {
  background: linear-gradient(135deg, var(--cream) 0%, #fbe6e1 100%);
  color: var(--maroon);
  transform: rotateY(180deg);
}

.card-front svg {
  width: 52%;
  height: 52%;
  filter: drop-shadow(0 3px 6px rgba(90, 26, 44, 0.18));
}

.card.matched .card-front {
  background: linear-gradient(135deg, #fde2e2 0%, var(--blush) 100%);
  box-shadow:
    0 0 0 2px var(--rose),
    0 14px 30px -10px rgba(210, 138, 153, 0.7);
  animation: matched-glow 1.4s ease infinite;
}

.card.matched .card-front svg {
  animation: matched-bounce 0.8s ease;
}

@keyframes matched-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--rose), 0 14px 30px -10px rgba(210, 138, 153, 0.6); }
  50%      { box-shadow: 0 0 0 2px var(--maroon), 0 16px 36px -10px rgba(90, 26, 44, 0.5); }
}

@keyframes matched-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.25); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}

.card.shake .card-inner {
  animation: shake-card 0.45s ease;
}

@keyframes shake-card {
  0%, 100% { transform: rotateY(180deg) translateX(0); }
  20%      { transform: rotateY(180deg) translateX(-6px); }
  40%      { transform: rotateY(180deg) translateX(6px); }
  60%      { transform: rotateY(180deg) translateX(-4px); }
  80%      { transform: rotateY(180deg) translateX(4px); }
}

/* ============================================
   REVEAL VEIL
   ============================================ */
.reveal-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: linear-gradient(160deg, var(--maroon-deep), var(--maroon));
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.reveal-veil.show {
  opacity: 1;
  pointer-events: auto;
}

.reveal-veil.fading {
  animation: veil-out 1.4s ease forwards;
}

@keyframes veil-out {
  0%   { opacity: 1; }
  100% { opacity: 0; transform: scale(1.05); }
}

.veil-message {
  text-align: center;
  color: var(--cream);
  padding: 24px;
  transform: translateY(10px);
  opacity: 0;
  animation: fadeUp 1s ease 0.2s forwards;
}

.veil-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--blush);
  margin-bottom: 14px;
}

.veil-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
}

.veil-title .cursive {
  color: var(--blush);
  font-size: 1.2em;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease;
}

.main-content.is-visible {
  opacity: 1;
  visibility: visible;
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.container.narrow {
  max-width: 720px;
}

.center {
  text-align: center;
}

/* HERO */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(244, 207, 210, 0.6), transparent 60%),
    radial-gradient(circle at 80% 60%, rgba(210, 138, 153, 0.35), transparent 60%),
    var(--cream);
  padding: 80px 24px;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 820px;
}

.eyebrow {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--maroon-soft);
  margin-bottom: 22px;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(48px, 9vw, 110px);
  line-height: 1;
  letter-spacing: -2px;
  color: var(--maroon-deep);
}

.hero-comma {
  color: var(--rose);
}

.hero-name {
  font-size: 1.25em;
  display: inline-block;
  margin-top: 8px;
}

.hero-sub {
  margin-top: 28px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 1.8vw, 19px);
  color: var(--maroon-soft);
}

.scroll-cue {
  position: absolute;
  bottom: 38px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.scroll-cue span {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--maroon-soft);
  border-bottom: 2px solid var(--maroon-soft);
  transform: rotate(45deg);
  opacity: 0;
  animation: scroll-bounce 1.8s ease-in-out infinite;
}
.scroll-cue span:nth-child(2) { animation-delay: 0.2s; }
.scroll-cue span:nth-child(3) { animation-delay: 0.4s; }

@keyframes scroll-bounce {
  0%   { opacity: 0; transform: rotate(45deg) translate(-6px, -6px); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: rotate(45deg) translate(6px, 6px); }
}

/* SECTIONS */
.section {
  padding: 110px 0;
  position: relative;
}

.letter-section {
  background:
    radial-gradient(ellipse at top, rgba(244, 207, 210, 0.4), transparent 60%),
    var(--bg);
}

.story-section {
  background: linear-gradient(180deg, var(--bg) 0%, #fbece9 100%);
}

.dreams-section {
  background:
    radial-gradient(circle at 50% 0%, rgba(210, 138, 153, 0.25), transparent 60%),
    #fbece9;
}

.final-section {
  padding: 130px 0 80px;
  background: linear-gradient(180deg, #fbece9 0%, var(--bg-2) 100%);
}

.section-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--rose);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.2;
  color: var(--maroon-deep);
  letter-spacing: -0.5px;
  margin-bottom: 36px;
  max-width: 24ch;
}

.section-title.cursive-mix {
  font-style: italic;
}

/* LETTER */
.letter-body p {
  font-family: var(--serif-soft);
  font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 28px;
  font-weight: 400;
}

.letter-signoff {
  margin-top: 40px !important;
  font-family: var(--script) !important;
  font-style: normal !important;
  font-size: clamp(22px, 3vw, 30px) !important;
  color: var(--maroon) !important;
  font-weight: 600 !important;
  text-align: center;
  line-height: 1.4 !important;
}

/* CARDS (the soft content cards, not memory game) */
.card-soft {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(90, 26, 44, 0.06);
  position: relative;
}

.card-soft::before {
  content: "❝";
  position: absolute;
  top: 12px;
  left: 24px;
  font-family: var(--serif);
  font-size: 64px;
  color: var(--blush);
  line-height: 1;
  opacity: 0.7;
}

.card-soft p {
  font-family: var(--serif-soft);
  font-size: clamp(17px, 1.9vw, 20px);
  line-height: 1.85;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.card-soft.dreamy {
  background: linear-gradient(135deg, var(--cream), #fdeae5);
}

.card-soft.long p + p {
  margin-top: 22px;
}

/* ============================================
   INSTAGRAM SECTION
   ============================================ */
.ig-section {
  padding: 90px 0 100px;
  background: linear-gradient(180deg, #fbece9 0%, #fdf2ee 100%);
}

.ig-title {
  margin: 0 auto 18px;
  text-align: center;
  max-width: none;
}

.ig-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 1.7vw, 17px);
  color: var(--maroon-soft);
  margin-bottom: 36px;
}

.ig-card {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 16px 26px 16px 16px;
  background: var(--cream);
  border-radius: 22px;
  box-shadow: 0 22px 50px -22px rgba(90, 26, 44, 0.35);
  border: 1px solid rgba(90, 26, 44, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: var(--ink);
  max-width: 100%;
}

.ig-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 32px 60px -22px rgba(90, 26, 44, 0.5);
}

.ig-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%);
  box-shadow: 0 12px 28px -10px rgba(220, 39, 67, 0.55);
  flex-shrink: 0;
}

.ig-icon svg {
  width: 30px;
  height: 30px;
  color: #fff;
}

.ig-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
  min-width: 0;
}

.ig-handle {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--maroon-deep);
  font-weight: 500;
  letter-spacing: -0.3px;
}

.ig-cta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11px;
  color: var(--maroon-soft);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: 4px;
}

.ig-arrow {
  font-size: 22px;
  color: var(--maroon-soft);
  transition: transform 0.3s ease, color 0.3s ease;
  margin-left: 4px;
}

.ig-card:hover .ig-arrow {
  transform: translateX(6px);
  color: var(--maroon);
}

/* STORY */
.story-body p {
  font-family: var(--serif-soft);
  font-size: clamp(17px, 1.9vw, 21px);
  line-height: 1.85;
  margin-bottom: 26px;
  color: var(--ink);
}

/* DIVIDER */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 0;
  background: var(--bg);
}

.divider-heart {
  font-size: 22px;
  color: var(--rose);
  position: relative;
  display: inline-block;
  padding: 0 18px;
}

.divider-heart::before,
.divider-heart::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 70px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
}
.divider-heart::before { right: 100%; }
.divider-heart::after  { left: 100%; }

/* FINAL */
.final-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.1;
  color: var(--maroon-deep);
  letter-spacing: -1px;
  margin-bottom: 22px;
}

.final-title .cursive {
  font-size: 1.3em;
}

.final-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 2vw, 22px);
  color: var(--maroon-soft);
  margin-bottom: 40px;
}

.confetti-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 34px;
  background: var(--maroon);
  color: var(--cream);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 18px 35px -15px rgba(90, 26, 44, 0.55);
}

.confetti-btn:hover {
  transform: translateY(-3px);
  background: var(--maroon-deep);
  box-shadow: 0 24px 40px -15px rgba(90, 26, 44, 0.7);
}

.confetti-btn:active { transform: translateY(0); }

/* FOOTER */
.footer {
  text-align: center;
  padding: 40px 24px 60px;
  background: var(--bg-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--maroon-soft);
  letter-spacing: 1px;
}

/* ============================================
   AMBIENT FLOATING HEARTS (post-reveal)
   ============================================ */
.ambient-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.ambient-hearts.on { opacity: 1; }

.ambient-heart {
  position: absolute;
  bottom: -40px;
  width: 18px;
  height: 18px;
  color: var(--rose);
  opacity: 0;
  animation: ambient-rise linear forwards;
}

.ambient-heart svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 6px rgba(90, 26, 44, 0.18));
}

@keyframes ambient-rise {
  0%   { transform: translateY(0) rotate(0); opacity: 0; }
  10%  { opacity: 0.55; }
  90%  { opacity: 0.55; }
  100% { transform: translateY(-110vh) rotate(20deg); opacity: 0; }
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

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

/* ============================================
   CONFETTI BURSTS
   ============================================ */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 14px;
  pointer-events: none;
  z-index: 999;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--cx), 110vh) rotate(720deg); opacity: 0; }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 720px) {
  .section { padding: 80px 0; }
  .container { padding: 0 22px; }
  .card-soft { padding: 34px 24px; }
  .card-soft::before { font-size: 50px; left: 18px; }
  .scroll-cue { display: none; }
  .hero { padding: 60px 22px; }
  .letter-signoff { font-size: 26px !important; }
  .divider-heart::before,
  .divider-heart::after { width: 50px; }
}

@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 320px;
    gap: 10px;
  }
  .game-content { padding: 8px; }
  .game-stats {
    gap: 16px;
    padding: 8px 18px;
  }
  .stat-value { font-size: 18px; }
  .card-back-mark { font-size: 24px; }

  .ig-card {
    padding: 14px 20px 14px 14px;
    gap: 14px;
  }
  .ig-icon { width: 48px; height: 48px; border-radius: 14px; }
  .ig-icon svg { width: 26px; height: 26px; }
  .ig-handle { font-size: 17px; }
  .ig-cta { font-size: 10px; letter-spacing: 1.6px; }
  .ig-section { padding: 70px 0 80px; }
}

@media (max-width: 360px) {
  .cards-grid {
    max-width: 280px;
    gap: 8px;
  }
}

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