:root {
  --bg: #f5f1e8;
  --panel: #fffdf7;
  --panel-strong: #f0eadc;
  --ink: #1d2433;
  --muted: #586174;
  --line: #d8ccb4;
  --accent: #0f766e;
  --accent-soft: #d2efe9;
  --warn: #b45309;
  --warn-soft: #fff1db;
  --ok: #166534;
  --ok-soft: #e3f4e6;
  --info: #1d4ed8;
  --info-soft: #dde9ff;
  --shadow: 0 14px 40px rgba(44, 37, 21, 0.08);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.09), transparent 28rem),
    radial-gradient(circle at top right, rgba(180, 83, 9, 0.09), transparent 32rem),
    var(--bg);
  font:
    16px/1.65 "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    "Times New Roman", serif;
}

a {
  color: inherit;
}

code {
  font-family:
    "SFMono-Regular", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo,
    Consolas, monospace;
  font-size: 0.92em;
  background: rgba(29, 36, 51, 0.06);
  padding: 0.1rem 0.32rem;
  border-radius: 0.3rem;
}

.hero {
  padding: 4.5rem 1.5rem 2rem;
}

.hero-inner,
.page {
  width: min(var(--max), calc(100vw - 2rem));
  margin: 0 auto;
}

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

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5.2rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.7rem, 2.8vw, 2.35rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.05rem;
  margin-bottom: 0.55rem;
}

.lede {
  max-width: 58rem;
  font-size: 1.12rem;
  color: var(--muted);
  margin: 1rem 0 1.25rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.meta span {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(216, 204, 180, 0.85);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
}

.status-grid,
.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-card,
.summary-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
}

.status-card {
  padding: 1.1rem 1.15rem 1.2rem;
}

.status-card h2 {
  font-size: 0.98rem;
  margin-bottom: 0.45rem;
}

.status-card p,
.summary-grid p,
.panel p,
.panel li {
  color: var(--muted);
}

.status-card.ok {
  background: linear-gradient(180deg, var(--ok-soft), var(--panel));
}

.status-card.warn {
  background: linear-gradient(180deg, var(--warn-soft), var(--panel));
}

.status-card.info {
  background: linear-gradient(180deg, var(--info-soft), var(--panel));
}

.page {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0 0 3rem;
}

.toc {
  position: sticky;
  top: 1rem;
  align-self: start;
  background: rgba(255, 253, 247, 0.82);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.toc h2 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.toc nav {
  display: grid;
  gap: 0.45rem;
}

.toc a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.3rem 0;
}

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

.content {
  display: grid;
  gap: 1.25rem;
}

.panel {
  padding: 1.35rem 1.4rem 1.5rem;
}

.summary-grid {
  margin-top: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-grid article {
  padding: 1rem 1.05rem 1.1rem;
}

.step-list,
.checklist,
.improvement-list {
  margin: 0;
  padding-left: 1.25rem;
}

.step-list li,
.checklist li,
.improvement-list li {
  margin: 0 0 0.9rem;
}

.improvement-list li {
  padding-left: 0.2rem;
}

.diagram {
  margin: 1rem 0;
  overflow-x: auto;
  background: #18212f;
  color: #e7f0ff;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  font:
    0.88rem/1.55 "SFMono-Regular", ui-monospace, "Cascadia Code",
    "Source Code Pro", Menlo, Consolas, monospace;
}

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

thead th {
  text-align: left;
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

tbody td {
  vertical-align: top;
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid rgba(216, 204, 180, 0.7);
  color: var(--muted);
}

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

@media (max-width: 980px) {
  .page {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

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

@media (max-width: 640px) {
  .hero {
    padding-top: 3rem;
  }

  .hero-inner,
  .page {
    width: min(var(--max), calc(100vw - 1rem));
  }

  .status-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 1.1rem 1rem 1.2rem;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody td {
    padding: 0.45rem 0;
    border-bottom: 0;
  }

  tbody tr {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(216, 204, 180, 0.7);
  }

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