/* ==========================================================================
   Durango-CE Official Design System
   Unified theme for durango-ce.com & Wild Lands Encyclopedia (/wiki/)
   Palette: Volcanic Basalt, Campfire Amber, Canopy Moss, T-Stone Slate, Bone Ink
   ========================================================================== */

:root {
  /* Surfaces */
  --bg-void: #0b0d0b;
  --bg-base: #101310;
  --bg-surface: #161a16;
  --bg-elevated: #1d221d;
  --bg-hover: #242a23;
  --bg-inset: #080a08;

  /* Borders */
  --border-subtle: rgba(236, 232, 223, 0.08);
  --border-default: rgba(236, 232, 223, 0.14);
  --border-strong: rgba(236, 232, 223, 0.24);
  --border-amber: rgba(217, 155, 56, 0.42);

  /* Ink */
  --ink-primary: #ece8df;
  --ink-secondary: #b4afa2;
  --ink-muted: #848075;
  --ink-dim: #5e5c53;
  --ink-on-amber: #120e07;

  /* Brand & Semantic Accents */
  --amber: #d99b38;
  --amber-hi: #ebb454;
  --amber-soft: rgba(217, 155, 56, 0.14);

  --moss: #5ca668;
  --moss-hi: #77c283;
  --moss-soft: rgba(92, 166, 104, 0.14);

  --tstone: #5ea3a3;
  --tstone-hi: #7ec2c2;
  --tstone-soft: rgba(94, 163, 163, 0.14);

  --rust: #cf5c46;
  --rust-hi: #e57a65;
  --rust-soft: rgba(207, 92, 70, 0.15);

  /* Typography */
  --font-display: 'Barlow Condensed', 'Impact', 'Arial Narrow', sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Scale */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.32);
  --shadow-drawer: -12px 0 40px rgba(0, 0, 0, 0.55);

  --nav-h: 66px;
  --container: 1180px;
  --container-wide: 1360px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-void);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--amber-hi);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #f7cb78;
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--amber-hi);
  outline-offset: 2px;
}

img, svg {
  display: block;
}

button, input, select {
  font-family: inherit;
}

.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;
}

/* Containers */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

/* Topographic subtle background utility */
.topo-bg {
  background-image:
    radial-gradient(circle at 80% 0%, rgba(217, 155, 56, 0.06), transparent 45%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320' viewBox='0 0 320 320'%3E%3Cg fill='none' stroke='%23ece8df' stroke-opacity='0.032' stroke-width='1'%3E%3Cpath d='M-20 80 Q 60 20 150 70 T 340 50'/%3E%3Cpath d='M-20 130 Q 80 65 170 120 T 340 105'/%3E%3Cpath d='M-20 185 Q 90 125 190 175 T 340 165'/%3E%3Cpath d='M-20 245 Q 100 190 205 235 T 340 230'/%3E%3Cpath d='M-20 300 Q 110 250 220 295 T 340 285'/%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================================================
   Unified Site Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--nav-h);
  background: rgba(11, 13, 11, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
  color: var(--ink-primary);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #252b22, #121512);
  border: 1px solid var(--border-amber);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.14);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-primary);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink-primary);
  background: rgba(236, 232, 223, 0.05);
  text-decoration: none;
}

.nav-link.active {
  color: var(--amber-hi);
  background: var(--amber-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-toggle {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--ink-primary);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--ink-primary);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, color 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--ink-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--amber);
  border-color: var(--amber-hi);
  color: var(--ink-on-amber);
  box-shadow: 0 2px 12px rgba(217, 155, 56, 0.22);
}

.btn-primary:hover {
  background: var(--amber-hi);
  border-color: #f6c975;
  color: var(--ink-on-amber);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--ink-secondary);
}

.badge-moss {
  background: var(--moss-soft);
  border-color: rgba(92, 166, 104, 0.36);
  color: var(--moss-hi);
}

.badge-amber {
  background: var(--amber-soft);
  border-color: rgba(217, 155, 56, 0.4);
  color: var(--amber-hi);
}

.badge-tstone {
  background: var(--tstone-soft);
  border-color: rgba(94, 163, 163, 0.38);
  color: var(--tstone-hi);
}

.badge-rust {
  background: var(--rust-soft);
  border-color: rgba(207, 92, 70, 0.4);
  color: var(--rust-hi);
}

/* Status Pulse Dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--moss-hi);
  box-shadow: 0 0 0 0 rgba(119, 194, 131, 0.55);
  animation: pulse-ring 2.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.amber {
  background: var(--amber-hi);
  box-shadow: 0 0 0 0 rgba(235, 180, 84, 0.5);
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(119, 194, 131, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(119, 194, 131, 0); }
  100% { box-shadow: 0 0 0 0 rgba(119, 194, 131, 0); }
}

/* Code & Monospace */
code, .mono {
  font-family: var(--font-mono);
}

code {
  font-size: 0.87em;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  color: #dfd8c8;
}

pre {
  margin: 0;
  padding: 16px 18px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: #d7d1c4;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
}

/* ==========================================================================
   Section Headers & Cards
   ========================================================================== */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 10px;
}

.section-eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--amber);
}

.section-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-primary);
}

.section-lead {
  margin: 0 0 32px;
  max-width: 680px;
  color: var(--ink-secondary);
  font-size: 15.5px;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-default);
}

.card-interactive:hover {
  border-color: var(--border-amber);
  transform: translateY(-2px);
}

/* ==========================================================================
   Art Animation Keyframes (Durango Wild Lands Themes)
   ========================================================================== */
@keyframes frond-sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2.6deg); }
}

@keyframes frond-sway-reverse {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-2.2deg); }
}

@keyframes mist-drift {
  0% { transform: translateX(-3%); opacity: 0.35; }
  50% { transform: translateX(3%); opacity: 0.58; }
  100% { transform: translateX(-3%); opacity: 0.35; }
}

@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Unified Footer
   ========================================================================== */
.site-footer {
  background: var(--bg-inset);
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0 48px;
  color: var(--ink-muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

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

.footer-links a:hover {
  color: var(--amber-hi);
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: rgba(16, 19, 16, 0.98);
    border-bottom: 1px solid var(--border-default);
    padding: 12px 24px 18px;
    gap: 4px;
  }
  .nav-links.open {
    display: flex;
  }
  .section {
    padding: 52px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
