/* Henecorp.ai — Course Catalog page styles
   Brand source of truth in brand/SKILL.md
*/

:root {
  --brand-teal: #0F6E56;
  --brand-teal-dark: #0a513f;
  --brand-teal-tint: #e6f1ee;
  --brand-navy: #0A2540;
  --brand-navy-soft: #1a3a5a;
  --brand-mint: #5DCAA5;
  --brand-mint-soft: #d2efe2;
  --brand-white: #FFFFFF;

  --ink: #0A2540;
  --slate: #475569;
  --slate-light: #64748b;
  --mist: #E2E8F0;
  --mist-strong: #cbd5e1;
  --cloud: #F1F5F9;
  --paper: #FAFBFC;

  --warning: #B45309;
  --warning-tint: #fef3c7;

  --shadow-xs: 0 1px 2px rgba(10, 37, 64, 0.04);
  --shadow-sm: 0 2px 6px rgba(10, 37, 64, 0.06);
  --shadow-md: 0 6px 18px rgba(10, 37, 64, 0.08);
  --shadow-lg: 0 16px 40px rgba(10, 37, 64, 0.10);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* ---------- Top nav ---------- */

.site-nav {
  background: var(--brand-white);
  border-bottom: 1px solid var(--mist);
  position: sticky; top: 0; z-index: 50;
}
.site-nav .container {
  display: flex; align-items: center;
  gap: 36px;
  height: 72px;
}
.site-nav .logo { display: flex; align-items: center; }
.site-nav .logo img { height: 32px; width: auto; display: block; }
.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 26px;
  font-size: 14px; font-weight: 500;
}
.site-nav ul a {
  color: var(--slate);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}
.site-nav ul a:hover { color: var(--ink); text-decoration: none; }
.site-nav ul a[aria-current] {
  color: var(--ink);
  border-bottom-color: var(--brand-teal);
}
.site-nav .nav-cta { margin-left: auto; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-teal); color: var(--brand-white);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 600;
  transition: background .15s ease;
  border: 1px solid var(--brand-teal);
}
.btn-primary:hover { background: var(--brand-teal-dark); text-decoration: none; }
.btn-primary svg { transition: transform .15s ease; }
.btn-primary:hover svg { transform: translateX(2px); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  color: var(--brand-teal);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--brand-teal);
}
.btn-ghost:hover { background: var(--brand-teal-tint); text-decoration: none; }

.btn-text {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--brand-teal);
  font-size: 13px; font-weight: 600;
  padding: 4px 0;
}
.btn-text:hover { text-decoration: underline; }

/* ---------- Hero ---------- */

.hero {
  background: var(--brand-white);
  border-bottom: 1px solid var(--mist);
  padding: 64px 0 56px;
}
.eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--brand-teal);
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(36px, 4.6vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 0 0 20px;
  max-width: 880px;
}
.hero h1 em {
  color: var(--brand-teal);
  font-style: normal;
}
.hero .lead {
  font-size: 18px;
  line-height: 1.55;
  color: var(--slate);
  max-width: 720px;
  margin: 0 0 36px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 8px;
  padding-top: 32px;
  border-top: 1px solid var(--mist);
}
.stat .big {
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.stat .lbl {
  font-size: 13px;
  color: var(--slate);
  margin-top: 6px;
  line-height: 1.4;
}

/* ---------- About + G4E ---------- */

.about-g4e {
  padding: 56px 0;
  background: var(--paper);
}
.about-g4e .grid {
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: 56px;
  align-items: start;
}
.section-eyebrow {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--slate);
  margin-bottom: 12px;
}
.about-g4e h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.about-g4e p {
  font-size: 15px;
  color: var(--slate);
  margin: 0 0 14px;
  line-height: 1.6;
}
.about-g4e em { color: var(--ink); font-style: normal; font-weight: 500; }
.about-g4e strong { color: var(--ink); font-weight: 600; }

