:root {
  /* Core palette */
  --bg: #050811;
  --bg-soft: #070b15;
  --bg-alt: #0b101c;
  --fg: #f9fafb;
  --muted: #9ca3af;

  --border-soft: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.16);

  --accent: #facc15;
  --accent-soft: rgba(250, 204, 21, 0.16);
  --accent-strong: rgba(250, 204, 21, 0.32);

  --danger: #f97373;
  --success: #4ade80;

  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);

  /* Hero + Nav hardening */
  --nav-height: 64px;
  --nav-offset: 16px;
  --page-gutter: 20px;

  /* Make in-page anchors land clear of sticky header on all routes */
  scroll-padding-top: calc(var(--nav-height) + var(--nav-offset));
}

/* Global reset / base */

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #020617 0, #020617 34%, #020617 52%, #020617 100%);
  color: var(--fg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body,
main,
section {
  scroll-margin-top: calc(var(--nav-height) + 12px);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Skip link, for accessibility parity with static pages */

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 8px 14px;
  background: #111827;
  color: #f9fafb;
  border-radius: 999px;
  z-index: 999;
}

.skip-link:focus {
  left: 50%;
  transform: translateX(-50%);
}

/* Layout */

.container {
  width: min(1120px, 100% - (var(--page-gutter) * 2));
  margin: 0 auto;
}

main.container {
  padding-top: 18px;
}

/* Allow HTML-only pages and PDF shells to opt in explicitly */
.page-shell,
.pdf-shell {
  padding-top: 18px;
}

/* Card shell + surfaces */

.card {
  margin: 18px 0;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
  box-shadow: var(--shadow-soft);
}

/* Topbar / brand / nav */

/*
  Hero Authority Lock + Nav Offset Hardening

  - Sticky topbar shared across all routes (home, cohorts, PDF shells)
  - Horizontal-scrolling nav on mobile to avoid wrapping / vertical blow-ups
  - Scroll offset handled via scroll-padding + scroll-margin
*/

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.96);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(18px);
}

/* Static HTML uses `.topbar > .container` and inline flex styles.
   Next/React surfaces can use `.topbar-inner` as a normalized shell. */

.topbar .container,
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

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

.brand h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.03em;
}

.brand p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.logo {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #facc15, #4f46e5);
  box-shadow: 0 0 0 1px rgba(250, 250, 250, 0.08);
}

/* Brand pill + mode labels (nonprofit / services) */

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--border-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.brand-pill-label {
  opacity: 0.9;
}

.brand-pill-mode {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.18);
  border: 1px solid rgba(34, 197, 94, 0.32);
  font-size: 10px;
}

/* Primary nav */

.nav {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.nav a {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}

.nav a:hover {
  border-color: rgba(148, 163, 184, 0.5);
  color: #e5e7eb;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.85));
}

.nav a.nav-strong,
.nav-strong {
  border-color: var(--accent-soft);
  background: rgba(250, 204, 21, 0.08);
  color: #fef9c3;
}

.nav a.nav-strong:hover,
.nav-strong:hover {
  border-color: var(--accent-strong);
  background: rgba(250, 204, 21, 0.16);
}

.nav a.nav-trust,
.nav-trust {
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(15, 23, 42, 0.98);
  color: #e0f2fe;
}

.nav a.nav-trust:hover,
.nav-trust:hover {
  border-color: rgba(56, 189, 248, 0.6);
}

/* Hero */

.hero {
  margin: 18px 0 16px;
  padding: 22px 22px 20px;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.94));
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);

  /* Hero Authority Lock: keep hero visually under, not over, the sticky header */
  position: relative;
  z-index: 1;
}

.hero-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.hero-copy {
  flex: 2;
}

.hero-copy p.muted {
  max-width: 720px;
}

.hero h1,
.hero h2 {
  margin: 0 0 10px;
}

.hero h1 {
  font-size: 30px;
}

.hero h2 {
  font-size: 24px;
}

.hero-sidecard {
  flex: 1.1;
}

.hero-sidecard .card {
  margin: 0;
}

.hero .actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Training hero variant used on internal / non-home pages */

.training-hero {
  margin-top: 16px;
}

.training-hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

/* Approver hero specifics */

.approver-hero .hero-sidecard .kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

/* PDF / document shells (board slide, executive brief, procurement PDFs, etc.) */

.pdf-frame,
.pdf-embed {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: #020617;
  min-height: min(80vh, 960px);
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.pdf-toolbar .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 13px;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--accent-soft);
  background: linear-gradient(135deg, #fde047, #facc15);
  color: #111827;
}

.btn.primary:hover {
  border-color: var(--accent-strong);
  background: linear-gradient(135deg, #facc15, #eab308);
}

.btn.ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.4);
}

/* Pills / labels */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  font-size: 11px;
}

.pill-muted {
  background: rgba(15, 23, 42, 0.94);
  color: var(--muted);
}

.pill-strong {
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.5);
  color: #fef9c3;
}

/* Typography helpers */

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.hero-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.95;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Anchor offset hardening:
   Any element with an id (sections, cards, PDF shells) will respect the sticky nav height. */

[id] {
  scroll-margin-top: calc(var(--nav-height) + 12px);
}

/* Mobile responsiveness */

@media (max-width: 768px) {
  .topbar .container,
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand-pill-label {
    font-size: 13px;
  }

  .nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
  }

  .nav::-webkit-scrollbar {
    height: 4px;
  }

  .nav a {
    white-space: nowrap;
    font-size: 13px;
    padding: 8px 10px;
  }

  .hero {
    padding-top: 24px;
    padding-bottom: 20px;
  }

  .hero h1 {
    font-size: 22px;
  }

  .hero-layout {
    flex-direction: column;
  }

  .hero-sidecard {
    width: 100%;
  }

  .hero .actions,
  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero .btn,
  .cta-row .btn {
    width: 100%;
    justify-content: center;
  }

  .pdf-frame,
  .pdf-embed {
    min-height: 70vh;
  }
}

/* Production polish: widen decision surface on large screens */

@media (min-width: 1280px) {
  .container {
    max-width: 1240px;
  }
}
