:root {
  color-scheme: light;
  --rose: #c85567;
  --coral: #ef765f;
  --gold: #d6a84f;
  --teal: #216f73;
  --ink: #241d27;
  --plum: #563045;
  --cream: #fff5e8;
  --paper: #fffaf4;
  --line: rgba(36, 29, 39, 0.16);
  --shadow: 0 22px 60px rgba(36, 29, 39, 0.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body.is-gate-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-160%);
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.skip-link:focus {
  transform: translateY(0);
}

.module[hidden],
.birthday-module[hidden] {
  display: none;
}

.module-picker {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: rgba(255, 250, 244, 0.88);
  box-shadow: 0 10px 30px rgba(36, 29, 39, 0.18);
  backdrop-filter: blur(14px);
}

.module-picker__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.module-picker button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0.55rem 0.75rem;
  background: transparent;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}

.module-picker button[aria-pressed="true"] {
  background: var(--plum);
  color: white;
}

.birthday-module {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 10%, rgba(214, 168, 79, 0.26), transparent 23rem),
    radial-gradient(circle at 8% 42%, rgba(200, 85, 103, 0.18), transparent 27rem),
    var(--cream);
}

.birthday-hero {
  position: relative;
  display: grid;
  min-height: min(740px, 100vh);
  align-content: center;
  padding: clamp(8rem, 14vw, 11rem) clamp(1.2rem, 7vw, 8rem) clamp(4rem, 8vw, 7rem);
  overflow: hidden;
}

.birthday-hero::before,
.birthday-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.birthday-hero::before {
  top: 12%;
  right: clamp(-8rem, -4vw, -3rem);
  width: min(36vw, 25rem);
  aspect-ratio: 1;
  border: 1px solid rgba(200, 85, 103, 0.34);
  box-shadow: inset 0 0 0 1.2rem rgba(255, 255, 255, 0.2);
}

.birthday-hero::after {
  right: clamp(1rem, 9vw, 10rem);
  bottom: -5rem;
  width: min(25vw, 18rem);
  aspect-ratio: 1;
  background: rgba(33, 111, 115, 0.12);
}

.birthday-petals {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.birthday-petal {
  position: absolute;
  top: -3rem;
  left: var(--petal-left, 50%);
  color: var(--petal-color, rgba(200, 85, 103, 0.58));
  font-size: var(--petal-size, 1.7rem);
  animation: birthday-petal-drift var(--petal-duration, 12s) linear infinite;
  animation-delay: var(--petal-delay, 0s);
}

.birthday-petal:nth-child(1) { --petal-left: 6%; --petal-delay: -2s; --petal-duration: 13s; }
.birthday-petal:nth-child(2) { --petal-left: 19%; --petal-color: rgba(214, 168, 79, 0.76); --petal-delay: -8s; --petal-duration: 16s; }
.birthday-petal:nth-child(3) { --petal-left: 34%; --petal-size: 2rem; --petal-delay: -5s; --petal-duration: 15s; }
.birthday-petal:nth-child(4) { --petal-left: 53%; --petal-color: rgba(33, 111, 115, 0.48); --petal-delay: -10s; --petal-duration: 18s; }
.birthday-petal:nth-child(5) { --petal-left: 67%; --petal-color: rgba(214, 168, 79, 0.7); --petal-delay: -3s; --petal-duration: 14s; }
.birthday-petal:nth-child(6) { --petal-left: 78%; --petal-size: 2.1rem; --petal-delay: -12s; --petal-duration: 17s; }
.birthday-petal:nth-child(7) { --petal-left: 89%; --petal-color: rgba(33, 111, 115, 0.48); --petal-delay: -6s; --petal-duration: 15s; }
.birthday-petal:nth-child(8) { --petal-left: 95%; --petal-color: rgba(214, 168, 79, 0.7); --petal-delay: -13s; --petal-duration: 19s; }

.birthday-flower-shower {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 420ms ease;
}

body.is-birthday-active .birthday-flower-shower {
  visibility: visible;
  opacity: 1;
}

.birthday-flower-rain {
  position: absolute;
  top: -4rem;
  left: var(--flower-x);
  color: var(--flower-color);
  font-size: var(--flower-size);
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 0.25rem 0.3rem rgba(71, 31, 48, 0.12));
  will-change: transform, opacity;
  animation: birthday-flower-fall var(--flower-duration) linear var(--flower-delay) infinite;
}

