/* ═══════════════════════════════════════════
   CerealKiller DWS — Shared Dark Tactical Theme
   Used by: index, battle, troops, heroes, spending, progression
   ═══════════════════════════════════════════ */

/* ─── DESIGN TOKENS (Splash-screen palette — deep teals, slate blues, warm ambers) ─── */
:root {
  --bg: #0c1218;
  --bg-card: #101c28;
  --bg-card-hover: #162436;
  --bg-elevated: #152030;
  --bg-surface: #1a2a3c;
  --border: #2a3e52;
  --border-accent: #3a5468;
  --text: #e4ecf0;
  --text-dim: #8da4b8;
  --text-muted: #4d6878;
  --text-label: #6a8a9c;
  --accent: #d4883a;
  --accent-dim: #8a5a28;
  --accent-glow: rgba(212,136,58,0.08);
  --accent-subtle: rgba(212,136,58,0.12);
  --green: #4a9888;
  --green-dim: rgba(74,152,136,0.12);
  --red: #c45040;
  --red-dim: rgba(196,80,64,0.12);
  --blue: #3b82f6;
  --blue-dim: rgba(59,130,246,0.12);
  --yellow: #eab308;
  --yellow-dim: rgba(234,179,8,0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168,85,247,0.12);

  /* Spacing scale */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1rem);
  --space-md: clamp(1.5rem, 3vw, 2rem);
  --space-lg: clamp(2.5rem, 5vw, 4rem);
  --space-xl: clamp(3.5rem, 7vw, 6rem);
  --space-2xl: clamp(5rem, 10vw, 8rem);

  /* Accent RGB for rgba() usage */
  --accent-rgb: 212, 136, 58;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-elevated);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

p { text-wrap: pretty; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent); color: #000; }

img { max-width: 100%; height: auto; border-radius: 8px; }

/* ─── NOISE OVERLAY ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ─── LAYERED GRADIENT GLOW (3 shapes — outer ambient, mid core, inner highlight) ─── */
body::after {
  content: '';
  position: fixed;
  bottom: -25%;
  left: -22%;
  width: 1000px;
  height: 1000px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.06) 0%, rgba(var(--accent-rgb), 0.02) 40%, transparent 70%);
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.glow-layer {
  position: fixed;
  bottom: -20%;
  left: -15%;
  width: 700px;
  height: 700px;
  pointer-events: none;
  z-index: 0;
}

.glow-layer::before {
  content: '';
  position: absolute;
  bottom: 10%;
  left: 15%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.07) 0%, rgba(138,90,40,0.03) 50%, transparent 75%);
  filter: blur(140px);
  border-radius: 50%;
}

.glow-layer::after {
  content: '';
  position: absolute;
  bottom: 18%;
  left: 22%;
  width: 220px;
  height: 180px;
  background: radial-gradient(ellipse, rgba(234,179,8,0.04) 0%, rgba(var(--accent-rgb), 0.02) 50%, transparent 80%);
  filter: blur(80px);
  border-radius: 50%;
}

/* ─── LAYOUT ─── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Container with 12-column grid */
.container.grid-12 {
  padding: 0 32px;
}

section {
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--border);
}

/* ─── 12-COLUMN GRID SYSTEM ─── */

/* Base 12-column grid — use on any container */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px 24px;
}

/* Span utilities */
.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }
.col-full { grid-column: 1 / -1; }

/* Rail layout — sidebar + content inside 12-col */
.page-rail {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
  overflow: visible;
}

/* Sidebar label wrapper — spans 3 of 12 columns, sticky */
.rail-label-wrap {
  grid-column: 1 / span 3;
  padding-top: 96px;
  position: sticky;
  top: 52px;
  align-self: start;
  z-index: 10;
}

/* Rail label pill — compact inline-flex badge */
.rail-label {
  display: inline-flex;
  flex-direction: column;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}

.rail-label .rail-num {
  display: block;
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 3px;
  letter-spacing: 0.05em;
}

/* Section content — spans 9 of 12 columns */
.rail-section {
  grid-column: 4 / -1;
  padding: 96px 0 72px;
  border-bottom: 1px solid var(--border);
}

.rail-section:last-of-type { border-bottom: none; }

/* Full-bleed element inside rail grid */
.rail-full {
  grid-column: 1 / -1;
}

