:root {
  --bg: #fbfaf7;
  --paper: #ffffff;
  --code: #f1f3f5;
  --text: #101418;
  --muted: #5f6b7a;
  --faint: #9aa4b2;
  --line: #e6e2da;
  --line-soft: #f0ede6;
  --accent: #0f5fd6;
  --accent-dark: #0c469b;
  --accent-soft: #e9f1ff;
  --green: #117a4b;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(15, 95, 214, 0.035), transparent 22rem),
    var(--bg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

::selection {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

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

code {
  padding: 0.1rem 0.35rem;
  color: var(--accent-dark);
  background: var(--code);
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-weight: 500;
}

pre {
  margin: 0;
}

.wrap {
  width: min(720px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 4rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
}

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.9rem;
}

nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.hero {
  padding: clamp(4.5rem, 14vw, 9rem) 0 3.5rem;
  text-align: center;
}

.kicker,
.label {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1,
.chapter h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.hero h1 {
  margin-top: 0.65rem;
  font-size: clamp(4rem, 13vw, 7rem);
  font-style: italic;
  line-height: 0.92;
}

.lede {
  max-width: 40rem;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  font-weight: 300;
  line-height: 1.75;
}

.lede strong,
p strong {
  color: var(--text);
  font-weight: 600;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.75rem 1.1rem;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  font-size: 0.94rem;
  font-weight: 700;
}

.button:hover,
.button:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

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

.button.primary:hover,
.button.primary:focus-visible {
  color: #ffffff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.75rem;
  text-align: center;
}

.facts div,
.bench-item {
  padding: 1.05rem 0.75rem;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line-soft);
  border-radius: 0.45rem;
}

.facts strong,
.bench-item strong {
  display: block;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
}

.facts span,
.bench-item span {
  display: block;
  margin-top: 0.35rem;
  color: var(--faint);
  font-size: 0.78rem;
}

hr {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line-soft);
}

.chapter {
  padding: 4.5rem 0;
}

.chapter h2 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  line-height: 1.05;
}

.rule {
  width: 3rem;
  height: 2px;
  margin: 1rem 0 1.6rem;
  background: var(--accent);
  border-radius: 99rem;
}

.chapter p {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.85;
}

.bench {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 2rem;
}

.steps {
  margin: 1.6rem 0 2rem;
}

.step {
  display: grid;
  grid-template-columns: 2.2rem minmax(8rem, 11rem) 1fr;
  gap: 0.9rem;
  align-items: baseline;
  padding: 0.7rem 0 0.7rem 1rem;
  border-left: 2px solid var(--accent);
}

.step + .step {
  margin-top: 0.35rem;
}

.step span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.step strong {
  color: var(--text);
  font-size: 0.94rem;
}

.step em {
  color: var(--muted);
  font-size: 0.94rem;
  font-style: normal;
}

.code-block {
  overflow-x: auto;
  padding: 1.15rem 1.25rem;
  color: #26323f;
  background: var(--code);
  border: 1px solid var(--line-soft);
  border-radius: 0.45rem;
  font-size: 0.87rem;
  line-height: 1.8;
  white-space: pre;
}

.matrix {
  display: grid;
  gap: 0.45rem;
  margin: 1.5rem 0 1.75rem;
}

.matrix div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid var(--line-soft);
  border-radius: 0.45rem;
}

.matrix strong {
  color: var(--text);
}

.matrix span {
  line-height: 1.65;
}

.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.links a {
  display: block;
  min-height: 7rem;
  padding: 1rem;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
}

.links a:hover,
.links a:focus-visible {
  color: var(--muted);
  border-color: var(--accent);
  text-decoration: none;
}

.links strong {
  display: block;
  color: var(--text);
}

.links span {
  display: block;
  margin-top: 0.5rem;
  line-height: 1.55;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.7rem;
  padding-top: 1.5rem;
  color: var(--faint);
  border-top: 1px solid var(--line-soft);
  font-size: 0.86rem;
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    justify-content: flex-start;
  }

  .hero {
    text-align: left;
  }

  .actions {
    justify-content: flex-start;
  }

  .facts,
  .bench,
  .links {
    grid-template-columns: 1fr;
  }

  .step,
  .matrix div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}
