/* ============================================================
   Cheyenne Propagation Company — Main Stylesheet
   Dark navy/steel/amber-gold (default) + Light mode (Bob mode)
   ============================================================ */

/* ── GOOGLE FONTS ── */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;900&family=Barlow:ital,wght@0,400;0,500;0,600;1,400&display=swap');

/* ── DESIGN TOKENS: DARK MODE (default) ── */
:root {
  --navy:          #0d1b2a;
  --navy-mid:      #142233;
  --navy-light:    #1e3248;
  --navy-card:     #192d42;
  --steel:         #3d5a73;
  --steel-light:   #5a7a96;
  --steel-muted:   #2a3f52;
  --amber:         #c8922a;
  --amber-light:   #e0a83a;
  --amber-pale:    #f0c96a;
  --amber-dim:     #8a6318;

  --bg:            var(--navy);
  --bg-mid:        var(--navy-mid);
  --bg-light:      var(--navy-light);
  --bg-card:       var(--navy-card);
  --text:          #d4dde6;
  --text-strong:   #eef2f6;
  --text-muted:    #7a9ab5;
  --text-faint:    #4a6880;
  --border:        rgba(61,90,115,0.4);
  --border-strong: rgba(61,90,115,0.7);
  --accent:        var(--amber);
  --accent-light:  var(--amber-light);
  --glow:          rgba(200,146,42,0.15);
  --shadow:        rgba(0,0,0,0.4);

  --header-bg:     var(--navy-mid);
  --header-border: var(--amber);
  --footer-bg:     #0a1520;

  --font-display:  'Barlow Condensed', sans-serif;
  --font-body:     'Barlow', sans-serif;

  --radius:        3px;
  --radius-md:     6px;
  --transition:    0.18s ease;
  --nav-height:    64px;
}

/* ── LIGHT MODE (Bob Mode) ── */
[data-theme="light"] {
  --bg:            #f5f7fa;
  --bg-mid:        #ffffff;
  --bg-light:      #edf0f4;
  --bg-card:       #ffffff;
  --text:          #1a2a3a;
  --text-strong:   #0d1b2a;
  --text-muted:    #4a6070;
  --text-faint:    #8a9fb0;
  --border:        rgba(0,0,0,0.1);
  --border-strong: rgba(0,0,0,0.18);
  --accent:        #a07020;
  --accent-light:  #c8922a;
  --glow:          rgba(160,112,32,0.1);
  --shadow:        rgba(0,0,0,0.12);

  --header-bg:     #ffffff;
  --header-border: #c8922a;
  --footer-bg:     #0d1b2a;
}

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

