:root {
  --bg-lilac: #d18bff;
  --bg-mint: #7fffd1;
  --bg-sky: #9de3ff;
  --bg-lemon: #ffd443;
  --bg-peach: #ff9776;
  --bg-rose: #ff6db6;
  --ink: #1c1032;
  --paper: #fff9ea;
  --shadow: #2d0e49;
  --grid: rgba(255, 255, 255, 0.28);
  --font-body: "DotGothic16", sans-serif;
  --font-display: "Syne", sans-serif;
  --font-pixel: "Press Start 2P", "DotGothic16", monospace;
  --font-marquee: "Silkscreen", "DotGothic16", monospace;
  --font-cn-title: "ZCOOL QingKe HuangYou", "Microsoft YaHei", sans-serif;
  --pointer-x: 50vw;
  --pointer-y: 28vh;
  --scroll-progress: 0%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.55) 0 4%, transparent 4.5%),
    radial-gradient(circle at 78% 11%, rgba(255, 243, 122, 0.75) 0 3%, transparent 3.5%),
    radial-gradient(circle at 82% 70%, rgba(110, 255, 190, 0.65) 0 8%, transparent 8.5%),
    linear-gradient(180deg, #bd84ff 0%, #ffb8e0 42%, #8ce8ff 100%);
  background-size: 240px 240px, 280px 280px, 340px 340px, cover;
  font-family: var(--font-body);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.3;
  animation: grid-drift 18s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.95) 0 0.8px, transparent 1.2px),
    radial-gradient(circle at 70% 60%, rgba(28, 16, 50, 0.55) 0 0.6px, transparent 1px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.75) 0 0.8px, transparent 1.2px),
    radial-gradient(circle at 12% 22%, rgba(255, 246, 168, 0.42) 0 1.3px, transparent 2px),
    radial-gradient(circle at 82% 74%, rgba(255, 255, 255, 0.32) 0 1.1px, transparent 1.8px);
  background-size: 18px 18px, 22px 22px, 26px 26px, 180px 180px, 220px 220px;
  mix-blend-mode: soft-light;
  animation: noise-shift 1.8s steps(2) infinite;
}

.scroll-progress {
  position: fixed;
  bottom: 8px;
  left: 16px;
  right: 16px;
  z-index: 40;
  height: 44px;
  pointer-events: none;
}

.scroll-progress-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.scroll-progress-glow,
.scroll-progress-dots,
.scroll-progress-burst,
.scroll-progress-bar {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  border-radius: 999px;
}

.scroll-progress-glow {
  width: 100%;
  height: 14px;
  background:
    linear-gradient(180deg, rgba(232, 255, 250, 0.98), rgba(170, 239, 255, 0.88)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.18) 0 8px,
      rgba(255, 255, 255, 0.03) 8px 16px
    );
  border: 3px solid rgba(45, 14, 73, 0.92);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.45),
    4px 4px 0 rgba(45, 14, 73, 0.55);
  opacity: 1;
}

.scroll-progress-dots {
  width: 100%;
  height: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(45, 14, 73, 0.15) 0 6px,
      transparent 6px 12px
    );
  opacity: 0.52;
}

.scroll-progress-bar {
  width: calc(var(--scroll-progress) + 0.5%);
  max-width: 100%;
  height: 8px;
  left: 4px;
  background:
    repeating-linear-gradient(
      90deg,
      #92eeff 0 10px,
      #e6fdff 10px 20px
    );
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.34),
    2px 2px 0 rgba(45, 14, 73, 0.22);
  transition: width 120ms linear;
}

.scroll-progress-burst {
  display: none;
}

.scroll-progress-flight {
  position: absolute;
  top: 50%;
  left: var(--scroll-progress);
  width: 74px;
  height: 36px;
  transform: translate(-18%, -50%);
  transition: left 120ms linear;
}

.scroll-progress-trail {
  display: none;
}

.scroll-progress-hero {
  position: absolute;
  right: 0;
  top: -8px;
  width: 50px;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(2px 3px 0 rgba(45, 14, 73, 0.28));
  transform-origin: 54% 50%;
  animation: hero-progress-float 2.2s ease-in-out infinite, hero-progress-breathe 2.9s ease-in-out infinite;
}

.ambient-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-scene::before {
  content: "";
  position: absolute;
  inset: -15%;
  background:
    radial-gradient(circle at var(--pointer-x) var(--pointer-y), rgba(255, 255, 255, 0.22), transparent 20%),
    radial-gradient(circle at 14% 20%, rgba(255, 240, 143, 0.16), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(255, 116, 186, 0.18), transparent 26%),
    radial-gradient(circle at 70% 78%, rgba(127, 255, 209, 0.18), transparent 24%);
  filter: blur(18px);
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(3px);
  opacity: 0.65;
  mix-blend-mode: screen;
}

.orb-a {
  top: 9%;
  left: -4%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(255, 245, 141, 0.7) 0%, rgba(255, 245, 141, 0.06) 62%, transparent 72%);
  animation: drift-orb-a 14s ease-in-out infinite;
}

.orb-b {
  top: 34%;
  right: -7%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 112, 186, 0.54) 0%, rgba(255, 112, 186, 0.05) 64%, transparent 76%);
  animation: drift-orb-b 18s ease-in-out infinite;
}

