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

/* ============ ROOT VARIABLES ============ */
:root {
  --navy: #0B1F3A;
  --navy-light: #142C4C;
  --navy-deep: #081728;
  --cream: #F4EFE6;
  --cream-dark: #E8E1D4;
  --rust: #E05A33;
  --gold: #D4AF37;
  --ink: #1C1815;
  --link-blue: #4A7BA6;
  --gray: #6B6B6B;
  --line: #D8D0C4;
  --border-brown: #B8B2A7;
  --shadow-hard: 8px 8px 0 rgba(27, 25, 23, 0.2);
  --shadow-soft: 4px 4px 0 rgba(27, 25, 23, 0.12);
  --border-thick: 4px solid var(--border-brown);
  --font-head: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-data: 'Roboto Mono', 'JetBrains Mono', 'Courier New', monospace;
  --header-h: 72px;
  --content-max: 1200px;
}

/* ============ BASE ELEMENTS ============ */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.5em;
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--link-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--rust);
}

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

ul, ol {
  padding-left: 1.5em;
}

button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

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

/* ============ ACCESSIBILITY ============ */
.skip-link {
  position: fixed;
  top: -100%;
  left: 16px;
  z-index: 3000;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.4;
  padding: 10px 20px;
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus-visible {
  top: 12px;
}

/* ============ LAYOUT PRIMITIVES ============ */
.container {
  width: min(var(--content-max), 92vw);
  margin-inline: auto;
}

.container-wide {
  width: min(1380px, 96vw);
  margin-inline: auto;
}

.container-narrow {
  width: min(820px, 92vw);
  margin-inline: auto;
}

.section {
  padding-block: 64px;
}

.section-tight {
  padding-block: 32px;
}

.main-content {
  min-height: 60vh;
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ============ TYPOGRAPHIC HELPERS ============ */
.data-label {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
}

.data-large {
  font-family: var(--font-data);
  font-size: 34px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.heading-light {
  color: var(--cream);
}

.text-light {
  color: rgba(244, 239, 230, 0.85);
}

.text-muted {
  color: var(--gray);
}

.text-center {
  text-align: center;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  text-align: center;
  background: var(--rust);
  color: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 var(--ink);
  background: #C94A26;
  color: var(--cream);
}

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}

.btn-gold:hover {
  background: #C19D2F;
  color: var(--ink);
}

.btn-outline {
  background: transparent;
  color: var(--cream);
  border-color: var(--cream);
  box-shadow: 4px 4px 0 rgba(244, 239, 230, 0.2);
}

.btn-outline:hover {
  background: rgba(244, 239, 230, 0.1);
  color: var(--cream);
  box-shadow: 1px 1px 0 rgba(244, 239, 230, 0.2);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 13px;
  border-width: 2px;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-data);
  font-size: 13px;
  color: var(--gray);
  padding: 16px 0;
}

.breadcrumb a {
  color: var(--link-blue);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--rust);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--line);
  font-size: 12px;
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 700;
}

/* ============ SECTION TITLE ============ */
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}

.section-title .section-index {
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 700;
  color: var(--rust);
  border: 2px solid var(--rust);
  padding: 2px 10px;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 0;
}

.section-title-light .section-index {
  color: var(--gold);
  border-color: var(--gold);
}

.section-title-light h2 {
  color: var(--cream);
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 239, 230, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 239, 230, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.header-inner {
  position: relative;
  z-index: 2;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 0 24px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cream);
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  background: var(--navy-light);
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.brand-mark-dot {
  position: absolute;
  top: 7px;
  left: 7px;
  width: 8px;
  height: 8px;
  background: var(--rust);
  border-radius: 50%;
  z-index: 1;
}

.brand-mark-cross::before,
.brand-mark-cross::after {
  content: "";
  position: absolute;
  background: var(--gold);
}

.brand-mark-cross::before {
  top: 50%;
  left: 2px;
  right: 2px;
  height: 1px;
  transform: translateY(-0.5px);
}

.brand-mark-cross::after {
  left: 50%;
  top: 2px;
  bottom: 2px;
  width: 1px;
  transform: translateX(-0.5px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 20px;
  color: var(--cream);
  letter-spacing: 0.03em;
}

.brand-sub {
  font-family: var(--font-data);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-badge {
  align-self: flex-start;
  font-family: var(--font-data);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  padding: 1px 7px;
  line-height: 1.5;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 56px;
  height: 48px;
  padding: 6px 10px;
  background: transparent;
  border: 2px solid rgba(244, 239, 230, 0.35);
  color: var(--cream);
  cursor: pointer;
}

.nav-toggle-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 22px;
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cream);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle-label {
  font-family: var(--font-data);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--gold);
  line-height: 1.2;
  text-transform: uppercase;
}

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

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

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

.header-nav {
  flex-shrink: 0;
}

.header-nav-list {
  display: flex;
  list-style: none;
  gap: 4px;
}

.header-nav-item a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-data);
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
  text-decoration: none;
  padding: 10px 14px;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.header-nav-item a:hover {
  border-color: rgba(244, 239, 230, 0.3);
  background: rgba(244, 239, 230, 0.06);
  color: var(--cream);
}

