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

:root {
  color-scheme: dark;
  --bg-primary: #0A1633;
  --bg-surface: #16274D;
  --accent-speed: #00E88F;
  --accent-alert: #FF7A29;
  --text-primary: #F0F5FA;
  --text-body: #B8CCE0;
  --text-muted: #7B90A9;
  --line-grid: #28436E;

  --font-heading: 'Space Grotesk', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-numeric: 'DIN Alternate', 'Bahnschrift', 'Roboto Mono', monospace;

  --container-w: 1200px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 2rem;
  --space-xl: 4rem;

  --shadow-card: 4px 4px 0 rgba(0, 232, 143, 0.12);
}

html {
  scroll-behavior: smooth;
}

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

body {
  background:
    linear-gradient(rgba(40, 67, 110, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 67, 110, 0.18) 1px, transparent 1px),
    var(--bg-primary);
  background-size: 48px 48px;
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#main-content {
  min-height: 70vh;
  outline: none;
}

/* ===================== Base Typography ===================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.3;
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: 2.625rem;
  font-weight: 900;
}
h2 {
  font-size: 1.75rem;
  font-weight: 700;
}
h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

p {
  margin-bottom: var(--space-md);
}
p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--accent-speed);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

ul,
ol {
  list-style-position: inside;
}

address {
  font-style: normal;
}

strong {
  font-weight: 700;
  color: var(--text-primary);
}

::selection {
  background: rgba(0, 232, 143, 0.25);
  color: var(--text-primary);
}

/* ===================== Accessibility ===================== */
.sr-only {
  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: 0;
  left: 0;
  z-index: 1000;
  transform: translateY(-120%);
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent-speed);
  color: var(--bg-primary);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.06em;
  border-radius: 0;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: transform 0.15s ease;
}
.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

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

/* ===================== Layout ===================== */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* ===================== Helper / Decorative Backgrounds ===================== */
.grid-bg {
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(var(--line-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-grid) 1px, transparent 1px);
  background-size: 40px 40px;
}

.speed-bg {
  position: relative;
  overflow: hidden;
}
.speed-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent 0px,
    transparent 14px,
    rgba(0, 232, 143, 0.07) 14px,
    rgba(0, 232, 143, 0.07) 16px
  );
  pointer-events: none;
  z-index: 0;
}
.speed-bg > * {
  position: relative;
  z-index: 1;
}

/* ===================== Header ===================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 999;
  background: linear-gradient(90deg, var(--accent-speed) 0%, var(--accent-alert) 100%);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 51, 0.97);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-grid);
}

.masthead {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.125rem 3rem;
  border-bottom: 1px solid var(--line-grid);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
}

.brand-symbol {
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 0 6px rgba(0, 232, 143, 0.35));
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.14em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-tagline {
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  line-height: 1.2;
  color: var(--accent-speed);
  white-space: nowrap;
}

.site-nav {
  border-bottom: 3px solid var(--accent-speed);
}

.nav-list {
  display: flex;
  justify-content: center;
  list-style: none;
  flex-wrap: wrap;
}

.nav-list .nav-link + .nav-link {
  border-left: 1px solid var(--line-grid);
}

.nav-link {
  position: relative;
  display: block;
  padding: 0.875rem 1.625rem;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  background-color: rgba(0, 232, 143, 0.06);
  color: var(--accent-speed);
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%) scaleX(0);
  width: 72%;
  height: 3px;
  background-color: var(--accent-alert);
  transition: transform 0.15s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-link[aria-current="page"] {
  color: var(--accent-speed);
  background-color: rgba(0, 232, 143, 0.04);
}

.nav-toggle {
  display: none;
}

/* ===================== Footer ===================== */
.site-footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--line-grid);
  margin-top: var(--space-xl);
}

.footer-accent {
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--accent-speed) 0,
    var(--accent-speed) 28px,
    var(--bg-primary) 28px,
    var(--bg-primary) 34px,
    var(--accent-alert) 34px,
    var(--accent-alert) 42px,
    var(--bg-primary) 42px,
    var(--bg-primary) 50px
  );
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.9fr 1fr 1.35fr;
  gap: 3rem;
  padding: 3rem 0 2.5rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  line-height: 1;
}

.footer-logo svg {
  flex-shrink: 0;
  filter: drop-shadow(0 0 4px rgba(0, 232, 143, 0.25));
}

.footer-mission {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-body);
  max-width: 44ch;
}

.footer-trust {
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-muted);
  padding-left: 0.875rem;
  border-left: 3px solid var(--accent-alert);
  max-width: 48ch;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line-grid);
  position: relative;
}

.footer-heading::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 42px;
  height: 3px;
  background: var(--accent-speed);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.footer-links a {
  color: var(--text-body);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent-speed);
  padding-left: 0.25rem;
}

.footer-contact {
  gap: 0.5rem;
}

