/* =========================================================
   RESET + VARIABLES
   ========================================================= */

:root {
  --blue-dark: #225b82;
  --blue: #5ca9d6;
  --blue-soft: #dff3ff;
  --blue-pale: #eff9ff;

  --white: #ffffff;
  --warm-white: #fffdf9;
  --paper: #fffef9;

  --text: #30485a;
  --text-soft: #6d8190;

  --pink-soft: #f4b8c7;
  --line: rgba(55, 110, 145, 0.15);

  --shadow-soft: 0 15px 45px rgba(43, 93, 120, 0.10);
  --shadow-paper: 0 18px 50px rgba(55, 82, 96, 0.12);

  --radius: 24px;
}


* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}


html {
  scroll-behavior: smooth;
}


body {
  background: var(--warm-white);
  color: var(--text);
  font-family:
    "Noto Sans Gujarati",
    "Nirmala UI",
    "Shruti",
    system-ui,
    sans-serif;
  line-height: 1.8;
  overflow-x: hidden;
}


button {
  font: inherit;
}


img {
  display: block;
  max-width: 100%;
}


::selection {
  background: var(--blue-soft);
  color: var(--blue-dark);
}


/* =========================================================
   OPENING SCREEN
   ========================================================= */

.opening-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    radial-gradient(
      circle at 50% 30%,
      #ffffff 0%,
      var(--blue-pale) 45%,
      var(--blue-soft) 100%
    );

  transition:
    opacity 0.8s ease,
    visibility 0.8s ease;
}


.opening-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


.opening-content {
  width: min(90%, 420px);
  text-align: center;
}


.opening-small {
  margin-bottom: 30px;
  color: var(--blue-dark);
  font-size: 0.95rem;
}


.envelope-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 38px;
}


.envelope {
  position: relative;
  width: 285px;
  height: 190px;
  perspective: 900px;
}


.envelope-back,
.envelope-front {
  position: absolute;
  inset: 0;
  border-radius: 8px;
}


.envelope-back {
  background: #a9d8f1;
  box-shadow: 0 20px 35px rgba(44, 100, 135, 0.18);
}


.envelope-front {
  z-index: 5;

  background:
    linear-gradient(
      145deg,
      #bfe4f6,
      #8fc9e9
    );

  clip-path: polygon(
    0 0,
    50% 57%,
    100% 0,
    100% 100%,
    0 100%
  );
}


.envelope-flap {
  position: absolute;
  z-index: 6;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  background: #c9eafa;

  clip-path: polygon(
    0 0,
    100% 0,
    50% 58%
  );

  transform-origin: top center;

  transition:
    transform 0.75s cubic-bezier(.65, .05, .36, 1),
    z-index 0.1s;
}


.envelope.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 1;
}


.letter {
  position: absolute;
  z-index: 3;

  left: 15px;
  right: 15px;
  bottom: 8px;

  height: 145px;

  background: var(--paper);

  border-radius: 5px;

  box-shadow: 0 5px 15px rgba(50, 80, 95, 0.08);

  transform: translateY(0);

  transition:
    transform 0.8s cubic-bezier(.2, .8, .2, 1),
    z-index 0.1s;
}


.envelope.opened .letter {
  z-index: 8;
  transform: translateY(-105px);
}


.letter-content {
  padding: 25px 18px;
  color: var(--blue-dark);
  font-size: 0.82rem;
}


.heart-seal {
  position: absolute;
  z-index: 10;

  top: 80px;
  left: 50%;

  width: 42px;
  height: 42px;

  display: flex;
  align-items: center;
  justify-content: center;

  transform: translateX(-50%);

  background: #fff;
  color: #df8098;

  border-radius: 50%;

  box-shadow: 0 4px 12px rgba(100, 80, 90, 0.15);

  transition:
    opacity 0.3s ease,
    transform 0.5s ease;
}


.envelope.opened .heart-seal {
  opacity: 0;
  transform: translateX(-50%) scale(0.6);
}


.open-button,
.cute-button {
  border: 0;
  border-radius: 999px;

  background: var(--blue-dark);
  color: white;

  padding: 12px 25px;

  cursor: pointer;

  box-shadow: 0 8px 22px rgba(34, 91, 130, 0.18);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}


.open-button:hover,
.cute-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(34, 91, 130, 0.22);
}


