:root {
  --bg: #0B0E14;
  --panel: #111830;
  --panel-2: #0D1428;
  --ink: #04060A;
  --line: #26314C;
  --line-bright: #46587A;
  --text: #DCE4F2;
  --muted: #8A96AD;
  --green: #7CFC6B;
  --green-soft: #9BE38F;
  --purple: #A78BFA;
  --yellow: #FFD75E;
  --orange: #FFA94D;
  --px: 4px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(167, 139, 250, 0.09), transparent 62%),
    radial-gradient(900px 480px at 8% 108%, rgba(124, 252, 107, 0.07), transparent 62%),
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 4px 4px, 4px 4px, auto;
  color: var(--text);
  font-family: "Zpix", "Microsoft YaHei", "PingFang SC", monospace;
  font-size: 16px;
  line-height: 1.9;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--green);
  color: var(--ink);
}

.en {
  font-family: "Press Start 2P", "Zpix", monospace;
  font-weight: 400;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.crt {
  position: fixed;
  inset: 0;
  z-index: 9400;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.52));
}

.page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 48px) clamp(16px, 3vw, 28px) 24px;
  display: grid;
  gap: clamp(18px, 3vw, 28px);
}

.panel {
  position: relative;
  background: var(--panel);
  border: 4px solid transparent;
  border-image: url("../assets/img/frame.svg") 4 / 4px stretch;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.35);
  scroll-margin-top: 20px;
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.panel__head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0.04em;
}

.plate {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--green);
  padding: 6px 8px 5px;
  box-shadow: 3px 3px 0 var(--ink);
}

.plate--purple {
  background: var(--purple);
}

.plate--yellow {
  background: var(--yellow);
}

.panel__note {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.prose p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 2.05;
  max-width: 46em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #182138;
  border: 3px solid var(--line-bright);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s steps(2, end), background-color 0.12s linear, color 0.12s linear,
    border-color 0.12s linear;
}

.btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: var(--ink);
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--ghost {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
  background: transparent;
  border-color: #39466A;
}

.hero {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
  padding: clamp(20px, 3.4vw, 34px);
}

.hero__portrait {
  text-align: center;
}

.portrait {
  position: relative;
  background: var(--ink);
  border: 4px solid transparent;
  border-image: url("../assets/img/frame.svg") 4 / 4px stretch;
  padding: 8px;
  box-shadow: 0 0 0 4px var(--ink), 0 0 36px rgba(255, 169, 77, 0.2);
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  filter: saturate(0.92) contrast(1.05);
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
}

.portrait__cap {
  margin: 12px 0 0;
  font-size: 10px;
  color: var(--green);
  letter-spacing: 0.1em;
}

.portrait__cap::before {
  content: "●";
  margin-right: 6px;
  animation: pulse 1.8s steps(2, end) infinite;
}

.hero__kicker {
  font-size: 18px;
}

.hero__name {
  margin: 10px 0 6px;
  font-size: clamp(36px, 6vw, 48px);
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-shadow: 3px 3px 0 rgba(124, 252, 107, 0.22);
}

.hero__name:focus {
  outline: none;
}

.hero__sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.hero__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 0 0 18px;
}

.hero__fields div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 6px;
  min-width: 0;
}