/* ─── ATMOSPHERIC HERO (full-bleed, outside grid) ─── */
.page-hero-atmos {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  padding-left: max(32px, calc(50vw - 540px));
  padding-right: max(32px, calc(50vw - 540px));
}

.page-hero-atmos .hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  z-index: 0;
  border-radius: 0;
}

.page-hero-atmos::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--bg) 0%, transparent 35%, transparent 65%, var(--bg) 100%);
  z-index: 1;
  pointer-events: none;
}

.page-hero-atmos::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60%;
  background: linear-gradient(to top, var(--bg), transparent);
  z-index: 1;
  pointer-events: none;
}

.page-hero-atmos .hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
  align-content: center;
  padding: 80px 0 72px;
}

.page-hero-atmos .hero-inner > * {
  grid-column: 3 / 10;
}

.page-hero-atmos .hero-inner .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-hero-atmos .hero-inner .label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.page-hero-atmos .hero-inner h1 {
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.page-hero-atmos .hero-inner h1 span { color: var(--accent); }

.page-hero-atmos .hero-inner .subtitle {
  font-size: 1.125rem;
  color: var(--text-dim);
  line-height: 1.75;
  font-weight: 300;
}

.page-hero-atmos .hero-inner .subtitle strong {
  font-weight: 600;
  color: var(--text);
}

/* ─── COMPOSED STATEMENT (H2 + pitch) ─── */
.section-heading {
  font-size: clamp(1.5rem, 3.5vw, 2.125rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

.section-pitch {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 600px;
  margin-bottom: 40px;
  font-weight: 300;
}

.section-pitch strong {
  font-weight: 600;
  color: var(--text);
}

/* ─── SCROLL-REVEAL ANIMATION ─── */
.scroll-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ─── IMAGE PAIR (grid-based, replaces float) ─── */
.img-pair {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin: 40px 0;
}

.img-pair > * {
  grid-column: span 6;
}

.img-unit img {
  border-radius: 8px;
  border: 1px solid var(--border-accent);
  transition: transform 0.3s ease;
}

.img-unit:hover img { transform: scale(1.02); }

.img-caption {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ─── RAIL RESPONSIVE ─── */
@media (max-width: 768px) {
  .page-rail {
    padding: 0 20px;
    gap: 0 12px;
  }

  .rail-label-wrap {
    grid-column: 1 / -1;
    position: static;
    padding-top: 48px;
    padding-bottom: 8px;
  }

  .rail-label {
    display: inline-flex;
  }

  .rail-full { grid-column: 1 / -1; }
  .rail-section { padding: 48px 0; grid-column: 1 / -1; }

  .page-hero-atmos {
    min-height: auto;
    padding-left: 20px;
    padding-right: 20px;
  }

  .page-hero-atmos .hero-inner {
    padding: 48px 0 40px;
    gap: 0 12px;
  }
  .page-hero-atmos .hero-inner > * { grid-column: 1 / -1; }
  .page-hero-atmos .hero-inner h1 { font-size: 1.8rem; }

  .img-pair > * { grid-column: span 12; }
}

/* ─── SPLIT SECTION (alternating image/text) ─── */
.split-section {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
  padding: var(--space-xl) 0;
}

.split-section > * {
  grid-column: span 6;
}

.split-section.reverse {
  direction: rtl;
}
.split-section.reverse > * {
  direction: ltr;
}

@media (max-width: 767px) {
  .split-section > * {
    grid-column: span 12;
  }
  .split-section.reverse {
    direction: ltr;
  }
}

/* ─── SECTION LABEL ─── */
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-xs);
}

section h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

section h3 {
  font-size: 1.15rem;
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

section > p, section > div > p {
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
}

/* ─── PAGE HERO (subpage headers) ─── */
.page-hero {
  padding: 104px 0 88px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent), 0 0 48px var(--accent-glow);
}

.page-hero .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-hero .label::before {
  content: '';
  width: 20px;
  height: 1px;
  background: var(--accent);
}

.page-hero h1 {
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
}

.page-hero h1 span { color: var(--accent); }

.page-hero .subtitle {
  font-size: 1.125rem;
  color: var(--text-dim);
  max-width: 580px;
  line-height: 1.75;
}

/* ─── NAVBAR (MEGA MENU) ─── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
}

/* Top-level nav items */
.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.nav-links > li {
  position: relative;
}

.nav-links > li > a,
.nav-links > li > button {
  font-size: 0.82rem;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-dim);
  transition: color 0.2s;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links > li > a:hover,
.nav-links > li > button:hover { color: var(--text); }
.nav-links > li > a.active,
.nav-links > li > button.active { color: var(--accent); font-weight: 600; }

/* Dropdown caret */
.nav-caret {
  font-size: 0.55rem;
  transition: transform 0.2s;
  opacity: 0.6;
}
li.mega-open .nav-caret { transform: rotate(180deg); }

/* Mega dropdown panel */
.mega-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: rgba(18,18,20,0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 8px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
li.mega-open > .mega-panel { display: block; }

.mega-panel .mega-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-label);
  padding: 4px 12px 8px;
  display: block;
}

.mega-panel a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.15s, color 0.15s;
}
.mega-panel a:hover { background: var(--bg-elevated); color: var(--text); }
.mega-panel a.active { color: var(--accent); font-weight: 600; }
.mega-panel .mega-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 8px;
  line-height: 1.4;
  display: inline;
}
.mega-panel .mega-desc::before {
  content: '·';
  margin-right: 6px;
  opacity: 0.5;
}