.open-button:active,
.cute-button:active {
  transform: translateY(0);
}


/* =========================================================
   MAIN PAGE
   ========================================================= */

.main-page {
  opacity: 0;
  visibility: hidden;

  transition:
    opacity 1s ease 0.2s,
    visibility 1s ease;
}


.main-page.visible {
  opacity: 1;
  visibility: visible;
}


.section {
  width: min(92%, 900px);
  margin-inline: auto;
  padding: 100px 0;
}


/* =========================================================
   HERO
   ========================================================= */

.hero {
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: center;

  position: relative;
}


.hero::before {
  content: "";
  position: absolute;

  width: 180px;
  height: 180px;

  top: 12%;
  right: -100px;

  background: var(--blue-soft);
  border-radius: 50%;

  z-index: -1;
}


.tiny-note,
.little-label {
  color: var(--blue);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}


.tiny-note {
  margin-bottom: 12px;
}


.hero h1 {
  color: var(--blue-dark);
  font-size: clamp(2rem, 8vw, 4.2rem);
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 12px;
}


.hero h1 span {
  font-size: 0.65em;
}


.hero-subtitle {
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 32px;
}


.hero-letter {
  max-width: 700px;

  padding: 30px 25px;

  background: rgba(255, 255, 255, 0.7);

  border-left: 3px solid var(--blue);

  box-shadow: var(--shadow-soft);

  border-radius: 5px 20px 20px 5px;
}


.hero-letter p {
  margin-bottom: 17px;
}


.signature {
  margin-top: 25px;
  color: var(--blue-dark);
  font-size: 1.05rem;
}


.scroll-hint {
  align-self: flex-start;

  margin-top: 40px;

  border: 0;
  background: none;

  color: var(--blue-dark);

  cursor: pointer;

  opacity: 0.7;

  transition: opacity 0.2s ease;
}


.scroll-hint:hover {
  opacity: 1;
}


/* =========================================================
   SECTION HEADINGS
   ========================================================= */

.section-heading {
  max-width: 650px;
  margin-bottom: 50px;
}


.section-heading.left {
  margin-right: auto;
}


.section-heading h2 {
  color: var(--blue-dark);
  font-size: clamp(1.8rem, 6vw, 3rem);
  line-height: 1.35;
  margin: 8px 0 12px;
}


.section-heading p {
  color: var(--text-soft);
}


/* =========================================================
   MEMORY CARDS
   ========================================================= */

.months-section {
  padding-top: 50px;
}


.memory-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}


.memory-card {
  position: relative;

  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 18px;

  padding: 23px;

  background: white;

  border: 1px solid var(--line);

  border-radius: var(--radius);

  box-shadow: 0 8px 28px rgba(60, 100, 120, 0.06);

  transform: rotate(-0.3deg);

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}


.memory-card:nth-child(2) {
  transform: rotate(0.5deg);
}


.memory-card:nth-child(4) {
  transform: rotate(-0.7deg);
}


.memory-card:hover {
  transform: translateY(-4px) rotate(0);
  box-shadow: var(--shadow-soft);
}


.memory-number {
  color: #8fc9e9;
  font-size: 0.85rem;
  padding-top: 4px;
}


.memory-card h3 {
  color: var(--blue-dark);
  font-size: 1.1rem;
  margin-bottom: 3px;
}


.memory-card p {
  color: var(--text-soft);
  font-size: 0.91rem;
  line-height: 1.75;
}


.first-kiss {
  background: #fafdff;
  border-color: rgba(244, 184, 199, 0.4);
}


.kiss-title {
  display: flex;
  align-items: center;
  gap: 8px;
}


.tiny-heart {
  color: #df8098;
}


/* =========================================================
   PHOTO SCRAPBOOK
   ========================================================= */

.photos-section {
  position: relative;
}


.photo-scrapbook {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 18px;
  align-items: start;
}


.photo-card {
  width: 100%;

  padding: 9px 9px 15px;

  background: white;

  box-shadow: 0 10px 30px rgba(40, 75, 90, 0.11);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}


.photo-card:nth-child(1) {
  transform: rotate(-2deg);
}


.photo-card:nth-child(2) {
  transform: rotate(2.5deg);
  margin-top: 25px;
}


.photo-card:nth-child(3) {
  transform: rotate(1deg);
  margin-top: -10px;
}


