/* ============================================
   Skirmish — Dark Dungeon Theme
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text-primary: #c8c8d0;
  --text-secondary: #8888a0;
  --text-heading: #e0e0e8;
  --accent-gold: #d4a017;
  --accent-gold-dim: #a07a10;
  --accent-red: #c44040;
  --accent-green: #40a050;
  --accent-blue: #4080c0;
  --border-color: #2a2a3a;
  --border-accent: #3a3a50;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', 'Courier New', monospace;
  --max-width: 1100px;
  --nav-height: 60px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  min-height: 100vh;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #e8b830;
}

img {
  max-width: 100%;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4 {
  color: var(--text-heading);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.2rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.8rem; margin-top: 2.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.6rem; margin-top: 1.8rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.5rem; margin-top: 1.2rem; }

p {
  margin-bottom: 1rem;
}

/* ============================================
   Container
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================
   Navigation
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-gold);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 1px;
}

/* Hamburger menu */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Hero
   ============================================ */

.hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  text-align: center;
  background: linear-gradient(180deg, #0a0a0f 0%, #0f0f18 50%, #0a0a0f 100%);
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212, 160, 23, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.hero-logo {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-gold);
  line-height: 1.15;
  margin: 0 auto 1.5rem;
  background: none;
  border: none;
  padding: 0;
  display: inline-block;
  text-align: left;
  overflow-x: auto;
  max-width: 100%;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-block;
  padding: 14px 36px;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 4px;
  transition: background-color 0.2s, transform 0.1s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: #e8b830;
  color: var(--bg-primary);
  transform: translateY(-1px);
}

/* ============================================
   Sections
   ============================================ */

.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: var(--accent-gold);
  margin: 12px auto 0;
}

/* ============================================
   Cards Grid
   ============================================ */

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

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

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 28px;
  transition: border-color 0.2s, background-color 0.2s;
}

.card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.card-icon {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
  display: block;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 0;
}

/* Class cards */
.class-card .class-stats {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  line-height: 1.8;
}

.class-card .class-stats span {
  display: inline-block;
  margin-right: 12px;
  white-space: nowrap;
}

.class-card .class-stats .stat-label {
  color: var(--accent-gold-dim);
}

.class-card .class-glyph {
  font-family: var(--font-mono);
  font-size: 3rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 160, 23, 0.08);
  border: 1px solid rgba(212, 160, 23, 0.2);
  border-radius: 8px;
  margin-bottom: 12px;
}

.class-warrior .class-glyph { color: #e06040; }
.class-rogue .class-glyph { color: #40c070; }
.class-wizard .class-glyph { color: #6080e0; }

/* ============================================
   Tables
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}

thead {
  background: var(--bg-card);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-heading);
  border-bottom: 2px solid var(--border-accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover {
  background: rgba(212, 160, 23, 0.03);
}

.stat-table {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.stat-table th {
  font-family: var(--font-body);
}

.stat-table td {
  white-space: nowrap;
}

/* ============================================
   Code / Mono blocks
   ============================================ */

code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
  color: var(--accent-gold);
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1rem 0;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

/* ============================================
   Manual — Sidebar + Content layout
   ============================================ */

.manual-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding-top: calc(var(--nav-height) + 30px);
  min-height: 100vh;
}

.manual-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 30px);
  align-self: start;
  max-height: calc(100vh - var(--nav-height) - 60px);
  overflow-y: auto;
  padding-bottom: 30px;
}

.manual-sidebar h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  margin-top: 0;
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li {
  margin-bottom: 2px;
}

.toc-list a {
  display: block;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.toc-list a:hover {
  color: var(--text-primary);
  background: rgba(212, 160, 23, 0.05);
}

.toc-list a.active {
  color: var(--accent-gold);
  border-left-color: var(--accent-gold);
  background: rgba(212, 160, 23, 0.08);
}

.manual-content {
  padding-bottom: 80px;
  max-width: 820px;
}

.manual-content section {
  margin-bottom: 3rem;
  padding-top: 1rem;
}

.manual-content h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

/* ============================================
   Download Cards
   ============================================ */

.download-card {
  text-align: center;
  padding: 32px 24px;
}

.download-card .os-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  display: block;
}

.download-card h3 {
  margin-top: 0;
}

.download-card .btn-download {
  display: inline-block;
  padding: 10px 28px;
  margin-top: 16px;
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.download-card .btn-download:hover {
  background: var(--accent-gold);
  color: var(--bg-primary);
}

.download-card .os-note {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* ============================================
   Install page
   ============================================ */

.install-content {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 80px;
}

.install-content h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.install-content h3 {
  color: var(--accent-gold);
}

.step-number {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: var(--accent-gold);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
  margin-right: 8px;
}

/* ============================================
   Footer
   ============================================ */

.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--accent-gold);
}

.footer .flavor {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  opacity: 0.5;
  margin-top: 8px;
}

/* ============================================
   Utility
   ============================================ */

.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-secondary); }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }

.formula {
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 20px;
  margin: 1rem 0;
  font-size: 0.9rem;
  color: var(--accent-gold);
}

.note {
  background: rgba(212, 160, 23, 0.06);
  border-left: 3px solid var(--accent-gold);
  padding: 12px 16px;
  margin: 1rem 0;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
}

.warning {
  background: rgba(196, 64, 64, 0.08);
  border-left: 3px solid var(--accent-red);
  padding: 12px 16px;
  margin: 1rem 0;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
}

/* ============================================
   Responsive
   ============================================ */

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

@media (max-width: 768px) {
  /* Nav mobile */
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 10px 0;
    font-size: 1rem;
  }

  /* Hero */
  .hero h1 {
    font-size: 2rem;
    letter-spacing: 3px;
  }

  .hero .tagline {
    font-size: 1rem;
  }

  .hero-logo {
    font-size: 0.38rem;
  }

  /* Cards */
  .card-grid,
  .card-grid-4 {
    grid-template-columns: 1fr;
  }

  .card-grid-2 {
    grid-template-columns: 1fr;
  }

  /* Manual */
  .manual-layout {
    grid-template-columns: 1fr;
  }

  .manual-sidebar {
    position: static;
    max-height: none;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
  }

  /* Tables scroll */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* General */
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: calc(var(--nav-height) + 40px) 0 40px;
  }

  .section {
    padding: 40px 0;
  }
}