.birthday-hero__content,
.birthday-hero__note {
  position: relative;
  z-index: 1;
}

.birthday-hero__content {
  width: min(760px, 100%);
}

.birthday-hero .eyebrow {
  color: var(--teal);
}

.birthday-number {
  margin: 0 0 -1.2rem;
  color: rgba(200, 85, 103, 0.16);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(9rem, 25vw, 17rem);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.1em;
  user-select: none;
}

.birthday-hero h1 {
  position: relative;
  max-width: 700px;
  color: var(--plum);
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: 0.9;
}

.birthday-hero__copy {
  width: min(560px, 100%);
  margin: 1.5rem 0 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 2vw, 1.28rem);
}

.birthday-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.birthday-hero [data-start-birthday-game] {
  min-width: 0;
  padding: 0.8rem 1.15rem;
  border: 1px solid rgba(33, 111, 115, 0.38);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: none;
  color: var(--teal);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.birthday-hero [data-start-birthday-game]:hover,
.birthday-hero [data-start-birthday-game]:focus-visible {
  border-color: var(--teal);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(33, 111, 115, 0.12);
}

.birthday-hero .button--ghost {
  border-color: rgba(36, 29, 39, 0.32);
  color: var(--ink);
}

.birthday-hero__note {
  width: fit-content;
  margin: clamp(3rem, 9vw, 8rem) 0 0 auto;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(33, 111, 115, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--teal);
  font-weight: 800;
}

.birthday-game,
.birthday-memories,
.birthday-letter-wrap,
.birthday-diploma-wrap {
  padding: clamp(3.8rem, 8vw, 7rem) clamp(1.2rem, 7vw, 8rem);
}

.birthday-game {
  background: linear-gradient(135deg, #fffaf4, #f9ebdc);
}

.birthday-challenge {
  max-width: 760px;
  min-height: 300px;
  margin: 2rem auto 0;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border: 1px solid rgba(214, 168, 79, 0.5);
  border-radius: 10px;
  background:
    radial-gradient(circle at 92% 8%, rgba(214, 168, 79, 0.22), transparent 14rem),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 42px rgba(36, 29, 39, 0.1);
}

.birthday-challenge__progress,
.birthday-challenge__eyebrow {
  margin: 0 0 0.55rem;
  color: var(--teal);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.birthday-challenge__progress {
  color: var(--coral);
}

.birthday-challenge h3 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.birthday-challenge__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0;
}

.birthday-challenge[data-type="maze"] .birthday-challenge__actions {
  display: block;
}

.birthday-maze {
  display: grid;
  gap: 1rem;
  padding: clamp(0.9rem, 3vw, 1.35rem);
  border: 1px solid rgba(26, 111, 120, 0.25);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(211, 237, 232, 0.78), rgba(255, 250, 244, 0.86));
}

.birthday-maze__status {
  margin: 0;
  color: var(--teal);
  font-weight: 850;
  text-align: center;
}

.birthday-maze__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(58px, 1fr));
  gap: 0.32rem;
  width: min(330px, 100%);
  margin: 0 auto;
}

.birthday-maze__cell {
  display: grid;
  min-height: 66px;
  place-items: center;
  border-radius: 7px;
  color: var(--teal);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 900;
}

.birthday-maze__cell--wall {
  color: transparent;
  background:
    linear-gradient(135deg, rgba(86, 48, 69, 0.38) 25%, transparent 25%) 0 0 / 14px 14px,
    rgba(86, 48, 69, 0.38);
}

.birthday-maze__cell--exit {
  color: var(--coral);
  background: rgba(255, 227, 191, 0.84);
  font-size: 1.45rem;
}

.birthday-maze__cell.is-active {
  color: white;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(242, 119, 95, 0.16);
}

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

