:root {
  color-scheme: light;
  --ink: #18202a;
  --muted-ink: #566272;
  --paper: #f8f6ef;
  --panel: #ffffff;
  --panel-soft: #eef4f1;
  --line: #d6d8d2;
  --accent: #0f766e;
  --accent-strong: #155e75;
  --warn: #b45309;
  --code-bg: #17202a;
  --code-ink: #eef6f5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

code {
  border-radius: 4px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f4f4a;
  padding: 0.08rem 0.22rem;
  font-size: 0.92em;
}

pre {
  margin: 0;
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem;
  line-height: 1.45;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: 0.65rem;
  color: var(--muted-ink);
  font-size: 0.92rem;
}

.hero {
  min-height: 74vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(rgba(17, 33, 35, 0.68), rgba(17, 33, 35, 0.52)),
    url("diagnostic_1_3_7_2_5_1_full_sequence.png");
  background-position: center;
  background-size: cover;
  color: #fff;
}

.topbar {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem clamp(1rem, 3vw, 2rem);
}

.topbar a {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  background: rgba(12, 23, 24, 0.38);
  text-decoration: none;
  font-size: 0.9rem;
}

.topbar a:hover {
  background: rgba(255, 255, 255, 0.18);
}

.hero-inner {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 6rem 0 5rem;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: #a7f3d0;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lede {
  max-width: 780px;
  margin: 1.35rem 0 0;
  color: #eefbf8;
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
}

.band {
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.band.muted {
  background: var(--panel-soft);
}

.content {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

h2 {
  margin: 0 0 1rem;
  color: #12303a;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.65rem;
  color: #17313a;
  font-size: 1.05rem;
  letter-spacing: 0;
}

p {
  margin: 0 0 1rem;
  color: var(--muted-ink);
}

table {
  width: 100%;
  margin-top: 1.4rem;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-variant-numeric: tabular-nums;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.72rem 0.8rem;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

thead th {
  background: #e7efec;
  color: #263b42;
  font-size: 0.86rem;
}

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

tbody tr.selected td {
  background: #dcfce7;
  color: #123b2a;
  font-weight: 700;
}

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

.split-cards article,
.matrix-grid article,
.formula,
.callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 1.15rem;
}

.formula {
  margin-top: 1rem;
}

.callout {
  border-color: rgba(180, 83, 9, 0.25);
  background: #fff7ed;
}

.callout h3 {
  color: var(--warn);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  min-height: 11rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 1rem;
  color: var(--muted-ink);
}

.steps li::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.bottom-line {
  max-width: 850px;
  margin: 1rem 0 0;
  color: #12303a;
  font-weight: 650;
}

@media (max-width: 840px) {
  .topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .hero {
    min-height: 70vh;
  }

  .two-col,
  .split-cards,
  .matrix-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: 0.55rem;
    font-size: 0.86rem;
  }
}