.g4e-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 18px 0;
  list-style: none;
  padding: 0;
}
.g4e-step {
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius-md);
  background: var(--brand-white);
  border: 1px solid var(--mist);
}
.g4e-step.active {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: var(--brand-white);
}
.g4e-step.active .g4e-name { color: var(--brand-mint); }
.g4e-step.active .g4e-sub { color: var(--mist); }
.g4e-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.g4e-sub {
  font-size: 11px;
  color: var(--slate-light);
  margin-top: 4px;
  line-height: 1.35;
}

/* ---------- Track selector ---------- */

.tracks-section {
  padding: 56px 0 28px;
  background: var(--brand-white);
  border-top: 1px solid var(--mist);
}
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  margin-bottom: 28px;
  gap: 24px;
}
.section-head .text { max-width: 720px; }
.section-head h2 {
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.section-head .desc {
  font-size: 15px;
  color: var(--slate);
  margin: 0;
  line-height: 1.55;
}

.track-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.track-tab {
  text-align: left;
  padding: 20px 20px;
  border-radius: var(--radius-lg);
  background: var(--brand-white);
  border: 1.5px solid var(--mist);
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease, background .15s ease;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.track-tab:hover {
  border-color: var(--mist-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.track-tab.active {
  border-color: var(--brand-teal);
  background: var(--brand-teal-tint);
  box-shadow: var(--shadow-md);
}
.track-tab.active .track-tab-level { color: var(--brand-teal); }
.track-tab-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.track-tab-level {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--slate);
}
.track-tab-count {
  font-size: 12px;
  color: var(--slate);
}
.track-tab-name {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 6px 0 4px;
  letter-spacing: -0.01em;
}
.track-tab-sub {
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.45;
}

/* ---------- Catalog grid (filter rail + listing) ---------- */

.catalog-grid {
  padding: 24px 0 56px;
  background: var(--brand-white);
}
.catalog-grid .grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  align-items: start;
}

/* Filter rail */
.filter-rail {
  position: sticky;
  top: 92px;
  padding: 22px 22px 18px;
  background: var(--paper);
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
}
.filter-rail h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}
.filter-rail .rail-sub {
  font-size: 13px;
  color: var(--slate);
  margin: 0 0 14px;
}
.filter-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s;
}
.filter-row:hover { background: var(--cloud); }
.filter-row input { display: none; }
.filter-row .check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--mist-strong);
  border-radius: 4px;
  background: var(--brand-white);
  flex-shrink: 0;
  position: relative;
  transition: background .12s, border-color .12s;
}
.filter-row input:checked + .check {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
}
.filter-row input:checked + .check::after {
  content: ''; position: absolute;
  left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid var(--brand-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.filter-row .code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate);
  min-width: 28px;
}
.filter-row .name {
  font-size: 13.5px;
  color: var(--ink);
  flex: 1;
}
.filter-row.checked .name { font-weight: 600; }
.filter-row .count {
  font-size: 11.5px;
  color: var(--slate-light);
  font-variant-numeric: tabular-nums;
}

.rail-divider {
  height: 1px;
  background: var(--mist);
  margin: 16px -22px;
}
.rail-status {
  font-size: 13px;
  color: var(--slate);
  line-height: 1.5;
  margin-bottom: 12px;
}
.rail-status strong { color: var(--ink); font-weight: 600; }
.filter-rail .btn-ghost { width: 100%; justify-content: center; }
.filter-rail .btn-ghost[disabled] { opacity: 0.4; cursor: default; }

/* Listing */
.track-summary {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--mist);
  margin-bottom: 28px;
}
.track-summary .row {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 8px;
}
.track-summary h2 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.track-summary .level-badge {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-teal);
  background: var(--brand-teal-tint);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.track-summary p {
  font-size: 15px;
  color: var(--slate);
  margin: 0;
  line-height: 1.55;
  max-width: 760px;
}

.pillar-section { margin-bottom: 40px; }
.pillar-section:last-child { margin-bottom: 0; }
.pillar-head { margin-bottom: 14px; }
.pillar-head h3 {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px;
}
.pillar-head h3 .pillar-prefix {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-teal);
  background: var(--brand-teal-tint);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  align-self: center;
}
.pillar-head h3 .pillar-name {
  letter-spacing: -0.01em;
}
.pillar-head h3 .count-inline {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  letter-spacing: 0;
  margin-left: auto;
}
.pillar-head p {
  font-size: 14.5px;
  color: var(--slate);
  margin: 0;
  line-height: 1.55;
  max-width: 760px;
}

