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

:root {
  --bg-primary: #0A1428;
  --bg-panel: #122C4D;
  --bg-cream: #F5F1E8;
  --text-ink: #1C1C1A;
  --accent: #FF5A3C;
  --speed: #B6FF00;
  --cyan: #4DC9F6;
  --muted: #97A7B8;
  --amber: #FFB800;
  --border: #23425F;
  --text: #F5F1E8;
  --font-headline: Georgia, 'Noto Serif SC', 'Songti SC', serif;
  --font-body: 'Inter', 'Noto Sans SC', 'PingFang SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --container-width: 1440px;
  --header-h: 76px;
  --header-h-shrunk: 60px;
  --ease: 180ms cubic-bezier(0.22, 0.9, 0.35, 1);
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#main-content {
  flex: 1;
  min-width: 0;
  scroll-margin-top: calc(var(--header-h) + 12px);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  color: var(--text);
  line-height: 1.2;
  font-weight: 800;
}

p {
  margin-bottom: 1em;
}

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

a:hover {
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

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

/* ========== Accessibility ========== */
:focus-visible {
  outline: 2px solid var(--speed);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 3000;
  padding: 10px 20px;
  background: var(--speed);
  color: var(--text-ink);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 24px rgba(182, 255, 0, 0.35);
  transition: top 220ms var(--ease);
}

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

/* ========== Layout Primitives ========== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--speed);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-headline);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.12;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
}

.breadcrumb a {
  color: var(--cyan);
  transition: color 160ms ease;
}

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

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

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #FF6B4A;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--speed);
  color: var(--speed);
}

/* ========== Base Components ========== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(18, 44, 77, 0.5);
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.image-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.image-frame::before {
  content: "";
  display: block;
  padding-top: 62.5%;
}

.image-frame--wide::before {
  padding-top: 50%;
}

.image-frame--portrait::before {
  padding-top: 125%;
}

.slant-divider {
  height: 4px;
  border: 0;
  margin: 32px 0;
  background: linear-gradient(90deg, var(--speed) 0%, transparent 70%);
  transform: skewX(-12deg);
  transform-origin: left center;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 20, 40, 0.88);
  border-bottom: 1px solid var(--border);
  transition: background 240ms ease, box-shadow 240ms ease;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(77, 201, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 201, 246, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.site-header.is-shrunk {
  --header-h: var(--header-h-shrunk);
  background: rgba(10, 20, 40, 0.97);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  transition: height 220ms var(--ease);
}

.header-inner::after {
  content: "";
  position: absolute;
  left: 42%;
  bottom: 0;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transform: translateX(-50%);
}

/* Brand */
.brand-lockup {
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.brand-glyph {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--speed) 0%, #7FD400 100%);
  color: var(--text-ink);
  font-family: var(--font-headline);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  clip-path: polygon(0 0, 100% 0, 100% 74%, 78% 100%, 0 100%);
  box-shadow: 0 4px 16px rgba(182, 255, 0, 0.18);
  flex-shrink: 0;
}

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

.brand-name {
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text);
}

.brand-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--speed);
  letter-spacing: 0.14em;
}

.brand-tagline::before {
  content: "\2192";
  display: inline-block;
  margin-right: 3px;
  font-family: var(--font-mono);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Live Toggle */
.live-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 44, 77, 0.6);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.live-toggle:hover {
  border-color: var(--speed);
  box-shadow: 0 0 20px rgba(182, 255, 0, 0.08);
}

.live-toggle[aria-expanded="true"] {
  background: rgba(182, 255, 0, 0.08);
  border-color: var(--speed);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--speed);
  box-shadow: 0 0 0 3px rgba(182, 255, 0, 0.15);
  animation: live-pulse 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(182, 255, 0, 0.5); }
  50% { box-shadow: 0 0 0 7px rgba(182, 255, 0, 0); }
}

.live-label {
  white-space: nowrap;
}

/* Navigation */
.site-nav {
  position: relative;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 10px 14px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 160ms ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--speed);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms var(--ease);
}

.nav-link:hover {
  color: var(--text);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

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

/* Nav Toggle (mobile) */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease;
}

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

.nav-toggle-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

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

.nav-toggle-text {
  white-space: nowrap;
}

/* Scroll Progress */
.scroll-progress {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--speed), var(--cyan));
  border-radius: 0 3px 3px 0;
  z-index: 3;
  pointer-events: none;
}