img { display: block; max-width: 100%; }
a { color: var(--accent-light); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--amber-pale); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--text-strong);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; }
p  { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── LAYOUT ── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow { max-width: 860px; }
.container--wide   { max-width: 1440px; }

.section {
  padding: 4rem 0;
}
.section--sm { padding: 2rem 0; }
.section--lg { padding: 6rem 0; }

/* ── GRID ── */
.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; }
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── HEADER ── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--header-bg);
  border-bottom: 2px solid var(--header-border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: background 0.25s ease;
  box-shadow: 0 2px 12px var(--shadow);
}

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

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-diamond {
  width: 38px; height: 38px;
  background: var(--amber);
  transform: rotate(45deg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.logo-diamond span {
  transform: rotate(-45deg);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.logo-wordmark {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-strong);
  line-height: 1.15;
}
.logo-wordmark em {
  display: block;
  font-style: normal;
  color: var(--accent-light);
  font-size: 0.7rem;
  letter-spacing: 2px;
  font-weight: 600;
}
.logo-img {
  height: 48px;
  width: auto;
  /* Dark mode: shift dark greens to a steel-blue tint, keep proportions readable */
  filter: brightness(1.8) saturate(0.4) hue-rotate(160deg);
  transition: filter 0.25s ease;
}
/* Light mode — show original logo colors as-is */
[data-theme="light"] .logo-img {
  filter: none;
}

/* Nav */
#site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  position: relative;
}
.nav-link:hover { color: var(--accent-light); background: var(--glow); }
.nav-link.active {
  color: var(--accent);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%; transform: translateX(-50%);
  width: 16px; height: 2px;
  background: var(--accent);
}

/* Header right: theme toggle + mobile menu */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-light);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 3px;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.theme-toggle-btn {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.theme-toggle-btn.active {
  background: var(--amber);
  color: var(--navy);
}
[data-theme="light"] .theme-toggle-btn.active { color: #1a1a1a; }

/* ── MOBILE NAV ── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.mobile-menu-btn span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  #site-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--header-bg);
    border-bottom: 2px solid var(--header-border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 0.15rem;
    box-shadow: 0 8px 24px var(--shadow);
  }
  #site-nav.open { display: flex; }
  .nav-link { width: 100%; padding: 0.65rem 0.5rem; }
  .nav-link.active::after { display: none; }
}

/* ── PANEL / CARD ── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}
.panel:hover { border-color: var(--steel); }

.panel-header {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.panel-title::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.panel-body { padding: 1.25rem; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--accent); color: var(--navy); }
.btn:hover a { color: var(--navy); }

.btn--solid { background: var(--accent); color: var(--navy); }
.btn--solid:hover { background: var(--accent-light); border-color: var(--accent-light); }

.btn--ghost { border-color: var(--steel); color: var(--text-muted); }
.btn--ghost:hover { background: var(--steel); color: var(--text-strong); }

.btn--sm { font-size: 0.72rem; padding: 0.35rem 0.8rem; }
.btn--lg { font-size: 0.9rem; padding: 0.7rem 1.5rem; }

/* ── DIVIDER ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}
.divider--amber { border-color: var(--amber-dim); }

/* ── ACCENT BAR ── */
.accent-bar {
  display: block;
  width: 40px; height: 3px;
  background: var(--accent);
  margin-bottom: 1rem;
}
.accent-bar--center { margin: 0 auto 1rem; }

/* ── PAGE HERO ── */
.page-hero {
  background: linear-gradient(160deg, var(--bg-mid) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero h1 { color: var(--text-strong); position: relative; }
.page-hero h1 span { color: var(--accent); }
.page-hero p { color: var(--text-muted); font-size: 0.92rem; margin-top: 0.3rem; position: relative; }

/* ── STATUS DOTS ── */
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #43a047;
  animation: pulse-dot 2.5s infinite;
}
.dot--warn { background: var(--amber); animation: none; }
.dot--err  { background: #e53935; animation: none; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.25} }

/* ── FOOTER ── */
#site-footer {
  background: var(--footer-bg);
  border-top: 2px solid var(--amber-dim);
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
.footer-heading {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.75rem;
}
.footer-text { font-size: 0.88rem; color: #7a9ab5; line-height: 1.7; }
.footer-text a { color: #7a9ab5; }
.footer-text a:hover { color: var(--amber-light); }
.footer-nav { list-style: none; }
.footer-nav li { margin-bottom: 0.4rem; }
.footer-nav a {
  font-size: 0.88rem;
  color: #7a9ab5;
  text-decoration: none;
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--amber-light); }
.footer-bottom {
  border-top: 1px solid rgba(61,90,115,0.3);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer-copy { font-size: 0.78rem; color: #4a6880; }
.footer-copy a { color: #4a6880; }

/* ── UTILITY ── */
.text-center { text-align: center; }
.text-muted   { color: var(--text-muted); }
.text-amber   { color: var(--accent); }
.text-strong  { color: var(--text-strong); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── INFO TABLE (used in sidebars) ── */
.info-table { width: 100%; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-muted); flex-shrink: 0; margin-right: 1rem; }
.info-val { color: var(--text-strong); font-weight: 500; text-align: right; }
.info-val--amber { color: var(--accent); }

/* ── SPINNER ── */
.spinner-ring {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TRANSITIONS for theme switch ── */
*, *::before, *::after {
  transition-property: background-color, border-color, color, box-shadow;
  transition-duration: 0.2s;
  transition-timing-function: ease;
}
/* But NOT for transforms/animations that need to be instant */
.spinner-ring, .dot, .logo-diamond { transition: none; }
