:root {
  --primary: #2f5b9a;
  --primary-dark: #1f3553;
  --accent: #d78a1e;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #ffffff;
  --soft: #f8fafc;
  --border: #e2e8f0;

  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  --container: 80rem;
  --reading: 46rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
}

a {
  color: var(--primary);
  text-underline-offset: .2em;
}

a:hover {
  color: var(--primary-dark);
}

a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3 {
  color: var(--primary-dark);
  line-height: 1.15;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
  letter-spacing: -.035em;
}

h2 {
  margin: 3rem 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h3 {
  margin: 0 0 .75rem;
  font-size: 1.25rem;
}

p,
ul,
ol,
pre,
table {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.site-container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

.reading-container {
  width: min(calc(100% - 2rem), var(--reading));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header__inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand span {
  color: var(--primary);
}

.site-brand::after {
  content: "";
  width: 3px;
  height: 1.3rem;
  margin-left: .25rem;
  background: var(--accent);
}

.site-nav,
.site-footer__nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-nav a,
.site-footer__nav a {
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.site-footer__nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
}

.hero {
  padding: clamp(4rem, 9vw, 8rem) 0;
}

.hero__content {
  max-width: 68rem;
}

.hero__lead,
.page-lead {
  max-width: 48rem;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.technical-label {
  margin-bottom: 1rem;
  color: var(--primary);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  padding: .7rem 1rem;
  border-radius: .45rem;
  background: var(--primary);
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-dark);
  color: white;
}

.section {
  padding: 4rem 0;
}

.section--soft {
  background: var(--soft);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-heading h2 {
  margin: 0;
}

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

.category-card,
.contact-card,
.empty-state {
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: .7rem;
  background: var(--bg);
}

.category-card span {
  display: block;
  margin-bottom: 1.5rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .8rem;
}

.category-card p,
.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.page-intro,
.article-header {
  padding: clamp(3rem, 7vw, 6rem) 0;
  border-bottom: 1px solid var(--border);
  background: var(--soft);
}

.prose {
  padding-block: 4rem;
}

.prose p,
.prose li {
  font-size: 1.05rem;
}

pre {
  overflow-x: auto;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: .6rem;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.55;
}

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

:not(pre) > code {
  padding: .12em .3em;
  border: 1px solid var(--border);
  border-radius: .3rem;
  background: var(--soft);
}

.callout {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border-left: 4px solid var(--primary);
  background: var(--soft);
}

.callout--warning {
  border-left-color: var(--accent);
}

.callout p {
  margin: .4rem 0 0;
}

.article-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .85rem;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--primary-dark);
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--soft);
}

.site-footer__inner {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 52rem) {
  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
    padding-block: 1rem;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: .3rem;
  }
}

@media (max-width: 38rem) {
  .site-container,
  .reading-container {
    width: min(calc(100% - 1.5rem), 100%);
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer__inner {
    padding-block: 2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
