:root {
  color-scheme: dark;
  --ink: #fff9ea;
  --muted: rgba(255, 249, 234, 0.72);
  --panel: rgba(20, 23, 33, 0.58);
  --line: rgba(255, 255, 255, 0.18);
  --red: #ef4d48;
  --gold: #ffd36a;
  --jade: #68d8ba;
  --blue: #73b7ff;
  --rose: #ff9fa0;
  --night: #111522;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(239, 77, 72, 0.24), transparent 30rem),
    radial-gradient(circle at 85% 18%, rgba(104, 216, 186, 0.22), transparent 32rem),
    linear-gradient(140deg, #121522 0%, #27324a 45%, #63383a 72%, #ba6246 100%);
  color: var(--ink);
  font-family: "Noto Serif SC", "STSong", serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 38%), rgba(255, 211, 106, 0.15), transparent 18rem),
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.08) 48%, transparent 58% 100%);
  mix-blend-mode: screen;
  opacity: 0.88;
}

button {
  font: inherit;
}

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

.page-shell {
  position: relative;
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 88px 0 112px;
}

.hero::before {
  position: absolute;
  inset: 0 50%;
  width: 100vw;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(rgba(10, 12, 20, 0.12), rgba(10, 12, 20, 0.26)),
    url("./assets/gaokao-hero.png") center top / min(100vw, 1900px) auto no-repeat,
    linear-gradient(to bottom, rgba(10, 12, 20, 0.18), rgba(10, 12, 20, 0.1) 45%, rgba(10, 12, 20, 0.66) 100%),
    radial-gradient(ellipse at center, rgba(10, 12, 20, 0.3), rgba(10, 12, 20, 0.08) 42%, transparent 70%);
  transform: translateX(-50%);
}

.hero__ribbon {
  position: absolute;
  top: 16vh;
  left: 50%;
  width: min(820px, 84vw);
  height: 220px;
  pointer-events: none;
  border: 1px solid rgba(255, 211, 106, 0.22);
  border-right: 0;
  border-left: 0;
  opacity: 0.48;
  transform: translateX(-50%) rotate(-7deg);
  animation: ribbonDrift 9s ease-in-out infinite;
}

.hero__seal {
  display: inline-grid;
  min-height: 38px;
  margin-bottom: 22px;
  padding: 8px 15px;
  place-items: center;
  border: 1px solid rgba(255, 211, 106, 0.42);
  border-radius: 999px;
  background: rgba(20, 23, 33, 0.34);
  color: rgba(255, 249, 234, 0.86);
  font-size: 0.92rem;
  box-shadow: 0 0 36px rgba(255, 211, 106, 0.14);
  backdrop-filter: blur(12px);
}

.hero__content {
  position: relative;
  width: min(920px, 100%);
  text-align: center;
}

.hero__eyebrow,
.section-heading p,
.letter__kicker {
  margin: 0 0 18px;
  color: var(--gold);
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  font-size: clamp(1rem, 2vw, 1.28rem);
  letter-spacing: 0;
}

.hero h1 {
  position: relative;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3.6rem, 11vw, 8.8rem);
  font-weight: 900;
  line-height: 0.98;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: titleGlow 6.6s ease-in-out infinite;
}

.hero h1::after {
  position: absolute;
  inset: auto 8% -18px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 211, 106, 0.92), transparent);
  box-shadow: 0 0 28px rgba(255, 211, 106, 0.5);
}

.hero h1 span {
  display: inline-block;
  opacity: 0;
  animation: charRise 720ms cubic-bezier(0.2, 0.9, 0.2, 1.1) forwards;
}

.hero h1 .name-char {
  color: var(--gold);
  text-shadow:
    0 0 12px rgba(255, 211, 106, 0.48),
    0 8px 32px rgba(0, 0, 0, 0.34);
}

.hero__poem {
  width: min(760px, 100%);
  margin: 30px auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.9;
}

.hero__actions,
.signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.hero__actions {
  flex-wrap: wrap;
  margin-top: 42px;
}

.btn {
  position: relative;
  min-width: 154px;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.btn::before {
  position: absolute;
  inset: -2px;
  z-index: -1;
  content: "";
  background: linear-gradient(110deg, transparent 0 34%, rgba(255, 255, 255, 0.45) 45%, transparent 57% 100%);
  transform: translateX(-110%);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:hover::before {
  animation: sheen 760ms ease;
}

.btn:focus-visible,
.step:focus-visible,
.letter__close:focus-visible {
  outline: 3px solid rgba(255, 211, 106, 0.78);
  outline-offset: 4px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--red), #ff8a5b 54%, var(--gold));
  box-shadow: 0 16px 38px rgba(239, 77, 72, 0.28);
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.hero__sun {
  position: absolute;
  bottom: 8vh;
  left: 50%;
  width: min(54vw, 640px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 226, 124, 0.72) 0 14%, rgba(255, 146, 89, 0.28) 36%, transparent 70%),
    conic-gradient(from 30deg, transparent, rgba(255, 211, 106, 0.38), transparent 34%);
  filter: blur(2px);
  opacity: 0.7;
  transform: translateX(-50%);
  animation: sunPulse 8s ease-in-out infinite;
}

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  width: 28px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  transform: translateX(-50%);
}

