/* Album - modern beige/creme theme */

:root {
  --bg-creme: #f5f0ea;
  --text-charcoal: #3a3530;
  --rose: #c9827a;
  --rose-light: #deb5ac;
  --rose-dark: #a0635c;
  --gold: #c8a97d;
  --cream: #fefcf7;
  --overlay: rgba(255, 252, 247, 0.95);
  --font-display: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-creme);
  color: var(--text-charcoal);
}

#app {
  height: 100%;
  position: relative;
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
}

.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ----- Password gate ----- */

.password-gate {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: var(--bg-creme);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-gate.hidden {
  display: none;
}

.password-content {
  text-align: center;
  padding: 2rem;
}

.password-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text-charcoal);
  margin: 0 0 2rem;
  line-height: 1.2;
}

.password-input {
  display: block;
  margin: 0 auto 1.25rem;
  padding: 0.6rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-charcoal);
  background: var(--cream);
  border: 1.5px solid var(--rose-light);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease;
}

.password-input:focus {
  border-color: var(--rose);
}

.password-error {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--rose-dark);
  font-weight: 600;
}

.password-error.hidden {
  display: none;
}

/* ----- Page 1: Prompt ----- */

.hearts-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  bottom: -1em;
  font-size: 1.2rem;
  color: var(--rose);
  opacity: 0.4;
  animation: floatHeart 15s linear infinite;
}

@keyframes floatHeart {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-100vh) translateX(10vw) rotate(360deg);
    opacity: 0;
  }
}

.prompt-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
}

.prompt-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--text-charcoal);
  margin: 0 0 2rem;
  line-height: 1.2;
}

.prompt-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  padding: 0.75rem 1.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-yes {
  background: var(--rose);
  color: var(--cream);
  font-size: 1.1rem;
  padding: 0.85rem 2rem;
  box-shadow: 0 2px 12px rgba(201, 130, 122, 0.4);
}

.btn-yes:hover {
  background: var(--rose-dark);
  box-shadow: 0 4px 16px rgba(201, 130, 122, 0.5);
}

.btn-no {
  background: transparent;
  color: var(--rose);
  border: 2px solid var(--rose-light);
}

.btn-no:hover {
  background: rgba(222, 181, 172, 0.2);
}

.no-message {
  position: fixed;
  font-size: 0.95rem;
  color: var(--rose-dark);
  white-space: nowrap;
  z-index: 15;
}

.confetti-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -20px;
  animation: confettiFall 2s ease-out forwards;
}

.confetti-piece.heart {
  width: 20px;
  height: 20px;
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ----- Overlays: sad, no-choice ----- */

.sad-overlay,
.no-choice-popup {
  position: fixed;
  inset: 0;
  background: rgba(58, 53, 48, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.sad-overlay-inner {
  background: var(--overlay);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(201, 130, 122, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.no-choice-popup-inner {
  background: var(--overlay);
  padding: 2rem;
  border-radius: 16px;
  max-width: 90vw;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(201, 130, 122, 0.2);
}

.sad-image {
  width: 50vh;
  height: 50vh;
  max-width: 90vw;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.btn-close-sad {
  display: block;
  margin: 1rem auto 0;
  padding: 0.5rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--rose);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-close-sad:hover {
  background: var(--rose-dark);
}

.no-choice-text {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-charcoal);
}

/* ----- Page 2: Year selection ----- */

#page-years.active {
  justify-content: center;
  padding: 2rem;
}

.album-frame {
  position: relative;
  padding: 0;
  max-width: 90vw;
  width: 100%;
}

.album-frame--years {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.years-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-charcoal);
  margin: 0 0 2rem;
  text-align: center;
}

.years-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 2.5rem;
}

.year-card {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  background: #E8DECA;
  border: none;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.15),
    0 1px 0 rgba(0, 0, 0, 0.08),
    0 -1px 0 #d6cbb8,
    0 2px 0 #c9bda8,
    0 3px 0 #bfb29c,
    0 4px 0 #b5a790,
    0 5px 0 #ab9d85,
    0 6px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin: 0;
  padding: 4.5rem 1.5rem 6rem;
  flex: 0 0 300px;
  max-width: 300px;
}

.year-card:hover {
  transform: scale(1.02);
  box-shadow:
    0 6px 10px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(0, 0, 0, 0.08),
    0 -1px 0 #d6cbb8,
    0 2px 0 #c9bda8,
    0 3px 0 #bfb29c,
    0 4px 0 #b5a790,
    0 5px 0 #ab9d85,
    0 8px 14px rgba(0, 0, 0, 0.3);
}

.year-card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.year-card-label {
  display: inline-block;
  padding: 0.35rem 0.5rem;
  margin: 0 auto 1.5rem;
  font-family: "Lobster Two", cursive;
  font-weight: 700;
  font-style: italic;
  font-size: 1.1rem;
  color: #BE2D2D;
  text-align: center;
  background: #fff;
}

/* ----- Page 3: Photo grid ----- */

#page-slideshow.active {
  display: block;
  padding: 0;
}