.orb-c {
  bottom: -8%;
  left: 24%;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(127, 255, 209, 0.52) 0%, rgba(127, 255, 209, 0.04) 66%, transparent 76%);
  animation: drift-orb-c 16s ease-in-out infinite;
}

.ambient-particles {
  position: absolute;
  inset: 0;
}

.ambient-particle {
  position: absolute;
  width: var(--size, 8px);
  height: var(--size, 8px);
  left: var(--left, 50%);
  top: var(--top, 50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.24) 48%, transparent 72%);
  opacity: var(--alpha, 0.7);
  animation: particle-drift var(--duration, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
}

.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.08;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.16) 0 2px,
      transparent 2px 5px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(45, 14, 73, 0.04) 0 1px,
      transparent 1px 4px
    );
  animation: crt-scan 7s linear infinite;
}

body.lang-transition::before {
  opacity: 0.52;
}

body.lang-transition::after {
  opacity: 0.38;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100% - 96px));
  margin: 0 auto;
  padding: 92px 0 72px;
}

.top-controls {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  width: min(1480px, calc(100% - 96px));
  padding: 0 4px;
}

.scroll-progress {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 26px;
  z-index: 4;
  height: 34px;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  border: 0;
  border-radius: 0;
  overflow: visible;
}

.scroll-progress-label,
.scroll-progress-percent {
  position: absolute;
  top: -12px;
  z-index: 2;
  font-family: var(--font-pixel);
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scroll-progress-label {
  left: 2px;
  color: rgba(28, 16, 50, 0.76);
  text-shadow:
    0 0 0 rgba(255, 255, 255, 0),
    1px 1px 0 rgba(45, 14, 73, 0.12);
  animation: loading-pulse 1.1s ease-in-out 7, loading-fade-out 8.2s linear forwards;
}

.scroll-progress-percent {
  left: 2px;
  right: auto;
  color: #fff4a4;
  text-shadow:
    0 0 6px rgba(255, 244, 164, 0.28),
    2px 2px 0 rgba(45, 14, 73, 0.36);
  filter: saturate(1.02);
  opacity: 0;
  animation: percent-reveal 8.2s linear forwards, percent-pixel-blink 900ms steps(3) 8.2s 1 forwards;
}

.scroll-progress-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.scroll-progress-glow {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(246, 252, 255, 0.96), rgba(204, 240, 255, 0.92));
  border: 3px solid rgba(45, 14, 73, 0.92);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.55),
    inset 0 -2px 0 rgba(93, 182, 255, 0.22);
}

.scroll-progress-dots {
  position: absolute;
  top: 50%;
  left: 5px;
  width: calc(100% - 10px);
  height: 2px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, rgba(45, 14, 73, 0.12) 0 8px, transparent 8px 16px);
  opacity: 0.48;
}

.scroll-progress-bar {
  position: absolute;
  top: 50%;
  left: 6px;
  width: calc(100% - 12px);
  height: 6px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: repeating-linear-gradient(90deg, #b7f4ff 0 12px, #eafdff 12px 24px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  opacity: 0.96;
}

.scroll-progress-flight {
  position: absolute;
  top: 50%;
  left: 0;
  width: 56px;
  height: 24px;
  transform: translate(-10%, -50%);
  animation: hud-flight 7.2s linear forwards;
}

.scroll-progress-hero {
  position: absolute;
  right: 0;
  top: -6px;
  width: 38px;
}

.scroll-progress-hero--fly {
  animation:
    hero-progress-float 2.2s ease-in-out infinite,
    hero-progress-breathe 2.9s ease-in-out infinite,
    hero-flight-hide 7.2s linear forwards;
}

.scroll-progress-hero--done {
  opacity: 0;
  transform: translateY(3px) scale(0.92);
  transform-origin: 50% 100%;
  animation:
    hero-done-reveal 7.2s linear forwards,
    hero-done-bounce 1.35s ease-in-out 7.2s infinite;
}

.scroll-progress::before,
.scroll-progress::after {
  content: none;
}

.music-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 3px solid var(--shadow);
  border-radius: 50%;
  background: rgba(255, 249, 234, 0.92);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.music-toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.music-toggle.is-on {
  background: #18111f;
  color: #fff6ba;
}

.music-icon {
  position: relative;
  width: 14px;
  height: 20px;
  display: inline-block;
}

.music-icon::before,
.music-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.music-icon::before {
  left: 7px;
  top: 0;
  width: 4px;
  height: 15px;
  border-radius: 3px;
  transform: skewY(-18deg);
}

.music-icon::after {
  left: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.music-toggle.is-on .music-icon {
  animation: speaker-bounce 900ms steps(2) infinite;
}

.lang-toggle {
  display: flex;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  justify-content: flex-end;
  gap: 8px;
}

.lang-button {
  position: relative;
  min-width: 60px;
  padding: 9px 13px;
  border: 3px solid var(--shadow);
  border-radius: 999px;
  background: rgba(255, 249, 234, 0.92);
  color: var(--ink);
  font-family: var(--font-pixel);
  font-size: 11px;
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
  overflow: hidden;
}

.lang-button.is-active {
  background: #18111f;
  color: #fff6ba;
}

.lang-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}

.lang-button::after {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 16%, rgba(255, 102, 184, 0.55) 30%, rgba(132, 232, 255, 0.18) 52%, transparent 70%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.lang-button.jump-glow::after,
.track-button.jump-glow::after {
  animation: button-jump-glow 520ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.pixel-flash {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16) 50%, rgba(28, 16, 50, 0.06) 50%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 247, 183, 0.12) 0 14px,
      rgba(255, 94, 169, 0.14) 14px 28px,
      rgba(132, 232, 255, 0.14) 28px 42px,
      rgba(255, 255, 255, 0.08) 42px 56px
    );
  background-size: 100% 6px, 56px 56px;
  mix-blend-mode: screen;
}