.mega-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* Hamburger toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 1.1rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* ─── MOBILE NAV ─── */
@media (max-width: 680px) {
  .nav-toggle { display: block; }

  /*
   * Mobile overlay: .site-nav itself becomes the fullscreen overlay.
   * We can't use position:fixed on .nav-links because .site-nav has
   * backdrop-filter, which creates a containing block that traps
   * fixed-position children. Instead, we expand .site-nav itself.
   */
  .site-nav.nav-open {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.97);
    border-bottom: none;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
  }

  .site-nav.nav-open .nav-inner {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr;
    width: 100%;
    height: auto;
    padding-top: 24px;
    gap: 0;
  }

  /* Brand (top-left) and close button (top-right) share the first row */
  .site-nav.nav-open .nav-brand {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }

  .site-nav.nav-open .nav-toggle {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  /* Links fill the remaining space below */
  .site-nav.nav-open .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    gap: 8px;
    list-style: none;
    margin: 0;
  }

  .nav-links.open {
    display: flex;
    flex: 1;
  }

  /* Hide the bottom-border hover effect inside mobile overlay */
  .site-nav.nav-open .nav-links > li > a::after,
  .site-nav.nav-open .nav-links > li > button::after {
    display: none;
  }

  /* Flatten mega panels on mobile */
  .mega-panel {
    position: static;
    transform: none;
    border: none;
    background: none;
    backdrop-filter: none;
    box-shadow: none;
    padding: 0 0 0 12px;
    min-width: 0;
  }
  li.mega-open > .mega-panel { display: block; }
  .nav-links > li > button { padding: 12px 0; font-size: 1.1rem; width: 100%; justify-content: center; gap: 8px; }
  .nav-links > li > a { padding: 12px 0; font-size: 1.1rem; text-align: center; }
  .mega-panel a { padding: 10px 0; font-size: 1rem; text-align: center; }
  .mega-panel .mega-group-label { padding: 8px 0 4px; text-align: center; }
  .mega-divider { margin: 6px 0; }

  /* Close button z-index when overlay is open */
  .nav-toggle {
    position: relative;
    z-index: 1001;
  }
}

/* ─── WIP BANNER (scrolling marquee) ─── */
.wip-banner {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  width: 100%;
  height: 32px;
  line-height: 32px;
  font-size: 0.75rem;
  color: var(--text-dim);
  position: relative;
}

.wip-banner .marquee-viewport {
  max-width: 1080px;
  margin: 0 auto;
  overflow: hidden;
  white-space: nowrap;
  height: 100%;
}

.wip-banner .marquee-track {
  display: inline-block;
  animation: marquee-scroll 60s linear infinite;
  padding-left: 100%;
}

.wip-banner .marquee-track span {
  display: inline-block;
  padding: 0 3em;
}

@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* Pause on hover so users can read / click */
.wip-banner:hover .marquee-track,
.wip-banner .marquee-viewport:hover .marquee-track {
  animation-play-state: paused;
}

/* ─── BREADCRUMB TRAIL (inside hero section) ─── */
.site-breadcrumb {
  position: relative;
  z-index: 2;
  margin-bottom: 12px;
}

