/* Palette */
:root {
  --paper: #f8f4ec;
  --paper-shadow: #e1d9c7;
  --ink: #2f2a2a;
  --accent: #ff7f50;
  --accent-soft: #ffd9c7;
  --accent-2: #6c9bbd;
  --tape: #d9e0e5;
  --postit-yellow: #ffeaa7;
  --postit-pink: #ffd6e8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #fdfaf5, #f0e6d6 60%, #e5dac5);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }

.valentine-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
  z-index: 200;
}
.valentine-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}
.valentine-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,127,80,0.28), transparent 45%),
              radial-gradient(circle at 70% 70%, rgba(108,155,189,0.24), transparent 45%),
              rgba(0,0,0,0.08);
  backdrop-filter: blur(12px) saturate(120%);
  opacity: 0.82;
}
.valentine-card {
  position: relative;
  max-width: 520px;
  width: min(90vw, 520px);
  background: linear-gradient(160deg, #fffdf8, #fff3eb);
  border-radius: 22px;
  padding: 1.8rem 1.6rem 1.6rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.18), 0 10px 26px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.06);
  text-align: center;
  overflow: hidden;
  transform: scale(0.96);
  animation: popIn 0.55s ease forwards;
}
.valentine-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.valentine-particles span {
  position: absolute;
  font-size: 1.3rem;
  color: rgba(255,127,80,0.9);
  animation: floaty 5s ease-in-out infinite;
}
.valentine-particles span:nth-child(2){ color: #d16ba5; left: 18%; top: 16%; animation-duration: 6s; }
.valentine-particles span:nth-child(3){ color: #f4b400; left: 70%; top: 12%; animation-duration: 5.5s; }
.valentine-particles span:nth-child(4){ color: #6c9bbd; left: 12%; top: 70%; animation-duration: 6.5s; }
.valentine-particles span:nth-child(5){ color: #c07cf2; left: 78%; top: 68%; animation-duration: 6.2s; }
.valentine-particles span:nth-child(6){ color: #5cbecf; left: 44%; top: 82%; animation-duration: 5.8s; }
.val-pretitle {
  margin: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: rgba(0,0,0,0.6);
}
.val-question {
  margin: 0.8rem 0 1.2rem;
  font-family: 'Shadows Into Light', cursive;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: #2f2a2a;
}
.val-actions {
  display: inline-flex;
  gap: 0.8rem;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 60px;
}
.val-btn {
  border: none;
  cursor: pointer;
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Quicksand', sans-serif;
  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.val-btn.yes { background: linear-gradient(120deg, #ff9f80, #ff7f50); color: #2f2a2a; }
.val-btn.no { background: #fff; color: #2f2a2a; border: 1px dashed rgba(0,0,0,0.12); }
.val-btn:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(0,0,0,0.12); }
.val-btn.pulse { transform: scale(1.08); }
.val-btn.grow {
  transform: scale(1.18);
  box-shadow: 0 14px 28px rgba(255,127,80,0.35);
}
.val-btn.wiggle { animation: wiggle 0.45s ease; }
.val-foot {
  margin: 0.9rem 0 0;
  color: rgba(0,0,0,0.65);
  font-size: 0.95rem;
}
.valentine-overlay.is-closing { opacity: 0; }

@keyframes popIn { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes floaty { 0%{ transform: translateY(0); opacity: 0.7; } 50%{ transform: translateY(-14px); opacity: 1; } 100%{ transform: translateY(0); opacity: 0.7; } }
@keyframes wiggle { 0%,100%{ transform: translate(0,0) rotate(0deg); } 25%{ transform: translate(6px,-4px) rotate(3deg); } 50%{ transform: translate(-4px,4px) rotate(-3deg); } 75%{ transform: translate(4px,-2px) rotate(2deg); } }

.valentine-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 190;
}
.valentine-confetti span {
  position: absolute;
  top: -10%;
  left: var(--x);
  font-size: 1.4rem;
  animation: confetti-fall var(--duration) ease-in forwards;
  animation-delay: var(--delay);
  color: #ff7f50;
}
.valentine-confetti span:nth-child(2n) { color: #d16ba5; }
.valentine-confetti span:nth-child(3n) { color: #6c9bbd; }
.valentine-confetti span:nth-child(5n) { color: #f4b400; }

@keyframes confetti-fall {
  0% { transform: translate3d(-10px, -20px, 0) rotate(0deg) scale(1); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate3d(20px, 110vh, 0) rotate(calc(var(--spin) * 220deg)) scale(0.9); opacity: 0; }
}

.paper-grain {
  position: fixed;
  inset: 0;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="140" height="140" viewBox="0 0 140 140"%3E%3Crect fill="%23f8f4ec" width="140" height="140"/%3E%3Cg fill="%23d9d0c0" fill-opacity="0.2"%3E%3Ccircle cx="10" cy="10" r="1"/%3E%3Ccircle cx="90" cy="40" r="1"/%3E%3Ccircle cx="60" cy="90" r="1"/%3E%3Ccircle cx="120" cy="120" r="1"/%3E%3Ccircle cx="30" cy="70" r="1"/%3E%3C/g%3E%3C/svg%3E');
  mix-blend-mode: multiply;
  opacity: 0.55;
  pointer-events: none;
  z-index: -2;
}

.extra-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}
.topbar-actions { display: flex; align-items: center; gap: 0.65rem; }
.extra-topbar .back-btn {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border: 1px dashed rgba(0,0,0,0.2);
  border-radius: 10px;
  background: rgba(255,255,255,0.8);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}
.extra-topbar .back-btn:active { transform: translateY(1px); }
.topbar-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255,127,80,0.18), rgba(108,155,189,0.18));
  border: 1px solid rgba(0,0,0,0.06);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
.topbar-heart { font-size: 1.2rem; color: var(--accent); }
.audio-control {
  position: relative;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  background: rgba(255,255,255,0.65);
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
}
.vinyl {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(#1f1a17 40%, #2f2a2a 41%, #1f1a17 60%, #0f0c0c 61%);
  border: 3px solid var(--accent);
  animation: spin 5s linear infinite;
  box-shadow: 0 0 12px rgba(255,127,80,0.35);
}
.vinyl.paused { animation-play-state: paused; filter: grayscale(0.7) brightness(0.7); box-shadow: none; }
.audio-visualizer { display: flex; align-items: flex-end; gap: 2px; height: 26px; }
.freq-bar {
  width: 3px;
  height: 22px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 1px;
  transform-origin: center bottom;
  animation: audioViz 0.9s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(255,127,80,0.35);
}
.freq-bar:nth-child(2){ animation-delay: .1s; }
.freq-bar:nth-child(3){ animation-delay: .2s; }
.freq-bar:nth-child(4){ animation-delay: .3s; }
.freq-bar:nth-child(5){ animation-delay: .4s; }
.freq-bar.paused { animation: none; transform: scaleY(0.091); opacity: 0.45; }
.audio-hint {
  font-size: 0.78rem;
  color: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.audio-hint .arrow { font-size: 1rem; opacity: 0.8; }

.cover {
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}
.cover h1 {
  margin: 0.4rem 0;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-family: 'Shadows Into Light', cursive;
  letter-spacing: 0.05em;
}
.cover .eyebrow {
  margin: 0;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: rgba(0,0,0,0.55);
}
.cover-note {
  margin: 0.2rem 0 0;
  color: rgba(0,0,0,0.7);
}
.tape {
  position: absolute;
  width: 120px;
  height: 28px;
  background: var(--tape);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  opacity: 0.8;
  transform: rotate(-5deg);
}
.tape-left { left: 16%; top: 16px; }
.tape-right { right: 16%; top: 12px; transform: rotate(6deg); }

.notebook-shell {
  max-width: 1100px;
  margin: 1.5rem auto 5rem;
  padding: 0 1rem 4rem;
  position: relative;
}
.spiral {
  position: absolute;
  left: 50%;
  top: 0;
  width: 12px;
  height: 100%;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.12) 0,
    rgba(0,0,0,0.12) 14px,
    rgba(0,0,0,0.02) 14px,
    rgba(0,0,0,0.02) 40px
  );
  transform: translateX(-50%);
  filter: drop-shadow(0 0 4px rgba(0,0,0,0.08));
  pointer-events: none;
}
.page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.page {
  background: var(--paper);
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05);
  padding: 1.6rem 1.6rem 1.8rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}
.page-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 24px,
    rgba(0,0,0,0.05) 24px,
    rgba(0,0,0,0.05) 25px
  );
  z-index: 0;
}
.page-hole {
  position: absolute;
  top: 22px;
  left: -6px;
  width: 14px;
  height: 14px;
  background: #f2ede2;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,0.8), 0 0 0 4px #f8f4ec;
}
.page h2 { margin-top: 0; }
.page-text p { position: relative; z-index: 1; }

.doodle-cluster {
  position: absolute;
  display: flex;
  gap: 0.35rem;
  font-size: 1.1rem;
  opacity: 0.55;
  color: var(--accent);
  z-index: 0;
  pointer-events: none;
}
.doodle-cluster.left { top: 12px; left: 12px; transform: rotate(-8deg); }
.doodle-cluster.right { top: 10px; right: 14px; transform: rotate(6deg); }
.doodle-cluster span { display: inline-block; }
.d-heart { color: #ff7f50; }
.d-flower { color: #d16ba5; }
.d-sparkle { color: #6c9bbd; }
.d-star { color: #f4b400; }
.d-rain { color: #5cbecf; transform: translateY(2px); }
.d-swirl { color: #c07cf2; }

.marker-title {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  background: linear-gradient(120deg, rgba(255,127,80,0.28), rgba(108,155,189,0.22));
  border-radius: 10px;
  margin: 0 0 0.6rem 0;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.handwrite {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  line-height: 1.5;
  margin: 0.35rem 0 0.1rem;
  letter-spacing: 0.02em;
}
.highlight {
  background: linear-gradient(180deg, rgba(255,214,200,0.9), rgba(255,214,200,0.25));
  padding: 0.05rem 0.25rem;
  border-radius: 6px;
}
.ink-heart { color: var(--accent); font-weight: 700; }
.signature {
  margin-top: 1.3rem;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.1rem;
  color: rgba(0,0,0,0.7);
}

.sticky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin: 1.3rem 0 0.8rem;
  position: relative;
  z-index: 1;
}
.sticky {
  padding: 0.9rem 1rem 1.1rem;
  border-radius: 12px;
  box-shadow: 0 12px 22px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
}
.sticky h3 { margin: 0 0 0.35rem 0; font-family: 'Shadows Into Light', cursive; }
.sticky ul { margin: 0; padding-left: 1rem; line-height: 1.4; }
.soft-yellow { background: var(--postit-yellow); }
.soft-pink { background: var(--postit-pink); }
.sticky::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 18px;
  width: 70px;
  height: 16px;
  background: var(--tape);
  opacity: 0.75;
  transform: rotate(-4deg);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

.page-polaroids {
  min-height: 520px;
  background: linear-gradient(180deg, #f8f4ec, #f2ecdf);
  padding-top: 2.8rem;
}
.polaroid-note {
  margin: 0.15rem 0 0.2rem;
  padding: 0 0.3rem;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #2f2a2a;
  display: none;
}
.polaroid-board {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.6rem;
  padding-top: 1.2rem;
}
.polaroid-board.first-page {
  align-content: end;
  min-height: 280px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  padding-top: 0.25rem;
  margin-top: 0.25rem;
  gap: 0.65rem;
}
.polaroid-board.second-page {
  align-content: start;
  min-height: 320px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  padding-top: 0.6rem;
}
.polaroid-board.scrap-page {
  align-content: start;
  min-height: 360px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  padding-top: 0.4rem;
}
.polaroid {
  background: #fff;
  padding: 0.65rem 0.65rem 0.9rem;
  border-radius: 12px;
  box-shadow: 0 16px 28px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.05);
  transform: translateX(var(--offset-x, 0)) rotate(var(--rot, 0deg));
  opacity: 0;
  animation: drop 0.6s ease forwards;
  animation-delay: var(--delay, 0ms);
  position: relative;
}
.polaroid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.polaroid p {
  margin: 0.45rem 0 0;
  font-family: 'Caveat', cursive;
  font-size: 1.05rem;
  text-align: center;
}
.polaroid-pin {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: linear-gradient(180deg, #fefefe, #c3c3c3);
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.8), 0 6px 12px rgba(0,0,0,0.18);
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-18px) translateX(var(--offset-x,0)) rotate(calc(var(--rot,0deg) - 4deg)); }
  to { opacity: 1; transform: translateY(0) translateX(var(--offset-x,0)) rotate(var(--rot,0deg)); }
}

.postit-corner {
  position: absolute;
  right: 6px;
  top: -6px;
  background: #fff7d6;
  padding: 0.95rem 1.1rem;
  border-radius: 12px;
  font-family: 'Shadows Into Light', cursive;
  font-size: 1.05rem;
  box-shadow: 0 14px 24px rgba(0,0,0,0.1);
  transform: rotate(3deg);
  border: 1px solid rgba(0,0,0,0.06);
  max-width: 230px;
}
.doodle {
  position: absolute;
  bottom: 14px;
  right: 18px;
  font-size: 1.4rem;
  color: rgba(0,0,0,0.3);
}

.polaroid-controls {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  position: relative;
  z-index: 2;
}
.polaroid-btn {
  border: none;
  background: linear-gradient(120deg, rgba(255,127,80,0.18), rgba(108,155,189,0.18));
  color: var(--ink);
  font-size: 1.1rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.polaroid-btn:active { transform: translateY(1px); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.polaroid-page { font-weight: 700; letter-spacing: 0.04em; }

.scrap-card {
  background: #fffbe6;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 10px 18px rgba(0,0,0,0.08);
  position: relative;
  font-family: 'Caveat', cursive;
  color: #2f2a2a;
}
.scrap-card::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 12px;
  width: 70px;
  height: 16px;
  background: var(--tape);
  opacity: 0.75;
  transform: rotate(-4deg);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}
.scrap-title {
  margin: 0 0 0.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}
.scrap-text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.5;
}

.photo-strip {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 0.8rem 0.9rem 0.95rem;
  box-shadow: 0 12px 20px rgba(0,0,0,0.08);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  position: relative;
}
.strip-tape {
  position: absolute;
  top: -10px;
  left: 14px;
  width: 70px;
  height: 16px;
  background: var(--tape);
  opacity: 0.8;
  transform: rotate(-6deg);
  box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}
.strip-tape.right {
  left: auto;
  right: 18px;
  transform: rotate(5deg);
}
.mini-polaroid {
  background: #fffef9;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 10px;
  padding: 0.45rem 0.45rem 0.6rem;
  box-shadow: 0 10px 16px rgba(0,0,0,0.08);
  transform: rotate(var(--rot, 0deg));
  opacity: 0;
  animation: drop 0.5s ease forwards;
  animation-delay: var(--delay, 0ms);
}
.mini-polaroid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}
.mini-polaroid span {
  display: block;
  margin-top: 0.35rem;
  font-family: 'Caveat', cursive;
  font-size: 0.95rem;
  text-align: center;
}

.letter-card {
  background: linear-gradient(160deg, #fffdf7, #fdf7e8);
  border: 1px dashed rgba(0,0,0,0.12);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.2rem;
  box-shadow: 0 14px 24px rgba(0,0,0,0.1);
  position: relative;
  font-family: 'Caveat', cursive;
  color: #2f2a2a;
}
.letter-stamp {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 1.2rem;
}
.letter-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.letter-text {
  margin: 0.1rem 0;
  font-size: 1.02rem;
  line-height: 1.5;
}
.letter-sign {
  margin-top: 0.5rem;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 700;
}

@keyframes audioViz { 0%,100% { transform: scaleY(0.182); } 50% { transform: scaleY(1); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.extra-footer {
  text-align: center;
  padding: 2rem 1rem 5rem;
  color: rgba(0,0,0,0.65);
  font-family: 'Shadows Into Light', cursive;
}

@media (max-width: 880px) {
  .page-grid { grid-template-columns: 1fr; }
  .spiral { display: none; }
}

@media (max-width: 540px) {
  .cover { padding: 2.2rem 1rem 1.2rem; }
  .page { padding: 1.35rem; }
  .polaroid img { height: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