.pixel-flash.active {
  animation: pixel-flicker 460ms steps(5) forwards;
}

.card.reassemble,
.hero.reassemble {
  animation: card-reassemble 560ms steps(6) both;
  animation-delay: var(--delay, 0ms);
}

.card.reassemble::before,
.hero.reassemble::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18) 50%, rgba(255, 255, 255, 0) 50%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 246, 165, 0.18) 0 12px,
      rgba(255, 105, 180, 0.15) 12px 24px,
      rgba(132, 232, 255, 0.15) 24px 36px,
      rgba(255, 255, 255, 0.08) 36px 48px
    );
  background-size: 100% 8px, 48px 48px;
  mix-blend-mode: screen;
  animation: overlay-flicker 560ms steps(6) both;
  animation-delay: var(--delay, 0ms);
}

.panel {
  position: relative;
  border: 5px solid var(--shadow);
  border-radius: 28px;
  box-shadow: 10px 10px 0 var(--shadow);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 220ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 16px;
  border: 2px dashed rgba(28, 16, 50, 0.2);
  border-radius: 18px;
  pointer-events: none;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.22;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.45) 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 78% 72%, rgba(28, 16, 50, 0.08) 0 1px, transparent 1.8px),
    radial-gradient(circle at 60% 28%, rgba(255, 255, 255, 0.24) 0 1px, transparent 2px),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.06) 0 4px,
      rgba(255, 255, 255, 0) 4px 12px
    );
  background-size: 18px 18px, 14px 14px, 16px 16px, 100% 100%;
  mix-blend-mode: soft-light;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  padding: 40px 40px 78px;
  background: linear-gradient(135deg, #ffd83f 0%, #ff98b8 45%, #8ce8ff 100%);
  transform: rotate(-1deg);
  box-shadow: 16px 16px 0 var(--shadow);
}

.hero-copy {
  padding: 18px 10px 20px 8px;
}

.system-tag,
.panel-kicker,
.screen-label,
.track-time,
.quest-time,
.project-rank,
.quest-badge {
  font-family: var(--font-pixel);
  letter-spacing: 0.08em;
}

.system-tag {
  display: inline-block;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #18111f;
  color: #fff9a3;
  border-radius: 14px;
  font-size: 11px;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(3.35rem, 9.8vw, 6.6rem);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #fff7be, 8px 8px 0 var(--shadow);
}

.hero-intro {
  max-width: 34rem;
  margin: 28px 0 34px;
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.9;
  text-transform: uppercase;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-favorites {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 42rem;
  margin-top: 22px;
}

.hero-meta span,
.hero-favorites span,
.chip-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 3px solid var(--shadow);
  border-radius: 999px;
  background: rgba(255, 249, 234, 0.9);
  box-shadow: 4px 4px 0 var(--shadow);
  font-size: 0.92rem;
}

.hero-favorites span {
  min-height: 36px;
  background: rgba(255, 255, 255, 0.68);
}

.hero-stage {
  align-self: end;
  display: grid;
  gap: 20px;
}

.marquee {
  justify-self: start;
  padding: 12px 18px;
  background: #18111f;
  color: #ffffff;
  border-radius: 18px;
  border: 4px solid #fff;
  font-family: var(--font-marquee);
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  box-shadow: 8px 8px 0 #ff5fa9;
  animation: floaty 4s ease-in-out infinite;
}