.topics {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--mist);
  border-radius: var(--radius-lg);
  background: var(--brand-white);
  overflow: hidden;
}
.topic {
  border-top: 1px solid var(--mist);
}
.topic:first-child { border-top: none; }
.topic-toggle {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background .12s ease;
}
.topic-toggle:hover { background: var(--cloud); }
.topic.expanded .topic-toggle { background: var(--cloud); }
.topic-id {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-light);
  letter-spacing: 0.02em;
}
.topic-content { min-width: 0; }
.topic-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.005em;
}
.topic-summary {
  font-size: 14px;
  color: var(--slate);
  line-height: 1.5;
}
.topic-meta {
  display: flex; align-items: center;
  gap: 14px;
}
.topic-chips {
  display: flex; gap: 5px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 240px;
}
.chip {
  display: inline-flex; align-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.chip-lvl {
  background: var(--brand-teal-tint);
  color: var(--brand-teal-dark);
}
.chip-aud {
  background: var(--cloud);
  color: var(--slate);
}
.chip-aud-all {
  background: var(--brand-navy);
  color: var(--brand-white);
}
.topic-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: var(--slate);
  transition: transform .15s ease, background .12s, color .12s;
  border: 1px solid var(--mist);
}
.topic.expanded .topic-arrow {
  background: var(--brand-teal);
  color: var(--brand-white);
  border-color: var(--brand-teal);
  transform: rotate(180deg);
}

.topic-expanded {
  padding: 0 22px 22px;
  background: var(--cloud);
  border-top: 1px solid var(--mist);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
}
.topic-expanded .full-desc {
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.65;
  margin: 18px 0 0;
  max-width: 720px;
}
.topic-expanded .standards-cited {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--mist-strong);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.topic-expanded .standards-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  margin-right: 4px;
}
.standard-chip {
  font-size: 12px;
  background: var(--brand-white);
  color: var(--brand-navy);
  border: 1px solid var(--mist-strong);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}
.no-results {
  padding: 32px;
  text-align: center;
  color: var(--slate);
  background: var(--paper);
  border: 1px dashed var(--mist-strong);
  border-radius: var(--radius-lg);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--brand-navy);
  color: var(--brand-white);
  padding: 64px 0;
  position: relative;
  overflow: hidden;
}
.cta-band .grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.cta-band h2 {
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0 0 16px;
  color: var(--brand-white);
}
.cta-band h2 em {
  font-style: normal;
  color: var(--brand-mint);
}
.cta-band p {
  font-size: 16px;
  color: var(--mist);
  line-height: 1.6;
  margin: 0;
  max-width: 540px;
}
.cta-band .cta-aside {
  text-align: right;
}
.cta-band .cta-aside .btn-primary {
  background: var(--brand-mint);
  color: var(--brand-navy);
  border-color: var(--brand-mint);
  font-size: 15px;
  padding: 14px 22px;
}
.cta-band .cta-aside .btn-primary:hover {
  background: #4ab791;
  border-color: #4ab791;
}
.cta-band .cta-aside .note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--mist);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--brand-navy);
  color: var(--mist);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 40px 0 32px;
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}
.site-footer .brand img { height: 28px; display: block; margin-bottom: 14px; }
.site-footer .brand p {
  font-size: 13.5px;
  color: var(--mist);
  margin: 0;
  max-width: 360px;
  line-height: 1.55;
}
.site-footer .contact {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px 28px;
  font-size: 13.5px;
}
.site-footer .contact dt {
  color: var(--brand-mint);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-top: 2px;
}
.site-footer .contact dd { margin: 0; color: var(--mist); }
.site-footer .contact dd a { color: var(--mist); }
.site-footer .contact dd a:hover { color: var(--brand-white); text-decoration: underline; }
.site-footer .meta {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
  color: var(--slate-light);
  display: flex; justify-content: space-between;
}

/* ---------- Section theming (Tweaks) ---------- */

