@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: #e2ebd8;
  color: #1f3829;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

button,
audio,
video {
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

button:focus-visible {
  outline: 3px solid #5b8766;
  outline-offset: 3px;
}

/* FLOATING DECORATIONS */

.floating-decor {
  position: fixed;
  pointer-events: none;
  z-index: 10;
}

.floating-decor img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.12));
}

.sunflower-decor {
  font-size: 2.2rem;
}

.side-decor-left-top {
  top: 12%;
  left: 8px;
}

.side-decor-right-top {
  top: 18%;
  right: 8px;
}

.side-decor-left-bottom {
  bottom: 15%;
  left: 8px;
}

.side-decor-right-bottom {
  bottom: 20%;
  right: 12px;
}

/* FLOWER TRANSITION */

.flower-transition-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(226, 235, 216, 0.98);
  z-index: 2000;
  display: flex;
  justify-content: space-around;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;
}

.flower-transition-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.falling-flower {
  position: absolute;
  top: -100px;
  font-size: clamp(2.5rem, 8vw, 5rem);
  animation: flowerFall 2.3s linear infinite;
  user-select: none;
}

.f1 {
  left: 5%;
  animation-delay: 0s;
}

.f2 {
  left: 16%;
  animation-delay: 0.25s;
}

.f3 {
  left: 28%;
  animation-delay: 0.5s;
}

.f4 {
  left: 40%;
  animation-delay: 0.1s;
}

.f5 {
  left: 52%;
  animation-delay: 0.4s;
}

.f6 {
  left: 64%;
  animation-delay: 0.7s;
}

.f7 {
  left: 76%;
  animation-delay: 0.2s;
}

.f8 {
  left: 87%;
  animation-delay: 0.55s;
}

.f9 {
  left: 95%;
  animation-delay: 0.8s;
}

@keyframes flowerFall {
  0% {
    transform: translateY(-120px) rotate(0deg);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  100% {
    transform: translateY(115vh) rotate(420deg);
    opacity: 0.9;
  }
}

/* TOP NAVIGATION */

.top-nav.subtle-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(226, 235, 216, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
}

.nav-arrow {
  background: none;
  border: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: #1f3829;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 50%;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.nav-arrow:active {
  transform: scale(0.9);
}

.nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: #486952;
}

/* MAIN LAYOUT */

main {
  width: 100%;
  max-width: 480px;
  padding: 80px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen {
  display: none;
  width: 100%;
  text-align: center;
  animation: screenFadeIn 0.45s ease both;
}

.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes screenFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* GENERAL HEADINGS */

.section-heading {
  width: 100%;
  margin-bottom: 20px;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.15;
  margin-bottom: 10px;
}

.section-heading p {
  color: #486952;
  font-size: 0.95rem;
  line-height: 1.5;
}

.eyebrow {
  color: #5b8766;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.small-note {
  color: #486952;
  font-size: 0.95rem;
  margin-top: 18px;
}

/* HERO PAGE */

.hero-screen {
  position: relative;
  min-height: 620px;
  justify-content: center;
  overflow: hidden;
}

.heart-icon {
  margin-bottom: 14px;
  animation: heartFloat 3s ease-in-out infinite;
}

@keyframes heartFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-6px) rotate(3deg);
  }
}

.hero-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(2.8rem, 10vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.5px;
  margin-top: 15px;
  text-shadow: 2px 3px 0 rgba(255, 255, 255, 0.65);
  transform: rotate(-1deg);
}

.hero-title span {
  display: inline-block;
  color: #5b8766;
  transform: rotate(1deg);
}

.hero-subtitle {
  font-family: 'Caveat', cursive;
  font-size: 1.65rem;
  font-weight: 600;
  color: #486952;
  margin-top: 10px;
  margin-bottom: 30px;
}

.hero-side-decoration {
  position: absolute;
  font-size: 3rem;
  opacity: 0.7;
  pointer-events: none;
  animation: floatSlow 4s ease-in-out infinite alternate;
}

.hero-flower-left {
  top: 9%;
  left: 2%;
  transform: rotate(-18deg);
}