.birthday-maze__direction {
  min-height: 56px;
  padding: 0.6rem 0.35rem;
  border: 1px solid rgba(86, 48, 69, 0.2);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.birthday-maze__direction:hover,
.birthday-maze__direction:focus-visible {
  border-color: rgba(200, 85, 103, 0.62);
  box-shadow: 0 8px 18px rgba(200, 85, 103, 0.14);
}

.birthday-challenge__button,
.birthday-memory-choice {
  min-height: 92px;
  padding: 0.9rem;
  border: 1px solid rgba(86, 48, 69, 0.2);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 9px 18px rgba(36, 29, 39, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.birthday-challenge__button:hover,
.birthday-challenge__button:focus-visible,
.birthday-memory-choice:hover,
.birthday-memory-choice:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(200, 85, 103, 0.66);
  background: white;
  box-shadow: 0 14px 26px rgba(200, 85, 103, 0.14);
}

.birthday-challenge__button:disabled {
  cursor: default;
  color: var(--teal);
  border-color: rgba(26, 111, 120, 0.36);
  background: rgba(211, 237, 232, 0.68);
  box-shadow: none;
  transform: none;
}

.birthday-challenge__sparkle {
  color: var(--plum);
  font-size: 0.98rem;
}

.birthday-challenge__key {
  text-transform: capitalize;
}

.birthday-memory-choice {
  min-height: 178px;
  padding: 0;
  overflow: hidden;
  text-align: left;
}

.birthday-memory-choice img {
  display: block;
  width: 100%;
  height: 128px;
  object-fit: cover;
}

.birthday-memory-choice span {
  display: block;
  padding: 0.62rem 0.75rem;
}

.birthday-challenge__feedback {
  margin: 1.1rem 0 1.25rem;
  padding: 0.85rem 0.95rem;
  border-left: 4px solid var(--coral);
  border-radius: 0 7px 7px 0;
  background: rgba(255, 226, 219, 0.62);
  color: var(--plum);
  font-weight: 750;
}

.birthday-challenge__feedback[data-tone="success"] {
  border-left-color: var(--teal);
  background: rgba(211, 237, 232, 0.7);
}

.birthday-challenge__reward {
  display: grid;
  grid-template-columns: minmax(0, 150px) 1fr;
  align-items: center;
  gap: 1rem;
  margin: 1.1rem 0 1.4rem;
  padding: 0.75rem;
  border: 1px solid rgba(214, 168, 79, 0.45);
  border-radius: 9px;
  background: rgba(255, 250, 244, 0.82);
}

.birthday-challenge__reward[hidden] {
  display: none;
}

.birthday-challenge__reward img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
}

.birthday-challenge__reward p {
  margin: 0;
  color: var(--plum);
  font-family: Georgia, serif;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 800;
}

.birthday-memories {
  background:
    radial-gradient(circle at 90% 7%, rgba(214, 168, 79, 0.28), transparent 23rem),
    linear-gradient(135deg, #fffaf4, #f7e2d8);
}

.birthday-memories[hidden] {
  display: none;
}

.birthday-memories__heading {
  margin-bottom: 2.4rem;
}

.birthday-memories__heading > p:last-child {
  width: min(620px, 100%);
  margin: 1.15rem 0 0;
  font-size: clamp(1.02rem, 2vw, 1.18rem);
}

.birthday-song {
  display: grid;
  width: min(520px, 100%);
  gap: 0.18rem;
  margin-top: 1.3rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(200, 85, 103, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 12px 26px rgba(36, 29, 39, 0.09);
  color: var(--plum);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.birthday-song:hover,
.birthday-song:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(36, 29, 39, 0.14);
}

.birthday-song span {
  color: var(--teal);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.birthday-song strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.1rem, 2vw, 1.34rem);
}

.birthday-song small {
  color: rgba(86, 48, 69, 0.82);
  font-size: 0.87rem;
}

.birthday-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(0.75rem, 1.6vw, 1.3rem);
  width: min(1200px, 100%);
  margin: 0 auto;
}

.birthday-memory {
  position: relative;
  min-height: 240px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 10px;
  background: var(--plum);
  box-shadow: 0 18px 38px rgba(36, 29, 39, 0.16);
}

.birthday-memory--wide {
  grid-column: span 2;
}

.birthday-memory--tall {
  grid-row: span 2;
  min-height: 500px;
}

.birthday-memory img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 500ms ease;
}

.birthday-memory::after {
  content: "";
  position: absolute;
  inset: 42% 0 0;
  background: linear-gradient(180deg, transparent, rgba(36, 29, 39, 0.84));
  pointer-events: none;
}