section[data-theme="white"] { background: var(--brand-white); }
section[data-theme="paper"] { background: var(--neutral-paper); }
section[data-theme="cloud"] { background: var(--neutral-cloud); }
section[data-theme="navy"]  { background: var(--brand-navy);   color: var(--brand-white); }
section[data-theme="teal"]  { background: var(--brand-teal);   color: var(--brand-white); }

/* Dark-theme overrides — flip foreground colors */
section[data-theme="navy"] .eyebrow,
section[data-theme="navy"] .section-eyebrow,
section[data-theme="teal"] .eyebrow,
section[data-theme="teal"] .section-eyebrow { color: var(--brand-mint); }

section[data-theme="navy"] h1,
section[data-theme="navy"] h2,
section[data-theme="navy"] h3,
section[data-theme="teal"] h1,
section[data-theme="teal"] h2,
section[data-theme="teal"] h3 { color: var(--brand-white); }

section[data-theme="navy"] h1 em,
section[data-theme="teal"] h1 em,
section[data-theme="navy"] h2 em,
section[data-theme="teal"] h2 em { color: var(--brand-mint); }

section[data-theme="navy"] .lead,
section[data-theme="navy"] p,
section[data-theme="teal"] .lead,
section[data-theme="teal"] p { color: rgba(255, 255, 255, 0.85); }

section[data-theme="navy"] strong,
section[data-theme="teal"] strong { color: var(--brand-white); }
section[data-theme="navy"] em,
section[data-theme="teal"] em { color: var(--brand-mint); }

section[data-theme="navy"] .stats,
section[data-theme="teal"] .stats { border-top-color: rgba(255, 255, 255, 0.14); }
section[data-theme="navy"] .stat .big,
section[data-theme="teal"] .stat .big { color: var(--brand-white); }
section[data-theme="navy"] .stat .lbl,
section[data-theme="teal"] .stat .lbl { color: rgba(255, 255, 255, 0.7); }

/* G4E strip cards keep their light look on a dark section background */
section[data-theme="navy"] .g4e-step:not(.active),
section[data-theme="teal"] .g4e-step:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
section[data-theme="navy"] .g4e-step:not(.active) .g4e-name,
section[data-theme="teal"] .g4e-step:not(.active) .g4e-name { color: var(--brand-white); }
section[data-theme="navy"] .g4e-step:not(.active) .g4e-sub,
section[data-theme="teal"] .g4e-step:not(.active) .g4e-sub { color: rgba(255, 255, 255, 0.6); }

/* Track tabs on dark background */
section[data-theme="navy"] .track-tab,
section[data-theme="teal"] .track-tab {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.16);
}
section[data-theme="navy"] .track-tab:hover,
section[data-theme="teal"] .track-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.32);
}
section[data-theme="navy"] .track-tab.active,
section[data-theme="teal"] .track-tab.active {
  background: var(--brand-mint);
  border-color: var(--brand-mint);
  color: var(--brand-navy);
}
section[data-theme="navy"] .track-tab.active .track-tab-level,
section[data-theme="teal"] .track-tab.active .track-tab-level,
section[data-theme="navy"] .track-tab.active .track-tab-name,
section[data-theme="teal"] .track-tab.active .track-tab-name,
section[data-theme="navy"] .track-tab.active .track-tab-sub,
section[data-theme="teal"] .track-tab.active .track-tab-count,
section[data-theme="teal"] .track-tab.active .track-tab-sub,
section[data-theme="navy"] .track-tab.active .track-tab-count { color: var(--brand-navy); }
section[data-theme="navy"] .track-tab .track-tab-level,
section[data-theme="navy"] .track-tab .track-tab-count,
section[data-theme="navy"] .track-tab .track-tab-sub,
section[data-theme="teal"] .track-tab .track-tab-level,
section[data-theme="teal"] .track-tab .track-tab-count,
section[data-theme="teal"] .track-tab .track-tab-sub { color: rgba(255, 255, 255, 0.7); }
section[data-theme="navy"] .track-tab .track-tab-name,
section[data-theme="teal"] .track-tab .track-tab-name { color: var(--brand-white); }

