:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --ink: #151515;
  --muted: #6a6e73;
  --muted-strong: #4d4d4d;
  --line: #e0e0e0;
  --line-strong: #c7c7c7;
  --brand: #ee0000;
  --brand-deep: #a30000;
  --link: #0066cc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Red Hat Text", system-ui, sans-serif;
}

a {
  color: var(--link);
}

.page-shell {
  width: min(1136px, calc(100% - 4rem));
  margin: 0 auto;
  padding: 0 0 3rem;
}

.masthead {
  display: flex;
  align-items: center;
  min-height: 4.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.96rem;
  font-weight: 600;
}

.hero {
  margin: 0;
  padding: 4rem 0 2rem;
  border-top: 4px solid var(--brand);
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.hero h1,
.essay h2 {
  margin: 0;
  font-family: "Red Hat Display", "Red Hat Text", system-ui, sans-serif;
  font-weight: 600;
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.6rem, 6vw, 4.75rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.96rem;
}

.hero-meta span {
  position: relative;
}

.hero-meta span + span::before {
  content: "";
  position: absolute;
  left: -0.65rem;
  top: 50%;
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 999px;
  background: var(--muted-strong);
  transform: translateY(-50%);
}

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}

.lede {
  max-width: 789px;
  margin: 1.25rem 0 0;
  color: var(--ink);
  font-size: 1.14rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--muted-strong);
  border-radius: 0;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.essay {
  background: var(--surface);
  border: 1px solid var(--line);
}

.essay section {
  padding: 2rem 2rem 2.25rem;
}

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

.essay h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
}

.essay p,
.essay li {
  font-size: 1rem;
  line-height: 1.5;
}

.essay p {
  max-width: 789px;
  margin: 1rem 0 0;
}

.essay ul {
  max-width: 789px;
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.essay li + li {
  margin-top: 0.3rem;
}

.checklist {
  list-style: square;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  max-width: 789px;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  border-radius: 0;
}

pre.mermaid {
  overflow-x: auto;
  max-width: 789px;
  margin: 1.35rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.sources {
  word-break: break-word;
}

code {
  padding: 0.08rem 0.28rem;
  background: #f5f5f5;
  font-family: "Red Hat Mono", monospace;
  font-size: 0.95em;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100%, calc(100% - 2rem));
  }

  .hero {
    padding: 3rem 0 1.5rem;
  }

  .essay section {
    padding: 1.25rem;
  }
}