.header-nav-item a[aria-current="page"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-index {
  font-family: var(--font-data);
  font-size: 11px;
  color: var(--rust);
  line-height: 1;
}

/* ============ FOOTER ============ */
.site-footer {
  position: relative;
  background: var(--navy);
  color: var(--cream);
  border-top: 4px solid var(--rust);
  margin-top: 80px;
  padding: 64px 0 28px;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(244, 239, 230, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 239, 230, 0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.site-footer::after {
  content: "COORD: N30.59° E114.31°";
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--font-data);
  font-size: 10px;
  color: rgba(212, 175, 55, 0.45);
  letter-spacing: 0.12em;
  pointer-events: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: 0 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.15);
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin-bottom: 16px;
}

.footer-brand-link:hover .footer-brand-name {
  color: var(--gold);
}

.footer-brand-name {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 900;
  color: var(--cream);
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.footer-trust {
  font-size: 14px;
  color: rgba(244, 239, 230, 0.75);
  line-height: 1.8;
  max-width: 420px;
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
}

.footer-net-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--gold);
  border: 2px dashed rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.06);
  padding: 8px 14px;
  line-height: 1.6;
}

.net-entry-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--navy), 0 0 0 4px var(--gold);
  flex-shrink: 0;
}

.footer-col-title {
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(244, 239, 230, 0.15);
}

.footer-col-index {
  color: var(--rust);
  margin-right: 6px;
}

.footer-list {
  list-style: none;
  padding-left: 0;
}

.footer-list li {
  margin-bottom: 10px;
}

.footer-list a {
  color: rgba(244, 239, 230, 0.85);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-list a:hover {
  color: var(--gold);
  padding-left: 6px;
}

.footer-contact-col .footer-list {
  color: rgba(244, 239, 230, 0.7);
  font-size: 14px;
  line-height: 1.8;
}

.footer-contact-col .footer-list li {
  margin-bottom: 6px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  font-family: var(--font-data);
  font-size: 12px;
  color: rgba(244, 239, 230, 0.5);
}

.footer-copyright,
.footer-icp {
  margin: 0;
}

/* ============ SHARED COMPONENTS ============ */
.card {
  background: var(--cream);
  border: var(--border-thick);
  box-shadow: var(--shadow-soft);
  padding: 24px;
}

.tag {
  display: inline-block;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  background: var(--cream-dark);
  border: 2px solid var(--ink);
  padding: 3px 10px;
  line-height: 1.4;
}

.tag-gold {
  background: var(--gold);
  color: var(--ink);
}

.tag-rust {
  background: var(--rust);
  color: var(--cream);
}

.tag-navy {
  background: var(--navy);
  color: var(--cream);
}

.figure-frame {
  position: relative;
  background: var(--navy);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  min-height: 180px;
}

.figure-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 65%, rgba(212, 175, 55, 0.12) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(244, 239, 230, 0.04) 3px, rgba(244, 239, 230, 0.04) 4px);
  pointer-events: none;
}

.figure-frame--square {
  aspect-ratio: 1 / 1;
}

.figure-frame--wide {
  aspect-ratio: 21 / 9;
}

.figure-coord {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 2;
  font-family: var(--font-data);
  font-size: 12px;
  color: var(--gold);
  background: rgba(11, 31, 58, 0.85);
  padding: 2px 8px;
  border-left: 3px solid var(--gold);
  line-height: 1.5;
}

.speed-lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.speed-lines::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  right: -8%;
  width: 35%;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 16px,
    rgba(224, 90, 51, 0.25) 16px,
    rgba(224, 90, 51, 0.25) 18px
  );
  transform: skewX(-15deg);
}

.speed-lines::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 12%;
  width: 12%;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0,
    transparent 13px,
    rgba(212, 175, 55, 0.18) 13px,
    rgba(212, 175, 55, 0.18) 15px
  );
  transform: skewX(-15deg);
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35);
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.2s ease, color 0.2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--rust);
  color: var(--cream);
}

.back-to-top-icon {
  display: block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 9px solid var(--ink);
  transition: border-bottom-color 0.2s ease;
}

.back-to-top:hover .back-to-top-icon {
  border-bottom-color: var(--cream);
}

.back-to-top-label {
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  :root {
    --header-h: 64px;
  }

  .nav-toggle {
    display: flex;
  }

  .header-inner {
    flex-wrap: wrap;
    min-height: auto;
    padding: 10px 16px;
  }

  .header-nav {
    flex-basis: 100%;
    flex-shrink: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, border-color 0.35s ease;
    border-top: 0 solid rgba(244, 239, 230, 0.15);
  }

  .header-nav[data-open] {
    max-height: 75vh;
    overflow-y: auto;
    border-top-width: 2px;
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }

  .header-nav-list {
    flex-direction: column;
    padding: 8px 0;
    gap: 0;
  }

  .header-nav-item a {
    padding: 14px 18px;
    border: none;
    font-size: 15px;
  }

  .header-nav-item a[aria-current="page"] {
    border-left: 3px solid var(--gold);
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
  }

  .header-nav-item a:hover {
    border-left-color: transparent;
  }

  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

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

@media (max-width: 600px) {
  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 26px;
  }

  .section {
    padding-block: 48px;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .brand-name {
    font-size: 18px;
  }

  .brand-badge {
    font-size: 9px;
    padding: 1px 6px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-mark-dot {
    top: 6px;
    left: 6px;
    width: 7px;
    height: 7px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 20px;
  }

  .site-footer {
    padding: 48px 0 24px;
    margin-top: 56px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    padding: 8px 12px;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .back-to-top {
    transition: none;
  }
}
