*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #ffffff;
  background: #0a1628;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
:focus-visible {
  outline: 2px solid #d4a745;
  outline-offset: 2px;
}
::selection {
  background: #d4a745;
  color: #0a1628;
}
a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
:root {
  --primary-bg: #0a1628;
  --primary-accent: #d4a745;
  --secondary-accent: #e63946;
  --tertiary-accent: #c0c0c0;
  --card-bg: #1c2e4a;
  --gold-start: #d4a745;
  --gold-end: #f0c040;
  --text-primary: #ffffff;
  --text-secondary: #b0b8c4;
  --nav-active: #d4a745;
  --nav-hover: #f0c040;
  --nav-width: 256px;
  --header-height-mobile: 60px;
  --font-mono: ui-monospace, SFMono-Regular, monospace;
  --max-content: 1200px;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: fixed;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 8px 20px;
  background: #d4a745;
  color: #0a1628;
  font-weight: 600;
  border-radius: 0 0 4px 0;
  clip: rect(1px,1px,1px,1px);
}
.skip-link:focus {
  top: 0;
  clip: auto;
}

/* ===== HEADER / LEFT NAV ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: #0a1628;
  border-right: 1px solid rgba(212, 167, 69, 0.15);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
}
.header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(212, 167, 69, 0.2);
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.5px;
}
.logo-icon {
  color: #d4a745;
  font-size: 22px;
}
.logo-text {
  background: linear-gradient(135deg, #d4a745, #f0c040);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  gap: 5px;
}
.toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #d4a745;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.header-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}
.nav-list {
  display: flex;
  flex-direction: column;
}
.nav-item {
  margin: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: #b0b8c4;
  border-left: 3px solid transparent;
  transition: color 0.25s, border-color 0.25s, background 0.25s;
  position: relative;
}
.nav-link:hover {
  color: #f0c040;
  background: rgba(212, 167, 69, 0.06);
  border-left-color: #f0c040;
}
.nav-link[aria-current="page"] {
  color: #d4a745;
  border-left-color: #d4a745;
  background: rgba(212, 167, 69, 0.08);
  font-weight: 600;
}
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #d4a745;
  border-radius: 50%;
}
.header-meta {
  padding: 16px 24px 24px;
  border-top: 1px solid rgba(212, 167, 69, 0.12);
  font-size: 12px;
  color: #c0c0c0;
  font-family: var(--font-mono);
  display: flex;
  gap: 6px;
  align-items: center;
}
.meta-version {
  color: #d4a745;
  font-weight: 600;
}
.meta-divider {
  opacity: 0.3;
}
.meta-tagline {
  opacity: 0.7;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #0d1a2e;
  border-top: 1px solid rgba(212, 167, 69, 0.12);
  margin-left: var(--nav-width);
  padding: 48px 24px 24px;
  color: #b0b8c4;
  font-size: 14px;
}
.footer-container {
  max-width: var(--max-content);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-logo {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}
.footer-logo:hover {
  color: #d4a745;
}
.footer-desc {
  font-size: 13px;
  color: #c0c0c0;
  opacity: 0.8;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-link {
  color: #b0b8c4;
  transition: color 0.2s;
  position: relative;
  width: fit-content;
}
.footer-link:hover {
  color: #d4a745;
}
.footer-link::after {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  background: #d4a745;
  transition: width 0.3s;
}
.footer-link:hover::after {
  width: 100%;
}
.footer-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-line {
  font-size: 13px;
  opacity: 0.85;
}
.info-note {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 4px;
  font-style: italic;
}
.footer-bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(212, 167, 69, 0.1);
  font-size: 12px;
  color: #c0c0c0;
  opacity: 0.7;
}

/* ===== COMMON COMPONENTS ===== */
.content-container {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}
.card {
  background: #1c2e4a;
  border-radius: 8px;
  padding: 24px;
  border-top: 3px solid #d4a745;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-weight: 600;
  font-size: 15px;
  border-radius: 4px;
  background: linear-gradient(135deg, #d4a745, #f0c040);
  color: #0a1628;
  transition: transform 0.25s, box-shadow 0.25s;
  letter-spacing: 0.3px;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,167,69,0.3);
}
.btn:active {
  transform: translateY(0);
}
.gold-divider {
  height: 2px;
  background: linear-gradient(90deg, #d4a745, #f0c040, transparent);
  border: none;
  margin: 24px 0;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: #b0b8c4;
  font-family: var(--font-mono);
}
.breadcrumb a {
  color: #c0c0c0;
  transition: color 0.2s;
}
.breadcrumb a:hover {
  color: #d4a745;
}
.breadcrumb span::before {
  content: "/";
  margin: 0 4px;
  color: #d4a745;
  opacity: 0.5;
}
.frame-window {
  border: 2px solid rgba(212, 167, 69, 0.25);
  border-radius: 12px;
  padding: 32px;
  position: relative;
  background: rgba(28, 46, 74, 0.4);
  backdrop-filter: blur(4px);
}
.frame-window::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #d4a745, transparent);
}
.scale-mark {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #c0c0c0;
  opacity: 0.5;
}
.scale-mark span::before {
  content: "—";
  margin-right: 4px;
  color: #d4a745;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.page-title {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #d4a745, #f0c040);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.page-subtitle {
  font-size: 16px;
  color: #b0b8c4;
  font-weight: 400;
  margin-top: 8px;
}
.text-mono {
  font-family: var(--font-mono);
}
.text-gold {
  color: #d4a745;
}
.text-red {
  color: #e63946;
}

/* ===== SCROLL PROGRESS ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: var(--nav-width);
  height: 3px;
  background: linear-gradient(90deg, #d4a745, #f0c040);
  z-index: 999;
  width: 0%;
  pointer-events: none;
  transition: width 0.1s linear;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #d4a745;
  color: #0a1628;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  box-shadow: 0 4px 16px rgba(212,167,69,0.25);
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(212,167,69,0.35);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .site-header {
    width: 100%;
    height: var(--header-height-mobile);
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid rgba(212, 167, 69, 0.15);
    padding: 0 16px;
  }
  .header-brand {
    padding: 0;
    border-bottom: none;
    width: 100%;
  }
  .toggle-btn {
    display: flex;
  }
  .header-nav {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height-mobile));
    background: #0a1628;
    padding: 16px 0;
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 999;
    border-right: none;
    border-top: 1px solid rgba(212, 167, 69, 0.1);
  }
  .site-header[data-open] .header-nav {
    transform: translateX(0);
  }
  .site-header[data-open] .toggle-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .site-header[data-open] .toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .site-header[data-open] .toggle-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
  .nav-link {
    padding: 14px 24px;
    font-size: 16px;
    border-left: none;
    border-bottom: 1px solid rgba(212, 167, 69, 0.06);
  }
  .nav-link[aria-current="page"] {
    border-left: none;
    background: rgba(212, 167, 69, 0.08);
  }
  .nav-link[aria-current="page"]::after {
    right: 24px;
  }
  .header-meta {
    display: none;
  }
  .site-footer {
    margin-left: 0;
    padding: 32px 16px 20px;
  }
  .footer-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
  .scroll-progress {
    left: 0;
  }
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
  .page-title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .frame-window {
    padding: 20px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 18px;
  }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .card:hover {
    transform: none;
  }
  .btn:hover {
    transform: none;
  }
  .back-to-top:hover {
    transform: none;
  }
  .header-nav {
    transition: none;
  }
}

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