.hero-flower-right {
  top: 14%;
  right: 3%;
  transform: rotate(16deg);
}

.hero-flower-bottom-left {
  bottom: 10%;
  left: 4%;
  transform: rotate(-12deg);
}

.hero-flower-bottom-right {
  bottom: 14%;
  right: 5%;
  transform: rotate(15deg);
}

.hero-sticker {
  position: absolute;
  width: 85px;
  height: 85px;
  pointer-events: none;
  z-index: 1;
}

.hero-sticker img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.12));
}

.hero-sticker-left {
  left: 0;
  top: 30%;
  transform: rotate(-12deg);
}

.hero-sticker-right {
  right: 0;
  bottom: 28%;
  transform: rotate(12deg);
}

/* BUTTONS */

.primary-pill-btn {
  background-color: #b8d4a8;
  color: #1f3829;
  border: none;
  padding: 16px 28px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(31, 56, 41, 0.1);
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  margin-top: 20px;
}

.primary-pill-btn:hover {
  background-color: #a4c792;
  box-shadow: 0 6px 16px rgba(31, 56, 41, 0.14);
}

.primary-pill-btn:active {
  transform: scale(0.96);
  background-color: #a4c792;
}

.primary-pill-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* MUSIC PLAYER */

.music-player-container {
  background: #ffffff;
  padding: 16px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  margin-bottom: 25px;
  width: 100%;
}

.music-prompt {
  font-size: 0.85rem;
  color: #5b8766;
  margin-bottom: 8px;
  font-weight: 500;
}

.music-toggle-btn {
  background: #f1f6ec;
  border: 1px solid #b8d4a8;
  padding: 10px 18px;
  border-radius: 20px;
  color: #1f3829;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

/* PHOTO GALLERY */

.photo-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin: 20px 0;
}

.photo-frame {
  background: #ffffff;
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.photo-frame img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

.photo-frame figcaption {
  font-size: 0.9rem;
  color: #486952;
  margin-top: 8px;
  font-weight: 500;
}

/* QUIZ */

.quiz-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  width: 100%;
  margin-top: 15px;
}

.quiz-question {
  font-size: 1.2rem;
  line-height: 1.4;
  margin-bottom: 20px;
}

.quiz-step {
  margin-top: 8px;
}

