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

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

body {
  margin: 0;
  background: var(--color-pitch);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: .01em;
  color: var(--color-text);
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

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

a:hover {
  text-decoration: underline;
}

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

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

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

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

:root {
  --color-pitch: #0f1a14;
  --color-card: #16231d;
  --color-field: #1d2d24;
  --color-gold: #ffd700;
  --color-gold-warm: #ffaa00;
  --color-red: #c0392b;
  --color-text: #f0f0e8;
  --color-muted: #a8b5a8;
  --color-line: #2a3a33;
  --font-head: "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --font-body: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Roboto Mono", "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --max-width: 1200px;
  --pad: clamp(16px, 4vw, 44px);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 12px 30px rgba(0, 0, 0, .35);
}

/* ===== Container & Main ===== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--pad);
}

#main-content {
  scroll-margin-top: 90px;
  min-height: 60vh;
}

/* ===== Skip Link ===== */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 400;
  padding: 10px 18px;
  background: var(--color-gold);
  color: var(--color-pitch);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 14px;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow);
  transition: top .25s ease;
}

.skip-link:hover {
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ===== Scroll Progress ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  z-index: 300;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-warm));
  pointer-events: none;
}

/* ===== Header Ticker ===== */
.header-ticker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-block: 7px;
  padding-inline: max(var(--pad), calc((100vw - var(--max-width)) / 2 + var(--pad)));
  background: #0a130e;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 12px;
  overflow: hidden;
}

.ticker-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-gold);
  letter-spacing: .08em;
}

.ticker-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-red);
  animation: ticker-pulse 1.8s ease-out infinite;
}

.ticker-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-muted);
  font-family: var(--font-body);
  letter-spacing: .02em;
}

@keyframes ticker-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(192, 57, 43, .55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(192, 57, 43, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(192, 57, 43, 0);
  }
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background:
    radial-gradient(ellipse 80% 130% at 50% -60%, rgba(255, 215, 0, .09), transparent 70%),
    linear-gradient(180deg, #132019 0%, var(--color-pitch) 100%);
  border-bottom: 1px solid var(--color-line);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, .7) 18%, rgba(255, 170, 0, .7) 50%, rgba(255, 215, 0, .7) 82%, transparent);
  opacity: .5;
  pointer-events: none;
}

.header-main {
  padding-top: 16px;
  padding-bottom: 12px;
}

.header-toprow {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.header-toprow .brand {
  grid-column: 2;
  justify-self: center;
}

.header-toprow .header-actions {
  grid-column: 3;
  justify-self: end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-warm) 100%);
  color: var(--color-pitch);
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 74%, 50% 100%, 0 74%);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 50% 100%, 0 74%);
}

.brand-word {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
  white-space: nowrap;
  color: var(--color-text);
  transition: color .2s ease;
}

.brand:hover .brand-word {
  color: var(--color-gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-query {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-warm) 100%);
  color: var(--color-pitch);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: 0 4px 16px rgba(255, 215, 0, .18);
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn-query:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 215, 0, .28);
  text-decoration: none;
}

.btn-query-arrow {
  font-family: var(--font-mono);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px;
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.nav-toggle:hover {
  border-color: rgba(255, 215, 0, .5);
  background: rgba(255, 215, 0, .05);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-gold);
  border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
}

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

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 12px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--color-muted);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: color .2s ease, background .2s ease;
}

.nav-link:hover {
  color: var(--color-text);
  background: rgba(255, 215, 0, .05);
  text-decoration: none;
}

.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--color-gold);
  opacity: .65;
}

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

.nav-link:hover .nav-index {
  opacity: 1;
}

.nav-link[aria-current="page"] {
  color: var(--color-gold);
}

.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 3px;
  background: var(--color-gold);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 6px 100%);
}

/* ===== Responsive Header ===== */
@media (max-width: 860px) {
  .header-main {
    padding-top: 12px;
  }

  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-top: 12px;
    border-top: 1px solid var(--color-line);
    padding: 4px 0 10px;
  }

  .nav-link {
    padding: 13px 6px;
    border-bottom: 1px dashed var(--color-line);
    border-radius: 0;
  }

  .nav-link[aria-current="page"]::after {
    left: 6px;
    right: auto;
    width: 26px;
    bottom: 0;
    height: 3px;
  }

  .js-nav .site-nav {
    display: none;
  }

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

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

  .brand-word {
    font-size: 19px;
  }

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

  .btn-query {
    padding: 7px 10px;
    font-size: 13px;
  }
}

@media (min-width: 861px) {
  .header-toprow {
    grid-template-columns: 1fr auto 1fr;
  }

  .header-toprow .brand {
    grid-column: 2;
  }

  .header-toprow .header-actions {
    grid-column: 3;
  }

  .site-nav {
    gap: 4px;
  }
}