/* Catalog grid on dark — keep filter rail and topic cards light surfaces */
section[data-theme="navy"] .filter-rail,
section[data-theme="teal"] .filter-rail {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
}
section[data-theme="navy"] .filter-rail h3,
section[data-theme="teal"] .filter-rail h3 { color: var(--brand-mint); }
section[data-theme="navy"] .filter-rail .rail-sub,
section[data-theme="teal"] .filter-rail .rail-sub,
section[data-theme="navy"] .filter-rail .rail-status,
section[data-theme="teal"] .filter-rail .rail-status,
section[data-theme="navy"] .filter-row .name,
section[data-theme="teal"] .filter-row .name { color: rgba(255, 255, 255, 0.85); }
section[data-theme="navy"] .filter-row .code,
section[data-theme="teal"] .filter-row .code { color: rgba(255, 255, 255, 0.55); }
section[data-theme="navy"] .filter-row:hover,
section[data-theme="teal"] .filter-row:hover { background: rgba(255, 255, 255, 0.06); }
section[data-theme="navy"] .filter-row .check,
section[data-theme="teal"] .filter-row .check {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}
section[data-theme="navy"] .rail-divider,
section[data-theme="teal"] .rail-divider { background: rgba(255, 255, 255, 0.12); }
section[data-theme="navy"] .btn-ghost,
section[data-theme="teal"] .btn-ghost {
  color: var(--brand-mint);
  border-color: var(--brand-mint);
}
section[data-theme="navy"] .btn-ghost:hover,
section[data-theme="teal"] .btn-ghost:hover { background: rgba(93, 202, 165, 0.12); }

section[data-theme="navy"] .track-summary,
section[data-theme="teal"] .track-summary { border-bottom-color: rgba(255, 255, 255, 0.14); }
section[data-theme="navy"] .track-summary h2,
section[data-theme="teal"] .track-summary h2 { color: var(--brand-white); }
section[data-theme="navy"] .track-summary .level-badge,
section[data-theme="teal"] .track-summary .level-badge {
  background: rgba(93, 202, 165, 0.18);
  color: var(--brand-mint);
}
section[data-theme="navy"] .pillar-head h3,
section[data-theme="teal"] .pillar-head h3 { color: var(--brand-white); }
section[data-theme="navy"] .pillar-head h3 .pillar-prefix,
section[data-theme="teal"] .pillar-head h3 .pillar-prefix {
  background: rgba(93, 202, 165, 0.18);
  color: var(--brand-mint);
}
section[data-theme="navy"] .pillar-head h3 .count-inline,
section[data-theme="teal"] .pillar-head h3 .count-inline,
section[data-theme="navy"] .pillar-head p,
section[data-theme="teal"] .pillar-head p { color: rgba(255, 255, 255, 0.7); }

/* Topic cards stay on a light card surface for legibility */
section[data-theme="navy"] .topics,
section[data-theme="teal"] .topics {
  background: var(--brand-white);
  border-color: rgba(255, 255, 255, 0.14);
}

/* Section dividers (the line between sections) */
section[data-theme="white"] { border-bottom: 1px solid var(--mist); }
section[data-theme="paper"] + section[data-theme="paper"],
section[data-theme="cloud"] + section[data-theme="cloud"] { border-top: 1px solid var(--mist); }
section[data-theme="navy"], section[data-theme="teal"] { border: 0; }

/* /Section theming */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-g4e .grid, .catalog-grid .grid, .cta-band .grid, .site-footer .grid {
    grid-template-columns: 1fr; gap: 32px;
  }
  .g4e-strip { grid-template-columns: repeat(5, 1fr); }
  .track-tabs { grid-template-columns: 1fr; }
  .filter-rail { position: static; }
  .topic-toggle { grid-template-columns: 48px 1fr; padding: 16px; }
  .topic-meta { grid-column: 2; padding-top: 8px; justify-content: flex-start; }
  .topic-chips { justify-content: flex-start; }
  .topic-arrow { position: absolute; top: 16px; right: 16px; }
  .topic { position: relative; }
  .topic-expanded { grid-template-columns: 1fr; padding: 0 16px 18px; }
  .cta-band .cta-aside { text-align: left; }
  .site-nav ul { display: none; }
}