.answers-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  background: #f1f6ec;
  border: 1px solid #b8d4a8;
  padding: 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f3829;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.answer-btn:active {
  transform: scale(0.98);
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.correct {
  background: #b8d4a8;
  border-color: #1f3829;
}

.answer-btn.wrong {
  background: #f1c5c5;
  border-color: #a33b3b;
}

.feedback {
  margin-top: 15px;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.4;
}

/* ENVELOPE AND LETTER */

.envelope-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin: 30px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.envelope-wrapper {
  width: 220px;
  height: 140px;
  background: #b8d4a8;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 8px 20px rgba(31, 56, 41, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.envelope-btn:active .envelope-wrapper {
  transform: scale(0.96);
}

.green-heart-seal {
  font-size: 2.2rem;
}

.envelope-sticker {
  position: absolute;
  width: 55px;
  height: 55px;
  object-fit: contain;
}

.sticker-left {
  bottom: -10px;
  left: -15px;
  transform: rotate(-10deg);
}

.sticker-right {
  top: -10px;
  right: -15px;
  transform: rotate(10deg);
}

.letter-paper {
  background: #ffffff;
  padding: 28px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  text-align: left;
  margin: 20px 0;
  width: 100%;
  position: relative;
}

.letter-header-stickers {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.letter-mini-sticker {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.handwritten-text {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  line-height: 1.5;
  color: #1f3829;
  margin-bottom: 15px;
}

.highlight-love {
  font-size: 1.7rem;
  font-weight: 700;
  color: #e08295;
  text-align: center;
  margin-top: 20px;
}

.signature-cursive {
  font-family: 'Caveat', cursive;
  font-size: 1.5rem;
  text-align: right;
  color: #5b8766;
  margin-top: 15px;
}

/* MEDIA PAGE */

.media-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin: 20px 0;
}

.media-card {
  background: #ffffff;
  padding: 18px;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.media-card h3 {
  margin-top: 8px;
  font-size: 1.05rem;
}

.media-icon {
  font-size: 1.5rem;
}

.media-element {
  width: 100%;
  margin-top: 12px;
  border-radius: 12px;
}

video.media-element {
  display: block;
  background: #d8e4cf;
}

/* BOUQUET */

.bouquet-card {
  width: 100%;
  background: #ffffff;
  border-radius: 20px;
  padding: 14px;
  margin: 8px 0 20px;
  box-shadow: 0 8px 22px rgba(31, 56, 41, 0.08);
}

.bouquet-card img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 14px;
}

/* OCEAN NOTE AND FLORAL CANVAS */

.ocean-note-container {
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  margin-bottom: 25px;
  border: 1px solid rgba(31, 56, 41, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.ocean-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #1f3829;
  font-weight: 500;
}

.floral-canvas {
  position: relative;
  width: 100%;
  min-height: 360px;
  margin-bottom: 25px;
  overflow: hidden;
}

.floral-item {
  position: absolute;
  font-size: 2.8rem;
  animation: floatSlow 4s ease-in-out infinite alternate;
  user-select: none;
}

.pos-1 {
  top: 5%;
  left: 8%;
  animation-delay: 0s;
}

.pos-2 {
  top: 12%;
  right: 12%;
  animation-delay: 0.5s;
}

.pos-3 {
  top: 42%;
  left: 5%;
  animation-delay: 1s;
}

.pos-4 {
  top: 48%;
  right: 8%;
  animation-delay: 1.5s;
}

.pos-5 {
  bottom: 8%;
  left: 18%;
  animation-delay: 0.8s;
}

.pos-6 {
  bottom: 12%;
  right: 22%;
  animation-delay: 1.2s;
}

.pos-7 {
  top: 28%;
  left: 42%;
  animation-delay: 0.3s;
}

.canvas-character {
  position: absolute;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-character img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.1));
}

.char-garfield {
  top: 2%;
  left: 38%;
}

.char-cartman {
  bottom: 22%;
  left: 8%;
}

.char-plankton {
  top: 58%;
  right: 12%;
}

@keyframes floatSlow {
  from {
    transform: translateY(0) rotate(0deg);
  }

  to {
    transform: translateY(-12px) rotate(5deg);
  }
}

/* HIDDEN ELEMENTS */

.hidden {
  display: none !important;
}

/* MOBILE OPTIMIZATION */

@media (max-width: 600px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-screen {
    min-height: 580px;
  }

  .hero-title {
    font-size: clamp(2.6rem, 11vw, 3.8rem);
  }

  .hero-subtitle {
    font-size: 1.45rem;
  }

  .hero-sticker {
    width: 48px;
    height: 48px;
    opacity: 0.65;
  }

  .hero-sticker-left {
    left: 2px;
    top: 24%;
  }

  .hero-sticker-right {
    right: 2px;
    bottom: 25%;
  }

  .hero-side-decoration {
    font-size: 1.8rem;
    opacity: 0.55;
  }

  .floating-decor {
    opacity: 0.5;
  }

  .floating-decor img {
    width: 42px;
    height: 42px;
  }

  .sunflower-decor {
    font-size: 1.5rem;
  }

  .top-nav.subtle-nav {
    padding: 10px 12px;
  }

  .nav-arrow {
    font-size: 1.3rem;
    padding: 5px 10px;
  }

  .page-indicator {
    font-size: 0.8rem;
  }

  .primary-pill-btn {
    max-width: 100%;
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .handwritten-text {
    font-size: 1.3rem;
  }

  .letter-paper {
    padding: 24px 17px;
  }

  .letter-mini-sticker {
    width: 38px;
    height: 38px;
  }

  .floral-canvas {
    min-height: 300px;
  }

  .floral-item {
    font-size: 2.2rem;
  }

  .canvas-character {
    width: 62px;
    height: 62px;
  }

  .bouquet-card img {
    max-height: 260px;
  }
}

/* REDUCE MOTION FOR DEVICES THAT REQUEST IT */

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