/* ===== Sections & Typography ===== */
.section {
  padding-block: clamp(48px, 8vw, 96px);
}

.section-head {
  margin-bottom: clamp(24px, 4vw, 40px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 2px;
  flex: none;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-warm));
  transform: skewX(-24deg);
}

.page-title {
  margin: 10px 0 14px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
}

.page-lead {
  max-width: 64ch;
  color: var(--color-muted);
  font-size: 17px;
  line-height: 1.7;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-warm) 100%);
  color: var(--color-pitch);
  font-weight: 900;
  box-shadow: 0 4px 16px rgba(255, 215, 0, .18);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 215, 0, .28);
}

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

.btn-outline:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
}

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  margin: 18px 0 10px;
  font-size: 13px;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--color-line);
  font-family: var(--font-mono);
}

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

.breadcrumb-item a:hover {
  color: var(--color-gold);
  text-decoration: none;
}

.breadcrumb-item.is-current {
  color: var(--color-text);
}

/* ===== Grids ===== */
.grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 28px);
}

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

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

@media (max-width: 960px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

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

@media (max-width: 600px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Data Components ===== */
.data-card {
  position: relative;
  padding: clamp(18px, 3vw, 28px);
  background: linear-gradient(160deg, var(--color-card) 0%, #121e18 100%);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 30px;
  height: 30px;
  background: linear-gradient(225deg, var(--color-gold) 0 50%, transparent 51%);
  opacity: .32;
}

.data-num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--color-gold);
}

.data-label {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: rgba(15, 26, 20, .65);
  color: var(--color-muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.badge-gold {
  border-color: rgba(255, 215, 0, .4);
  color: var(--color-gold);
  background: rgba(255, 215, 0, .07);
}

.badge-red {
  border-color: rgba(192, 57, 43, .45);
  color: #f0aaa3;
  background: rgba(192, 57, 43, .12);
}

/* ===== Image Frame ===== */
.image-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background-color: var(--color-card);
  background-image:
    linear-gradient(rgba(255, 215, 0, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, .05) 1px, transparent 1px);
  background-size: 28px 28px;
}

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

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

.image-frame.is-square::before {
  padding-top: 100%;
}

.image-frame > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.image-frame:hover > img {
  transform: scale(1.03);
}

.image-tag {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--color-gold);
  color: var(--color-pitch);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}

/* ===== Panels & Textures ===== */
.panel {
  padding: clamp(20px, 3vw, 32px);
  background: var(--color-card);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
}

.pitch-bg {
  background-color: var(--color-pitch);
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 44px 44px;
}

.rule-gold {
  height: 2px;
  margin: 28px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--color-gold) 18%, transparent 100%);
  opacity: .55;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  margin-top: clamp(64px, 10vw, 120px);
  border-top: 1px solid var(--color-line);
  background:
    linear-gradient(rgba(255, 215, 0, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 215, 0, .03) 1px, transparent 1px),
    linear-gradient(180deg, var(--color-pitch) 0%, #0a120d 80%);
  background-size: 44px 44px, 44px 44px, auto;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 170px;
  height: 3px;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-warm));
  opacity: .85;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(28px, 5vw, 56px);
  padding-block: 52px 36px;
}

@media (max-width: 900px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-block: 40px 28px;
  }
}

.footer-brand .brand-word {
  font-size: 22px;
}

.footer-slogan {
  margin: 14px 0 18px;
  max-width: 34ch;
  color: var(--color-muted);
  font-size: 14px;
}

.footer-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.footer-title {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-gold);
}

.footer-nav a {
  display: inline-block;
  padding: 5px 0 5px 8px;
  border-left: 2px solid transparent;
  color: var(--color-muted);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease;
}

.footer-nav a:hover {
  border-left-color: var(--color-gold);
  color: var(--color-gold);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  padding-block: 18px;
  border-top: 1px solid var(--color-line);
  font-size: 13px;
  color: var(--color-muted);
}

.contact-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-muted);
}

.contact-row::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--color-gold-warm);
}

.contact-note {
  flex-basis: 100%;
  color: var(--color-muted);
  font-size: 12px;
  padding: 4px 0 0;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 16px 22px;
  border-top: 1px solid var(--color-line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
}

@media (max-width: 700px) {
  .footer-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .contact-note {
    flex-basis: auto;
  }
}

/* ===== Reveal ===== */
.site-anim [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

.site-anim [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

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

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

  .site-anim [data-reveal],
  .site-anim [data-reveal].is-visible {
    opacity: 1 !important;
    transform: none !important;
  }
}