/* ========== Score Ticker ========== */
.score-ticker {
  display: block;
  position: relative;
  z-index: 2;
  background: rgba(18, 44, 77, 0.96);
  border-bottom: 1px solid var(--border);
  animation: ticker-enter 220ms var(--ease);
}

.score-ticker[hidden] {
  display: none;
}

@keyframes ticker-enter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ticker-track {
  display: flex;
  gap: 12px;
  padding: 12px 32px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ticker-track::-webkit-scrollbar {
  display: none;
}

.ticker-item {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(10, 20, 40, 0.5);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.ticker-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--cyan);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(77, 201, 246, 0.1);
  border: 1px solid rgba(77, 201, 246, 0.2);
}

.ticker-score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--speed);
  font-variant-numeric: tabular-nums;
}

/* ========== Footer ========== */
.site-footer {
  position: relative;
  margin-top: 80px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(77, 201, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 201, 246, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.footer-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--speed) 0%, var(--accent) 60%, var(--cyan) 100%);
  transform: skewX(-12deg);
  transform-origin: left top;
  z-index: 1;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 64px 32px 48px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.25fr;
  gap: 48px;
}

/* Footer Brand */
.footer-brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.footer-glyph {
  width: 40px;
  height: 40px;
  font-size: 22px;
  border-radius: 12px;
}

.footer-brand-name {
  font-family: var(--font-headline);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.footer-brand-desc {
  max-width: 42ch;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-motto {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--speed);
}

.footer-motto::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--speed);
}

/* Footer Columns */
.footer-heading {
  font-family: var(--font-headline);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 20px;
}

.footer-heading::after {
  content: "";
  display: block;
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 8px;
}

.footer-links,
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  display: inline-block;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  transition: color 160ms ease, transform 160ms ease;
}

.footer-link:hover {
  color: var(--speed);
  transform: translateX(3px);
}

.footer-contact-list {
  margin-bottom: 24px;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  word-break: break-all;
}

.footer-contact-icon {
  flex-shrink: 0;
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 15px;
  line-height: 1.6;
  min-width: 18px;
  text-align: center;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer-legal-links .footer-link {
  font-size: 13px;
}

/* Footer Bottom */
.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: rgba(18, 44, 77, 0.25);
}

.footer-bottom-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.copyright {
  color: var(--muted);
  font-size: 13px;
}

.footer-divider-line {
  flex: 1;
  min-width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.icp {
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ========== Responsive ========== */
@media (max-width: 1280px) {
  .header-actions {
    gap: 20px;
  }

  .footer-inner {
    grid-template-columns: 1.2fr 1fr 1.1fr;
    gap: 32px;
  }
}

@media (max-width: 1024px) {
  .header-inner {
    padding: 0 20px;
  }

  .header-actions {
    gap: 12px;
  }

  .live-toggle {
    padding: 7px 14px;
  }

  .live-label {
    display: none;
  }

  .live-dot {
    width: 8px;
    height: 8px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    z-index: 998;
    width: min(320px, 88vw);
    height: calc(100vh - var(--header-h));
    padding: 28px 20px;
    background: rgba(10, 20, 40, 0.98);
    border-left: 1px solid var(--border);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
    transform: translateX(102%);
    transition: transform 260ms var(--ease);
    overflow-y: auto;
  }

  .site-nav[data-open] {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-link {
    display: block;
    padding: 14px 12px;
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .nav-link::after {
    bottom: 8px;
    left: 12px;
    right: 12px;
  }

  .nav-link[aria-current="page"] {
    color: var(--speed);
    background: rgba(182, 255, 0, 0.08);
  }

  .nav-link[aria-current="page"]::after {
    transform: scaleX(0);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 56px 24px 40px;
  }

  .footer-bottom-inner {
    padding: 18px 24px;
  }
}

@media (max-width: 640px) {
  .brand-tagline {
    display: none;
  }

  .brand-mark {
    gap: 8px;
  }

  .brand-glyph {
    width: 38px;
    height: 38px;
    font-size: 22px;
    border-radius: 12px;
  }

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

  .container {
    padding: 0 20px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 48px 20px 32px;
  }

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

  .footer-divider-line {
    display: none;
  }

  .ticker-track {
    padding: 10px 20px;
  }
}

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

  html {
    scroll-behavior: auto;
  }

  .live-dot {
    animation: none !important;
    box-shadow: 0 0 0 3px rgba(182, 255, 0, 0.15);
  }

  .site-nav {
    transition: none !important;
  }
}