.breadcrumb-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb-item a:hover {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb-item.current {
  color: var(--text-dim);
}

.breadcrumb-sep {
  color: var(--border-accent);
  margin: 0 6px;
  font-size: 0.8rem;
}

/* ─── PHONE FRAMES ─── */
.phone-frame {
  max-width: 280px;
  margin: 24px auto;
  background: none;
  border-radius: 24px;
  padding: 8px;
  border: none;
  box-shadow: none;
}

.phone-frame img { border-radius: 16px; display: block; width: 100%; }

.phone-caption {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  font-family: 'JetBrains Mono', monospace;
}

.phone-frame.float-right {
  float: right;
  margin: 0 0 16px 24px;
}

.phone-frame.float-left {
  float: left;
  margin: 0 24px 16px 0;
}

.clearfix::after { content: ''; display: table; clear: both; }

@media (max-width: 600px) {
  .phone-frame.float-right,
  .phone-frame.float-left {
    float: none;
    margin: 0 auto 20px;
    max-width: 240px;
  }
}

/* ─── CARDS (generic) ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin: 16px 0;
}

.card.accent {
  border-left: 3px solid var(--accent);
}

.card p { font-size: 1rem; line-height: 1.75; color: var(--text-dim); }

/* ─── STAT CARDS (Convoy-style big numbers) ─── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin: 28px 0 8px;
  container-type: inline-size;
}

.stat-grid > * {
  grid-column: span 4;
}

@container (max-width: 500px) {
  .stat-grid > * { grid-column: span 12; }
}

.stat-card {
  background: transparent;
  border: none;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  padding: 1rem 1.5rem;
  transition: border-color 0.25s;
}

.stat-card:hover {
  border-left-color: var(--accent-dim);
}

.stat-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.75;
}

@media (max-width: 600px) {
  .stat-grid > * { grid-column: span 12; }
}

/* ─── FAQ / ACCORDION (Convoy-style) ─── */
.faq-list {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--bg-elevated);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.faq-item[open] {
  border-color: var(--accent);
}

.faq-item summary {
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: background 0.2s;
}

.faq-item summary:hover {
  background: var(--bg-card);
}

.faq-item summary .faq-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-label);
  min-width: 20px;
}

.faq-item summary .faq-icon {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-item[open] summary .faq-icon {
  transform: rotate(45deg);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-content {
  padding: 0 24px 20px 60px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
}

/* ─── TWO-COLUMN HEADER (Convoy-style) ─── */
.split-header {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.split-header .split-left {
  flex: 0 0 45%;
}

.split-header .split-left h2 {
  margin-bottom: 0;
}

.split-header .split-right {
  flex: 1;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
  padding-top: 6px;
}

@media (max-width: 600px) {
  .split-header {
    flex-direction: column;
    gap: 12px;
  }
  .split-header .split-right {
    padding-top: 0;
  }
}

/* ─── GUIDE CARDS ─── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin: 24px 0;
  container-type: inline-size;
}

.guide-grid > * {
  grid-column: span 6;
}

@container (max-width: 500px) {
  .guide-grid > * { grid-column: span 12; }
}

.guide-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  text-decoration: none;
}

.guide-card .card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-label);
}

.guide-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.guide-card p {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.75;
}

.guide-card .card-arrow {
  color: var(--accent);
  font-size: 0.85rem;
  margin-top: auto;
  padding-top: 4px;
  font-weight: 600;
}

.guide-card--featured {
  border-color: var(--accent-dim);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(var(--accent-rgb), 0.08) 100%);
}

@media (max-width: 600px) {
  .guide-grid > * { grid-column: span 12; }
}

/* ─── CALLOUT ─── */
.callout {
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: 12px;
  padding: 2rem;
  margin: 20px 0;
  position: relative;
}
.callout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.callout-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.86rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 700;
}

.callout p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-dim);
}

/* ─── RULE GRID / RULE CARDS ─── */
.rule-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  margin: 24px 0;
  container-type: inline-size;
}

.rule-grid > * {
  grid-column: span 6;
}

@container (max-width: 500px) {
  .rule-grid > * { grid-column: span 12; }
}

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

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

.rule-card.do { border-left: 3px solid var(--green); }
.rule-card.dont { border-left: 3px solid var(--red); }

.rule-card .rule-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}

.rule-card.do .rule-tag { color: var(--green); }
.rule-card.dont .rule-tag { color: var(--red); }

.rule-card p {
  font-size: 1rem;
  margin-bottom: 0;
  line-height: 1.75;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .rule-grid > * { grid-column: span 12; }
}