.photo-card:nth-child(4) {
  transform: rotate(-2.5deg);
  margin-top: 15px;
}


.photo-card:nth-child(5) {
  grid-column: 1 / -1;
  width: 78%;
  justify-self: center;
  transform: rotate(1deg);
}


.photo-card:hover {
  transform: rotate(0) translateY(-5px);
  box-shadow: var(--shadow-paper);
  z-index: 2;
}


.photo-frame {
  aspect-ratio: 1 / 1.08;

  overflow: hidden;

  background:
    repeating-linear-gradient(
      45deg,
      #f1f8fc,
      #f1f8fc 10px,
      #eaf5fa 10px,
      #eaf5fa 20px
    );
}


.photo-frame img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.45s ease;
}


.photo-card:hover img {
  transform: scale(1.035);
}


.photo-card figcaption {
  padding: 10px 4px 0;

  color: var(--blue-dark);

  font-size: 0.78rem;
  text-align: center;
}


/* =========================================================
   PERSONAL LETTER
   ========================================================= */

.personal-section {
  padding-top: 70px;
}


.personal-paper {
  position: relative;

  padding: 65px 25px 40px;

  background:
    linear-gradient(
      rgba(255,255,255,0.9),
      rgba(255,255,255,0.9)
    ),
    repeating-linear-gradient(
      transparent 0,
      transparent 31px,
      rgba(92, 169, 214, 0.10) 32px
    );

  box-shadow: var(--shadow-paper);

  border-radius: 4px;

  transform: rotate(0.3deg);
}


.paper-tape {
  position: absolute;

  top: -13px;
  left: 50%;

  width: 100px;
  height: 30px;

  transform: translateX(-50%) rotate(-2deg);

  background: rgba(183, 222, 241, 0.7);
}


.letter-date {
  color: var(--blue);
  font-size: 0.82rem;
}


.personal-paper h2 {
  margin: 8px 0 35px;

  color: var(--blue-dark);

  font-size: clamp(1.7rem, 6vw, 2.5rem);

  line-height: 1.35;
}


.personal-letter-text {
  max-width: 700px;
  margin-inline: auto;

  font-size: 0.97rem;
}


.personal-letter-text p {
  margin-bottom: 22px;
}


.letter-ending {
  margin-top: 35px;

  color: var(--blue-dark);

  font-size: 1rem;
}


/* =========================================================
   INTERACTIVE QUESTION
   ========================================================= */

.question-section {
  padding-top: 70px;
}


.question-card {
  position: relative;

  padding: 55px 25px;

  text-align: center;

  background: var(--blue-pale);

  border-radius: 30px;

  overflow: hidden;
}


.question-decoration {
  position: absolute;

  top: -20px;
  right: 20px;

  color: rgba(92, 169, 214, 0.25);

  font-size: 120px;
  line-height: 1;
}


.question-card h2 {
  position: relative;

  margin: 10px 0 25px;

  color: var(--blue-dark);

  font-size: clamp(1.5rem, 5vw, 2.2rem);
}


.hidden-message {
  max-width: 570px;
  margin: 28px auto 0;

  display: none;

  animation: messageIn 0.5s ease both;
}


.hidden-message.show {
  display: block;
}


.hidden-message p {
  margin-bottom: 18px;
}


.text-button {
  border: 0;
  background: transparent;

  color: var(--blue-dark);

  cursor: pointer;

  text-decoration: underline;
  text-underline-offset: 4px;
}


.second-message {
  margin-top: 15px;
}


/* =========================================================
   FINAL
   ========================================================= */

.final-section {
  position: relative;

  min-height: 85vh;

  padding: 120px 20px 80px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  background:
    radial-gradient(
      circle at center,
      #f3fbff 0%,
      #e0f4ff 55%,
      #d4edfa 100%
    );
}


.final-heart {
  width: 65px;
  height: 65px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 22px;

  border-radius: 50%;

  background: white;

  color: #df8098;

  font-size: 1.8rem;

  box-shadow: 0 12px 30px rgba(50, 100, 130, 0.13);

  animation: gentlePulse 3s ease-in-out infinite;
}


.final-small {
  color: var(--blue);
  font-size: 0.85rem;
}


.final-section h2 {
  margin: 10px 0 25px;

  color: var(--blue-dark);

  font-size: clamp(2rem, 8vw, 4rem);

  line-height: 1.25;
}