.birthday-memory figcaption {
  position: absolute;
  z-index: 1;
  right: 1rem;
  bottom: 0.9rem;
  left: 1rem;
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  font-weight: 700;
  line-height: 1.22;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.birthday-memory:hover img,
.birthday-memory:focus-within img {
  transform: scale(1.05);
}

.birthday-memories:not([hidden]) .birthday-memory {
  animation: birthday-memory-rise 620ms both;
}

.birthday-memories:not([hidden]) .birthday-memory:nth-child(3n + 1) { animation-delay: 80ms; }
.birthday-memories:not([hidden]) .birthday-memory:nth-child(3n + 2) { animation-delay: 150ms; }
.birthday-memories:not([hidden]) .birthday-memory:nth-child(3n) { animation-delay: 220ms; }

.birthday-memory img:focus-visible {
  outline: 4px solid var(--coral);
  outline-offset: -5px;
}

.memory-lightbox {
  width: min(900px, calc(100vw - 1.5rem));
  max-height: min(92vh, 980px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.memory-lightbox::backdrop {
  background: rgba(27, 20, 30, 0.8);
  backdrop-filter: blur(5px);
}

.memory-lightbox figure {
  position: relative;
  margin: 0;
}

.memory-lightbox img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 68px);
  object-fit: contain;
  background: #161019;
}

.memory-lightbox figcaption {
  padding: 0.9rem 3.4rem 0.95rem 1rem;
  color: white;
  font-weight: 750;
}

.memory-lightbox__close {
  position: absolute;
  z-index: 1;
  top: 0.65rem;
  right: 0.65rem;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(36, 29, 39, 0.8);
  color: white;
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
}

.birthday-letter-wrap {
  background: var(--plum);
}

.birthday-letter {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 6vw, 4rem);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 250, 244, 0.08);
  color: white;
}

.birthday-letter .section-kicker {
  color: #ffd98b;
}

.birthday-letter .section-title::before {
  background: linear-gradient(90deg, #ffd98b, var(--coral));
}

.birthday-letter .section-title::after {
  background: linear-gradient(90deg, #ffd98b, rgba(255, 255, 255, 0.42), transparent);
}

.birthday-letter .birthday-song {
  margin-top: 1.6rem;
  border-color: rgba(255, 217, 139, 0.38);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  color: white;
}

.birthday-letter .birthday-song span {
  color: #ffd98b;
}

.birthday-letter .birthday-song small {
  color: rgba(255, 255, 255, 0.78);
}

.birthday-letter__signature {
  margin-top: 2rem;
  color: #ffd98b;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-style: italic;
}

.birthday-letter__signature span {
  color: white;
  font-family: inherit;
  font-size: 1rem;
}

.birthday-letter__actions {
  margin-top: 2rem;
}

.birthday-diploma-wrap {
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 15% 10%, rgba(247, 167, 183, 0.36), transparent 20rem),
    radial-gradient(circle at 84% 86%, rgba(214, 168, 79, 0.34), transparent 24rem),
    #fff8ee;
}

.birthday-diploma-wrap[hidden] {
  display: none;
}

.birthday-diploma-wrap .section-heading {
  margin-inline: auto;
}

.birthday-diploma {
  position: relative;
  width: min(760px, 100%);
  margin: 2rem auto 0;
  padding: clamp(2rem, 7vw, 4.5rem);
  overflow: hidden;
  border: 1px solid rgba(214, 168, 79, 0.72);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 1.4rem 3rem rgba(88, 53, 36, 0.14);
}

.birthday-diploma::before,
.birthday-diploma::after {
  position: absolute;
  color: rgba(200, 85, 103, 0.14);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7rem, 20vw, 13rem);
  font-weight: 700;
  line-height: 1;
}

.birthday-diploma::before {
  content: "25";
  top: -1.3rem;
  left: -0.7rem;
}

.birthday-diploma::after {
  content: "✿";
  right: 1.1rem;
  bottom: -1.7rem;
}

.birthday-diploma > * {
  position: relative;
  z-index: 1;
}