/* ─── PRIORITY STACK ─── */
.priority-stack {
  margin: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.priority-item {
  display: flex;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}

.priority-item:first-child { border-radius: 8px 8px 0 0; }
.priority-item:last-child { border-radius: 0 0 8px 8px; }
.priority-item:hover { border-color: var(--border-accent); }

.priority-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 12px 0;
}

.priority-item:nth-child(2) .priority-rank { background: var(--yellow); }
.priority-item:nth-child(3) .priority-rank { background: var(--blue); }
.priority-item:nth-child(n+4) .priority-rank { background: var(--text-muted); }

.priority-content {
  padding: 14px 18px;
  flex: 1;
}

.priority-content strong {
  font-size: 1rem;
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

.priority-content span {
  font-size: 1rem;
  color: var(--text-dim);
}

/* ─── HERO CARDS ─── */
.hero-card {
  background: linear-gradient(135deg, var(--bg-elevated) 0%, rgba(var(--accent-rgb), 0.05) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 16px;
  padding: clamp(2rem, 4vw, 4rem);
  margin: 12px 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
  transition: border-color 0.2s;
}

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

.hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  color: var(--bg);
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
}

.hero-card h4 {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}

.hero-card .hero-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 1px;
  color: var(--text-label);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.hero-card p { font-size: 1rem; margin-bottom: 0; line-height: 1.75; color: var(--text-dim); }

/* ─── BADGES ─── */
h3 .badge, h4 .badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 700;
  vertical-align: middle;
}

.badge-s { background: var(--accent-glow); color: var(--accent); border: 1px solid var(--accent-dim); }
.badge-a { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
.badge-b { background: var(--purple-dim); color: var(--purple); border: 1px solid rgba(168,85,247,0.3); }

/* ─── COMPARE TABLE ─── */
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  font-size: 1rem;
}

.compare-table th {
  background: var(--bg-elevated);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table .highlight { color: var(--accent); font-weight: 600; }
.compare-table .col-label { color: var(--text); font-weight: 600; white-space: nowrap; }

/* ─── TOOL WRAPPER ─── */
.tool-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
}

/* ─── SPLIT SECTION IMAGE TREATMENT ─── */
.split-section img,
.split-section .visual {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.split-section img:hover,
.split-section .visual:hover {
  transform: scale(1.03);
}

/* ─── FOOTER ─── */
.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 32px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.site-footer > * {
  grid-column: 3 / span 8;
}

.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

/* ─── LIGHTBOX ─── */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
}

.lightbox-overlay.active { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
}

.lightbox-caption {
  margin-top: 16px;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.lightbox-close:hover {
  color: var(--text);
  background: rgba(255,255,255,0.08);
}

/* ─── HOVER STATES & MICRO-INTERACTIONS ─── */

/* Buttons: scale + glow */
button:not(.nav-toggle):not(.tool-tab):not(.reset-btn):not(.lightbox-close):hover {
  transform: scale(1.02);
}

/* Links: underline slide-in from left */
a:not(.guide-card):not(.nav-brand):not(.mega-panel a) {
  position: relative;
  text-decoration: none;
}
a:not(.guide-card):not(.nav-brand):not(.mega-panel a)::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
a:not(.guide-card):not(.nav-brand):not(.mega-panel a):hover::after {
  width: 100%;
}
a:not(.guide-card):not(.nav-brand):not(.mega-panel a):hover {
  text-decoration: none;
}

/* Accordion arrow: rotate on open */
.faq-item[open] summary .faq-icon {
  transform: rotate(180deg);
}

/* Nav items: bottom border fade-in — aligned to text, not to li */
.nav-links > li > a,
.nav-links > li > button {
  position: relative;
}
.nav-links > li > a.no-underline::after { display: none; }
.nav-links > li > a::after,
.nav-links > li > button::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10px;
  right: 10px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links > li > a:hover::after,
.nav-links > li > button:hover::after {
  transform: scaleX(1);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  section { padding: 48px 0; }
  .page-hero { padding: 48px 0 36px; }
  .page-hero h1 { font-size: 1.8rem; }
  .hero-card { grid-template-columns: 1fr; }
  .hero-icon { width: 40px; height: 40px; font-size: 15px; }
  .compare-table { font-size: 0.88rem; }
  .compare-table th, .compare-table td { padding: 8px 10px; }
}
