/* ============================================================
   KingofKnight.com — Medieval Dark Theme
   ============================================================ */

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

:root {
  --bg:          #08101e;
  --bg-card:     #0f1c2e;
  --bg-hover:    #162440;
  --border:      #1e3050;
  --border-glow: #2e5090;
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --gold-dim:    #7a6030;
  --silver:      #a8b2c1;
  --text:        #dde3ed;
  --text-muted:  #7a8898;
  --red:         #c0392b;
  --blue:        #2e86c1;
  --nav-h:       64px;
  --radius:      6px;
  --radius-lg:   12px;
  --font-body:   'Inter', system-ui, -apple-system, sans-serif;
  --font-head:   'Cinzel', 'Palatino Linotype', serif;
  --transition:  0.2s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

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

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: var(--gold);
  line-height: 1.25;
  letter-spacing: 0.02em;
}
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.3rem; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section { padding: 5rem 0; }
.section + .section { border-top: 1px solid var(--border); }
.section--alt { background: rgba(255,255,255,0.015); }

.section-label {
  font-size: 0.75rem;
  font-family: var(--font-head);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 0.5rem;
}
.section-title { margin-bottom: 0.75rem; }
.section-intro {
  color: var(--silver);
  max-width: 680px;
  margin-bottom: 3rem;
  font-size: 1.05rem;
}

