:root {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --bg: #0b0712;
}

body {
  background: radial-gradient(ellipse at 14% 8%, #1d1026, transparent 30%),
    radial-gradient(ellipse at 86% 37%, #151020, transparent 28%), var(--bg);
}

.memories { background: linear-gradient(180deg, transparent, #130b1c 35% 80%, transparent); }
.finale { background: radial-gradient(circle at 30% 45%, #271435, transparent 36%); }

.hero h1 span,
.planet span,
.photo-meta strong,
.photo-note,
.fortune strong,
dialog h3 {
  font-family: inherit;
}

.hero h1 span { font-weight: 800; }
.hero h1 .hero-dedication {
  display: block;
  color: var(--ink);
  font-size: clamp(1.55rem, 4.45vw, 5.1rem);
  letter-spacing: .04em;
  white-space: nowrap;
  text-shadow: none;
}
.hero h1 .hero-name {
  display: flex;
  align-items: baseline;
  gap: .14em;
  margin-top: .15em;
  white-space: nowrap;
}
.hero-name small {
  color: #e9bfdc;
  font-size: .23em;
  font-weight: 600;
  letter-spacing: 0;
  text-shadow: none;
}
.planet span, dialog h3 { font-weight: 700; }
.photo-meta strong, .fortune strong { font-weight: 600; }
.photo-note { font-weight: 500; }

.portrait-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: clamp(340px, 39vw, 555px);
}

.portrait-light {
  position: absolute;
  width: min(78%, 360px);
  aspect-ratio: 0.82;
  border-radius: 48% 48% 24% 24%;
  border: 1px solid #ffd1c33d;
  background: linear-gradient(150deg, #f2a99542, #803d6b1a 75%);
  box-shadow: inset 0 0 85px #ffad902a, 0 0 100px #dc78942b;
  transform: rotate(9deg);
}

.hero-portrait {
  position: relative;
  display: block;
  width: min(97%, 470px);
  max-height: 510px;
  object-fit: contain;
  filter: drop-shadow(0 26px 28px #09060c80);
  animation: portrait-drift 6s ease-in-out infinite;
}

.portrait-star {
  position: absolute;
  top: 15%;
  right: 12%;
  color: #ffd8c6;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  animation: portrait-drift 5.8s ease-in-out infinite;
}

.portrait-star-small {
  top: 27%;
  right: 5%;
  font-size: clamp(.65rem, 1.25vw, 1.1rem);
  opacity: .75;
  animation-delay: -2s;
}

.portrait-star-medium {
  top: 72%;
  right: auto;
  left: 6%;
  font-size: clamp(1rem, 2vw, 1.65rem);
  opacity: .88;
  animation-delay: -3.6s;
}

.hero-matrix {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 70% 47%, #000 28%, #0009 68%, #0003 100%);
}

.hero-matrix span {
  position: absolute;
  width: var(--pixel-size);
  aspect-ratio: 1;
  border-radius: 1px;
  background: #f8c6e4;
  box-shadow: 0 0 10px #f8a5d980;
  opacity: .24;
  animation: matrix-twinkle var(--period) ease-in-out var(--delay) infinite alternate;
}

@keyframes matrix-twinkle {
  from { opacity: .16; }
  to { opacity: .48; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-matrix span {
    animation: none;
  }
}

@keyframes portrait-drift {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}
