@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;600;700&family=Source+Serif+4:wght@400;600;700&display=swap');

:root {
  --bg: #fbfaf7;
  --ink: #111111;
  --accent: #c43a2c;
  --muted: #5b5b5b;
  --card: #ffffff;
  --line: #111111;
  --line-soft: #d8d3cb;
  --shadow: rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
}

a {
  color: var(--ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: var(--accent);
}

.site-header {
  padding: 24px 6vw 20px;
  border-bottom: 1.5px solid var(--line);
  background: #ffffff;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: "Source Serif 4", "Times New Roman", serif;
}

.logo {
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.95rem;
}

.top-links a {
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.top-links a:hover {
  border-bottom-color: var(--accent);
}

.header-body {
  margin-top: 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.site-header h1 {
  font-family: "Source Serif 4", "Times New Roman", serif;
  margin: 8px 0 10px;
  font-size: clamp(2.1rem, 3.6vw, 3.4rem);
  line-height: 1.1;
}

.lead {
  max-width: 860px;
  font-size: 1.05rem;
  color: var(--muted);
}

.meta-row {
  margin-top: 12px;
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 28px;
  padding: 24px 6vw 48px;
}

.toc {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 16px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.toc h2 {
  font-family: "Source Serif 4", "Times New Roman", serif;
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.progress {
  height: 4px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 120ms linear;
}

.toc nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-left: 0;
}

.toc nav a {
  position: relative;
  padding-left: 18px;
}

.toc nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
}

.toc nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.toc nav a.active::before {
  border-color: var(--accent);
  background: var(--accent);
}

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

.toc nav a:hover::before {
  border-color: var(--accent);
  background: var(--accent);
}

main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

section {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

section p {
  max-width: 72ch;
}

.qa {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qa details {
  border-top: 1px solid var(--line-soft);
  padding-top: 10px;
}

.qa details:first-child {
  border-top: none;
  padding-top: 0;
}

.qa summary {
  cursor: pointer;
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  list-style: none;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::before {
  content: "+";
  display: inline-block;
  margin-right: 10px;
  font-weight: 600;
}

.qa details[open] summary::before {
  content: "–";
}

section h2 {
  font-family: "Source Serif 4", "Times New Roman", serif;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.65rem;
}

section h3 {
  font-family: "Source Serif 4", "Times New Roman", serif;
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-weight: 600;
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
}

.callout {
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: #fff3e6;
  border-radius: 12px;
  color: #3a2b25;
}

.footer {
  padding: 24px 6vw 48px;
  border-top: 1.5px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

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

  .toc {
    position: static;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-start;
  }
}