.final-message {
  max-width: 450px;
  margin-bottom: 28px;

  color: var(--text);
}


.final-signature {
  color: var(--blue-dark);
  line-height: 2;
}


.final-signature span {
  font-size: 0.92rem;
}


.restart-button {
  margin-top: 50px;

  padding: 9px 17px;

  border: 1px solid rgba(34, 91, 130, 0.25);
  border-radius: 999px;

  background: rgba(255, 255, 255, 0.6);

  color: var(--blue-dark);

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}


.restart-button:hover {
  background: white;
  transform: translateY(-2px);
}


/* =========================================================
   MUSIC BUTTON
   ========================================================= */

.music-button {
  position: fixed;

  right: 17px;
  bottom: 17px;

  z-index: 50;

  width: 43px;
  height: 43px;

  border: 1px solid rgba(34, 91, 130, 0.15);
  border-radius: 50%;

  background: rgba(255,255,255,0.88);

  color: var(--blue-dark);

  cursor: pointer;

  box-shadow: 0 8px 20px rgba(40, 80, 100, 0.12);

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}


.music-button:hover {
  transform: scale(1.05);
  background: white;
}


.music-button.playing {
  animation: musicPulse 1.5s ease-in-out infinite;
}


/* =========================================================
   FLOATING HEARTS
   ========================================================= */

.floating-hearts {
  position: fixed;
  inset: 0;

  z-index: 1;

  pointer-events: none;
  overflow: hidden;
}


.floating-hearts span {
  position: absolute;

  bottom: -30px;

  color: rgba(92, 169, 214, 0.20);

  font-size: 18px;

  animation: floatUp 13s linear infinite;
}


.floating-hearts span:nth-child(1) {
  left: 12%;
  animation-delay: 2s;
}


.floating-hearts span:nth-child(2) {
  left: 70%;
  animation-delay: 6s;
  font-size: 14px;
}


.floating-hearts span:nth-child(3) {
  left: 88%;
  animation-delay: 10s;
  font-size: 12px;
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes gentlePulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.06);
  }
}


@keyframes musicPulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}


@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  85% {
    opacity: 0.5;
  }

  100% {
    transform: translateY(-105vh) rotate(25deg);
    opacity: 0;
  }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (min-width: 700px) {

  .section {
    padding-top: 130px;
    padding-bottom: 130px;
  }


  .hero-letter {
    padding: 38px 40px;
  }


  .memory-card {
    grid-template-columns: 55px 1fr;
    padding: 28px 30px;
  }


  .memory-card:nth-child(2) {
    margin-left: 7%;
  }


  .memory-card:nth-child(5) {
    margin-left: 5%;
  }


  .photo-scrapbook {
    grid-template-columns: repeat(3, 1fr);
    gap: 35px 25px;
  }


  .photo-card:nth-child(2) {
    margin-top: 40px;
  }


  .photo-card:nth-child(3) {
    margin-top: -5px;
  }


  .photo-card:nth-child(4) {
    margin-top: 25px;
  }


  .photo-card:nth-child(5) {
    grid-column: 2 / 3;
    width: 100%;
    margin-top: -5px;
  }


  .personal-paper {
    padding: 75px 70px 55px;
  }


  .question-card {
    padding: 75px 50px;
  }

}


@media (max-width: 430px) {

  .opening-small {
    font-size: 0.88rem;
  }


  .envelope {
    width: 255px;
    height: 170px;
  }


  .letter {
    height: 130px;
  }


  .envelope.opened .letter {
    transform: translateY(-90px);
  }


  .hero {
    padding-top: 80px;
  }


  .hero-letter {
    padding: 25px 20px;
  }


  .section {
    padding-top: 80px;
    padding-bottom: 80px;
  }


  .memory-card {
    grid-template-columns: 35px 1fr;
    gap: 12px;
    padding: 20px;
  }


  .photo-scrapbook {
    gap: 18px 12px;
  }


  .photo-card {
    padding: 7px 7px 12px;
  }


  .personal-paper {
    padding: 60px 21px 35px;
  }


  .personal-letter-text {
    font-size: 0.92rem;
  }


  .question-card {
    padding: 55px 20px;
  }

}


/* =========================================================
   ACCESSIBILITY — REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

  html {
    scroll-behavior: auto;
  }


  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

}