.birthday-diploma__top {
  margin: 0;
  color: var(--plum);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.birthday-diploma h3 {
  margin: 1rem 0;
  color: var(--coral);
  font-size: clamp(3rem, 10vw, 5.7rem);
  line-height: 0.9;
}

.birthday-diploma > p:not(.birthday-diploma__top):not(.birthday-diploma__seal) {
  max-width: 610px;
  margin: 1.5rem auto;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.65;
}

.birthday-diploma__seal {
  display: inline-block;
  margin: 1rem 0 0;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(200, 85, 103, 0.45);
  border-radius: 999px;
  color: var(--teal);
  font-weight: 900;
}

.birthday-diploma__note {
  margin: 1.6rem 0 0;
  color: var(--plum);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-style: italic;
}

.birthday-diploma__actions {
  margin-top: 1.5rem;
}

.hero {
  position: relative;
  min-height: 92vh;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 6rem clamp(1.2rem, 4vw, 4rem) 5rem;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% center;
}

.hero__shade {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(36, 29, 39, 0.72) 0%, rgba(36, 29, 39, 0.34) 48%, rgba(36, 29, 39, 0.08) 100%),
    linear-gradient(180deg, rgba(36, 29, 39, 0.26) 0%, rgba(36, 29, 39, 0.02) 44%, rgba(255, 250, 244, 0.16) 100%);
}

.topbar {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  right: clamp(1rem, 4vw, 3rem);
  top: 1rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  color: white;
}

.topbar button,
.icon-button {
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(36, 29, 39, 0.28);
  color: white;
  min-height: 42px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem;
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  cursor: pointer;
}

.hero__content {
  width: min(720px, 100%);
  color: white;
  text-shadow: 0 2px 22px rgba(0, 0, 0, 0.42);
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: 0.54rem;
  height: 0.54rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0.75rem 0 0 rgba(216, 168, 79, 0.5);
}

.hero .eyebrow {
  color: #ffe0a5;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(3.2rem, 9vw, 6.4rem);
  line-height: 0.9;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  overflow-wrap: normal;
  word-break: normal;
}

.section-title {
  position: relative;
  display: inline-block;
  max-width: 900px;
  padding-bottom: clamp(0.7rem, 1.6vw, 1.05rem);
  text-wrap: balance;
}

.section-title::before {
  content: "";
  display: block;
  width: clamp(2.4rem, 7vw, 4.2rem);
  height: 0.3rem;
  margin-bottom: clamp(0.55rem, 1.4vw, 0.85rem);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--gold));
}

.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(15rem, 42%);
  height: 0.18rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold), transparent);
}

.band--rose .section-title::before {
  background: linear-gradient(90deg, var(--teal), var(--rose));
}

.band--rose .section-title::after {
  background: linear-gradient(90deg, var(--rose), var(--gold), transparent);
}

