:root {
  --deep-space: #0A0E23;
  --muted-blue: #1E2749;
  --cream: #F5EFE0;
  --dark-brown: #1F1710;
  --red-orange: #D94F37;
  --nebula-purple: #6C4A8C;
  --silver: #E0E0E0;
  --gold: #C9A227;
  --text-on-dark: #E8E8E8;
  --focus-border: #D94F37;
  --font-headline: "Orbitron", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --content-max: 74rem;
  --ease: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1px 1px at 18% 22%, rgba(224, 224, 224, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, rgba(224, 224, 224, 0.28) 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 65%, rgba(224, 224, 224, 0.2) 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 82%, rgba(224, 224, 224, 0.22) 50%, transparent 51%),
    var(--deep-space);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  line-height: 1.7;
}

::selection {
  background: var(--red-orange);
  color: #ffffff;
}

a {
  color: var(--silver);
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-headline);
  line-height: 1.25;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--focus-border);
  outline-offset: 3px;
  border-radius: 2px;
}

.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--cream);
  color: var(--dark-brown);
  font-weight: 600;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: relative;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 70%, rgba(255, 255, 255, 0.15) 50%, transparent 51%),
    linear-gradient(180deg, rgba(5, 8, 20, 0.95), rgba(16, 23, 54, 0.9));
  border-bottom: 1px solid rgba(224, 224, 224, 0.14);
  text-align: center;
}

.header-inner {
  position: relative;
  padding-top: clamp(1.5rem, 4vw, 2.75rem);
  padding-bottom: 1.25rem;
}

.header-version {
  margin: 0 0 0.75rem;
  font-family: var(--font-headline);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.9;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.brand-name {
  font-family: var(--font-headline);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.05;
  color: var(--cream);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.brand-tag {
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  color: var(--nebula-purple);
  text-transform: uppercase;
  padding-left: 0.42em;
}

.site-nav {
  border-block: 1px solid rgba(224, 224, 224, 0.12);
  background: rgba(6, 9, 25, 0.72);
}

.nav-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  counter-reset: navIndex;
}

.nav-item {
  counter-increment: navIndex;
}

.nav-link {
  display: inline-block;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: rgba(224, 224, 224, 0.82);
  border-bottom: 2px solid transparent;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.nav-link::before {
  content: counter(navIndex, decimal-leading-zero) " / ";
  font-family: var(--font-headline);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  vertical-align: 0.25em;
  opacity: 0.55;
  margin-right: 0.35rem;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--cream);
  border-bottom-color: var(--gold);
  background: rgba(201, 162, 39, 0.06);
}

.nav-link[aria-current="page"] {
  color: var(--cream);
  border-bottom-color: var(--red-orange);
  background: rgba(217, 79, 55, 0.1);
}

.nav-link[aria-current="page"]::before {
  opacity: 1;
  color: var(--red-orange);
}

.nav-toggle {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 20;
  align-items: center;
  gap: 0.5rem;
  background: var(--muted-blue);
  border: 1px solid rgba(224, 224, 224, 0.18);
  padding: 0.5rem 0.7rem;
  border-radius: 0.25rem;
  color: var(--silver);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: #253055;
  border-color: rgba(224, 224, 224, 0.4);
}

.nav-toggle-icon {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 1.1rem;
}

.nav-toggle-line {
  display: block;
  height: 2px;
  background: var(--silver);
  transition:
    transform 180ms ease,
    opacity 180ms ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-toggle-text {
  font-size: 0.75rem;
}

.site-footer {
  background:
    radial-gradient(1px 1px at 25% 80%, rgba(255, 255, 255, 0.18) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 20%, rgba(255, 255, 255, 0.12) 50%, transparent 51%),
    linear-gradient(0deg, #05070f 0%, #0e142f 100%);
  border-top: 1px solid rgba(224, 224, 224, 0.14);
  margin-top: clamp(3rem, 8vw, 5rem);
  font-size: 0.875rem;
}

.footer-main {
  padding-top: clamp(2.5rem, 6vw, 4rem);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: 2.5rem;
}

.footer-brand .brand {
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.footer-brand .brand-name {
  font-size: 1.8rem;
}

.footer-brand .brand-tag {
  font-size: 0.7rem;
}

.footer-note {
  max-width: 34rem;
  margin-top: 1rem;
  color: rgba(232, 232, 232, 0.62);
  line-height: 1.75;
}

.footer-heading {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-menu li {
  margin-bottom: 0.45rem;
}

.footer-menu a {
  display: inline-block;
  position: relative;
  padding-left: 0.75rem;
  color: var(--silver);
  transition:
    color 180ms ease,
    padding-left 180ms ease;
}

.footer-menu a::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--red-orange);
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.footer-menu a:hover,
.footer-menu a:focus-visible {
  color: var(--cream);
  padding-left: 1.1rem;
}

.footer-menu a:hover::before,
.footer-menu a:focus-visible::before {
  opacity: 1;
  transform: translateX(0);
}

.footer-contact p {
  margin-bottom: 0.35rem;
  color: rgba(232, 232, 232, 0.72);
}

.footer-meta {
  border-top: 1px solid rgba(224, 224, 224, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.footer-meta-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: rgba(224, 224, 224, 0.45);
}

.footer-meta a {
  color: inherit;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(224, 224, 224, 0.1);
  z-index: 999;
  pointer-events: none;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--nebula-purple), var(--red-orange));
  box-shadow: 0 0 8px rgba(217, 79, 55, 0.5);
}

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--red-orange);
  color: var(--red-orange);
  border-radius: 2px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  background: transparent;
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.button:hover,
.button:focus-visible {
  background: var(--red-orange);
  color: #ffffff;
  box-shadow: 0 0.25rem 1rem rgba(217, 79, 55, 0.25);
}

.button--secondary {
  border-color: var(--nebula-purple);
  color: var(--nebula-purple);
}

.button--secondary:hover,
.button--secondary:focus-visible {
  background: var(--nebula-purple);
  color: #ffffff;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.8rem;
  color: rgba(224, 224, 224, 0.6);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--silver);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--cream);
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: var(--red-orange);
}