.screen {
  position: relative;
  min-height: 440px;
  padding: 34px;
  border-radius: 34px;
  border: 8px solid #dd5f8d;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.55), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.15)),
    linear-gradient(135deg, #a4ddff, #c7ffd6 50%, #ffe0ff 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4), 0 16px 40px rgba(45, 14, 73, 0.18);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.65) 0 2px, transparent 2.4px),
    radial-gradient(circle at 78% 30%, rgba(255, 255, 255, 0.75) 0 1.6px, transparent 2px),
    radial-gradient(circle at 55% 72%, rgba(255, 219, 84, 0.75) 0 1.8px, transparent 2.4px);
  background-size: 120px 120px, 140px 140px, 110px 110px;
  opacity: 0.6;
  pointer-events: none;
}

.screen-playfield {
  position: absolute;
  left: 36px;
  top: 34px;
  bottom: 34px;
  right: 36px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    linear-gradient(145deg, rgba(166, 235, 255, 0.6), rgba(204, 255, 209, 0.72));
  border: 5px solid rgba(45, 14, 73, 0.9);
  box-shadow: inset 0 0 0 8px rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.screen-hud {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 2px solid rgba(45, 14, 73, 0.85);
  border-radius: 999px;
  background: rgba(255, 249, 234, 0.82);
  box-shadow: 3px 3px 0 rgba(45, 14, 73, 0.55);
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 0.05em;
  animation: hud-pulse 2.6s ease-in-out infinite;
}

.hud-pill:nth-child(2) {
  animation-delay: 0.2s;
}

.hud-pill:nth-child(3) {
  animation-delay: 0.45s;
}

.screen-playfield::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
  animation: grid-drift 10s linear infinite reverse;
}

.screen-playfield::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 64% 36%, rgba(255, 245, 149, 0.85) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 72%, rgba(255, 255, 255, 0.55) 0 1.6px, transparent 3px),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.06) 0 2px,
      rgba(255, 255, 255, 0) 2px 5px
    );
  opacity: 0.34;
  mix-blend-mode: screen;
  animation: sparkle-shift 3.6s steps(3) infinite;
}

.card h2 {
  margin: 10px 0 14px;
  font-family: var(--font-cn-title);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.8vw, 2.4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.hero-art,
.hero-art-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
}

.hero-art {
  z-index: 2;
  object-fit: cover;
  object-position: center;
  image-rendering: pixelated;
  transform: scale(1.04) translate3d(var(--hero-shift-x, 0px), var(--hero-shift-y, 0px), 0);
  transition: transform 260ms ease;
}

.hero-art-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 24px;
  font-family: var(--font-pixel);
  font-size: clamp(0.9rem, 1.8vw, 1.25rem);
  color: rgba(28, 16, 50, 0.65);
  text-align: center;
  letter-spacing: 0.08em;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.75) 0 4px, transparent 5px),
    radial-gradient(circle at 80% 20%, rgba(255, 235, 116, 0.72) 0 3px, transparent 4px),
    radial-gradient(circle at 50% 75%, rgba(255, 255, 255, 0.7) 0 3px, transparent 4px),
    linear-gradient(145deg, rgba(166, 235, 255, 0.6), rgba(204, 255, 209, 0.72));
}

.layout-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  grid-template-areas:
    "education education"
    "journey journey"
    "portfolio skills"
    "resume contact";
  gap: 38px;
  margin-top: 52px;
}

.card {
  padding: 42px 34px 34px;
  background: var(--paper);
}

.section-companion {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  justify-items: end;
  gap: 0;
  max-width: 92px;
  pointer-events: none;
}

.section-companion-art {
  width: clamp(62px, 7.8vw, 96px);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(3px 4px 0 rgba(45, 14, 73, 0.18));
  transform-origin: 50% 100%;
}

.section-companion-tag {
  display: none;
}

.companion-education .section-companion-art {
  animation: companion-think 3s ease-in-out infinite;
}

.companion-journey .section-companion-art {
  animation: companion-run 1.45s steps(2) infinite;
}

.companion-portfolio .section-companion-art {
  animation: companion-pop 2.2s ease-in-out infinite;
}

.companion-skills .section-companion-art {
  animation: companion-power 1.9s ease-in-out infinite;
}

.companion-resume .section-companion-art,
.companion-contact .section-companion-art {
  animation: companion-victory 2.6s ease-in-out infinite;
}

.companion-education {
  top: 12px;
  right: 16px;
}

.companion-journey {
  top: 10px;
  right: 18px;
}

.companion-portfolio {
  top: 12px;
  right: 16px;
}

.companion-skills {
  top: 12px;
  right: 16px;
}

.companion-resume {
  top: 10px;
  right: 12px;
}

.companion-contact {
  top: 10px;
  right: 12px;
}

.resume-card .section-companion,
.contact-card .section-companion {
  max-width: 78px;
}

.resume-card .section-companion-art,
.contact-card .section-companion-art {
  width: clamp(52px, 6vw, 78px);
}

.panel.interactive:hover {
  filter: saturate(1.06);
  box-shadow: 14px 16px 0 rgba(45, 14, 73, 0.92);
}

