:root {
  color-scheme: dark;
  --ink: #fff8ff;
  --muted: #d8c8ef;
  --violet: #9f72ff;
  --cyan: #71f4ff;
  --gold: #ffd37a;
  --panel: rgba(13, 8, 30, 0.68);
  --line: rgba(255, 255, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #080511;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 10%, #241442 0, #080511 62%);
  color: var(--ink);
  font-family:
    "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  font-weight: 800;
  padding: 0 14px;
  outline: 0;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

input::placeholder {
  color: rgba(216, 200, 239, 0.58);
}

input:focus,
select:focus {
  border-color: rgba(113, 244, 255, 0.82);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(113, 244, 255, 0.14);
}

option {
  color: #10091f;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
}

.stage.is-locked {
  display: none;
}

.gate {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 24px 16px;
}

.gate__panel {
  position: relative;
  width: min(480px, 100%);
  padding: clamp(24px, 7vw, 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 34%),
    rgba(13, 8, 30, 0.76);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.gate__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--cyan), var(--violet));
}

.gate__title {
  margin-bottom: 26px;
  font-size: clamp(2.3rem, 12vw, 4.4rem);
}

.gate label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.gate__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gate .primary {
  width: 100%;
  margin-top: 22px;
}

.gate__error {
  min-height: 28px;
  margin: 14px 0 0;
  color: var(--gold);
  text-align: center;
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

.hero__image,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__image {
  z-index: -2;
  background-image: url("assets/hero-birthday.png");
  background-position: center;
  background-size: cover;
  transform: scale(1.05);
  animation: drift 18s ease-in-out infinite alternate;
}

.hero__shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 5, 17, 0.12), rgba(8, 5, 17, 0.82) 82%),
    radial-gradient(circle at 55% 34%, rgba(113, 244, 255, 0.18), transparent 28%);
}

.hero__content {
  width: min(720px, calc(100% - 32px));
  align-self: end;
  margin: 0 auto;
  padding: 0 0 clamp(48px, 9vh, 96px);
  text-align: center;
}

.kicker,
.chapter__tag {
  margin: 0 0 14px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3.1rem, 13vw, 7.5rem);
  line-height: 0.96;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(159, 114, 255, 0.58);
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: 0;
}

.lead,
.chapter p,
.finale p,
.wishes p {
  margin: 18px auto 0;
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1.02rem, 3.8vw, 1.22rem);
  line-height: 1.8;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(520px, 100%);
  margin: 28px auto 22px;
}

.countdown span,
.wish-grid button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.countdown span {
  min-width: 0;
  padding: 12px 6px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.countdown b {
  display: block;
  color: var(--ink);
  font-size: clamp(1.3rem, 5vw, 2.4rem);
  line-height: 1.1;
}

.primary,
.ghost {
  min-width: 172px;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.primary {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  color: #10091f;
  box-shadow: 0 16px 40px rgba(113, 244, 255, 0.24);
}

.ghost {
  margin-top: 28px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  backdrop-filter: blur(14px);
}

.chapter,
.wishes,
.finale {
  width: min(980px, calc(100% - 32px));
  min-height: 86svh;
  margin: 0 auto;
  padding: clamp(48px, 12vh, 130px) 0;
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 900ms ease,
    transform 900ms ease;
}

.chapter.is-active,
.wishes.is-active,
.finale.is-active {
  opacity: 1;
  transform: translateY(0);
}

.chapter--split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: clamp(24px, 6vw, 70px);
  align-items: center;
}

.sigil {
  position: relative;
  aspect-ratio: 1;
  min-height: 240px;
}

.sigil span {
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(113, 244, 255, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 36px rgba(159, 114, 255, 0.35);
  animation: spin 16s linear infinite;
}

.sigil span:nth-child(2) {
  inset: 25%;
  border-color: rgba(255, 211, 122, 0.56);
  animation-duration: 11s;
  animation-direction: reverse;
}

.sigil span:nth-child(3) {
  inset: 38%;
  background: radial-gradient(circle, rgba(255, 248, 255, 0.95), rgba(159, 114, 255, 0.22) 42%, transparent 68%);
  border: 0;
  animation-duration: 5s;
}

.wish-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 26px;
}

.wish-grid button {
  min-height: 86px;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
}

.wish-grid button.is-open {
  border-color: var(--cyan);
  color: var(--cyan);
}

.wish-text {
  min-height: 72px;
}

.finale {
  text-align: center;
}

.finale .primary {
  margin-top: 28px;
}

@keyframes drift {
  from {
    transform: scale(1.05) translate3d(-1%, -1%, 0);
  }
  to {
    transform: scale(1.11) translate3d(1%, 1%, 0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .hero__content {
    padding-bottom: 34px;
  }

  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .chapter--split,
  .wish-grid {
    grid-template-columns: 1fr;
  }

  .wish-grid button {
    min-height: 62px;
  }
}

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