:root {
  color-scheme: light;
  --background: #fff8fb;
  --paper: rgba(255, 248, 251, 0.91);
  --text: #762242;
  --muted: #a95073;
  --accent: #e9367c;
  --accent-soft: #f36d9f;
  --art: #d92f72;
  --line: #e8a6bf;
  --line-soft: #f4cfdd;
  --display: "Bodoni 72", Didot, "Iowan Old Style", Baskerville, Georgia,
    "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--background);
  color: var(--text);
  font: 13px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}

body.entered {
  overflow-x: hidden;
  overflow-y: auto;
}

button,
a {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* One fixed scene behind everything: sky overhead, haze at the horizon,
   and a Palawan lagoon along the bottom. The ASCII layer paints its clouds
   blue up top, pink in the middle, and its karst islands and water teal. */
body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      circle at 86% 6%,
      rgba(255, 238, 178, 0.95) 0%,
      rgba(255, 238, 178, 0.45) 9%,
      rgba(255, 238, 178, 0) 24%
    ),
    linear-gradient(
      180deg,
      #a4cfee 0%,
      #c6e1f5 20%,
      #e9f2f9 44%,
      #fbf3f6 66%,
      #f5eef1 83.5%,
      #d5ece9 87.5%,
      #b3dfd9 100%
    );
  content: "";
  pointer-events: none;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--art);
  font: 12px/1 var(--mono);
  opacity: 0.66;
  pointer-events: none;
  user-select: none;
  white-space: pre;
}

body.transitioning #sky {
  z-index: 3;
}

/* Dragon transition: the seam between home and the birthday page follows the
   dragon; photos trail behind it on a kite string. */
.seam-glow {
  position: fixed;
  top: 0;
  bottom: 0;
  left: -90px;
  z-index: 2;
  display: none;
  width: 180px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
}

.dragon-tail,
.dragon-string {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: none;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dragon-string {
  z-index: 7;
  fill: none;
  stroke: rgba(118, 34, 66, 0.45);
  stroke-width: 1;
  stroke-linejoin: round;
}

body.transitioning .seam-glow,
body.transitioning .dragon-tail,
body.transitioning .dragon-string {
  display: block;
}

.tail-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 118px;
  margin: 0;
  border: 6px solid rgba(255, 253, 253, 0.97);
  background: #fff;
  box-shadow: 0 12px 30px rgba(72, 48, 69, 0.2);
  padding-bottom: 10px;
  opacity: 0;
  will-change: transform;
}

.tail-photo img,
.tail-photo canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px;
  background: transparent;
  text-align: center;
  cursor: default;
}

.screen[hidden] {
  display: none;
}

.home-content {
  position: relative;
  width: min(780px, 100%);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2.35rem, 6.5vw, 5.4rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.04;
  text-transform: none;
  text-shadow: 0 0 10px rgba(233, 54, 124, 0.14);
}

.names {
  font-size: 11px;
}

.names-heart {
  display: inline-block;
  margin: 0 0.5em;
  color: var(--accent);
  font-family: var(--display);
  font-size: 17px;
  line-height: 0;
  vertical-align: -1px;
}

.rule {
  width: min(330px, 72vw);
  height: 17px;
  margin: 13px auto 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: min(690px, 100%);
  margin: 46px auto 0;
}

.stat {
  display: flex;
  min-height: 82px;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 0 22px;
}

.stat + .stat {
  border-left: 1px solid var(--line-soft);
}

.stat dt {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  line-height: 1.45;
  text-transform: uppercase;
}

.stat dd {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1;
  text-shadow: 0 0 8px rgba(233, 54, 124, 0.14);
}

.stat dd.infinity {
  font-family: var(--display);
  font-size: 2.75rem;
  line-height: 0.72;
}

.sunshine-icon {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  margin: 8px auto 0;
  place-items: center;
  color: #f5b51b;
  filter: drop-shadow(0 0 3px rgba(245, 181, 27, 0.38));
  font-size: 27px;
  line-height: 1;
  transition: color 180ms ease, filter 180ms ease, transform 300ms ease;
}

