/* Landing page shared by every MaverickCER package (generated by internal-package-contract)
   Plain CSS, no build step. Custom properties as design tokens,
   a small set of classes as the "component" layer. */

:root {
  --color-navy: #0b1220;
  --color-accent-blue: #2563eb;
  --color-accent-blue-dark: #1d4ed8;
  --color-teal: #0f766e;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-error: #dc2626;
  --color-background: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #111827;
  /* #475569 on #f8fafc/#ffffff computes to ~7.2-7.6:1 -- comfortably past
     the 4.5:1 AA minimum with headroom for future palette drift, replacing
     a prior value that sat at ~4.55:1, right at the AA cliff edge, across
     a large share of this page's body copy. */
  --color-text-muted: #475569;
  --color-border: #e2e8f0;
  /* Inline <code> background -- kept separate from --color-border (used for
     dividers/outlines) because --color-text-muted on the dark-mode border
     tone alone only reached ~4.04:1, under the 4.5:1 AA minimum, for code
     spans inside muted body copy (section ledes, FAQ answers, adoption
     card descriptions). Light mode's border tone already clears AA against
     both text colors (~6.1-14.4:1), so only the dark value below differs. */
  --color-code-bg: var(--color-border);
  /* Headings/emphasis text -- distinct from --color-navy, which also styles
     fixed-dark panels (header/hero/footer/code blocks) that stay navy-
     background-with-white-text in both themes. Headings need to flip to a
     light color in dark mode instead of staying navy-on-dark-navy. */
  --color-heading: var(--color-navy);
  /* Accent blue used AS TEXT (links, eyebrows, callout titles) -- distinct
     from --color-accent-blue/-dark, which are also used as button/dot
     BACKGROUNDS with white text and must not lighten (a lighter button
     background would break the white-text-on-button contrast that already
     works in both themes). Text usage needs a lighter blue on a dark
     background; background usage doesn't. */
  --color-link: var(--color-accent-blue);
  --color-link-strong: var(--color-accent-blue-dark);

  --font-sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;

  --content-width: 76rem;
  --content-width-narrow: 56rem;
  --radius: 6px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --border-width: 1px;
}

/* Dark mode -- follows the OS/browser preference by default, overridden by
   an explicit choice from the theme toggle (persisted via localStorage,
   applied as [data-theme] on the root element). The hero/header/footer/
   code-block navy panels already read correctly in both modes since they're
   deliberately not tied to --color-background/--color-surface; only the
   light page background and body text/border tokens need a dark variant. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-background: #0f172a;
    --color-surface: #1e293b;
    --color-text: #f1f5f9;
    /* #94a3b8 on #0f172a/#1e293b computes to ~7.6-8.7:1. */
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    /* #94a3b8 on #1e2b3c computes to ~5.6:1; #f1f5f9 on the same to
       ~13.1:1 -- both text colors clear AA with real headroom, unlike
       reusing --color-border (#334155) directly, which only reached
       ~4.04:1 for the muted-text case. */
    --color-code-bg: #1e2b3c;
    --color-heading: #f1f5f9;
    /* Tailwind blue-400 -- ~5.8-7:1 against the dark surface/background
       tokens above, versus ~2.7:1 for the light-mode accent blues. */
    --color-link: #60a5fa;
    --color-link-strong: #60a5fa;
  }
}

:root[data-theme="dark"] {
  --color-background: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-border: #334155;
  --color-code-bg: #1e2b3c;
  --color-heading: #f1f5f9;
  --color-link: #60a5fa;
  --color-link-strong: #60a5fa;
}

/* Reset */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 var(--space-2);
  color: var(--color-heading);
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 1.3rem + 1vw, 2rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 var(--space-2);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: var(--color-link);
}

a:not([class]) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Accessibility utilities */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-2);
  z-index: 100;
  background: var(--color-navy);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: var(--space-2);
}

:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Layout */

.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.container--narrow {
  max-width: var(--content-width-narrow);
}

section[id] {
  scroll-margin-top: 5rem;
}

.section {
  padding-block: var(--space-6);
  border-bottom: var(--border-width) solid var(--color-border);
}

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

.section--muted {
  background: var(--color-surface);
}

.section-eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--color-link);
  font-weight: 700;
  margin: 0 0 var(--space-1);
}

.section-lede {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 46rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-navy);
  color: #fff;
  border-bottom: var(--border-width) solid rgba(255, 255, 255, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-1);
  min-height: 3.5rem;
}

.site-logo {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.primary-nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.primary-nav-list a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 0.4rem 0.15rem;
  border-bottom: 2px solid transparent;
}

