:root {
  --white: #f7fbff;
  --mist: #d8f3ff;
  --aqua: #a7d8f0;
  --sea: #5ea8c7;
  --deep: #244b5a;
  --pink: #fff1f5;
  --gold: #ffe6a8;
  --shadow: 0 24px 70px rgba(36, 75, 90, 0.16);
  --title-font: "DM Serif Display", Georgia, serif;
  --body-font: "Nunito", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--deep);
  font-family: var(--body-font);
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 241, 245, 0.95), transparent 22rem),
    radial-gradient(circle at 88% 14%, rgba(255, 230, 168, 0.58), transparent 18rem),
    linear-gradient(180deg, var(--white), var(--mist) 42%, var(--aqua) 100%);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
}

.water-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.light-ray {
  position: absolute;
  top: -20vh;
  width: 11rem;
  height: 130vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 76%);
  filter: blur(9px);
  transform: rotate(18deg);
  animation: ray-sway 9s ease-in-out infinite;
}

.ray-one { left: 22%; }
.ray-two { left: 68%; opacity: 0.55; animation-delay: -4s; }

.bubble {
  position: absolute;
  bottom: -4rem;
  width: 1rem;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, white, transparent 54%);
  animation: float-up 12s linear infinite;
}

.bubble-one { left: 12%; }
.bubble-two { left: 76%; width: 0.72rem; animation-delay: -4s; }
.bubble-three { left: 52%; width: 1.35rem; animation-delay: -8s; }
.bubble-four { left: 34%; width: 0.62rem; animation-delay: -10s; }

.tiny-fish {
  position: absolute;
  width: 3rem;
  height: 1.75rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #ffb4c8);
  opacity: 0.46;
  animation: slow-swim 20s linear infinite;
}

.tiny-fish::after {
  content: "";
  position: absolute;
  right: -0.8rem;
  top: 0.38rem;
  border-top: 0.48rem solid transparent;
  border-bottom: 0.48rem solid transparent;
  border-left: 0.85rem solid #ffb4c8;
}

.fish-a { left: -4rem; top: 22%; }
.fish-b { left: -6rem; top: 72%; width: 2.35rem; height: 1.35rem; animation-delay: -8s; }

.music-button {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(36, 75, 90, 0.14);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.music-button.is-playing {
  background: var(--pink);
}

main {
  position: relative;
  z-index: 1;
}

.hero-section {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 4.5rem 1rem;
}

.archive {
  display: none;
  width: min(58rem, 100%);
  margin: 0 auto;
  padding: 0 1rem 5rem;
}

.archive.is-open {
  display: block;
}

.archive-section {
  padding: clamp(1.6rem, 5vw, 3rem) 0;
}

.glass-card {
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 1.5rem;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(216, 243, 255, 0.34));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.pass-card {
  width: min(35rem, 100%);
  padding: clamp(1.25rem, 5vw, 2rem);
}

.pass-header,
.pass-details div,
.profile-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow,
.pass-number {
  margin: 0;
  color: #3f8ead;
  font-size: 0.78rem;
  font-weight: 900;
}

.pass-title {
  display: grid;
  gap: 0.6rem;
  margin: 1.35rem 0 1.5rem;
  padding: 1.2rem;
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 241, 245, 0.82), transparent 8rem),
    rgba(247, 251, 255, 0.54);
}

h1,
h2 {
  margin: 0;
  font-family: var(--title-font);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.pass-title h1 {
  font-size: clamp(2.3rem, 9.5vw, 4.2rem);
  line-height: 1.05;
  word-break: break-word;
}

h1 {
  font-size: clamp(3.2rem, 15vw, 5.7rem);
}

h2 {
  font-size: clamp(2.1rem, 7vw, 3.6rem);
}

p {
  line-height: 1.7;
}

.pass-title p,
.section-heading p,
.soft-note,
.note-card p,
.final-card p {
  margin: 0;
}

.pass-details,
.profile-list {
  display: grid;
  gap: 0.68rem;
  margin: 0 0 1.2rem;
}

.pass-details div,
.profile-list div {
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed rgba(36, 75, 90, 0.18);
}

.pass-details dt,
.pass-details dd,
.profile-list dt,
.profile-list dd {
  margin: 0;
}

.pass-details dt,
.profile-list dt {
  color: #3f8ead;
  font-size: 0.82rem;
  font-weight: 900;
}

.pass-details dd,
.profile-list dd {
  font-weight: 900;
  text-align: right;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--gold));
  box-shadow: 0 14px 30px rgba(36, 75, 90, 0.16);
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease;
}

