/* ═══════════════════════════════════════════════════════════
   OropAion Codex — Design System v2
   Modern dark UI inspired by Linear/Raycast/Discord
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg-0: #0c0d12;
  --bg-1: #13141a;
  --bg-2: #1a1b23;
  --bg-3: #22232e;
  --bg-hover: rgba(255,255,255,0.035);

  --accent: #7c6bf5;
  --accent-soft: rgba(124,107,245,0.12);
  --accent-text: #a89aff;

  --gold: #c9a84c;
  --gold-soft: rgba(201,168,76,0.1);

  --text-0: #ececf1;
  --text-1: #b4b4be;
  --text-2: #7a7a88;
  --text-3: #4e4e5a;

  --border: rgba(255,255,255,0.06);
  --border-active: rgba(255,255,255,0.12);

  --red: #ef4444;
  --green: #22c55e;
  --blue: #3b82f6;
  --orange: #f59e0b;
  --purple: #a855f7;

  --radius: 8px;
  --radius-lg: 12px;
  --nav-h: 56px;

  /* Legacy compat aliases */
  --bg-deep: var(--bg-0);
  --bg-mid: var(--bg-1);
  --elyos-gold: var(--gold);
  --elyos-gold-bright: #e0c76a;
  --elyos-blue: #6ec3ff;
  --asmo-purple: #8b3df0;
  --text-primary: var(--text-0);
  --text-secondary: var(--text-1);
  --text-tertiary: var(--text-2);
  --border-faint: var(--border);
  --border-subtle: rgba(255,255,255,0.03);
  --status-live: var(--green);
  --type-pvp: var(--red);
  --type-pve: var(--blue);
  --bg-card: var(--bg-1);
  --bg-elevated: var(--bg-2);
  --color-bg-elevated: var(--bg-2);
  --color-bg-secondary: var(--bg-1);
  --color-border-default: var(--border);
  --color-text-primary: var(--text-0);
  --color-text-muted: var(--text-2);
  --color-accent-gold: var(--gold);
  --radius-sm: 6px;
  --radius-md: 8px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}

/* Base resets — only applied to old (non-Tailwind) pages via body styles.
   Tailwind pages already have their own resets via Preflight. */

/* Scrollbar and selection styles moved to codex-nav partial to avoid affecting main site */

/* ─── Starfield (subtle) ─── */
.stars {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1px 1px at 20% 15%, rgba(255,255,255,0.15) 0, transparent 100%),
    radial-gradient(1px 1px at 70% 35%, rgba(255,255,255,0.1) 0, transparent 100%),
    radial-gradient(1px 1px at 85% 10%, rgba(255,255,255,0.12) 0, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.08) 0, transparent 100%),
    radial-gradient(1px 1px at 55% 50%, rgba(255,255,255,0.1) 0, transparent 100%);
  opacity: 0.3;
}

/* ─── Nav (codex only — scoped to avoid breaking main site nav) ─── */
nav.codex-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(12,13,18,0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.nav-brand { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; height: 100%; padding: 8px 0; }
.nav-brand img { height: 32px; width: auto; display: block; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-size: 13px; color: var(--text-2); text-decoration: none;
  padding: 6px 10px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text-0); background: var(--bg-hover); }
.nav-links a.active { color: var(--text-0); background: var(--bg-hover); }
.nav-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.lang-switch { display: flex; gap: 2px; font-size: 12px; color: var(--text-3); }
.lang-switch a { color: var(--text-3); text-decoration: none; padding: 4px 6px; border-radius: 4px; }
.lang-switch a:hover { color: var(--text-1); }
.lang-switch a.on { color: var(--text-0); background: var(--bg-hover); }
.btn-ghost {
  padding: 7px 14px; font-size: 12px; color: var(--text-1);
  border: 1px solid var(--border); border-radius: 6px;
  background: transparent; text-decoration: none;
  transition: all .15s;
}
.btn-ghost:hover { color: var(--text-0); border-color: var(--border-active); background: var(--bg-hover); }
.btn-fill {
  padding: 7px 14px; font-size: 12px; color: #fff;
  background: var(--accent); border: none; border-radius: 6px;
  text-decoration: none; font-weight: 500; transition: all .15s;
}
.btn-fill:hover { filter: brightness(1.1); }

.nav-toggle { display: none; background: transparent; border: 1px solid var(--border); width: 36px; height: 36px; cursor: pointer; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border-radius: 6px; }
.nav-toggle span { display: block; width: 16px; height: 1.5px; background: var(--text-1); transition: transform .2s, opacity .2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px; margin-top: 60px;
  font-size: 12px; color: var(--text-3);
}
footer a { color: var(--text-2); text-decoration: none; }
footer a:hover { color: var(--text-0); }
.foot-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; gap: 24px; } }
.foot-brand img { height: 32px; margin-bottom: 10px; }
.foot-brand-desc { color: var(--text-3); line-height: 1.6; max-width: 280px; }
.foot-col h4 { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.foot-col ul { list-style: none; }
.foot-col li { margin-bottom: 6px; }
.foot-col a { font-size: 13px; }
.foot-bottom { max-width: 1100px; margin: 24px auto 0; padding-top: 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); line-height: 1.5; }

/* ─── Steppers (number input +/- buttons) ─── */
.stepper {
  display: inline-flex; align-items: center; border: 1px solid var(--border);
  border-radius: var(--radius, 8px); overflow: hidden; background: var(--bg-0);
}
.stepper input[type="number"] {
  border: none !important; border-radius: 0 !important; text-align: center;
  width: 50px; padding: 6px 2px !important; background: transparent !important;
  -moz-appearance: textfield; margin: 0;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn {
  width: 28px; height: 100%; border: none; background: var(--bg-2);
  color: var(--text-2); font-size: 14px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .1s;
  padding: 6px 0;
}
.step-btn:hover { background: var(--bg-3); color: var(--text-0); }
