@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --page-background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(129, 140, 248, 0.08), transparent 50%),
    #05070f;
  --background-blur: 18px;
  --surface: rgba(9, 14, 27, 0.88);
  --surface-alt: rgba(16, 24, 43, 0.9);
  --surface-border: rgba(148, 163, 184, 0.2);
  --surface-border-strong: rgba(148, 163, 184, 0.4);
  --shadow-elevated: 0 30px 60px -30px rgba(3, 7, 18, 0.7);
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-soft: #cbd5f5;
  --brand: #38bdf8;
  --brand-strong: #0ea5e9;
  --accent: #a855f7;
  --accent-soft: rgba(168, 85, 247, 0.2);
  --outline: rgba(56, 189, 248, 0.35);
  /* Legacy token aliases */
  --color-text: var(--text-primary);
  --color-muted: var(--text-muted);
  --color-border: var(--surface-border);
  --color-border-strong: var(--surface-border-strong);
  --color-card-shadow: var(--shadow-elevated);
  --color-secondary: rgba(15, 23, 42, 0.85);
  --color-secondary-soft: rgba(15, 23, 42, 0.6);
  --color-table-divider: rgba(148, 163, 184, 0.24);
  --color-accent: var(--brand);
  --color-accent-strong: var(--brand-strong);
  --color-accent-soft: rgba(56, 189, 248, 0.22);
  --color-defense: #22d3ee;
  --color-defense-soft: rgba(34, 211, 238, 0.25);
  --color-offense: #f97316;
  --color-offense-soft: rgba(249, 115, 22, 0.22);
  --color-elemental: #a855f7;
  --color-elemental-soft: rgba(168, 85, 247, 0.25);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--page-background);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover,
a:focus-visible {
  color: var(--brand-strong);
}

.page-shell {
  min-height: 100vh;
  width: 100%;
  padding: 1.5rem 1.25rem 3rem;
}

@media (min-width: 768px) {
  .page-shell {
    padding: 2.5rem;
  }
}

.content-shell {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 7, 15, 0.9);
  backdrop-filter: blur(var(--background-blur));
  border: 1px solid var(--surface-border);
  border-radius: 1.5rem;
  padding: 0.85rem 1.25rem;
  margin-bottom: 2rem;
  transition: transform 0.35s ease, background 0.3s ease, border-color 0.3s ease;
}

.site-nav.nav-hidden {
  transform: translateY(-120%);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 1.1rem;
  color: var(--text-soft);
}

.nav-brand:hover,
.nav-brand:focus-visible {
  color: var(--text-primary);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--surface-border);
  background: var(--surface-alt);
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--outline);
  color: var(--text-soft);
}

.nav-toggle.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.nav-toggle.is-locked:hover,
.nav-toggle.is-locked:focus-visible {
  background: var(--surface-alt);
  border-color: var(--surface-border);
  color: var(--text-muted);
}

#nav-links {
  display: none;
  gap: 0.5rem;
  margin-top: 1rem;
}

#nav-links.is-open {
  display: grid;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-primary);
  border-color: var(--surface-border);
  background: rgba(148, 163, 184, 0.08);
}

.nav-link.is-active {
  color: var(--text-primary);
  border-color: var(--outline);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.18);
}

@media (min-width: 900px) {
  .site-nav {
    padding: 1rem 1.5rem;
  }

  .nav-inner {
    gap: 1.5rem;
  }

  .nav-toggle {
    display: none;
  }

  #nav-links {
    display: flex;
    margin-top: 0;
    gap: 0.5rem;
    align-items: center;
  }
}

main {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

main > section,
main > article,
.card-panel {
  position: relative;
  padding: clamp(1.5rem, 1.25rem + 1vw, 2.25rem);
  border-radius: 1.5rem;
  background: linear-gradient(160deg, var(--surface), var(--surface-alt));
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-elevated);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

main > section::before,
main > article::before,
.card-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(168, 85, 247, 0.08), transparent 65%);
  opacity: 0.65;
  mix-blend-mode: screen;
  pointer-events: none;
}

main > section:hover,
main > article:hover,
.card-panel:hover {
  transform: translateY(-4px);
  border-color: var(--surface-border-strong);
  box-shadow: 0 40px 90px -50px rgba(8, 16, 32, 0.85);
}

main > section > *:first-child,
main > article > *:first-child,
.card-panel > *:first-child {
  margin-top: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-soft);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem);
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.6rem);
  margin-bottom: 1rem;
}

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
  color: var(--text-muted);
}

li {
  margin-bottom: 0.65rem;
}

blockquote {
  margin: 1.75rem 0;
  padding: 1.5rem 1.75rem;
  border-left: 4px solid var(--brand);
  border-radius: 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-muted);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: rgba(10, 15, 30, 0.9);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
}

main thead th {
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.28), rgba(129, 140, 248, 0.28));
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  padding: 0.85rem 1rem;
}

main tbody td,
main tbody th {
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

main tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.45);
}

main tbody tr:hover {
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-primary);
}

main tbody tr:hover td,
main tbody tr:hover th {
  color: inherit;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-soft);
}

.badge-accent {
  background: rgba(56, 189, 248, 0.18);
  color: var(--brand);
}

.lead-text {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #030712;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px rgba(56, 189, 248, 0.7);
  border-color: rgba(56, 189, 248, 0.45);
}

#scroll-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(6, 11, 22, 0.92);
  color: var(--text-primary);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

#scroll-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#scroll-to-top:hover,
#scroll-to-top:focus-visible {
  border-color: var(--brand);
}

::selection {
  background: rgba(56, 189, 248, 0.4);
  color: #0f172a;
}

[data-aspect-ratio] {
  transition: background 0.3s ease;
}

/* Simulator equipment preview weight borders */
.armor-border {
  border-radius: 0.75rem;
  border: 4px solid var(--color-border-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.armor-border--none {
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 1px var(--color-border) inset;
}

.armor-border--light {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5) inset, 0 0 0 3px rgba(34, 197, 94, 0.35);
}

.armor-border--medium {
  border-color: #facc15;
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.5) inset, 0 0 0 3px rgba(250, 204, 21, 0.35);
}

.armor-border--heavy {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5) inset, 0 0 0 3px rgba(239, 68, 68, 0.35);
}

.armor-border:hover,
.armor-border:focus-visible {
  transform: translateY(-2px);
}