.pass-actions {
  display: grid;
  gap: 0.6rem;
}

.close-pass-button {
  display: none;
  background: rgba(255, 255, 255, 0.66);
}

.pass-card.is-open #open-pass {
  display: none;
}

.pass-card.is-open .close-pass-button {
  display: inline-flex;
}

.primary-button:hover,
.memory-card:hover,
.polaroid:hover {
  transform: translateY(-2px);
}

.small-button {
  width: auto;
  min-width: 8rem;
  padding-inline: 1.2rem;
}

.identity-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
  padding: clamp(1.2rem, 4vw, 1.7rem);
}

.identity-card .eyebrow,
.identity-card .card-intro,
.soft-note {
  grid-column: 1 / -1;
}

.profile-mark {
  display: grid;
  place-items: center;
  width: 5.2rem;
  aspect-ratio: 1;
  border-radius: 1.2rem;
  color: var(--deep);
  background: linear-gradient(135deg, var(--pink), var(--gold));
  font-family: var(--title-font);
  font-size: 3.5rem;
  box-shadow: 0 14px 32px rgba(36, 75, 90, 0.12);
}

.profile-list {
  margin: 0;
}

.soft-note {
  padding: 0.9rem;
  border-radius: 1rem;
  background: rgba(255, 241, 245, 0.55);
  text-align: center;
  font-weight: 800;
}

.centered-card {
  width: min(38rem, 100%);
  margin: 0 auto;
  padding: clamp(1.3rem, 5vw, 2rem);
  text-align: center;
}

.section-heading {
  margin-bottom: 1rem;
  text-align: center;
}

.section-heading > p:not(.eyebrow),
.card-intro {
  max-width: 28rem;
  margin: 0.45rem auto 0;
  color: #486875;
  font-size: 0.95rem;
}

.section-heading p:last-child {
  margin-top: 0.45rem;
}

.badge-row,
.floating-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.badge-row span,
.floating-notes span {
  padding: 0.62rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 10px 26px rgba(36, 75, 90, 0.1);
  font-size: 0.88rem;
  font-weight: 900;
}

