: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-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 {
  margin: 0;
  border: 8px solid rgba(255, 253, 253, 0.97);
  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;
}

.discord-section {
  padding-top: 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);
}

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

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

}