.band--ink .section-title::before {
  background: linear-gradient(90deg, #ffd98b, var(--coral));
}

.band--ink .section-title::after {
  background: linear-gradient(90deg, #ffd98b, rgba(255, 255, 255, 0.36), transparent);
}

.finale .section-title {
  margin-left: auto;
  margin-right: auto;
}

.finale .section-title::before {
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, #ffd98b, white);
}

.finale .section-title::after {
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #ffd98b, transparent);
}

p {
  line-height: 1.7;
  overflow-wrap: break-word;
}

.hero__copy {
  width: min(620px, 100%);
  margin: 1.25rem 0 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero__actions,
.center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.button {
  border: 0;
  border-radius: 8px;
  min-height: 48px;
  padding: 0.85rem 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button[hidden] {
  display: none;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
}

.button--primary {
  background: var(--coral);
  color: white;
  box-shadow: 0 14px 34px rgba(239, 118, 95, 0.35);
}

.button--ghost {
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: white;
  background: rgba(255, 255, 255, 0.13);
}

.button--dark {
  background: var(--ink);
  color: white;
}

.button--light {
  background: white;
  color: var(--ink);
}

.band,
.finale {
  padding: clamp(4rem, 8vw, 7rem) clamp(1.2rem, 6vw, 6rem);
}

.band--light {
  background: #fffaf4;
}

.band--rose {
  background: #ffe7df;
}

.band--ink {
  background: var(--ink);
  color: white;
}

.band--ink .section-kicker {
  color: #ffd98b;
}

.band--cream {
  background: var(--cream);
}

.section-heading {
  width: min(860px, 100%);
  margin-bottom: 2rem;
}

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

.mission-card,
.compliment-card,
.letter,
.diploma {
  border-radius: 8px;
}

.mission-card {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(36, 29, 39, 0.08);
}

.mission-card__code {
  color: var(--coral);
  font-weight: 900;
  font-size: 0.85rem;
}

.deck-layout,
.letter-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(1.2rem, 5vw, 4rem);
  align-items: center;
}

.deck-layout > div,
.letter-layout > div {
  max-width: 620px;
}

.compliment-card {
  min-height: 360px;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  align-content: center;
  background:
    linear-gradient(135deg, rgba(33, 111, 115, 0.15), rgba(216, 168, 79, 0.24)),
    white;
  border: 1px solid rgba(36, 29, 39, 0.12);
  box-shadow: var(--shadow);
}

.compliment-card__label {
  margin: 0 0 0.8rem;
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

#complimentTitle {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 1.05;
  font-weight: 900;
}

#complimentDeck {
  margin-top: 1.35rem;
}

.compliment-list {
  display: grid;
  gap: 0.85rem;
  margin: 1.35rem 0 0;
}

.compliment-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(36, 29, 39, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.compliment-list dt {
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.compliment-list dd {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(1.05rem, 1.7vw, 1.35rem);
  line-height: 1.18;
}

.letter {
  padding: clamp(1.5rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.2);
}

.letter p {
  margin: 0 0 1.2rem;
}

.letter p:last-child {
  margin-bottom: 0;
}

.letter-qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
}

.letter-qr img {
  width: 132px;
  height: 132px;
  padding: 0.45rem;
  border-radius: 8px;
  background: white;
}

.letter-qr span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.letter-qr p {
  margin: 0.35rem 0 0.55rem;
}

.letter-qr a {
  color: white;
  font-weight: 900;
  text-decoration-color: rgba(255, 255, 255, 0.46);
  text-underline-offset: 0.25rem;
}

.letter-qr a:hover {
  text-decoration-color: var(--gold);
}

.letter-signature {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffe0a5;
  font-weight: 900;
}

.letter-signature p {
  margin: 0;
  line-height: 1.5;
}

.letter[hidden],
.finale__message[hidden] {
  display: none;
}

[data-stage][hidden] {
  display: none;
}

.diploma {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 4rem);
  text-align: center;
  background:
    linear-gradient(90deg, rgba(216, 168, 79, 0.2), transparent 20%, transparent 80%, rgba(216, 168, 79, 0.2)),
    white;
  border: 2px solid rgba(214, 168, 79, 0.55);
  box-shadow: var(--shadow);
}

.diploma__top {
  margin-top: 0;
  color: var(--plum);
  font-weight: 900;
  text-transform: uppercase;
}

.diploma h3 {
  margin: 0.3rem 0 1rem;
  color: var(--rose);
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 0.95;
}

.diploma__seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 0;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid rgba(200, 85, 103, 0.36);
  border-radius: 8px;
  color: var(--teal);
  font-weight: 900;
}

.center-actions {
  justify-content: center;
}

.finale {
  text-align: center;
  background: var(--plum);
  color: white;
}

.finale .section-kicker {
  width: fit-content;
  color: #ffd98b;
}

.finale p {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.finale__message {
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  left: var(--x);
  width: 10px;
  height: 16px;
  border-radius: 3px;
  background: var(--color);
  transform: rotate(var(--angle));
  animation: fall var(--duration) linear forwards;
}

.music-control {
  position: fixed;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(260px, calc(100vw - 2rem));
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(36, 29, 39, 0.9);
  color: white;
  box-shadow: 0 18px 50px rgba(36, 29, 39, 0.28);
  backdrop-filter: blur(16px);
}

.music-control[hidden] {
  display: none;
}

.music-control__embed {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  overflow: hidden;
  pointer-events: none;
}

.music-control__meta {
  display: grid;
  gap: 0;
  min-width: 0;
  flex: 1;
}

.music-control__meta span,
.music-control__meta small {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.music-control__meta span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.music-control__meta a {
  display: block;
  width: fit-content;
  max-width: 100%;
  color: white;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.2;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 0.2rem;
  white-space: nowrap;
}

.music-control__button {
  border: 0;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 40px;
  padding: 0;
  background: white;
  color: var(--ink);
  font-size: 0;
  font-weight: 900;
  cursor: pointer;
}

.music-control__button::before {
  content: "II";
  font-size: 0.92rem;
  line-height: 1;
}

.music-control__button[aria-pressed="false"]::before {
  content: ">";
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(36, 29, 39, 0.72);
  backdrop-filter: blur(12px);
}

.gate[hidden] {
  display: none;
}

.gate__card {
  width: min(520px, 100%);
  padding: clamp(1.5rem, 5vw, 2.6rem);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 231, 223, 0.85), rgba(255, 250, 244, 0.96)),
    var(--paper);
  box-shadow: var(--shadow);
}

.gate__card h2 {
  font-size: clamp(2rem, 8vw, 3.4rem);
}

.gate__card p {
  margin-bottom: 0;
}

.gate__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.gate--birthday .gate__actions {
  grid-template-columns: minmax(0, 1fr);
}

.gate__continue {
  width: 100%;
  margin-top: 1rem;
}

.gate__message {
  margin: 1rem 0 0;
  padding: 1rem;
  color: var(--plum);
  font-weight: 900;
  border: 1px solid rgba(200, 85, 103, 0.28);
  border-radius: 8px;
  background: white;
}

@keyframes fall {
  to {
    transform: translate3d(var(--drift), 106vh, 0) rotate(680deg);
    opacity: 0.85;
  }
}

@keyframes birthday-petal-drift {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
    opacity: 0;
  }

  12% {
    opacity: 0.9;
  }

  100% {
    transform: translate3d(4rem, 116vh, 0) rotate(360deg);
    opacity: 0;
  }
}

