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

:root {
  --c-deep: #0A1F44;
  --c-deep-2: #0d2452;
  --c-gold: #FFD700;
  --c-orange: #FF6B35;
  --c-sand: #F5F0E6;
  --c-cyan: #00C8E8;
  --c-night: #1B1035;
  --c-silver: #B0B8C4;
  --c-white: #FFFFFF;
  --f-head: Impact, 'Archivo Black', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --f-body: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --f-num: 'Roboto Mono', 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
  --header-w: 280px;
  --header-h: 70px;
  --container-max: 1200px;
  --radius: 3px;
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);
  --ease: 0.25s ease;
}

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

body {
  min-height: 100vh;
  padding-left: var(--header-w);
  background: var(--c-deep);
  color: var(--c-white);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5 {
  font-family: var(--f-head);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 1rem;
  color: var(--c-white);
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 3vw, 2.5rem); }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1rem;
  text-wrap: pretty;
}

a {
  color: var(--c-cyan);
  text-decoration: none;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}

a:hover {
  color: var(--c-gold);
}

ul, ol {
  list-style: none;
}

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

strong {
  font-weight: 700;
}

/* ===== Utilities ===== */
.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;
}

.num {
  font-family: var(--f-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.divider {
  display: block;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(176, 184, 196, 0.35), transparent);
  margin: 2.5rem 0;
}

/* ===== Layout Helpers ===== */
.container {
  width: min(var(--container-max), 100% - 3rem);
  margin-inline: auto;
}

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

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: var(--f-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--ease), background var(--ease), border-color var(--ease), color var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--c-orange);
  color: var(--c-deep);
}

.btn-primary:hover {
  background: var(--c-gold);
  color: var(--c-deep);
  transform: translateY(-2px);
}

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

.btn-ghost:hover {
  background: var(--c-gold);
  color: var(--c-deep);
}

/* ===== Cards ===== */
.card {
  background: var(--c-sand);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: #1e293b;
  border-top: 3px solid var(--c-orange);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card h1, .card h2, .card h3, .card h4 {
  color: var(--c-deep);
}

.card-dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(176, 184, 196, 0.15);
  border-radius: var(--radius);
  padding: 1.75rem;
  color: var(--c-white);
  border-top: 3px solid var(--c-cyan);
}

.card-dark h1, .card-dark h2, .card-dark h3, .card-dark h4 {
  color: var(--c-white);
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 0.18rem 0.7rem;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.4;
  border-radius: 2px;
  text-transform: uppercase;
}

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

.tag-orange {
  background: var(--c-orange);
  color: var(--c-deep);
}

.tag-cyan {
  background: rgba(0, 200, 232, 0.12);
  color: var(--c-cyan);
  border: 1px solid rgba(0, 200, 232, 0.3);
}

/* ===== Breadcrumbs ===== */
.breadcrumb {
  margin: 1rem 0 2rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--c-silver);
}

.breadcrumb-link {
  color: var(--c-silver);
  text-decoration: none;
  padding: 0.1rem 0.2rem;
}

.breadcrumb-link:hover {
  color: var(--c-gold);
}

.breadcrumb-sep {
  color: rgba(176, 184, 196, 0.5);
  font-family: var(--f-num);
}

.breadcrumb-item[aria-current="page"] {
  color: var(--c-gold);
  font-weight: 600;
}

/* ===== Image Frames ===== */
.img-frame {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-deep) 0%, var(--c-night) 100%);
  border: 1px solid rgba(176, 184, 196, 0.18);
  aspect-ratio: 16 / 9;
}

.img-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 107, 53, 0.06)),
    repeating-linear-gradient(45deg, transparent 0, transparent 14px, rgba(255, 255, 255, 0.03) 14px, rgba(255, 255, 255, 0.03) 15px);
  pointer-events: none;
}

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

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--header-w);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, var(--c-deep) 0%, var(--c-deep-2) 55%, var(--c-night) 100%);
  border-right: 1px solid rgba(255, 215, 0, 0.12);
  z-index: 1000;
  overflow-x: hidden;
  overflow-y: auto;
}

.site-header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-gold) 0%, var(--c-orange) 100%);
  z-index: 1;
}

.header-inner {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  padding: 2.2rem 1.6rem 1.6rem;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: 0;
  left: 1rem;
  z-index: 1200;
  padding: 0.6rem 1.2rem;
  background: var(--c-gold);
  color: var(--c-deep);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 0 0 4px 4px;
  transform: translateY(-120%);
  transition: transform var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--c-deep);
}

/* Brand */
.brand-block {
  margin-bottom: 2.4rem;
}

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

.brand-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, var(--c-gold) 0%, var(--c-orange) 100%);
  color: var(--c-deep);
  font-family: var(--f-head);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--f-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-white);
}

.brand-name strong {
  color: var(--c-gold);
  font-weight: 900;
}