.scroll-cue span {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateX(-50%);
  animation: cue 1.7s ease-in-out infinite;
}

.wish-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 32px 0 110px;
}

.blessing-river {
  width: 100vw;
  margin: -58px 0 92px 50%;
  overflow: hidden;
  border-block: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 11, 18, 0.32);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.blessing-river__track {
  display: flex;
  width: max-content;
  gap: 18px;
  padding: 18px 0;
  animation: blessingFlow 22s linear infinite;
}

.blessing-river__track::after {
  display: flex;
  gap: 18px;
  content: "金榜题名  前程似锦  心之所向  得偿所愿  一路生花  万事胜意  山海无阻  热爱长明";
  white-space: pre;
}

.blessing-river span,
.blessing-river__track::after {
  color: rgba(255, 249, 234, 0.82);
  font-size: clamp(1rem, 2.6vw, 1.8rem);
  text-shadow: 0 0 22px rgba(255, 211, 106, 0.28);
}

.blessing-river span {
  display: inline-block;
  min-width: max-content;
  padding-inline: 10px;
}

.wish-card,
.stage,
.letter__paper {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.wish-card {
  min-height: 246px;
  padding: 28px;
  border-radius: 8px;
  transform: translateY(26px);
  opacity: 0;
  transition:
    transform 700ms ease,
    opacity 700ms ease,
    background 240ms ease;
}

.wish-card.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.wish-card:hover {
  background: rgba(35, 38, 50, 0.72);
  transform: translateY(-6px);
}

.wish-card__mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-bottom: 44px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 211, 106, 0.14);
  color: var(--gold);
}

.wish-card h2 {
  margin: 0 0 14px;
  font-size: 1.55rem;
}

.wish-card p,
.stage p,
.letter__paper p,
.signature p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.82;
}

.timeline {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 28px;
  align-items: stretch;
  padding: 10px 0 120px;
}

.section-heading {
  align-self: center;
}

.section-heading h2,
.signature h2,
.letter__paper h2 {
  margin: 0;
  font-size: clamp(2.05rem, 5vw, 4.4rem);
  line-height: 1.14;
}

.steps {
  display: grid;
  gap: 12px;
}

.step {
  width: 100%;
  min-height: 92px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    border-color 180ms ease;
}

.step:hover,
.step.is-active {
  border-color: rgba(255, 211, 106, 0.52);
  background: rgba(255, 211, 106, 0.14);
  transform: translateX(4px);
}

.step strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.step span {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.stage {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(190px, 0.45fr) 1fr;
  gap: 26px;
  align-items: center;
  min-height: 240px;
  padding: 26px;
  border-radius: 8px;
}

.stage__visual {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(104, 216, 186, 0.22), transparent 54%),
    radial-gradient(circle at 50% 36%, rgba(255, 211, 106, 0.6), transparent 18%),
    linear-gradient(160deg, rgba(115, 183, 255, 0.22), rgba(239, 77, 72, 0.18));
}

.stage__visual span {
  position: absolute;
  bottom: 28px;
  width: 34%;
  height: 58%;
  border-radius: 999px 999px 0 0;
  background: rgba(255, 249, 234, 0.14);
  transform-origin: bottom;
  animation: lantern 3.6s ease-in-out infinite;
}

.stage__visual span:nth-child(1) {
  left: 13%;
}

.stage__visual span:nth-child(2) {
  left: 34%;
  height: 72%;
  animation-delay: -1.1s;
}

.stage__visual span:nth-child(3) {
  right: 13%;
  animation-delay: -2.2s;
}

.stage p {
  font-size: clamp(1.22rem, 2vw, 1.7rem);
}

.constellation {
  display: grid;
  grid-template-columns: 0.76fr 1.24fr;
  gap: 30px;
  align-items: center;
  padding: 6px 0 120px;
}

