@import url("https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,600;6..72,700&display=swap");

:root {
  color-scheme: light;
  --bg: hsl(40 33% 97%);
  --surface: hsl(0 0% 100%);
  --surface-soft: hsl(0 0% 98%);
  --ink: hsl(45 8% 8%);
  --muted: hsl(0 0% 37%);
  --faint: hsl(0 0% 53%);
  --border: hsl(0 0% 88%);
  --border-soft: hsl(0 0% 92%);
  --code-bg: hsl(210 20% 97%);
  --code-ink: hsl(215 20% 17%);
  --link: hsl(217 86% 38%);
  --focus: hsl(45 8% 8%);
  --content: 994px;
  --measure: 72ch;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

img {
  display: block;
  max-width: 100%;
}

code,
pre,
button,
.label,
.card-label,
figcaption,
.site-footer,
.nav-links,
.brand {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  padding: 0.55rem 0.75rem;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.15rem 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 1rem;
  height: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  overflow-x: auto;
  color: var(--muted);
  font-size: 0.79rem;
  white-space: nowrap;
}

.nav-links a {
  color: inherit;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--ink);
}

main {
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
}

.intro {
  max-width: 760px;
  padding: 4rem 0 3.5rem;
}

.section {
  padding: 3.6rem 0;
  border-top: 1px solid var(--border);
}

.section.close {
  padding-bottom: 4.5rem;
}

.label,
.card-label {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  margin: 0 0 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.28rem 0.5rem;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2 {
  font-family: "Newsreader", Georgia, serif;
  text-wrap: balance;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 5.2vw, 3.55rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  font-weight: 620;
  line-height: 1.18;
  letter-spacing: -0.018em;
}

h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}

.feature-card h3 a {
  color: inherit;
}

p {
  max-width: var(--measure);
  margin: 0;
}

.lede {
  margin-top: 1.35rem;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.section-copy {
  display: grid;
  gap: 0.8rem;
  max-width: var(--measure);
  margin-bottom: 1.35rem;
}

.section-copy p,
.step p,
.callout p,
.feature-card li,
.site-footer {
  color: var(--muted);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.8rem;
}

.intro-note {
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.35rem;
  border-radius: 6px;
  padding: 0.58rem 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: var(--bg);
}

.button.secondary {
  border: 1px solid var(--border);
  color: var(--ink);
}

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

.feature-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 1.25rem;
}

.feature-card ul {
  margin: 0.8rem 0 0;
  padding-left: 1.05rem;
}

.feature-card li + li,
.step-list article + article {
  margin-top: 0.45rem;
}

.step-list {
  display: grid;
  gap: 1.4rem;
}

.step {
  display: grid;
  gap: 0.75rem;
}

.code-block {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.code-block.compact {
  max-width: 760px;
}

.code-block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.75rem;
}

.code-block button {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.74rem;
  padding: 0.18rem 0.44rem;
}

.code-block button:hover {
  background: var(--surface-soft);
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 0.86rem;
  line-height: 1.55;
  tab-size: 2;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 1rem;
}

:not(pre) > code {
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.92em;
  padding: 0.05rem 0.2rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.block-spacer {
  display: block;
  width: 100%;
  height: 3rem;
  min-height: 3rem;
  pointer-events: none;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.72rem 0.8rem;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-soft);
  font-size: 0.78rem;
  font-weight: 650;
}

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

td:first-child,
th:first-child {
  width: 28%;
}

.callout {
  max-width: 760px;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 1rem;
}

.diagram {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.diagram img {
  width: 100%;
  min-height: 260px;
  object-fit: contain;
}

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

.resource-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.resource-group h3 {
  margin: 0;
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-soft);
}

.resource-group a {
  display: block;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.resource-group a:last-child {
  border-bottom: 0;
}

.resource-group a:hover {
  background: var(--surface-soft);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem 1rem;
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

.site-footer span {
  margin-right: auto;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.85rem;
    overflow-x: visible;
    padding-bottom: 0.1rem;
    white-space: normal;
  }

  .intro {
    padding: 3.1rem 0 3rem;
  }

  .section {
    padding: 3rem 0;
  }

  .feature-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.15rem;
  }

  pre {
    font-size: 0.8rem;
  }

  pre code {
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
