/* Stage Gate Acceptance — calm blue theme with teal status accents, self-contained */

/* ---------- Design tokens ---------- */
:root {
  --bg: #eef4f9;
  --surface: #ffffff;
  --surface-2: #f7fbfe;
  --ink: #152a3d;
  --ink-soft: #3f5d76;
  --accent: #1e6091;
  --accent-deep: #14456b;
  --teal: #0f766e;
  --teal-deep: #115e59;
  --teal-bg: #d7f0ec;
  --teal-line: #b9ded7;
  --chip-bg: #e3eef7;
  --line: #c9dcea;
  --shadow: 0 12px 32px rgba(20, 69, 107, 0.12);
  --shadow-sm: 0 4px 14px rgba(20, 69, 107, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: 3.75rem;
}

/* ---------- Reset & base ---------- */
* {
  box-sizing: border-box;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 500px at 85% -10%, #dcebf6 0%, rgba(220, 235, 246, 0) 60%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

main {
  flex: 1;
}

::selection {
  background: #bcd8ec;
  color: var(--ink);
}

/* ---------- Utilities ---------- */
.wrap {
  width: min(100% - 2.5rem, 70rem);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent-deep);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus-visible {
  left: 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--chip-bg);
  color: var(--accent-deep);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

/* ---------- Header & responsive navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(238, 244, 249, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  flex-wrap: wrap;
  padding-block: 0.5rem;
}

.wordmark {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--accent);
}

.site-nav {
  position: relative;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--chip-bg);
}

.nav-toggle-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.nav-list a:hover {
  background: var(--chip-bg);
  color: var(--accent-deep);
}

/* Status badge (teal status accent) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--teal-bg);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 0.82rem;
  border: 1px solid var(--teal-line);
  white-space: nowrap;
}

.status-badge svg {
  width: 0.85rem;
  height: 0.85rem;
  flex: none;
}

.status-badge--lg {
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
}

.status-badge--lg svg {
  width: 1rem;
  height: 1rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 5.5rem) clamp(2.5rem, 7vw, 4.5rem);
  background:
    radial-gradient(900px 420px at 80% -20%, #cfe4f3 0%, rgba(207, 228, 243, 0) 60%),
    linear-gradient(180deg, #e4eef7 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent) 45%, var(--teal));
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.5rem, 5vw + 1rem, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lede {
  margin: 0 0 1.5rem;
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.25rem);
  color: var(--ink-soft);
  max-width: 42rem;
}

.published-statement {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--teal-line);
  border-radius: var(--radius-sm);
  background: var(--teal-bg);
  color: var(--teal-deep);
  font-weight: 600;
}

.published-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

/* Hero stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
}

.stat dt {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.stat dd {
  margin: 0.2rem 0 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(2.5rem, 6vw, 4rem);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.section + .section {
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 2.5vw + 1rem, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-lede {
  margin: 0 0 1.75rem;
  color: var(--ink-soft);
  max-width: 46rem;
}

/* ---------- Stage cards ---------- */
.stage-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  counter-reset: stage;
}

.stage-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.stage-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.stage-number {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--chip-bg);
  color: var(--accent-deep);
  font-weight: 800;
  font-size: 0.95rem;
}

.stage-icon {
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  color: var(--accent);
}

.stage-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--ink);
}

.stage-card > p {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex: 1;
}

.stage-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.stage-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  max-width: 46rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 2px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  padding: 0 0 1.5rem 2.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--teal-bg);
  border: 2px solid var(--teal);
}

.timeline-item:last-child::before {
  background: var(--teal);
}

.timeline-item time {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.timeline-item p {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
}

.timeline-item p strong {
  color: var(--ink);
}

/* ---------- Security summary ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.security-table {
  width: 100%;
  min-width: 30rem;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.security-table th,
.security-table td {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.security-table thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.security-table tbody th {
  font-weight: 600;
  color: var(--ink);
}

.security-table td {
  color: var(--ink-soft);
}

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

.security-note {
  margin: 1.25rem 0 0;
  color: var(--ink-soft);
  max-width: 46rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding-block: 1.5rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.credit {
  font-style: italic;
}

/* ---------- Motion: reveal on scroll (JS-gated, motion-safe only) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition:
      opacity 0.5s ease,
      transform 0.5s ease;
  }

  .js .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Accessibility: reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Accessibility: increased contrast ---------- */
@media (prefers-contrast: more) {
  :root {
    --line: #7d99b0;
    --ink-soft: #2c455c;
  }

  .stage-card,
  .stat,
  .table-wrap,
  .status-badge {
    border-width: 2px;
  }
}

/* ---------- Accessibility: forced colors (Windows High Contrast) ---------- */
@media (forced-colors: active) {
  .status-badge,
  .stage-number,
  .stat {
    border: 1px solid CanvasText;
  }

  .timeline-item::before {
    border: 2px solid CanvasText;
  }
}

/* ---------- Responsive navigation: mobile disclosure ---------- */
@media (max-width: 47.99em) {
  .header-row {
    justify-content: space-between;
  }

  .site-nav {
    margin-left: 0;
    order: 3;
    flex-basis: 100%;
  }

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

  .js .nav-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 60;
    min-width: 14rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .js .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    padding: 0.6rem 0.8rem;
  }

  .status-badge--lg {
    margin-left: auto;
  }
}

@media (max-width: 24rem) {
  .header-row {
    gap: 0.5rem;
  }

  .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Print styles ---------- */
@media print {
  :root {
    --shadow: none;
    --shadow-sm: none;
  }

  body {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  .skip-link,
  .site-nav,
  .nav-toggle {
    display: none !important;
  }

  .site-header {
    position: static;
    background: #ffffff;
    border-bottom: 1pt solid #666666;
  }

  .hero {
    background: #ffffff;
    border-bottom: 1pt solid #666666;
    padding-block: 12pt 10pt;
  }

  .hero::before {
    display: none;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
    color: #000000;
  }

  .lede,
  .section-lede,
  .security-note,
  .stage-card > p,
  .timeline-item p,
  .security-table td {
    color: #222222;
  }

  .section {
    padding-block: 12pt;
  }

  .section + .section {
    border-top: 1pt solid #999999;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 6pt;
    margin-top: 10pt;
  }

  .stat,
  .stage-card,
  .table-wrap {
    background: #ffffff;
    border: 1pt solid #999999;
    box-shadow: none;
  }

  .stat dd {
    color: #000000;
  }

  .stage-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8pt;
  }

  .stage-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .status-badge,
  .published-statement {
    background: #ffffff;
    border: 1pt solid #333333;
    color: #000000;
  }

  .timeline {
    max-width: none;
  }

  .timeline::before {
    background: #999999;
  }

  .timeline-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .timeline-item::before {
    background: #ffffff;
    border-color: #333333;
  }

  .timeline-item time {
    color: #000000;
  }

  .timeline-item p strong {
    color: #000000;
  }

  .table-wrap {
    overflow: visible;
  }

  .security-table {
    min-width: 0;
  }

  .security-table th,
  .security-table td {
    border-color: #999999;
  }

  .security-table thead th {
    background: #eeeeee;
    color: #000000;
  }

  .security-table tbody th {
    color: #000000;
  }

  .site-footer {
    background: #ffffff;
    border-top: 1pt solid #666666;
  }

  .site-footer p {
    color: #333333;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}