.hero__fields dt {
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.hero__fields dd {
  margin: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.is-online {
  color: var(--green);
}

.is-online::before {
  content: "●";
  margin-right: 6px;
  animation: pulse 1.8s steps(2, end) infinite;
}

.hero__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quests {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.quest {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  background: var(--panel-2);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.1s steps(2, end), border-color 0.12s linear, background-color 0.12s linear;
}

.quest:hover,
.quest:focus-visible {
  background: #121B33;
  border-color: var(--green);
  transform: translateX(4px);
}

.quest__no {
  font-size: 11px;
  color: var(--purple);
}

.quest__name {
  overflow-wrap: anywhere;
}

.quest__tag {
  font-size: 12px;
  padding: 4px 8px;
  color: var(--green);
  border: 2px solid var(--green);
  white-space: nowrap;
}

.quest__tag--doing {
  color: var(--yellow);
  border-color: var(--yellow);
}

.quest__tag--doing::before {
  content: "●";
  margin-right: 6px;
  animation: blink 1.1s steps(2, start) infinite;
}

.quest__go {
  color: var(--muted);
}

.quest:hover .quest__go,
.quest:focus-visible .quest__go {
  color: var(--green);
}

.stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.stat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px 12px;
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  text-align: left;
  background: var(--panel-2);
  border: 3px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: border-color 0.12s linear, background-color 0.12s linear;
}

.stat:hover,
.stat:focus-visible {
  background: #121B33;
  border-color: var(--purple);
}

.stat__name {
  overflow-wrap: anywhere;
}

.stat__num {
  font-size: 11px;
  color: var(--yellow);
}

.stat__bar {
  grid-column: 1 / -1;
  display: block;
  height: 14px;
  background: #080D1A;
  border: 2px solid #1E2840;
  overflow: hidden;
}

.stat__fill {
  display: block;
  height: 100%;
  width: calc(var(--v) * 1%);
  background: var(--green);
  -webkit-mask-image: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px);
  mask-image: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px);
}

.js .stat__fill {
  width: 0;
  transition: width 0.9s steps(14, end);
}

.stat.is-visible .stat__fill {
  width: calc(var(--v) * 1%);
}

.stat:hover .stat__fill {
  box-shadow: 0 0 10px rgba(124, 252, 107, 0.55);
}

