:root {
  --color-bg: #ffffff;
  --color-surface: #fbfbf7;
  --color-panel: #f3f6f2;
  --color-text: #191b1f;
  --color-muted: #5b626b;
  --color-border: #d7dbd1;
  --color-accent: #285c7a;
  --color-accent-hover: #193f59;
  --color-teal: #2f7a62;
  --color-amber: #98612e;
  --color-red: #9d3d37;
  --color-green: #2e7451;
  --shadow-soft: 0 10px 30px rgba(29, 42, 50, 0.08);
  --max-content-width: 76ch;
  --max-wide-width: 1180px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover,
a:focus {
  color: var(--color-accent-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(40, 92, 122, 0.45);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: 0.5rem;
  top: 0.5rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--color-bg);
  border: 2px solid var(--color-accent);
  z-index: 1000;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: var(--max-wide-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__toggle {
  display: none;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  padding: 0.4rem 0.6rem;
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
}

.site-nav__list a {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  font-size: 0.94rem;
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

main {
  max-width: var(--max-wide-width);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

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

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--color-amber);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.45rem, 3.3vw, 2.2rem); }
h3 { font-size: 1.1rem; }

.hero {
  padding: 2rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.hero--home {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: 2rem;
}

.hero h1,
.page-hero h1 {
  margin: 0 0 1rem;
}

.hero p,
.page-hero p {
  font-size: 1.12rem;
  color: var(--color-muted);
  margin: 0 0 1.5rem;
  max-width: 68ch;
}

.page-hero {
  padding: 2.4rem 0 1.8rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.page-hero--compact h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.58rem 1rem;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  background: var(--color-bg);
  cursor: pointer;
}

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

.btn--quiet {
  border-color: var(--color-border);
}

.btn:hover,
.btn:focus {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #ffffff;
}

.hero-panel,
.info-panel {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.hero-panel {
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.metric {
  padding: 1rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.metric__value {
  display: block;
  font-weight: 800;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--color-accent);
}

.metric__label {
  display: block;
  color: var(--color-muted);
  font-size: 0.94rem;
  margin-top: 0.25rem;
}

.section-band,
.split-section {
  margin: 2.4rem 0;
  padding: 2rem 0;
  border-bottom: 1px solid var(--color-border);
}

.section-heading {
  max-width: var(--max-content-width);
  margin-bottom: 1.2rem;
}

.section-heading h2,
.section-heading p {
  margin-top: 0;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  gap: 2rem;
  align-items: center;
}

.card-grid {
  display: grid;
  gap: 1rem;
}

.card-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.path-card,
.content-card,
.walk-card {
  display: block;
  padding: 1.1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

a.path-card {
  text-decoration: none;
  color: var(--color-text);
}

.path-card:hover {
  border-color: var(--color-accent);
}

.path-card strong,
.path-card span {
  display: block;
}

.path-card__kicker {
  color: var(--color-amber);
  font-size: 0.78rem;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.55rem;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-list article {
  border-left: 4px solid var(--color-teal);
  padding-left: 1rem;
}

.posture-figure {
  margin: 0;
}

.posture-figure svg {
  display: block;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.svg-label {
  fill: #596066;
  font-size: 14px;
  font-weight: 650;
}

.svg-title {
  fill: var(--color-text);
  font-size: 18px;
  font-weight: 750;
}

.svg-copy {
  fill: var(--color-muted);
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-pass {
  color: #0d4f32;
  background: #e6f4ed;
  border-color: #b7ddc8;
}

.status-fail {
  color: #782019;
  background: #f9e7e4;
  border-color: #ebb9b2;
}

.status-na {
  color: #594824;
  background: #f4eddc;
  border-color: #e1d0a7;
}

.data-note,
.callout {
  border-left: 4px solid var(--color-amber);
  background: var(--color-surface);
  padding: 1rem;
  margin: 1rem 0;
}

.controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
}

.control label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

.control select,
.control input,
.contract-form input[type="text"] {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font: inherit;
  background: #ffffff;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.65rem 0.75rem;
  vertical-align: top;
  text-align: left;
}

th {
  background: var(--color-panel);
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--color-muted);
}

tr:last-child td { border-bottom: 0; }

.score-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.score-detail {
  max-width: 52rem;
}

.bar-chart {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.35fr) minmax(180px, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.bar-track {
  min-height: 1rem;
  background: #edf0ea;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  min-height: 1rem;
  background: var(--color-teal);
}

.report-layout {
  max-width: 1320px;
}

.report-shell {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 2rem;
}

.report-toc {
  position: sticky;
  top: 5rem;
  align-self: start;
  max-height: calc(100vh - 6rem);
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--color-surface);
}

.report-toc h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.report-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.report-toc li {
  margin: 0.2rem 0;
}

.report-toc a {
  text-decoration: none;
  font-size: 0.86rem;
}

.report-toc__level-3 { padding-left: 0.8rem; }
.report-toc__level-4 { padding-left: 1.6rem; }

.report-body {
  max-width: 88ch;
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-body h1:first-child {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.report-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  font-size: 0.88rem;
}

.report-body blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 4px solid var(--color-border);
  color: var(--color-muted);
}

.bibliography li {
  margin-bottom: 0.8rem;
}

.ref-marker {
  font-size: 0.75em;
}

.artifact-list {
  display: grid;
  gap: 0.75rem;
}

.artifact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
}

.artifact-item code,
.code-pill {
  overflow-wrap: anywhere;
}

.contract-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 1.4rem;
  align-items: start;
}

.contract-form {
  display: grid;
  gap: 1rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.check-option {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
}

.contract-output {
  width: 100%;
  min-height: 34rem;
  resize: vertical;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  font: 0.88rem/1.5 var(--font-mono);
}

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

.site-footer__inner {
  max-width: var(--max-wide-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.site-footer p {
  margin: 0.3rem 0;
}

.site-footer a { color: var(--color-muted); }

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

pre {
  background: var(--color-surface);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .hero--home,
  .split-section,
  .report-shell,
  .contract-layout {
    grid-template-columns: 1fr;
  }

  .hero--home {
    min-height: auto;
  }

  .card-grid--three,
  .card-grid--two,
  .feature-list,
  .controls {
    grid-template-columns: 1fr;
  }

  .report-toc {
    position: static;
    max-height: 20rem;
  }
}

@media (max-width: 720px) {
  main {
    padding: 1.25rem 0.85rem 2.2rem;
  }

  .site-nav__toggle { display: inline-block; }

  .site-nav__list {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
  }

  .site-nav__list[data-open="true"] { display: flex; }
  .site-nav__list li { width: 100%; }

  .site-nav__list a {
    display: block;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
  }

  .site-header__inner { flex-wrap: wrap; }
  .hero { padding-top: 1rem; }
  .hero h1 { font-size: 2.25rem; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .artifact-item { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
}