.slideshow-stage {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  background: linear-gradient(180deg, #ebe6df 0%, #e5dfd8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}


.slideshow-grid {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(210, 195, 175, 0.15) 25%, transparent 25%),
    linear-gradient(225deg, rgba(210, 195, 175, 0.15) 25%, transparent 25%),
    linear-gradient(45deg, rgba(210, 195, 175, 0.15) 25%, transparent 25%),
    linear-gradient(315deg, rgba(210, 195, 175, 0.15) 25%, transparent 25%),
    linear-gradient(to bottom, #d8cfc4 0%, #c9bfb2 40%, #c4b8a8 70%, #cdc2b4 100%);
  border-radius: 10px;
  box-shadow:
    inset 0 0 40px rgba(120, 100, 80, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.2),
    0 4px 20px rgba(0, 0, 0, 0.12);
}

.grid-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 53, 48, 0.5);
  z-index: 19;
  cursor: pointer;
}

.grid-backdrop.hidden {
  display: none;
}

.grid-photo {
  position: absolute;
  left: var(--photo-left, 0);
  top: var(--photo-top, 0);
  width: 400px;
  height: 400px;
  overflow: visible;
  background: transparent;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
  will-change: transform, z-index;
}

.grid-photo:hover:not(.centered) {
  transform: rotate(var(--hover-rotation, 0deg)) scale(1.08);
  filter: brightness(1.03);
}

.grid-photo-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 10px;
  background: #f5f0eb;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    2px 4px 14px rgba(0, 0, 0, 0.12),
    0 2px 6px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.grid-photo:hover:not(.centered) .grid-photo-frame {
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    4px 8px 24px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.12);
}

.grid-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grid-photo.centered .grid-photo-frame {
  padding: 14px;
  background: #f5f0eb;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.2);
}

.btn-back {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--overlay);
  border: 1px solid rgba(201, 130, 122, 0.2);
  color: var(--text-charcoal);
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.btn-back:hover {
  background: var(--cream);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.slideshow-extra {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-letter {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--overlay);
  border: 1px solid rgba(201, 130, 122, 0.2);
  border-radius: 50%;
  color: var(--text-charcoal);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-letter:hover {
  background: var(--cream);
}

.volume {
  width: 80px;
  accent-color: var(--rose);
}

.letter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58, 53, 48, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 2rem;
}

.letter-overlay.hidden {
  display: none;
}

.letter-content {
  background: var(--overlay);
  padding: 2rem;
  border-radius: 16px;
  max-width: 420px;
  position: relative;
  border: 1px solid rgba(201, 130, 122, 0.2);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
}

.letter-content #letter-text {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-charcoal);
}

.btn-close-letter {
  display: block;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--rose);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.btn-close-letter:hover {
  background: var(--rose-dark);
}

.heart-pop {
  position: fixed;
  pointer-events: none;
  z-index: 20;
  font-size: 2rem;
  color: var(--rose);
}

@keyframes heartPop {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ----- Heart rain (easter egg) ----- */

.heart-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.rain-heart {
  position: absolute;
  top: -1em;
  font-size: 1.5rem;
  color: var(--rose);
  animation: heartRain 4s linear forwards;
}

@keyframes heartRain {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* ----- Photo popup portal ----- */

#photo-popup-portal {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

#photo-popup-portal > * {
  pointer-events: auto;
}

/* ----- Utility ----- */

.hidden {
  display: none !important;
}


/* ----- Responsive ----- */

/* ----- Dog emojis ----- */

.dog-emoji {
  position: fixed;
  z-index: 99999;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.2s ease;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}

.dog-emoji:hover {
  transform: scale(1.3);
}

/* ----- Boop overlay ----- */

.boop-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(58, 53, 48, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.boop-overlay.hidden {
  display: none;
}

.boop-gif {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
  .prompt-title {
    font-size: 1.75rem;
  }

  .years-container {
    gap: 1.25rem;
  }

  .year-card {
    flex: 0 0 45vw;
    max-width: 45vw;
  }

  .year-card .year-card-label {
    font-size: 0.9rem;
  }
}
