:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #ecfdf5;
  --navy: #0f172a;
  --slate: #334155;
  --muted: #64748b;
  --light-bg: #f8fafc;
  --border: #e2e8f0;
  --card-bg: #ffffff;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --blue: #0284c7;
  --blue-light: #f0f9ff;
  --purple: #9333ea;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--light-bg);
  color: var(--navy);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header & Navigation */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-logo .accent {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--slate);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-badge {
  background: #f1f5f9;
  color: var(--slate);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 600;
}

/* Hero Section */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.hero-inner {
  max-width: 850px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  margin-bottom: 1rem;
  border: 1px solid #a7f3d0;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--navy);
}

.hero p {
  font-size: 1.15rem;
  color: var(--slate);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
}

/* Partner Sites Dual Gateway Grid */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.gateway-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 2.25rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.gateway-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.gateway-badge {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.gateway-card.food .gateway-badge {
  color: var(--primary);
}

.gateway-card.brands .gateway-badge {
  color: var(--blue);
}

.gateway-card h2 {
  font-size: 1.65rem;
  font-weight: 750;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.gateway-card p {
  color: var(--slate);
  margin-bottom: 1.5rem;
  font-size: 1rem;
  flex: 1;
}

.feature-list {
  list-style: none;
  margin-bottom: 1.5rem;
  padding: 0;
}

.feature-list li {
  font-size: 0.92rem;
  color: var(--slate);
  padding: 0.45rem 0;
  line-height: 1.5;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--navy);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-blue {
  background: var(--blue);
  color: #ffffff;
}

.btn-blue:hover {
  background: #0369a1;
}

/* Search bar */
.search-box {
  display: flex;
  background: #ffffff;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.4rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  max-width: 600px;
}

.search-box:focus-within {
  border-color: var(--primary);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0.6rem 1rem;
  font-size: 1rem;
}

/* Card Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 0.375rem;
  font-weight: 800;
  font-size: 0.95rem;
}

.score-high {
  background: #dcfce7;
  color: #15803d;
}

.score-med {
  background: #fef9c3;
  color: #a16207;
}

.score-low {
  background: #fee2e2;
  color: #b91c1c;
}

/* Dimension Score Bars */
.dim-bars {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.dim-name {
  color: var(--slate);
  font-weight: 500;
}

.dim-val {
  font-weight: 700;
}

.progress-track {
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 2px;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--primary);
}

/* Sourcing Ladder UI */
.ladder-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.ladder-tier {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: all 0.15s ease;
}

.ladder-tier:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

.ladder-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 60px;
  border-radius: 0.5rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 1.3rem;
  line-height: 1;
}

.ladder-badge span {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 700;
}

.ladder-content {
  flex: 1;
}

.ladder-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.ladder-content p {
  color: var(--slate);
  font-size: 0.9rem;
}

.ladder-pct {
  text-align: right;
  min-width: 100px;
}

.ladder-pct .pct-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.ladder-pct .pct-label {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Food Dollar Breakdown Visualization */
.split-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.split-bar {
  height: 28px;
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  margin: 1rem 0;
}

.split-segment {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  transition: opacity 0.15s;
}

.split-segment:hover {
  opacity: 0.9;
  filter: brightness(1.1);
}

/* Split Legend & Key */
.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin: 0.85rem 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--slate);
}

.legend-item strong {
  color: var(--navy);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}

.contrast-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #fef2f2 100%);
  border: 1px solid #fecaca;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contrast-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--navy);
}

.contrast-highlight-green {
  color: #16a34a;
  font-weight: 800;
}

.contrast-highlight-red {
  color: #dc2626;
  font-weight: 800;
}


/* Warnings and Flags */
.flag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.flag-rollup {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

.flag-coop {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid #a7f3d0;
}

.flag-snap {
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid #bae6fd;
}

/* Footer */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  color: var(--slate);
  text-decoration: none;
}

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

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .ladder-tier {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Top 2,000 Brands & Integrity Scorecards Styling
   ========================================================================== */
.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border-radius: 0.375rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}
.grade-A {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}
.grade-B {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}
.grade-C {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}
.grade-D {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fdba74;
}
.grade-F {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* 4-Part Revenue Flow Split Bar */
.brand-flow-container {
  margin: 0.75rem 0;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}
.brand-split-bar {
  display: flex;
  height: 18px;
  border-radius: 9999px;
  overflow: hidden;
  background: #e2e8f0;
  margin: 0.4rem 0 0.5rem 0;
}
.brand-split-seg {
  height: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.brand-split-seg:hover {
  opacity: 0.88;
}
.seg-workers { background: #16a34a; }
.seg-execs { background: #9333ea; }
.seg-shareholders { background: #dc2626; }
.seg-ads { background: #0284c7; }
.seg-cogs { background: #64748b; }

.flow-legend-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--slate);
}
.flow-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.flow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Labor and Waste Indicator Badges */
.badge-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}
.badge-labor-severe {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.badge-labor-mod {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}
.badge-labor-fair {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.badge-waste-severe {
  background: #fdf2f8;
  color: #9d174d;
  border: 1px solid #fbcfe8;
}
.badge-waste-circular {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Swap Highlight Callout */
.swap-callout-box {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #14532d;
}

/* Major Retailer Hub Cards */
.retailer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0;
}
.retailer-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
}
.retailer-card.failing {
  border-top: 5px solid var(--danger);
}
.retailer-card.passing {
  border-top: 5px solid var(--primary);
}

/* Infographic Contrast Banner */
.graphic-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.graphic-stat-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

/* Dual-Tier Swap Guide Classes */
.swap-philosophy-banner {
  background: linear-gradient(135deg, #f8fafc 0%, #f0fdf4 100%);
  border: 1px solid #bbf7d0;
  border-radius: 0.85rem;
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
}

.swap-dual-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.swap-card-better {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #0c4a6e;
}

.swap-card-best {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #16a34a;
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: #14532d;
}

.swap-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.swap-badge-better {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.03em;
}

.swap-badge-best {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.03em;
}

.swap-meta-pill {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.swap-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.swap-meta-footer a {
  text-decoration: none;
  font-weight: 700;
  color: inherit;
}

.category-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