.wish-machine {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  padding: clamp(26px, 5vw, 46px);
  border: 1px solid rgba(255, 211, 106, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(circle at 76% 24%, rgba(255, 211, 106, 0.24), transparent 16rem),
    radial-gradient(circle at 22% 74%, rgba(104, 216, 186, 0.2), transparent 18rem),
    rgba(18, 22, 34, 0.66);
  box-shadow: var(--shadow), inset 0 0 70px rgba(255, 211, 106, 0.06);
  backdrop-filter: blur(18px);
}

.wish-machine::before {
  position: absolute;
  inset: 18px;
  pointer-events: none;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.wish-machine__sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wish-machine__sky span {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 28px var(--gold);
  animation: orbitStar 5s ease-in-out infinite;
}

.wish-machine__sky span:nth-child(1) {
  top: 22%;
  left: 16%;
}

.wish-machine__sky span:nth-child(2) {
  top: 18%;
  right: 22%;
  animation-delay: -1.2s;
}

.wish-machine__sky span:nth-child(3) {
  bottom: 22%;
  left: 34%;
  animation-delay: -2.4s;
}

.wish-machine__sky span:nth-child(4) {
  right: 18%;
  bottom: 26%;
  animation-delay: -3.2s;
}

.wish-machine p {
  position: relative;
  width: min(620px, 100%);
  margin: 36px 0 30px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.72;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}

.wish-machine.is-changing p {
  animation: fortuneIn 520ms ease both;
}

.signature {
  min-height: 70vh;
  flex-direction: column;
  padding: 90px 0 120px;
  text-align: center;
}

.signature h2 {
  width: min(860px, 100%);
}

.signature .btn {
  margin-top: 18px;
}

.letter {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
}

.letter[hidden] {
  display: none;
}

.letter__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 11, 18, 0.68);
  backdrop-filter: blur(12px);
}

.letter__paper {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100svh - 40px));
  overflow: auto;
  padding: clamp(26px, 5vw, 54px);
  border-radius: 8px;
  animation: paperIn 360ms ease both;
}

.letter__paper strong {
  display: block;
  margin-top: 24px;
  color: var(--gold);
  font-size: 1.22rem;
}

.letter__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
}

.spark {
  position: fixed;
  z-index: 9;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--gold);
  box-shadow: 0 0 18px currentColor;
  animation: floatBlessing 920ms ease-out forwards;
}

.meteor {
  position: fixed;
  z-index: 8;
  width: 160px;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 249, 234, 0), rgba(255, 249, 234, 0.95));
  filter: drop-shadow(0 0 12px rgba(255, 211, 106, 0.86));
  transform: rotate(-22deg);
  animation: meteorFly 1150ms ease-in forwards;
}

.blessing-toast {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 34px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 211, 106, 0.36);
  border-radius: 999px;
  background: rgba(16, 19, 29, 0.72);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
  animation: toastIn 2400ms ease forwards;
}

@keyframes sheen {
  to {
    transform: translateX(110%);
  }
}

@keyframes sunPulse {
  50% {
    opacity: 0.92;
    transform: translateX(-50%) scale(1.04);
  }
}

@keyframes ribbonDrift {
  50% {
    opacity: 0.72;
    transform: translateX(-50%) rotate(7deg) translateY(14px);
  }
}

@keyframes titleGlow {
  50% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 18px rgba(255, 211, 106, 0.34));
  }
}

@keyframes charRise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.92);
  }

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

@keyframes blessingFlow {
  to {
    transform: translateX(-50%);
  }
}

@keyframes cue {
  70%,
  100% {
    opacity: 0;
    transform: translate(-50%, 17px);
  }
}

@keyframes lantern {
  50% {
    transform: scaleY(1.08) translateY(-8px);
  }
}

@keyframes paperIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
}

@keyframes floatBlessing {
  to {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.4);
  }
}

@keyframes orbitStar {
  50% {
    opacity: 0.45;
    transform: translateY(-14px) scale(1.45);
  }
}

@keyframes fortuneIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes meteorFly {
  from {
    opacity: 0;
    transform: translate3d(var(--start-x), var(--start-y), 0) rotate(-22deg);
  }

  18% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate3d(var(--end-x), var(--end-y), 0) rotate(-22deg);
  }
}

@keyframes toastIn {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px);
  }

  12%,
  82% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 28px, 680px);
  }

  .hero {
    min-height: 100svh;
    padding: 56px 0 90px;
  }

  .hero::before {
    background:
      linear-gradient(to bottom, rgba(8, 10, 18, 0.18), rgba(8, 10, 18, 0.42) 43%, rgba(8, 10, 18, 0.86) 100%),
      url("./assets/gaokao-hero.png") center top / cover no-repeat,
      radial-gradient(ellipse at center, rgba(10, 12, 20, 0.2), rgba(10, 12, 20, 0.28) 42%, transparent 70%);
  }

  .hero__content {
    margin-top: 22svh;
  }

  .hero__seal {
    margin-bottom: 16px;
  }

  .wish-board,
  .timeline,
  .constellation {
    grid-template-columns: 1fr;
  }

  .wish-card {
    min-height: 210px;
  }

  .stage {
    grid-template-columns: 1fr;
  }

  .constellation {
    padding-bottom: 96px;
  }
}

@media (max-width: 520px) {
  .hero h1 {
    font-size: clamp(2.85rem, 15.2vw, 4.1rem);
    line-height: 1.08;
  }

  .hero h1 span:nth-child(4) {
    width: 100%;
  }

  .hero__eyebrow {
    font-size: 1rem;
  }

  .hero__poem {
    margin-top: 24px;
    font-size: 1rem;
    line-height: 1.78;
  }

  .hero__actions,
  .signature {
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .signature {
    text-align: left;
  }

  .blessing-toast {
    border-radius: 8px;
  }
}

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