@keyframes birthday-flower-fall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg) scale(0.85);
    opacity: 0;
  }

  10% {
    opacity: 0.78;
  }

  82% {
    opacity: 0.65;
  }

  100% {
    transform: translate3d(var(--flower-drift), 116vh, 0) rotate(520deg) scale(1.08);
    opacity: 0;
  }
}

@keyframes birthday-memory-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }

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

@media (max-width: 980px) {
  .mission-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-layout,
  .letter-layout {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .hero {
    min-height: 88vh;
    padding-top: 7rem;
  }

  .topbar {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .module-picker {
    top: 3.85rem;
    left: 1rem;
  }

  .module-picker button {
    min-height: 44px;
    padding-inline: 0.65rem;
  }

  h1 {
    font-size: clamp(2.6rem, 12vw, 3.2rem);
    line-height: 0.96;
  }

  .hero__image {
    object-position: 70% center;
  }

  .gate__actions,
  .letter-qr,
  .music-control,
  .compliment-list div,
  .mission-grid {
    grid-template-columns: 1fr;
  }

  .music-control {
    left: 1rem;
    right: 1rem;
    align-items: stretch;
  }

  .letter-qr img {
    width: 118px;
    height: 118px;
  }

  .mission-card {
    min-height: auto;
  }

  .birthday-hero {
    min-height: 740px;
    padding-top: 11rem;
  }

  .birthday-number {
    margin-bottom: -0.7rem;
    font-size: clamp(8rem, 42vw, 11rem);
  }

  .birthday-hero h1 {
    font-size: clamp(2.7rem, 12vw, 3.7rem);
  }

  .birthday-hero__actions .button {
    width: 100%;
  }

  .birthday-hero__note {
    margin-top: 3rem;
  }

  .birthday-challenge__actions {
    grid-template-columns: 1fr;
  }

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

  .birthday-challenge__reward {
    grid-template-columns: 1fr;
  }

  .birthday-challenge__reward img {
    max-width: 260px;
  }

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

  .birthday-memory,
  .birthday-memory--wide,
  .birthday-memory--tall {
    grid-column: auto;
    grid-row: auto;
    min-height: min(112vw, 430px);
  }
}

@media print {
  body > *:not(.module--graduation),
  .module--graduation > *:not(main),
  .module--graduation main > *:not(#diploma),
  .module--graduation #diploma .section-heading,
  .module--graduation #diploma .center-actions {
    display: none !important;
  }

  .module--graduation #diploma {
    padding: 0;
    background: white;
  }

  .module--graduation .diploma {
    box-shadow: none;
    min-height: 92vh;
    display: grid;
    align-content: center;
  }
}

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