.education-card {
  grid-area: education;
  background: linear-gradient(180deg, #9cf0dd 0%, #f2fff8 100%);
}

.xp-card {
  grid-area: journey;
  background: linear-gradient(135deg, #ffaac5 0%, #ffe2b2 52%, #fff6dd 100%);
}

.portfolio-card {
  grid-area: portfolio;
  background: linear-gradient(180deg, #99dfff 0%, #d7f4ff 100%);
}

.skills-card {
  grid-area: skills;
  background: linear-gradient(180deg, #ffb4e5 0%, #ffe4f4 100%);
}

.resume-card {
  grid-area: resume;
  background: linear-gradient(180deg, #c7ff98 0%, #ecffd1 100%);
}

.contact-card {
  grid-area: contact;
  background: linear-gradient(180deg, #ffc0aa 0%, #ffefe7 100%);
  transform: rotate(1deg);
}

.panel-kicker {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: clamp(0.72rem, 1.05vw, 0.9rem);
  line-height: 1.15;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resume-card p:not(.panel-kicker),
.contact-line,
.skill-card p,
.boss-card p,
.boss-card small,
.reward-item span,
.section-lead {
  font-family: var(--font-body);
  line-height: 1.75;
}

.boss-card h3,
.skill-card h3,
.resume-option strong,
.resume-option small,
.qr-copy p {
  font-family: var(--font-body);
}

.section-lead {
  max-width: 50rem;
  margin: 0;
  opacity: 0.84;
}

.boss-lane {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(290px, 34vw);
  gap: 22px;
  margin-top: 28px;
  padding: 6px 6px 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.track-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 6px;
}

.track-button {
  position: relative;
  min-height: 46px;
  padding: 10px 16px;
  border: 3px solid var(--shadow);
  border-radius: 999px;
  background: rgba(255, 249, 234, 0.88);
  color: var(--ink);
  font-family: var(--font-cn-title);
  font-size: 11px;
  box-shadow: 4px 4px 0 var(--shadow);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, color 180ms ease;
  overflow: hidden;
  flex: 0 0 auto;
}

.track-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--shadow);
}

.track-button.is-active {
  background: #18111f;
  color: #fff6ba;
}

.track-button::after {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 16%, rgba(255, 102, 184, 0.55) 30%, rgba(132, 232, 255, 0.18) 52%, transparent 70%);
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.boss-card {
  position: relative;
  min-height: 250px;
  padding: 24px;
  border: 4px solid var(--shadow);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 8px 8px 0 rgba(45, 14, 73, 0.34);
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.boss-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 2px dashed rgba(28, 16, 50, 0.14);
  border-radius: 18px;
  pointer-events: none;
}

.boss-card h3,
.skill-card h3 {
  margin: 8px 0;
  font-size: 1.25rem;
}

.boss-card:hover,
.skill-card:hover,
.reward-item:hover,
.resume-option:hover,
.contact-line:hover {
  transform: translateY(-6px);
  box-shadow: 12px 14px 0 rgba(45, 14, 73, 0.28);
}

.journey-title-main,
.journey-title-role {
  display: inline;
}

.journey-title.is-split .journey-title-main::after {
  content: " \00b7 ";
}

.boss-status,
.boss-time {
  margin: 0;
  font-family: var(--font-pixel);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.boss-status {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #18111f;
  color: #fff4a4;
}

.boss-time {
  opacity: 0.65;
}

.is-active {
  background: linear-gradient(180deg, rgba(255, 249, 171, 0.9), rgba(255, 255, 255, 0.7));
}

.is-cleared {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(234, 245, 255, 0.86));
}

.wide-card {
  min-width: min(520px, 42vw);
}

.journey-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 14px;
}

.journey-topbar h2 {
  margin: 0;
}

.journey-lane {
  grid-auto-columns: minmax(420px, 520px);
  align-items: stretch;
  padding-bottom: 22px;
  scroll-snap-type: x proximity;
}

.journey-lane .boss-card {
  min-width: 0;
  width: 100%;
  scroll-snap-align: start;
}

.journey-lane .wide-card {
  min-width: 0;
}

.skill-deck {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.skill-card {
  position: relative;
  padding: 24px;
  border-radius: 24px;
  border: 4px solid var(--shadow);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 8px 8px 0 rgba(45, 14, 73, 0.32);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.rarity-ssr {
  background: linear-gradient(135deg, #fff899, #ffbecc 56%, #bbf0ff);
}

.rarity-sr {
  background: linear-gradient(135deg, #ffd1ef, #fff2a6 56%, #d7feff);
}

.rarity-r {
  background: linear-gradient(135deg, #edf4ff, #ffe7ff 56%, #e8ffd6);
}

.qr-showcase {
  display: grid;
  grid-template-columns: 158px 1fr;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 3px solid rgba(45, 14, 73, 0.75);
  border-radius: 22px;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.55) 0 3px, transparent 4px),
    radial-gradient(circle at 82% 78%, rgba(255, 234, 119, 0.5) 0 3px, transparent 4px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.22));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.qr-frame {
  position: relative;
  width: 158px;
  aspect-ratio: 1;
  padding: 10px;
  border: 4px solid var(--shadow);
  border-radius: 24px;
  background: linear-gradient(135deg, #fff6a6, #ffd4e8 58%, #b9f3ff);
  box-shadow: 6px 6px 0 rgba(45, 14, 73, 0.28);
  overflow: hidden;
}

.qr-frame.has-image .qr-fallback {
  display: none;
}

.qr-frame::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(45, 14, 73, 0.26);
  border-radius: 16px;
  pointer-events: none;
}

.qr-image,
.qr-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 14px;
}

.qr-image {
  display: block;
  object-fit: cover;
  image-rendering: pixelated;
  filter: saturate(1.06) contrast(1.08);
}

.qr-fallback {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: rgba(28, 16, 50, 0.7);
  background:
    linear-gradient(rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0.03) 50%),
    linear-gradient(135deg, #fff8c7, #ffd8ea 58%, #d7f7ff);
  background-size: 100% 8px, cover;
}

.qr-copy {
  display: grid;
  gap: 10px;
}

.qr-copy p {
  margin: 0;
  line-height: 1.7;
}

.qr-chip {
  display: inline-flex;
  width: fit-content;
  padding: 9px 12px;
  border-radius: 999px;
  border: 3px solid var(--shadow);
  background: #18111f;
  color: #fff6ba;
  font-family: var(--font-pixel);
  font-size: 11px;
  box-shadow: 4px 4px 0 var(--shadow);
}

.project-rank {
  display: inline-block;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: #18111f;
  color: #fff4a4;
  border-radius: 12px;
  font-size: 12px;
}

.skill-card a,
.resume-button {
  display: inline-flex;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 3px solid var(--shadow);
  background: #fff46c;
  color: var(--ink);
  text-decoration: none;
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.skill-card a:hover,
.resume-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--shadow);
}

.cta-button {
  animation: cta-breathe 2.6s ease-in-out infinite;
}

.cta-button:hover {
  animation-play-state: paused;
}

.github-portal {
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff46c, #ffd8a1 58%, #ffb8db);
}

.pixel-octocat {
  position: relative;
  width: 20px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
  image-rendering: pixelated;
  background:
    linear-gradient(#1c1032 0 0) 6px 4px / 8px 8px no-repeat,
    linear-gradient(#fff6ba 0 0) 8px 8px / 2px 2px no-repeat,
    linear-gradient(#fff6ba 0 0) 12px 8px / 2px 2px no-repeat,
    linear-gradient(#1c1032 0 0) 4px 2px / 4px 4px no-repeat,
    linear-gradient(#1c1032 0 0) 12px 2px / 4px 4px no-repeat,
    linear-gradient(#1c1032 0 0) 2px 6px / 2px 8px no-repeat,
    linear-gradient(#1c1032 0 0) 16px 6px / 2px 8px no-repeat,
    linear-gradient(#1c1032 0 0) 6px 12px / 2px 4px no-repeat,
    linear-gradient(#1c1032 0 0) 12px 12px / 2px 4px no-repeat;
  filter: drop-shadow(2px 2px 0 rgba(45, 14, 73, 0.25));
}

.pixel-octocat::before,
.pixel-octocat::after {
  content: "";
  position: absolute;
  background: #1c1032;
}

.pixel-octocat::before {
  left: 8px;
  bottom: 1px;
  width: 4px;
  height: 2px;
}

.pixel-octocat::after {
  right: -4px;
  top: 7px;
  width: 6px;
  height: 2px;
  box-shadow: 2px 2px 0 #1c1032, 4px 4px 0 #1c1032;
}

.reward-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.reward-item {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 3px solid var(--shadow);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 6px 6px 0 rgba(45, 14, 73, 0.22);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.reward-item strong {
  font-family: var(--font-pixel);
  font-size: 11px;
}

.resume-button.disabled {
  opacity: 0.72;
}

.resume-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.resume-option {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 24px;
  border: 4px solid var(--shadow);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 8px 8px 0 rgba(45, 14, 73, 0.28);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.resume-option strong {
  font-size: 1.18rem;
}

.resume-option small {
  line-height: 1.65;
}

.resume-option-tag,
.resume-option-cta {
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 3px solid var(--shadow);
  font-family: var(--font-pixel);
  font-size: 10px;
}

.resume-option-tag {
  background: #18111f;
  color: #fff6ba;
  box-shadow: 4px 4px 0 var(--shadow);
}

.resume-option-cta {
  background: #fff46c;
  box-shadow: 4px 4px 0 var(--shadow);
}

.resume-card code {
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(28, 16, 50, 0.08);
}

.contact-line {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 3px solid var(--shadow);
  background: rgba(255, 255, 255, 0.52);
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.track-card-enter {
  animation: track-card-enter 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--card-delay, 0ms);
}

@keyframes floaty {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes drift-orb-a {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(12%, 8%, 0) scale(1.08);
  }
}

@keyframes drift-orb-b {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-10%, 12%, 0) scale(0.95);
  }
}

@keyframes drift-orb-c {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(8%, -12%, 0) scale(1.04);
  }
}

@keyframes particle-drift {
  0% {
    transform: translate3d(0, 0, 0) scale(0.88);
  }
  50% {
    transform: translate3d(22px, -48px, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-10px, -96px, 0) scale(0.92);
  }
}

@keyframes hero-progress-float {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-1deg);
  }
  50% {
    transform: translate3d(0, -5px, 0) rotate(1.2deg);
  }
}

@keyframes hero-progress-breathe {
  0%, 100% {
    filter: drop-shadow(2px 3px 0 rgba(45, 14, 73, 0.28));
  }
  50% {
    filter: drop-shadow(3px 4px 0 rgba(45, 14, 73, 0.34));
  }
}

@keyframes hero-flight-hide {
  0%, 99% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes hero-done-reveal {
  0%, 99% {
    opacity: 0;
    transform: translateY(3px) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hud-flight {
  0% {
    left: 0;
  }
  100% {
    left: calc(100% - 44px);
  }
}

@keyframes loading-pulse {
  0%, 100% {
    opacity: 0.68;
    text-shadow:
      0 0 0 rgba(255, 255, 255, 0),
      1px 1px 0 rgba(45, 14, 73, 0.12);
  }
  50% {
    opacity: 1;
    text-shadow:
      0 0 8px rgba(255, 255, 255, 0.22),
      0 0 12px rgba(183, 244, 255, 0.2),
      1px 1px 0 rgba(45, 14, 73, 0.18);
  }
}

@keyframes loading-fade-out {
  0%, 98% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes percent-reveal {
  0%, 98% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes percent-pixel-blink {
  0% {
    opacity: 0.14;
    transform: translateY(0) scale(0.96);
    text-shadow:
      0 0 0 rgba(255, 244, 164, 0),
      2px 2px 0 rgba(45, 14, 73, 0.3);
  }
  22% {
    opacity: 1;
    transform: translateY(-1px) scale(1);
    text-shadow:
      0 0 10px rgba(255, 244, 164, 0.52),
      0 0 18px rgba(255, 255, 255, 0.34),
      2px 2px 0 rgba(45, 14, 73, 0.42);
  }
  40% {
    opacity: 0.26;
    transform: translateY(0) scale(0.97);
    text-shadow:
      0 0 0 rgba(255, 244, 164, 0),
      2px 2px 0 rgba(45, 14, 73, 0.28);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    text-shadow:
      0 0 8px rgba(255, 244, 164, 0.38),
      2px 2px 0 rgba(45, 14, 73, 0.4);
  }
}

@keyframes hero-done-bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-2px) scale(1.02);
  }
}

@keyframes companion-think {
  0%, 100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-3px) rotate(2deg);
  }
}

@keyframes companion-run {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
  }
  50% {
    transform: translateY(-3px) translateX(2px) scale(1.02);
  }
}

@keyframes companion-pop {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-4px) scale(1.04);
  }
}

@keyframes companion-power {
  0%, 100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }
  50% {
    transform: translateY(-3px) rotate(2deg) scale(1.03);
  }
}

@keyframes companion-victory {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.02);
  }
}

@keyframes pixel-flicker {
  0% {
    opacity: 0;
    transform: scale(1.01);
  }
  12% {
    opacity: 0.95;
  }
  28% {
    opacity: 0.2;
  }
  44% {
    opacity: 0.78;
  }
  66% {
    opacity: 0.1;
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}

@keyframes noise-shift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  25% {
    transform: translate3d(-0.5%, 0.35%, 0);
  }
  50% {
    transform: translate3d(0.45%, -0.25%, 0);
  }
  75% {
    transform: translate3d(-0.2%, 0.15%, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes grid-drift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 28px 14px, 14px 28px;
  }
}

@keyframes crt-scan {
  0% {
    transform: translateY(-1%);
    opacity: 0.06;
  }
  50% {
    transform: translateY(1%);
    opacity: 0.1;
  }
  100% {
    transform: translateY(-1%);
    opacity: 0.06;
  }
}

@keyframes sparkle-shift {
  0%,
  100% {
    opacity: 0.2;
    transform: translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.42;
    transform: translate3d(0.4%, -0.5%, 0);
  }
}

@keyframes hud-pulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 3px 3px 0 rgba(45, 14, 73, 0.55);
  }
  50% {
    transform: translateY(-3px);
    box-shadow: 4px 6px 0 rgba(45, 14, 73, 0.48);
  }
}

@keyframes track-card-enter {
  0% {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(0.96) rotate(-1deg);
  }
  60% {
    opacity: 1;
    transform: translate3d(0, -5px, 0) scale(1.01) rotate(0.2deg);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) rotate(0);
  }
}


@keyframes card-reassemble {
  0% {
    opacity: 0.22;
    transform: translateY(20px) scale(0.96);
    filter: saturate(1.45) contrast(1.2) blur(1px);
    clip-path: inset(0 0 78% 0);
  }
  18% {
    opacity: 0.55;
    clip-path: inset(12% 0 46% 0);
  }
  36% {
    opacity: 0.8;
    transform: translateY(-8px) scale(1.01);
    clip-path: inset(42% 0 18% 0);
  }
  54% {
    clip-path: inset(18% 0 32% 0);
  }
  78% {
    opacity: 0.94;
    transform: translateY(4px) scale(0.995);
    filter: saturate(1.12) contrast(1.08) blur(0);
    clip-path: inset(6% 0 8% 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: none;
    clip-path: inset(0 0 0 0);
  }
}

@keyframes overlay-flicker {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 0.92;
  }
  42% {
    opacity: 0.24;
  }
  68% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

@keyframes button-jump-glow {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  24% {
    opacity: 1;
  }
  55% {
    opacity: 0.82;
    transform: scale(1.12);
  }
  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes speaker-bounce {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 6px rgba(255, 246, 186, 0.7));
  }
}

@keyframes cta-breathe {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    box-shadow: 5px 5px 0 var(--shadow);
  }
  50% {
    transform: translate(-1px, -2px) scale(1.03);
    box-shadow: 9px 9px 0 var(--shadow);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    transform: none;
    padding-bottom: 74px;
  }

  .screen-hud {
    top: 14px;
    right: 16px;
  }

  .screen {
    min-height: 620px;
  }

  .screen-playfield {
    left: 28px;
    right: 28px;
    top: 28px;
    width: auto;
    min-width: 0;
    bottom: 28px;
  }

  .layout-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "education"
      "journey"
      "portfolio"
      "skills"
      "resume"
      "contact";
  }

  .portfolio-card,
  .skills-card,
  .contact-card {
    transform: none;
  }

  .boss-lane {
    grid-auto-columns: minmax(280px, 82vw);
  }

  .journey-topbar {
      flex-direction: column;
      align-items: flex-start;
      gap: 14px;
      margin: 10px 0 16px;
    }

  .track-switch {
      justify-content: flex-start;
      margin-top: 0;
    }

  .journey-lane {
    grid-auto-columns: minmax(300px, 84vw);
  }

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

  .resume-options {
    grid-template-columns: 1fr;
  }

  .qr-showcase {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 36px, 1440px);
    padding-top: 70px;
    padding-bottom: 40px;
  }

  .top-controls {
    top: 10px;
    width: min(100% - 20px, 1440px);
    gap: 8px;
    padding: 0;
  }

  .scroll-progress {
    left: 16px;
    right: 16px;
    bottom: 16px;
    height: 24px;
  }

  .scroll-progress-label,
  .scroll-progress-percent {
    top: -10px;
    font-size: 7px;
  }

  .scroll-progress-glow {
    height: 8px;
  }

  .scroll-progress-flight {
    width: 44px;
    height: 18px;
    transform: translate(-10%, -50%);
  }

  .scroll-progress-hero {
    top: -5px;
    width: 28px;
  }

  .music-toggle {
    width: 40px;
    height: 40px;
    box-shadow: 2px 2px 0 var(--shadow);
  }

  .lang-button {
    min-width: 48px;
    padding: 7px 9px;
    font-size: 9px;
    box-shadow: 2px 2px 0 var(--shadow);
  }

  .panel {
    border-radius: 22px;
    box-shadow: 7px 7px 0 var(--shadow);
  }

  .panel::after {
    inset: 12px;
    border-radius: 14px;
  }

  .hero {
    padding: 22px;
  }

  .card {
    padding: 40px 22px 22px;
  }

  .section-companion {
    top: 10px;
    right: 10px;
    gap: 0;
    max-width: 68px;
  }

  .section-companion-art {
    width: 50px;
  }

  .hero {
    gap: 18px;
    padding-bottom: 56px;
  }

  .hero-copy {
    padding: 6px 2px 4px;
  }

  .screen {
    min-height: 392px;
    padding: 14px;
  }

  .screen-hud {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .hud-pill {
    min-height: 24px;
    padding: 5px 8px;
    box-shadow: 2px 2px 0 rgba(45, 14, 73, 0.55);
    font-size: 8px;
  }

  .screen-playfield {
    left: 14px;
    right: 14px;
    top: 14px;
    bottom: 14px;
  }

  .hero-art {
    object-position: 71% center;
  }

  .hero h1 {
    font-size: clamp(1.82rem, 11.2vw, 2.9rem);
    line-height: 0.9;
    letter-spacing: 0;
    word-break: break-word;
    text-shadow: 2px 2px 0 #fff7be, 4px 4px 0 var(--shadow);
  }

  .system-tag,
  .panel-kicker {
    font-size: 0.68rem;
  }

  .hero-intro {
    margin: 14px 0 18px;
    font-size: 0.76rem;
    line-height: 1.4;
  }

  .hero-meta,
  .hero-favorites {
    gap: 8px;
    max-width: none;
  }

  .hero-meta span,
  .hero-favorites span {
    min-height: 30px;
    padding: 5px 9px;
    font-size: 0.66rem;
    box-shadow: 2px 2px 0 var(--shadow);
  }

  .marquee {
    width: 100%;
    justify-self: stretch;
    padding: 9px 12px;
    border-width: 3px;
    border-radius: 14px;
    font-size: 0.74rem;
    box-shadow: 4px 4px 0 #ff5fa9;
  }

  .card h2 {
    font-size: clamp(1.18rem, 6.2vw, 1.68rem);
  }

  .section-lead,
  .boss-card p,
  .skill-card p,
  .reward-item span,
  .resume-option small,
  .contact-line,
  .qr-copy p {
    font-size: 0.88rem;
    line-height: 1.65;
  }

  .boss-card h3,
  .skill-card h3,
  .resume-option strong {
    font-size: 1.08rem;
  }

  .journey-title-main,
  .journey-title-role {
    display: block;
  }

  .journey-title-main::after {
    content: "";
  }

  .journey-title-role {
    margin-top: 4px;
  }

  .boss-time,
  .boss-status,
  .project-rank,
  .qr-chip,
  .reward-item strong,
  .resume-option-tag,
  .resume-option-cta {
    font-size: 0.5rem;
    letter-spacing: 0.05em;
  }

  .boss-status,
  .project-rank,
  .qr-chip,
  .resume-option-tag,
  .resume-option-cta {
    padding: 5px 8px;
    border-radius: 9px;
    box-shadow: 2px 2px 0 var(--shadow);
  }

  .boss-card,
  .skill-card,
  .reward-item {
    padding: 18px;
  }

  .boss-lane,
  .journey-lane {
    margin-top: 22px;
    padding: 4px 0 18px;
  }

  .ambient-orb {
    opacity: 0.45;
  }
}

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