.brand-tagline {
  margin-top: 0.8rem;
  padding-left: 0.2rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--c-silver);
  text-transform: uppercase;
  border-left: 2px solid var(--c-orange);
  padding-left: 0.7rem;
}

/* Navigation */
.site-nav {
  display: block;
}

.nav-list {
  counter-reset: nav-counter;
}

.nav-item {
  counter-increment: nav-counter;
  display: flex;
  align-items: center;
  margin-bottom: 0.15rem;
}

.nav-item::before {
  content: "0" counter(nav-counter);
  font-family: var(--f-num);
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(176, 184, 196, 0.55);
  margin-right: 0.7rem;
  min-width: 1.6rem;
  text-align: right;
  transition: color var(--ease);
}

.nav-item:hover::before {
  color: var(--c-orange);
}

.nav-link {
  display: block;
  flex: 1;
  padding: 0.68rem 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #c8d0e0;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--c-gold);
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.08), transparent);
  border-left-color: var(--c-orange);
}

.nav-link[aria-current="page"] {
  color: var(--c-gold);
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
  border-left-color: var(--c-orange);
}

/* Header meta */
.header-meta {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(176, 184, 196, 0.15);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--c-silver);
  letter-spacing: 0.05em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-cyan);
  box-shadow: 0 0 10px rgba(0, 200, 232, 0.8);
  flex-shrink: 0;
}

.header-meta-note {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: rgba(176, 184, 196, 0.7);
  letter-spacing: 0.04em;
}

/* Nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  cursor: pointer;
}

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

.nav-toggle.is-active .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Header progress */
.header-progress {
  flex: 0 0 3px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
}

.header-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--c-gold), var(--c-orange));
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* ===== Footer ===== */
.site-footer {
  background:
    linear-gradient(180deg, rgba(27, 16, 53, 0.95) 0%, var(--c-deep) 100%);
  border-top: 1px solid rgba(255, 215, 0, 0.15);
  color: var(--c-silver);
  margin-top: auto;
}

.site-footer::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--c-cyan) 0%, var(--c-gold) 40%, var(--c-orange) 100%);
}

.footer-inner {
  padding: 3.5rem 2rem 1.8rem;
}

.footer-main {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.footer-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--c-gold), var(--c-orange));
  color: var(--c-deep);
  font-family: var(--f-head);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  clip-path: polygon(10% 0, 90% 0, 100% 50%, 90% 100%, 10% 100%, 0 50%);
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--f-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-white);
  display: block;
  line-height: 1.2;
}

.footer-brand-tagline {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--c-silver);
  letter-spacing: 0.06em;
}

.footer-col-title {
  font-family: var(--f-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 215, 0, 0.15);
  padding-bottom: 0.5rem;
}

.footer-links li {
  margin-bottom: 0.45rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-link {
  color: var(--c-silver);
  text-decoration: none;
  transition: color var(--ease), padding-left var(--ease);
}

.footer-link:hover {
  color: var(--c-gold);
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(176, 184, 196, 0.15);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-copyright {
  font-family: var(--f-num);
  font-size: 0.85rem;
  color: var(--c-silver);
  display: inline;
}

.footer-copyright-sub {
  font-size: 0.8rem;
  color: rgba(176, 184, 196, 0.7);
  margin-top: 0.2rem;
}

.footer-trust {
  margin-top: 0.8rem;
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(176, 184, 196, 0.65);
  max-width: 640px;
  margin-inline: auto;
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 1023.98px) {
  body {
    padding-left: 0;
    padding-top: var(--header-h);
  }

  .site-header {
    inset: 0 0 auto 0;
    width: 100%;
    height: auto;
    min-height: var(--header-h);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 215, 0, 0.12);
    overflow: visible;
  }

  .site-header::after {
    height: 2px;
  }

  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex: 1 1 auto;
    padding: 0 1.25rem;
    min-height: calc(var(--header-h) - 3px);
  }

  .brand-block {
    margin-bottom: 0;
    display: flex;
    align-items: center;
  }

  .brand-symbol {
    width: 44px;
    height: 44px;
    font-size: 0.75rem;
  }

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

  .brand-tagline {
    display: none;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(8, 22, 49, 0.97);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding: 0.6rem 1.25rem 1.2rem;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }

  .site-nav[data-open="true"] {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-item::before {
    font-size: 0.75rem;
  }

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

  .header-meta {
    display: none;
  }

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

  .header-progress {
    flex-basis: 3px;
    width: 100%;
  }

  .footer-main {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 640px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .footer-inner {
    padding: 2.5rem 1.25rem 1.4rem;
  }

  .container {
    width: min(var(--container-max), 100% - 2rem);
  }
}

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

  .header-progress-bar {
    transition: none;
  }

  .site-nav {
    transition: none;
  }
}