/* --- Navigation --- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(8, 16, 30, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.site-nav.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.5); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo .crown { font-size: 1.5rem; }
.nav-logo:hover { color: var(--gold-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-link {
  color: var(--silver);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--gold);
  background: rgba(201,168,76,0.1);
}

.nav-cta {
  margin-left: 0.5rem;
  background: var(--gold);
  color: var(--bg) !important;
  font-weight: 700;
  padding: 0.4rem 1rem !important;
}
.nav-cta:hover { background: var(--gold-light) !important; color: var(--bg) !important; }

#nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
#nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--silver);
  border-radius: 2px;
  transition: background var(--transition);
}
#nav-burger:hover span { background: var(--gold); }

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 20% 100%, rgba(30,60,100,0.3) 0%, transparent 50%),
    linear-gradient(180deg, #08101e 0%, #0a1525 100%);
  z-index: 0;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30,48,80,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,48,80,0.15) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.3rem 1rem;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: var(--silver);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.divider-rune {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 3rem 0;
  color: var(--gold-dim);
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}
.divider-rune::before, .divider-rune::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--gold);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--gold-light);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.3);
}
.btn-outline {
  border: 1px solid var(--border-glow);
  color: var(--silver);
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.05);
  transform: translateY(-1px);
}
.btn-ghost {
  color: var(--gold);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
}
.btn-ghost:hover {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.card p  { color: var(--silver); font-size: 0.93rem; margin-bottom: 0; }

/* --- Grid Layouts --- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

/* --- Faction Section --- */
.faction-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
}
.faction-card {
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
}
.faction-card--elmorad {
  background: linear-gradient(135deg, #0a1f3a 0%, #0d2d5a 100%);
  border: 1px solid #1e4080;
}
.faction-card--karus {
  background: linear-gradient(135deg, #1a0a08 0%, #3a1008 100%);
  border: 1px solid #802010;
}
.faction-emblem {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
}
.faction-name { color: var(--gold); margin-bottom: 0.75rem; }
.faction-card p { color: var(--silver); font-size: 0.93rem; margin-bottom: 0; }

.vs-badge {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: var(--gold);
  border: 2px solid var(--gold-dim);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg);
  box-shadow: 0 0 20px rgba(201,168,76,0.2);
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stat-item {
  padding: 2rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-number {
  font-family: var(--font-head);
  font-size: 2.2rem;
  color: var(--gold);
  display: block;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --- Class Grid --- */
.class-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}
.class-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
}
.class-icon { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; }
.class-card h4 { margin-bottom: 0.4rem; font-size: 1rem; }
.class-card p  { font-size: 0.83rem; color: var(--text-muted); margin: 0; }

/* --- Timeline --- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-dim) 0%, transparent 100%);
}
.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -0.45rem;
  top: 0.45rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}
.timeline-date {
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--gold-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}
.timeline-item h4 { color: var(--gold); margin-bottom: 0.4rem; }
.timeline-item p  { color: var(--silver); font-size: 0.93rem; margin: 0; }

/* --- Code Blocks --- */
.code-block {
  background: #060d18;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 1.5rem 0;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-family: var(--font-head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.code-dots { display: flex; gap: 6px; }
.code-dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.code-dots .d1 { background: #c0392b; }
.code-dots .d2 { background: #f39c12; }
.code-dots .d3 { background: #27ae60; }

pre {
  padding: 1.5rem;
  overflow-x: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #abb2bf;
  margin: 0;
}
code { font-family: inherit; }
.hl-keyword  { color: #c678dd; }
.hl-string   { color: #98c379; }
.hl-comment  { color: #5c6370; font-style: italic; }
.hl-number   { color: #d19a66; }
.hl-function { color: #61afef; }
.hl-var      { color: #e06c75; }
.hl-operator { color: #56b6c2; }

/* --- Badges / Tags --- */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 2rem;
  margin: 0.2rem;
}
.tag--gold   { background: rgba(201,168,76,0.15); color: var(--gold);   border: 1px solid rgba(201,168,76,0.3); }
.tag--blue   { background: rgba(46,134,193,0.15); color: #5dade2;       border: 1px solid rgba(46,134,193,0.3); }
.tag--silver { background: rgba(168,178,193,0.1); color: var(--silver); border: 1px solid rgba(168,178,193,0.2); }
.tag--red    { background: rgba(192,57,43,0.15);  color: #e74c3c;       border: 1px solid rgba(192,57,43,0.3); }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { color: var(--border-glow); }

/* --- Page Hero (inner pages) --- */
.page-hero {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(201,168,76,0.04) 0%, transparent 100%);
}
.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero .lead { color: var(--silver); font-size: 1.1rem; max-width: 650px; margin-bottom: 0; }

/* --- Resource Links --- */
.resource-list { list-style: none; padding: 0; }
.resource-list li {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.resource-list li:last-child { border-bottom: none; }
.resource-link {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.resource-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 0.1rem; }
.resource-info h4 { color: var(--gold); margin-bottom: 0.2rem; font-size: 1rem; }
.resource-info p  { color: var(--text-muted); font-size: 0.87rem; margin: 0; }

/* --- Info Box --- */
.info-box {
  background: rgba(201,168,76,0.05);
  border: 1px solid rgba(201,168,76,0.2);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.93rem;
  color: var(--silver);
}
.info-box strong { color: var(--gold); }

.warn-box {
  background: rgba(192,57,43,0.05);
  border: 1px solid rgba(192,57,43,0.2);
  border-left: 3px solid #c0392b;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.93rem;
  color: var(--silver);
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.footer-brand .nav-logo { font-size: 1.1rem; margin-bottom: 0.75rem; display: inline-flex; }
.footer-brand p { max-width: 300px; line-height: 1.6; }
.footer-col h5 {
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: var(--text-muted); }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 2rem 1.5rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}

/* --- Utility --- */
.text-gold    { color: var(--gold); }
.text-silver  { color: var(--silver); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.mt-1  { margin-top: 0.5rem; }
.mt-2  { margin-top: 1rem; }
.mt-3  { margin-top: 1.5rem; }
.mt-4  { margin-top: 2rem; }
.mb-0  { margin-bottom: 0; }
.mb-2  { margin-bottom: 1rem; }
.mb-4  { margin-bottom: 2rem; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .faction-grid { grid-template-columns: 1fr; }
  .vs-badge { margin: 0.5rem auto; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .stats-bar .stat-item:nth-child(2) { border-right: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  .hero-inner { padding: 4rem 1.5rem; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }

  #nav-burger { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(8,16,30,0.98);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    gap: 0.25rem;
    align-items: stretch;
  }
  .nav-links.open { display: flex; }
  .nav-link { text-align: center; padding: 0.65rem 1rem; }
  .nav-cta { text-align: center; }
}