.contact-item {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.contact-item + .contact-item {
  margin-top: 0.125rem;
}

.contact-label {
  flex-shrink: 0;
  min-width: 2.5em;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.contact-email,
.contact-phone,
.contact-address {
  color: var(--text-body);
  word-break: break-word;
}

.contact-email {
  color: var(--accent-speed);
}

.contact-note {
  margin-top: 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--text-muted);
  padding: 0.625rem 0.75rem;
  background: rgba(22, 39, 77, 0.5);
  border-left: 3px solid var(--line-grid);
}

.footer-bottom {
  border-top: 1px solid var(--line-grid);
  padding: 1.125rem 0;
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-icp {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-numeric);
  letter-spacing: 0.04em;
}

/* ===================== Buttons ===================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--text-primary);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--accent-speed);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background-color: var(--text-primary);
  color: var(--bg-primary);
}

.btn-outline {
  border-color: var(--accent-speed);
  color: var(--accent-speed);
}

.btn-outline:hover {
  background-color: var(--accent-speed);
  color: var(--bg-primary);
}

/* ===================== Breadcrumb ===================== */
.breadcrumb {
  padding: 1.125rem 0;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 0.375rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  margin-right: 0.375rem;
  color: var(--text-muted);
  font-family: var(--font-numeric);
}

.breadcrumb-link {
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-link:hover {
  color: var(--accent-speed);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* ===================== Content Card ===================== */
.content-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--line-grid);
  padding: 1.5rem;
  position: relative;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.content-card:hover {
  border-color: var(--accent-speed);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

/* ===================== Tag ===================== */
.tag {
  display: inline-block;
  padding: 0.25rem 0.8125rem;
  font-family: var(--font-numeric);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-speed);
  background: rgba(0, 232, 143, 0.08);
  border: 1px solid rgba(0, 232, 143, 0.28);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
}

.tag-alert {
  color: var(--accent-alert);
  background: rgba(255, 122, 41, 0.08);
  border-color: rgba(255, 122, 41, 0.28);
}

/* ===================== Typography Modifiers ===================== */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-alert);
}

.kicker::before {
  content: '';
  display: inline-block;
  width: 1.75rem;
  height: 3px;
  background-color: var(--accent-alert);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  transform: skewX(-2deg);
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1rem;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-speed), var(--accent-alert));
}

/* ===================== Image Figure ===================== */
.figure {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-surface);
  border: 1px solid var(--line-grid);
}

.figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 232, 143, 0.08), transparent 55%);
  pointer-events: none;
}

.img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-surface) 0,
    var(--bg-surface) 8px,
    rgba(10, 22, 51, 0.9) 8px,
    rgba(10, 22, 51, 0.9) 16px
  );
  border: 1px dashed var(--line-grid);
  color: var(--text-muted);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
}

/* ===================== Reveal Animation ===================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===================== Responsive ===================== */
@media (max-width: 1023px) {
  .brand-name {
    font-size: 1.1875rem;
  }

  .brand-tagline {
    font-size: 0.625rem;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

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

  .section-title {
    font-size: 1.625rem;
  }
}

@media (max-width: 767px) {
  .masthead {
    justify-content: center;
    padding: 0.875rem 3.25rem;
  }

  .brand-symbol {
    width: 30px;
    height: 30px;
  }

  .brand-name {
    font-size: 1.125rem;
  }

  .brand-tagline {
    font-size: 0.5625rem;
  }

  .nav-toggle {
    position: absolute;
    left: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--line-grid);
    border-radius: 0;
    cursor: pointer;
    z-index: 20;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  }

  .nav-toggle:hover {
    border-color: var(--accent-speed);
  }

  .nav-toggle-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: transform 0.15s ease, opacity 0.15s ease;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
    transform: translateY(7px) 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(-7px) rotate(-45deg);
  }

  .site-nav {
    display: none;
    border-bottom: 3px solid var(--accent-speed);
  }

  .site-nav[data-open] {
    display: block;
  }

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

  .nav-list .nav-link + .nav-link {
    border-left: none;
    border-top: 1px solid var(--line-grid);
  }

  .nav-link {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    white-space: normal;
  }

  .nav-link::after {
    left: 1.25rem;
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 40%;
  }

  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after {
    transform: translateY(-50%) scaleY(1);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 2rem 0 1.5rem;
  }

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

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.125rem;
  }

  .section-title {
    font-size: 1.375rem;
  }

  .breadcrumb {
    padding: 0.75rem 0;
  }
}

/* ===================== Reduced Motion ===================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .brand,
  .brand-symbol {
    filter: none;
  }
}

/* ===================== Print ===================== */
@media print {
  .site-header,
  .scroll-progress,
  .skip-link {
    position: static;
    background: none;
    border: none;
  }

  .nav-toggle,
  .nav-link::after {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