.sunshine-icon::before,
.sunshine-icon::after {
  position: absolute;
  inset: 1px;
  border: 1px solid #f5b51b;
  border-radius: 50%;
  content: "";
  opacity: 0;
  pointer-events: none;
}

.sunshine-icon:hover {
  color: #ffc83d;
  filter: drop-shadow(0 0 7px rgba(245, 181, 27, 0.78));
  transform: rotate(35deg) scale(1.16);
}

.sunshine-icon:hover::before {
  animation: sunshine-radiate 1.1s ease-out infinite;
}

.sunshine-icon:hover::after {
  animation: sunshine-radiate 1.1s 350ms ease-out infinite;
}

@keyframes sunshine-radiate {
  from {
    opacity: 0.8;
    transform: scale(0.45);
  }
  to {
    opacity: 0;
    transform: scale(2.4);
  }
}

.enter-prompt {
  margin: 44px 0 0;
  border: 1px solid rgba(233, 54, 124, 0.28);
  border-radius: 999px;
  background: rgba(255, 248, 251, 0.72);
  box-shadow: 0 8px 28px rgba(118, 34, 66, 0.07);
  color: var(--accent);
  padding: 11px 18px;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  animation: button-float 3.4s ease-in-out infinite;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.enter-prompt span {
  display: inline-block;
  margin-left: 8px;
  transition: transform 180ms ease;
}

.enter-prompt:hover {
  animation-play-state: paused;
  border-color: rgba(233, 54, 124, 0.58);
  box-shadow: 0 10px 34px rgba(118, 34, 66, 0.11);
}

.enter-prompt:focus-visible {
  animation-play-state: paused;
}

.enter-prompt:hover span {
  transform: translateX(3px);
}

@keyframes button-float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  18% {
    transform: translateY(-5px) rotate(0deg);
  }
  36% {
    transform: translateY(0) rotate(0deg);
  }
  46% {
    transform: translateY(-7px) rotate(-3deg);
  }
  54% {
    transform: translateY(-3px) rotate(3deg);
  }
  62% {
    transform: translateY(-6px) rotate(-2deg);
  }
  70% {
    transform: translateY(0) rotate(0deg);
  }
  85% {
    transform: translateY(-4px) rotate(0deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

.birthday {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: none;
}

body.entered .birthday,
body.transitioning .birthday {
  display: block;
}

.birthday-hero {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.birthday-hero h2 {
  max-width: calc(100vw - 48px);
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 6.25rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

/* The title's ink is a gradient clipped to the glyphs. It has to live on
   each split letter rather than the heading, because a clip on the parent
   doesn't paint through transformed children. */
.birthday-hero h2:not(.is-split),
.birthday-hero h2 .char {
  background: linear-gradient(180deg, #e9367c 0%, #b8285e 55%, #762242 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.transitioning .birthday-hero h2:not(.is-live) {
  visibility: hidden;
}

/* Sampaguita garland under the title. Blossoms open one by one. */
.garland {
  display: block;
  width: min(640px, 92vw);
  height: auto;
  margin: 22px auto 0;
  overflow: visible;
}

.garland .string {
  fill: none;
  stroke: rgba(118, 34, 66, 0.45);
  stroke-width: 0.9;
}

.garland .bloom {
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0);
}

.birthday.is-blooming .garland .bloom {
  animation: bloom 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
  animation-delay: calc(var(--i) * 65ms + 0.25s);
}

.garland .petal {
  fill: #fffdfd;
  stroke: rgba(233, 54, 124, 0.32);
  stroke-width: 0.6;
}

.garland .heart {
  fill: #f7d58f;
}

.garland .bud {
  fill: #fff6f9;
  stroke: rgba(233, 54, 124, 0.32);
  stroke-width: 0.6;
}

.garland .leaf {
  fill: #a9cf9b;
  stroke: rgba(70, 120, 70, 0.35);
  stroke-width: 0.5;
}

@keyframes bloom {
  from {
    transform: scale(0) rotate(-40deg);
  }
  to {
    transform: scale(1) rotate(0deg);
  }
}

.birthday-hero h2:focus {
  outline: none;
}

.birthday-hero h2::before {
  display: block;
  margin-bottom: 18px;
  color: var(--accent-soft);
  content: "♡";
  font-size: 19px;
  line-height: 1;
}

.scroll-note {
  position: absolute;
  bottom: 30px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
  opacity: 0.68;
  text-transform: uppercase;
}

.back-home {
  position: fixed;
  top: 22px;
  right: 24px;
  z-index: 4;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: var(--paper);
  color: var(--muted);
  padding: 4px 0;
  font-size: 9px;
  letter-spacing: 0.13em;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 150ms ease, border-color 150ms ease;
}

.back-home:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.keepsake-section,
.discord-section {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 100px 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}

.section-number {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
}

.section-heading h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 34px 22px;
  padding: 12px 6px;
}

.polaroid {
  display: block;
  width: 100%;
  margin: 0;
  border: 8px solid rgba(255, 253, 253, 0.97);
  cursor: zoom-in;
  font: inherit;
  text-align: inherit;
  background: #fff;
  box-shadow: 0 10px 30px rgba(72, 48, 69, 0.14);
  padding-bottom: 22px;
  transform: rotate(var(--tilt));
  transition: transform 320ms cubic-bezier(0.18, 0.89, 0.32, 1.2), box-shadow 320ms ease;
}

.polaroid:hover {
  box-shadow: 0 16px 38px rgba(72, 48, 69, 0.2);
  transform: rotate(0deg) scale(1.03);
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

.discord-section {
  padding-top: 40px;
}

/* Moments: one film strip per folder, scrolling sideways. */
.moments-section {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0 0;
}

.moment + .moment {
  margin-top: 54px;
}

.moment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.moment-head h4 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

.moment-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.film {
  position: relative;
  border-radius: 4px;
  background: rgba(255, 252, 253, 0.7);
  padding: 16px 0;
}

.film::before,
.film::after {
  position: absolute;
  right: 0;
  left: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--line-soft) 0 12px,
    transparent 12px 26px
  );
  content: "";
}

.film::before {
  top: 4px;
}

.film::after {
  bottom: 4px;
}

.filmstrip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 10px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.frame {
  flex: 0 0 auto;
  width: 240px;
  margin: 0;
  border: 5px solid #fff;
  background: #fff;
  box-shadow: 0 8px 22px rgba(72, 48, 69, 0.12);
  scroll-snap-align: start;
}

.frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.frame-index {
  display: block;
  padding: 6px 2px 1px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Card on the main page that opens the moments page. */
.moments-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 252, 253, 0.9);
  box-shadow: 0 14px 40px rgba(118, 34, 66, 0.08);
  color: inherit;
  padding: 24px 28px;
  text-decoration: none;
  transition: transform 320ms cubic-bezier(0.18, 0.89, 0.32, 1.2), box-shadow 320ms ease;
}

.moments-link:hover,
.moments-link:focus-visible {
  box-shadow: 0 20px 50px rgba(118, 34, 66, 0.14);
  transform: translateY(-3px);
}

.moments-link-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.moments-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.moments-chip {
  border: 1px dashed var(--line);
  border-radius: 999px;
  color: var(--text);
  padding: 7px 13px;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1;
}

/* Moments index: big cover cards. */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.cover {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 8px;
  background: #1a0a10;
  box-shadow: 0 16px 44px rgba(72, 48, 69, 0.22);
  color: #fff;
  aspect-ratio: 4 / 3;
  text-decoration: none;
  transition: transform 360ms cubic-bezier(0.18, 0.89, 0.32, 1.2), box-shadow 360ms ease;
}

.cover:hover,
.cover:focus-visible {
  box-shadow: 0 24px 60px rgba(72, 48, 69, 0.3);
  transform: translateY(-4px);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms ease;
}

.cover:hover img {
  transform: scale(1.04);
}

.cover-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(180deg, rgba(20, 4, 10, 0), rgba(20, 4, 10, 0.78));
  padding: 60px 20px 18px;
}

.cover-title {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.cover-count {
  flex: 0 0 auto;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Photos spread out at their natural shapes, masonry style. */
.spread {
  columns: 4 240px;
  column-gap: 14px;
}

.spread-item,
.wall .tile {
  display: block;
  overflow: hidden;
  margin: 0 0 14px;
  border: 0;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 0;
  break-inside: avoid;
  cursor: zoom-in;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.spread-item:hover,
.spread-item:focus-visible,
.wall .tile:hover,
.wall .tile:focus-visible {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.spread-item img,
.wall .tile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

/* Moments index: one full-width band per moment, in that moment's theme. */
.bands {
  width: 100%;
  padding: 20px 0 0;
}

.moment-band {
  position: relative;
  overflow: hidden;
  padding: 56px 0 48px;
}

.moment-band + .moment-band {
  margin-top: 24px;
}

.moment-band-inner {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
}

.moment-band .moment-head {
  margin-bottom: 22px;
}

.moment-band .band-open {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}

.moment-band.theme-sky {
  background: rgba(255, 252, 253, 0.55);
}

.moment-band.theme-rave {
  --text: #ffd9e1;
  --muted: #d98fa3;
  --accent: #ff3d6e;
  background: linear-gradient(180deg, #1c0510 0%, #12040a 55%, #0b0206 100%);
  color: var(--text);
}

/* Stage lights: the glows live on their own layer so they can pulse. */
.moment-band.theme-rave::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 40, 90, 0.42), transparent 38%),
    radial-gradient(circle at 88% 30%, rgba(200, 20, 70, 0.36), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255, 90, 60, 0.22), transparent 46%);
  content: "";
  animation: stage-lights 7s ease-in-out infinite alternate;
  pointer-events: none;
}

.moment-band.theme-rave .moment-head h4 {
  color: var(--text);
  text-shadow: 0 0 24px rgba(255, 61, 110, 0.55);
}

.moment-band.theme-rave .moment-count {
  color: var(--muted);
}

.moment-band.theme-rave .spread-item {
  box-shadow: 0 10px 30px rgba(255, 40, 90, 0.18);
}

.moment-band.theme-rave .spread-item:hover {
  box-shadow: 0 18px 50px rgba(255, 40, 90, 0.36);
}

/* A single moment: photos scattered like a pinboard, plus a viewer. */
.scatter-section {
  width: min(1500px, calc(100% - 24px));
  margin: 0 auto;
  padding: 10px 0 80px;
}

.scatter {
  position: relative;
}

.pin {
  position: absolute;
  top: var(--y);
  left: var(--x);
  display: block;
  width: var(--w);
  transform: translateX(-50%) rotate(var(--rot));
  animation: pin-float var(--float) ease-in-out var(--delay) infinite alternate;
  cursor: zoom-in;
  transition: transform 260ms ease, box-shadow 260ms ease;
}

.pin:hover,
.pin:focus-visible {
  z-index: 20 !important;
  animation-play-state: paused;
  transform: translateX(-50%) rotate(0deg) scale(1.06);
}

.pin img {
  display: block;
  width: 100%;
  height: auto;
}

.pin-polaroid {
  border: 7px solid #fff;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  padding-bottom: 20px;
}

.pin-polaroid .pin-label {
  position: absolute;
  bottom: 4px;
  left: 8px;
  color: #b8788f;
  font-size: 8px;
  letter-spacing: 0.2em;
}

.pin-print {
  border: 3px solid #2a0a14;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 61, 110, 0.45), 0 14px 40px rgba(255, 40, 90, 0.35);
}

@keyframes pin-float {
  from {
    translate: 0 -6px;
  }
  to {
    translate: 0 6px;
  }
}

body[data-theme="sky"] .pin-print {
  border-color: #fff;
  box-shadow: 0 14px 36px rgba(72, 48, 69, 0.22);
}

/* A single moment: a wall of big photos and a full-screen viewer. */
.wall-section {
  width: min(1600px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 60px;
}

.wall {
  columns: 4 300px;
  column-gap: 14px;
}

.tile {
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 0;
  cursor: zoom-in;
  transition: transform 300ms ease, box-shadow 300ms ease;
}

.tile:hover,
.tile:focus-visible {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.tile img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  border: 0;
  background: rgba(8, 2, 5, 0.94);
  padding: 0;
  color: #fff;
}

.lightbox::backdrop {
  background: rgba(8, 2, 5, 0.6);
}

.lightbox img {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 92%;
  max-height: 88%;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
}

.lightbox-nav {
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.lightbox-index {
  position: absolute;
  bottom: 18px;
  left: 50%;
  margin: 0;
  font-size: 9px;
  letter-spacing: 0.2em;
  transform: translateX(-50%);
}

.track-toggle {
  margin: 22px auto 0;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(233, 54, 124, 0.28);
  color: #fff;
  padding: 11px 20px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.track-toggle:hover {
  box-shadow: 0 12px 28px rgba(233, 54, 124, 0.36);
  transform: translateY(-1px);
}

.track-toggle[aria-pressed="true"] {
  background: transparent;
  color: var(--accent);
}

/* Rave theme: dark maroon ground, embers in the sky, stage lights. */
body[data-theme="rave"] {
  --background: #12040a;
  --paper: rgba(30, 6, 14, 0.9);
  --text: #ffd9e1;
  --muted: #d98fa3;
  --accent: #ff3d6e;
  --accent-soft: #ff7a9c;
  --line: rgba(255, 120, 150, 0.45);
  --line-soft: rgba(255, 120, 150, 0.22);
  color-scheme: dark;
  background: var(--background);
}

body[data-theme="rave"]::before {
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 40, 90, 0.42), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(200, 20, 70, 0.38), transparent 36%),
    radial-gradient(circle at 50% 100%, rgba(255, 90, 60, 0.22), transparent 44%),
    linear-gradient(180deg, #1c0510 0%, #12040a 55%, #0b0206 100%);
  animation: stage-lights 7s ease-in-out infinite alternate;
}

@keyframes stage-lights {
  from {
    filter: brightness(0.85);
  }
  to {
    filter: brightness(1.25);
  }
}

body[data-theme="rave"] #sky {
  opacity: 0.88;
}

/* Let the stage and crowd have the first screen; photos start below. */
body[data-theme="rave"] .scatter-section {
  padding-top: 44vh;
}

body[data-theme="rave"] .moments-hero h2 {
  text-shadow: 0 0 24px rgba(255, 61, 110, 0.55);
}

body[data-theme="rave"] .back-home {
  background: rgba(30, 6, 14, 0.85);
}

body[data-theme="rave"] .tile {
  box-shadow: 0 10px 30px rgba(255, 40, 90, 0.16);
}

body[data-theme="rave"] .tile:hover,
body[data-theme="rave"] .tile:focus-visible {
  box-shadow: 0 18px 50px rgba(255, 40, 90, 0.32);
}

body[data-theme="rave"] footer {
  border-color: var(--line-soft);
}

/* The moments page itself. */
.moments-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(56px, 12vh, 120px) 24px 24px;
  text-align: center;
}

/* On short windows the scene needs the room more than the heading does. */
@media (max-height: 720px) {
  .moments-hero h2 {
    font-size: clamp(2rem, 5vw, 3.6rem);
  }

  .moments-hero .track-toggle {
    margin-top: 14px;
  }
}

.moments-hero h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.moments-blurb {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-moments .moments-section {
  padding-bottom: 40px;
}

/* The Discord invite is a little ticket: a stub with an ASCII house, a
   dashed perforation, the copy, and a button. */
.invite {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0 34px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background:
    radial-gradient(circle at 100% 0%, rgba(174, 220, 240, 0.35), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(255, 197, 218, 0.4), transparent 40%),
    rgba(255, 252, 253, 0.94);
  box-shadow: 0 14px 40px rgba(118, 34, 66, 0.08);
  color: inherit;
  padding: 26px 30px 26px 0;
  text-decoration: none;
  transition: transform 320ms cubic-bezier(0.18, 0.89, 0.32, 1.2), box-shadow 320ms ease;
}

.invite:hover,
.invite:focus-visible {
  box-shadow: 0 20px 50px rgba(118, 34, 66, 0.14);
  transform: translateY(-3px);
}

.invite-stub {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
  justify-content: center;
  min-width: 150px;
  border-right: 1px dashed var(--line);
  padding: 4px 26px;
}

.invite-house {
  margin: 0;
  color: var(--accent);
  font: 11px/1.15 var(--mono);
  white-space: pre;
}

.invite-stub-label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
}

.invite-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.invite-kicker {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.invite-title {
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.invite-text {
  max-width: 520px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.invite-action {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 8px 22px rgba(233, 54, 124, 0.28);
  color: #fff;
  padding: 12px 20px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.invite-action span {
  display: inline-block;
  margin-left: 6px;
  transition: transform 200ms ease;
}

.invite:hover .invite-action {
  box-shadow: 0 12px 28px rgba(233, 54, 124, 0.36);
  transform: translateY(-1px);
}

.invite:hover .invite-action span {
  transform: translate(2px, -2px);
}

/* Sound controls, tucked in the top-left corner on both screens. */
.sound-panel {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-volume {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 251, 0.82);
  color: var(--muted);
  padding: 5px 11px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.music-volume input {
  width: 78px;
  height: 12px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.sound-toggle {
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: rgba(255, 248, 251, 0.82);
  color: var(--muted);
  padding: 6px 11px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 180ms ease, border-color 180ms ease;
}

.sound-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sound-toggle[aria-pressed="false"] {
  opacity: 0.6;
}

body.transitioning .sound-panel {
  visibility: hidden;
}

/* Tapping around the hero should never select the text. */
.screen,
.birthday-hero,
.sound-panel {
  -webkit-user-select: none;
  user-select: none;
}

/* A short note that types itself out under the garland. */
.letter {
  max-width: 540px;
  margin: 34px auto 0;
  text-align: center;
}

.letter-eyebrow {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.letter-text {
  min-height: 3.2em;
  margin: 0;
  color: var(--text);
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.55;
}

.letter-text.is-typing::after {
  display: inline-block;
  width: 0.45em;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  content: "";
  vertical-align: -0.15em;
  animation: cursor-blink 0.9s steps(2, start) infinite;
}

.letter-sign {
  margin: 12px 0 0;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 600ms ease;
}

.letter-sign.is-visible {
  opacity: 1;
}

@keyframes cursor-blink {
  to {
    visibility: hidden;
  }
}

.birthday-hero {
  cursor: default;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(1040px, calc(100% - 40px));
  margin: 40px auto 0;
  border-top: 1px solid var(--line-soft);
  padding: 26px 0 38px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 640px) {
  #sky {
    font-size: 10px;
  }

  .home-content {
    width: 100%;
  }

  .stats {
    width: min(330px, 100%);
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .stat {
    min-height: auto;
    padding: 14px 8px;
  }

  .stat + .stat {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .enter-prompt {
    margin-top: 30px;
  }

  .invite {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px;
  }

  .invite-stub {
    align-self: auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px dashed var(--line);
    padding: 0 0 16px;
  }

  .invite-action {
    justify-self: start;
  }

  .letter {
    margin-top: 26px;
  }

  .frame {
    width: 200px;
  }

  .music-volume input {
    width: 56px;
  }

  .moments-link {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .spread,
  .wall {
    columns: 2 140px;
    column-gap: 8px;
  }

  .spread-item,
  .wall .tile {
    margin-bottom: 8px;
  }

  .moment-band {
    padding: 36px 0 32px;
  }

  .pin-polaroid {
    border-width: 5px;
    padding-bottom: 14px;
  }

  .wall-section {
    width: calc(100% - 16px);
  }

  .keepsake-section,
  .discord-section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .photo-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 14px;
  }

  .tail-photo {
    width: 88px;
  }
}

@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;
  }

  .polaroid {
    transform: none;
  }

  .garland .bloom {
    transform: none;
  }

}
