:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1b1b1f;
  --muted: #5d5d66;
  --border: #e6e3dc;
  --accent: #3b3bd1;
  --accent-soft: #ececfb;
  --code-bg: #f2f0ea;
  --max: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --surface: #1c1c21;
    --text: #ececef;
    --muted: #a0a0ab;
    --border: #2d2d34;
    --accent: #8f8ff5;
    --accent-soft: #24243d;
    --code-bg: #24242a;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

img { max-width: 100%; }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  border-radius: 4px;
}
code { padding: 0.1em 0.35em; }
pre { padding: 1rem; overflow-x: auto; line-height: 1.45; }
pre code { padding: 0; background: none; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.logo span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero { padding: 4.5rem 0 3.5rem; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 40rem; margin: 0 0 2rem; }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  margin-left: 0.5rem;
}

/* Sections */
section { padding: 3rem 0; }
section + section { border-top: 1px solid var(--border); }
h2 { font-size: 1.7rem; letter-spacing: -0.015em; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }
.lead { color: var(--muted); max-width: 42rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.75rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.35rem;
}
.card p { margin: 0; color: var(--muted); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.75rem 0 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.5rem 3rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.steps p { margin: 0; color: var(--muted); }

/* Articles */
.prose { max-width: 42rem; padding: 3rem 0; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5rem; }
.prose h2 { margin-top: 2.25rem; font-size: 1.4rem; }
.meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 2rem; }

.post-list { list-style: none; padding: 0; margin: 2rem 0 0; }
.post-list li { padding: 1.25rem 0; border-top: 1px solid var(--border); }
.post-list a { font-size: 1.2rem; font-weight: 600; text-decoration: none; }
.post-list p { margin: 0.3rem 0 0; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.cdn-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

@media (max-width: 40rem) {
  .button.secondary { margin: 0.75rem 0 0; }
}