.stat__desc {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.panel--quote {
  text-align: center;
  background:
    radial-gradient(120% 140% at 50% 0%, rgba(255, 215, 94, 0.08), transparent 62%),
    var(--panel);
  padding: clamp(30px, 5vw, 52px) clamp(18px, 4vw, 40px);
}

.quote {
  margin: 18px 0 0;
}

.quote p {
  margin: 0 auto;
  max-width: 32em;
  font-size: clamp(17px, 2.4vw, 22px);
  line-height: 2.1;
}

.quote p::before {
  content: "「";
  color: var(--yellow);
}

.quote p::after {
  content: "」";
  color: var(--yellow);
}

.quote footer {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 20px 4px 8px;
  color: var(--muted);
  font-size: 12px;
}

.foot p {
  margin: 0;
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 9300;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
  transform-origin: center;
}

.boot__inner {
  width: min(580px, 100%);
}

.boot__brand {
  margin: 0 0 20px;
  font-size: clamp(12px, 3vw, 16px);
  letter-spacing: 0.12em;
  color: var(--green);
}

.boot__log {
  min-height: 12em;
  font-size: 14px;
  line-height: 2.1;
  color: var(--green-soft);
}

.boot__log span {
  display: block;
}

.boot__log span:last-child {
  color: var(--yellow);
}

.boot--off {
  animation: power-off 0.5s steps(5, end) forwards;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.15;
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes power-off {
  0% {
    opacity: 1;
    transform: scaleY(1);
  }
  70% {
    opacity: 1;
    transform: scaleY(0.02);
  }
  100% {
    opacity: 0;
    transform: scaleY(0.002);
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero__portrait {
    width: min(250px, 62%);
    justify-self: center;
  }

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

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

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

  .quest {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 12px 12px;
    gap: 10px;
  }

  .quest__go {
    display: none;
  }

  .panel__head h2 {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .js .stat__fill {
    transition: none;
  }
}

.prose p.is-typing::after {
  content: "▌";
  margin-left: 2px;
  color: var(--yellow);
  animation: blink 0.9s steps(2, start) infinite;
}

summary {
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.quest__go {
  transition: transform 0.16s steps(3, end), color 0.12s linear;
}

details[open] .quest__go {
  transform: rotate(90deg);
  color: var(--green);
}

.quest__body {
  margin-top: 8px;
  padding: 14px 16px;
  background: #0A0F1E;
  border: 3px solid var(--line);
  border-left: 6px solid var(--purple);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  animation: reveal 0.22s steps(4, end);
}

.quest__body p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 2;
  max-width: 46em;
}

.quest__body p:last-child {
  margin-bottom: 0;
}

.stat__go {
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.16s steps(3, end), color 0.12s linear;
}

details[open] .stat__go {
  transform: rotate(90deg);
  color: var(--green);
}

.stat__body {
  margin-top: 8px;
  padding: 12px 14px;
  background: #0A0F1E;
  border: 3px solid var(--line);
  border-left: 6px solid var(--green);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  animation: reveal 0.22s steps(4, end);
}

.stat__body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
  max-width: 46em;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rail {
  display: none;
}

.neon {
  margin: 0;
  writing-mode: vertical-rl;
  letter-spacing: 0.38em;
  font-size: 15px;
  color: var(--green);
  text-shadow: 0 0 10px rgba(124, 252, 107, 0.55), 0 0 2px rgba(124, 252, 107, 0.9);
  animation: neon-flicker 5s steps(2, end) infinite;
}

.neon--purple {
  color: var(--purple);
  letter-spacing: 0.3em;
  text-shadow: 0 0 10px rgba(167, 139, 250, 0.6), 0 0 2px rgba(167, 139, 250, 0.9);
}

.hud {
  margin: 0;
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.deco--sprite {
  position: relative;
  padding: 6px;
  background: #05070C;
  border: 3px solid var(--line-bright);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5);
  animation: deco-float 7s steps(10, end) infinite alternate;
}

.deco--sprite .bubble {
  position: absolute;
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
  padding: 3px 6px;
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--green);
  background: var(--panel);
  border: 2px solid var(--line-bright);
  box-shadow: 2px 2px 0 var(--ink);
}

.deco--sprite .bubble--low {
  top: auto;
  bottom: -15px;
  color: var(--purple);
}

.deco--sprite:nth-of-type(odd) {
  animation-delay: -2.5s;
}

.sprite {
  display: block;
  width: 76px;
  height: 76px;
  image-rendering: pixelated;
}

.deco--sprite-sm .sprite {
  width: 58px;
  height: 58px;
}

.deco--scan {
  width: 60px;
  height: 44px;
  border: 2px solid var(--line);
  background: repeating-linear-gradient(
    to bottom,
    rgba(124, 252, 107, 0.32) 0 2px,
    transparent 2px 6px
  );
  animation: deco-scan 5s steps(12, end) infinite;
}

.deco--barcode {
  width: 74px;
  height: 30px;
  background: repeating-linear-gradient(90deg, #C9D4E4 0 2px, transparent 2px 5px);
}

.deco--stripes {
  width: 74px;
  height: 14px;
  border: 2px solid var(--ink);
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 215, 94, 0.55) 0 6px,
    rgba(4, 6, 10, 0.9) 6px 12px
  );
}

.deco--circuit {
  display: block;
}

@keyframes deco-float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-9px);
  }
}

@keyframes deco-scan {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 24px;
  }
}

@keyframes neon-flicker {
  0%,
  100% {
    opacity: 1;
  }
  46% {
    opacity: 1;
  }
  48% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
  72% {
    opacity: 0.7;
  }
}

@media (min-width: 1280px) {
  .rail {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 5;
    width: 118px;
    padding: 52px 0 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 16px;
    pointer-events: none;
  }

  .rail--l {
    left: 0;
  }

  .rail--r {
    right: 0;
  }

  .rail .neon {
    opacity: 0.6;
  }

  .rail .hud {
    opacity: 0.4;
  }

  .rail .deco--sprite {
    opacity: 0.62;
  }

  .rail .deco--scan,
  .rail .deco--barcode,
  .rail .deco--stripes,
  .rail .deco--circuit {
    opacity: 0.45;
  }
}

@media (min-width: 1280px) and (max-height: 700px) {
  .rail .deco--scan,
  .rail .deco--barcode,
  .rail .deco--stripes,
  .rail .deco--circuit,
  .rail .deco--sprite-sm,
  .rail .hud {
    display: none;
  }
}