.card {
  background: var(--cream);
  color: var(--dark-brown);
  border: 1px solid rgba(224, 224, 224, 0.2);
  border-radius: 4px;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
  padding: clamp(1.25rem, 3vw, 2rem);
  transition:
    box-shadow 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.card:hover {
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
  border-color: var(--red-orange);
  transform: translateY(-2px);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

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

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

.section {
  padding-block: clamp(2rem, 5vw, 4rem);
}

.section-overline {
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--cream);
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

.prose {
  max-width: 45rem;
  color: rgba(232, 232, 232, 0.86);
}

.prose p {
  margin: 1em 0;
}

.prose h2 {
  color: var(--cream);
  margin-top: 1.5em;
}

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(224, 224, 224, 0.14);
  aspect-ratio: 16 / 10;
  background-color: var(--muted-blue);
  background-image:
    radial-gradient(1px 1px at 30% 30%, rgba(255, 255, 255, 0.3) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 60%, rgba(255, 255, 255, 0.2) 50%, transparent 51%);
}

.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    border-block-width: 0;
    transition:
      max-height 280ms ease,
      opacity 200ms ease,
      border-color 200ms ease;
  }

  .site-nav[data-open] {
    max-height: 28rem;
    opacity: 1;
    border-block-width: 1px;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(224, 224, 224, 0.08);
    border-left: 2px solid transparent;
    text-align: left;
  }

  .nav-link::before {
    margin-right: 0.5rem;
  }

  .nav-link:hover,
  .nav-link:focus-visible,
  .nav-link[aria-current="page"] {
    border-left-color: var(--red-orange);
    background: rgba(217, 79, 55, 0.06);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

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

  .footer-brand {
    grid-column: auto;
  }
}

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

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

  .scroll-progress {
    display: none;
  }
}