.floating-notes span:nth-child(even) {
  background: rgba(255, 241, 245, 0.66);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.memory-card {
  min-height: 11rem;
  padding: 1rem;
  border-radius: 1.2rem;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.memory-card.is-active {
  background: linear-gradient(145deg, rgba(255, 241, 245, 0.86), rgba(247, 251, 255, 0.7));
  box-shadow: 0 0 34px rgba(255, 241, 245, 0.8);
}

.memory-card span {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  aspect-ratio: 1;
  margin-bottom: 0.8rem;
  border-radius: 50%;
  background: var(--pink);
  color: #7c5b67;
  font-size: 0.8rem;
  font-weight: 900;
}

.memory-card strong {
  display: block;
  font-size: 1rem;
}

.memory-card p {
  margin-bottom: 0;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.polaroid {
  padding: 0.48rem 0.48rem 0.62rem;
  border: 0;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 28px rgba(36, 75, 90, 0.12);
  cursor: pointer;
  transition: transform 180ms ease;
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0.68rem;
  object-fit: cover;
}

.polaroid span {
  display: block;
  padding-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 900;
}

.fish-mail {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.mail-fish {
  position: relative;
  width: 3.5rem;
  height: 2.3rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  animation: bob 2.4s ease-in-out infinite;
}

.mail-fish:nth-child(2) { animation-delay: -0.5s; }
.mail-fish:nth-child(3) { animation-delay: -1s; }
.mail-fish:nth-child(4) { animation-delay: -1.5s; }
.mail-fish:nth-child(5) { animation-delay: -2s; }

.mail-fish span {
  position: absolute;
  inset: 0.45rem 0.55rem 0.4rem 0.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), #ffb4c8);
  box-shadow: 0 10px 22px rgba(36, 75, 90, 0.14);
}

.mail-fish span::before {
  content: "";
  position: absolute;
  right: -0.7rem;
  top: 0.28rem;
  border-top: 0.43rem solid transparent;
  border-bottom: 0.43rem solid transparent;
  border-left: 0.78rem solid #ffb4c8;
}

.mail-fish span::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.38rem;
  width: 0.18rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--deep);
}

.letter-card {
  width: min(38rem, 100%);
  margin: 0 auto;
  padding: clamp(1.3rem, 5vw, 2rem);
  text-align: center;
}

.letter-card .card-intro,
.final-card .card-intro {
  margin-bottom: 1rem;
}

.letter-text {
  max-height: 0;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 520ms ease, opacity 420ms ease, margin 420ms ease;
}

.letter-card.is-open .letter-text {
  max-height: 100rem;
  margin-top: 1rem;
  opacity: 1;
}

.letter-card.is-open .primary-button {
  display: none;
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.promise-grid p {
  min-height: 8rem;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 14px 32px rgba(36, 75, 90, 0.11);
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
  animation: bob 3.2s ease-in-out infinite;
}

.promise-grid p:nth-child(even) {
  background: rgba(255, 241, 245, 0.64);
  animation-delay: -1s;
}

.stamp {
  width: fit-content;
  margin: 1rem auto 1rem;
  padding: 0.5rem 0.85rem;
  border: 2px dashed rgba(255, 112, 146, 0.55);
  border-radius: 0.45rem;
  color: #a75069;
  background: rgba(255, 241, 245, 0.72);
  font-weight: 900;
  transform: rotate(-3deg);
}

.final-card {
  position: relative;
  overflow: hidden;
}

.final-card::before {
  content: "";
  position: absolute;
  inset: auto -10% -38% -10%;
  height: 55%;
  background: radial-gradient(ellipse at center, rgba(255, 241, 245, 0.58), transparent 68%);
  pointer-events: none;
}

.final-card > * {
  position: relative;
  z-index: 1;
}

.final-shell {
  width: 4.1rem;
  height: 3.2rem;
  margin: 0 auto 0.8rem;
  border-radius: 55% 55% 38% 38%;
  background:
    repeating-radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.62) 0 0.22rem, transparent 0.22rem 0.5rem),
    linear-gradient(135deg, var(--gold), var(--pink));
  box-shadow: 0 16px 34px rgba(36, 75, 90, 0.12);
}

.final-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.15rem auto 1.1rem;
}

.final-tags span {
  padding: 0.46rem 0.68rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 24px rgba(36, 75, 90, 0.09);
  color: #486875;
  font-size: 0.78rem;
  font-weight: 900;
}

.mail-modal,
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(36, 75, 90, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.mail-modal.is-open,
.photo-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mail-card,
.photo-card {
  position: relative;
  width: min(21rem, 100%);
  padding: 1.5rem;
  text-align: center;
}

.photo-card {
  width: min(27rem, 100%);
}

.photo-card img {
  display: block;
  width: 100%;
  border-radius: 1rem;
}

.close-mail,
.close-photo {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 241, 245, 0.82);
  cursor: pointer;
  font-size: 1.2rem;
}

#mail-message,
#photo-title {
  margin: 0.7rem 0 0;
  font-family: var(--title-font);
  font-size: 2rem;
  line-height: 1.12;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 520ms ease, transform 520ms ease;
}

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

@keyframes float-up {
  0% { transform: translateY(0) scale(0.8); opacity: 0; }
  20% { opacity: 0.75; }
  100% { transform: translateY(-110vh) scale(1.2); opacity: 0; }
}

@keyframes slow-swim {
  0% { transform: translateX(-8vw); }
  100% { transform: translateX(116vw); }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.35rem); }
}

@keyframes ray-sway {
  0%, 100% { transform: translateX(-1rem) rotate(18deg); }
  50% { transform: translateX(1rem) rotate(21deg); }
}

@media (max-width: 760px) {
  .hero-section {
    align-items: start;
    padding-top: 5.2rem;
  }

  .identity-card {
    grid-template-columns: 1fr;
  }

  .profile-mark {
    width: 4.5rem;
    font-size: 3rem;
  }

  .pass-details div,
  .profile-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .pass-details dd,
  .profile-list dd {
    text-align: left;
  }

  .memory-grid,
  .promise-grid {
    grid-template-columns: 1fr;
  }

  .photo-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .promise-grid p {
    min-height: auto;
    border-radius: 1.2rem;
  }
}

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