.primary-nav-list a:hover,
.primary-nav-list a:focus-visible {
  color: #fff;
  border-bottom-color: var(--color-accent-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.github-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}

.github-link:hover,
.github-link:focus-visible {
  color: #fff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: var(--border-width) solid transparent;
  cursor: pointer;
}

.button--primary {
  background: var(--color-accent-blue);
  color: #fff;
}

.button--primary:hover,
.button--primary:focus-visible {
  background: var(--color-accent-blue-dark);
}

.button--secondary {
  background: transparent;
  color: inherit;
  border-color: currentColor;
}

.button--on-dark.button--secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.button--on-dark.button--secondary:hover,
.button--on-dark.button--secondary:focus-visible {
  border-color: #fff;
}

.button--header {
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

/* Hero */

.hero {
  background: var(--color-navy);
  color: #fff;
  padding-block: var(--space-6);
}

.hero h1 {
  color: #fff;
  margin-bottom: var(--space-2);
}

/* The generic .section-eyebrow color (--color-link) is tuned for the light
   page background; on the hero's fixed navy panel the light-mode value
   (#2563eb) is only ~3.6:1, below WCAG2AA. Pin an explicit light blue that
   clears AA on --color-navy in both themes (~7:1), the same way .hero h1 /
   .hero-lede / .hero-support all set their own on-navy colors rather than
   inheriting a theme token. */
.hero .section-eyebrow {
  color: #60a5fa;
}

.hero-lede {
  font-size: 1.2rem;
  max-width: 46rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero-support {
  color: rgba(255, 255, 255, 0.7);
  max-width: 44rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Callout */

.callout {
  border: var(--border-width) solid var(--color-border);
  border-left-width: 4px;
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-3) 0;
  background: var(--color-surface);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 700;
  margin-bottom: 0.35em;
  color: var(--color-heading);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-steps {
  padding-left: 1.4em;
  margin: 0;
}

.callout-steps li {
  margin-bottom: 0.3em;
}

.callout-steps li:last-child {
  margin-bottom: 0;
}

.callout--note {
  border-left-color: var(--color-accent-blue);
}

.callout--note .callout-title {
  color: var(--color-link-strong);
}

/* Diagram */

.diagram {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin: var(--space-4) 0;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.diagram-tree,
.diagram-tree ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.diagram-tree > li {
  font-weight: 700;
  color: var(--color-heading);
}

.diagram-branch-label {
  display: block;
  font-weight: 700;
  color: var(--color-link-strong);
  margin-bottom: 0.4em;
}

.diagram-tree ol {
  margin-top: 0.4em;
  padding-left: var(--space-2) !important;
  border-left: 2px solid var(--color-border);
}

.diagram-tree ol li {
  font-weight: 400;
  color: var(--color-text);
  padding: 0.2em 0;
}

/* Comparison table */

.table-scroll {
  overflow-x: auto;
  margin: var(--space-4) 0;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
}

.comparison-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 42rem;
  background: var(--color-surface);
}

.comparison-table caption {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  font-weight: 700;
  color: var(--color-heading);
  border-bottom: var(--border-width) solid var(--color-border);
  caption-side: top;
}

.comparison-table th,
.comparison-table td {
  text-align: left;
  padding: 0.85rem var(--space-2);
  border-bottom: var(--border-width) solid var(--color-border);
  vertical-align: top;
  font-size: 0.95rem;
}

.comparison-table thead th {
  background: var(--color-background);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

.comparison-table th[scope="row"] {
  font-weight: 600;
  color: var(--color-heading);
  white-space: nowrap;
}

.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: none;
}

/* Adoption cards */

.adoption-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.adoption-card {
  display: block;
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  color: inherit;
}

.adoption-card:hover,
.adoption-card:focus-visible {
  border-color: var(--color-accent-blue);
}

.adoption-card-title {
  display: block;
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 0.25em;
}

.adoption-card-desc {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.5em;
}

.external-link-note {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.8rem;
  color: var(--color-link);
  font-weight: 600;
}

/* Code block */

.code-block {
  background: var(--color-navy);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem var(--space-2);
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-block-filename {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}

.copy-button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: #fff;
  color: #fff;
}

.code-block pre {
  margin: 0;
  padding: var(--space-2) var(--space-3);
  overflow-x: auto;
}

.code-block code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.55;
}

/* `.site-footer .container > p a` below matches this site's own footer-meta paragraph link (the
   MIT License link, unclassed) -- it fails WCAG AA contrast against the footer's navy background
   without this. `.site-header .header-actions a:not(.github-link):not(.button)` covers the
   equivalent case in the header, should a future header link ever go in unclassed; every current
   header-actions link (.github-link, .button) already carries its own color rule elsewhere.
   (This selector pair used to also cover the old TypeDoc-less generated API pages, which reused
   this same .site-header/.site-footer markup with unclassed nav links -- removed along with that
   generator; TypeDoc's own docs/api/ pages carry their own independent theme, not this site's.)
   Match the treatment the main site's own nav links already get on the same background. */
.site-header .header-actions a:not(.github-link):not(.button),
.site-footer .container > p a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-header .header-actions a:not(.github-link):not(.button):hover,
.site-header .header-actions a:not(.github-link):not(.button):focus-visible,
.site-footer .container > p a:hover,
.site-footer .container > p a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

/* Footer */

.site-footer {
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.75);
  padding-block: var(--space-4);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer-nav a,
.footer-meta a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus-visible,
.footer-meta a:hover,
.footer-meta a:focus-visible {
  color: #fff;
}

.footer-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* Responsive */

@media (max-width: 860px) {
  .primary-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-navy);
    border-bottom: var(--border-width) solid rgba(255, 255, 255, 0.08);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-2) var(--space-3) var(--space-3);
    display: none;
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav-list {
    flex-direction: column;
    gap: 0;
  }

  .primary-nav-list a {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .diagram-branches {
    flex-direction: column;
  }
}

/* Print */

@media print {
  .site-header,
  .nav-toggle,
  .hero-actions,
  .copy-button,
  .skip-link,
  .search-overlay {
    display: none !important;
  }

  body,
  .hero,
  .site-footer,
  .code-block {
    background: #fff !important;
    color: #000 !important;
  }

  .hero h1,
  .hero-lede,
  .hero-support,
  .benefit-list li,
  .site-footer,
  .site-footer a,
  .code-block code {
    color: #000 !important;
  }

  .benefit-list li::before {
    background: #000 !important;
  }

  a[href^="http"]::after,
  a[href^="https"]::after {
    content: " (" attr(href) ")";
    font-size: smaller;
    color: #444;
  }

  .card,
  .callout,
  .adoption-card,
  .comparison-table tr,
  .faq-item {
    break-inside: avoid;
  }

  .section {
    padding-block: var(--space-3);
  }
}

/* ---- Additions for the decision-maker layout ------------------------------------------------------ */

/* The one-sentence organizational outcome: the line a CTO should be able to quote. */
.hero-outcome {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 46rem;
  margin: var(--space-4) 0 var(--space-2);
  color: inherit;
}

.hero-meta {
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0 0 var(--space-4);
}

/* Inline code on the hero's fixed navy panel: the page-wide code background is a light grey tuned for
   the page, which under the hero's white text measured 1.23:1 in light mode. */
.hero code {
  background: rgb(255 255 255 / 0.14);
  color: #fff;
}

.hero-note {
  font-size: 0.9rem;
  opacity: 0.9;
  max-width: 46rem;
  margin: var(--space-2) 0 var(--space-4);
}

.hero-link {
  align-self: center;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.source-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.maturity {
  border-left: 4px solid var(--color-warning);
  padding: var(--space-2) var(--space-3);
  margin: var(--space-4) 0;
  background: var(--color-surface);
}

.fit-links {
  margin-top: var(--space-4);
  color: var(--color-text-muted);
}

/* A guarantee is a card that is not a link: the claim, then the scope that bounds it. */
.guarantee {
  cursor: default;
}

.code-block pre:focus-visible {
  outline: 2px solid var(--color-accent-blue);
  outline-offset: 2px;
}

/* ---- The one-page brief --------------------------------------------------------------------------- */

.brief-page {
  background: var(--color-surface);
}

.brief {
  max-width: 44rem;
  margin: 0 auto;
  padding: var(--space-6) var(--space-4);
  line-height: 1.55;
}

.brief h1 {
  margin-bottom: var(--space-2);
}

.brief-oneline {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 var(--space-4);
}

.brief-block {
  margin: var(--space-4) 0;
  break-inside: avoid;
}

.brief-block h2 {
  font-size: 1.05rem;
  margin: 0 0 var(--space-1);
}

.brief-block p,
.brief-block ul {
  margin: 0;
}

.brief-block ul {
  padding-left: 1.2rem;
}

.brief-next,
.brief-print,
.brief-back {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

@media print {
  .skip-link,
  .site-header,
  .site-footer,
  .brief-back,
  .brief-print {
    display: none;
  }

  .brief-page,
  .brief {
    background: #ffffff;
    color: #000000;
  }

  .brief {
    padding: 0;
    max-width: none;
  }

  .brief a {
    color: #000000;
    text-decoration: underline;
  }

  .brief-next a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
}

/* ---- Theme toggle in the header ------------------------------------------------------------------- */

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  border-radius: var(--radius);
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}

.icon-button:hover,
.icon-button:focus-visible {
  border-color: #fff;
  color: #fff;
}

.theme-toggle-icon {
  font-size: 1.05rem;
}

@media (forced-colors: active) {
  .icon-button,
  .copy-button {
    border-color: ButtonText;
  }

  .code-block pre:focus-visible {
    outline-color: Highlight;
  }
}
