:root {
  --canvas: #f7f7f4;
  --canvas-soft: #fafaf7;
  --surface-card: #ffffff;
  --surface-strong: #e6e5e0;
  --hairline: #e6e5e0;
  --hairline-soft: #efeee8;
  --hairline-strong: #cfcdc4;
  --ink: #26251e;
  --body: #5a5852;
  --muted: #807d72;
  --muted-soft: #a09c92;
  --primary: #f54e00;
  --primary-active: #d04200;
  --on-primary: #ffffff;
  --tl-thinking: #dfa88f;
  --tl-grep: #9fc9a2;
  --tl-read: #9fbbe0;
  --tl-edit: #c0a8dd;
  --tl-done: #c08532;
  --success: #1f8a65;
  --error: #cf2d56;
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;
  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-base: 16px;
  --sp-md: 20px;
  --sp-lg: 24px;
  --sp-xl: 32px;
  --sp-xxl: 48px;
  --sp-section: 80px;
  --maxw: 1200px;
  --sans: "Inter", system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.15px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 400;
  margin: 0 0 var(--sp-base);
}

h1 { font-size: 72px; line-height: 1.1; letter-spacing: -2.16px; }
h2 { font-size: 36px; line-height: 1.2; letter-spacing: -0.72px; }
h3 { font-size: 26px; line-height: 1.25; letter-spacing: -0.325px; }
h4 { font-size: 22px; line-height: 1.3; letter-spacing: -0.11px; }

p { margin: 0 0 var(--sp-base); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--canvas);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.section { padding: var(--sp-section) 0; }
.section-tight { padding: var(--sp-xxl) 0; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.88px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 var(--sp-sm);
}

.lead {
  font-size: 18px;
  line-height: 1.6;
  color: var(--body);
  max-width: 70ch;
}

/* Top nav */
.top-nav {
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 64px;
  padding: 0 var(--sp-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wordmark {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
}
.wordmark span { color: var(--primary); }
.wordmark:hover { text-decoration: none; }
.nav-menu { display: flex; align-items: center; gap: var(--sp-lg); }
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.nav-link:hover { color: var(--primary); text-decoration: none; }
.nav-cta {
  background: var(--primary);
  color: var(--on-primary);
  padding: 8px 16px;
  border-radius: var(--r-md);
}
.nav-cta:hover { background: var(--primary-active); color: var(--on-primary); }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  padding: 10px 18px;
  height: 40px;
}
.btn-primary:hover { background: var(--primary-active); color: var(--on-primary); }
.btn-secondary {
  background: var(--surface-card);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  padding: 10px 18px;
  height: 40px;
}
.btn-dark {
  background: var(--ink);
  color: var(--canvas);
  padding: 12px 20px;
  height: 44px;
}
.btn-dark:hover { color: var(--canvas); opacity: 0.92; }
.btn-text {
  color: var(--ink);
  font-weight: 500;
  padding: 10px 4px;
}
.btn-text:hover { color: var(--primary); }

/* Hero */
.hero-band { background: var(--canvas); padding: var(--sp-section) 0 var(--sp-xxl); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--sp-xxl);
  align-items: center;
}
.hero-actions { display: flex; gap: var(--sp-base); align-items: center; flex-wrap: wrap; margin-top: var(--sp-lg); }
.hero-figure {
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
  overflow: hidden;
  background: var(--surface-card);
}
.hero-figure img { width: 100%; height: 420px; object-fit: cover; }
.figure-caption {
  font-size: 13px;
  color: var(--muted);
  padding: var(--sp-sm) var(--sp-base);
}

/* Badge */
.badge-pill {
  display: inline-block;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.88px;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  padding: 4px 10px;
}

/* Cards */
.card {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-lg);
}
.card h3 { font-size: 22px; }
.card-title { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: var(--sp-xs); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-base); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-lg); }

.article-card { overflow: hidden; padding: 0; }
.article-card img { width: 100%; height: 200px; object-fit: cover; }
.article-card-body { padding: var(--sp-lg); }
.article-card .badge-pill { margin-bottom: var(--sp-sm); }

.section-head { max-width: 64ch; margin-bottom: var(--sp-xl); }

/* Code surfaces */
.code-block {
  background: var(--surface-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: var(--sp-md);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
}
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-strong);
  border-radius: var(--r-xs);
  padding: 2px 5px;
  color: var(--ink);
}

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 var(--sp-lg) 52px;
  border-left: 1px solid var(--hairline);
  margin-left: 16px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -4px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}
.steps li strong { color: var(--ink); }

/* Spec table */
.spec-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.spec-table caption { text-align: left; color: var(--muted); font-size: 13px; margin-bottom: var(--sp-xs); }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
.spec-table th { color: var(--ink); font-weight: 600; }

/* Callout */
.callout {
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--tl-done);
  border-radius: var(--r-md);
  padding: var(--sp-base) var(--sp-md);
}
.callout .eyebrow { color: var(--tl-done); margin-bottom: 6px; }

/* Article layout */
.article-wrap { display: grid; grid-template-columns: 1fr 260px; gap: var(--sp-xxl); }
.article-body > * + * { margin-top: var(--sp-base); }
.article-body h2 { margin-top: var(--sp-xl); }
.article-body figure { margin: var(--sp-lg) 0; }
.article-body figure img { border-radius: var(--r-lg); border: 1px solid var(--hairline); width: 100%; max-height: 460px; object-fit: cover; }
.article-meta { color: var(--muted); font-size: 14px; margin-bottom: var(--sp-base); }
.aside-card { position: sticky; top: 88px; }
.aside-card h4 { font-size: 16px; }
.aside-links { list-style: none; padding: 0; margin: 0; }
.aside-links li { padding: 8px 0; border-bottom: 1px solid var(--hairline-soft); }
.aside-links li:last-child { border-bottom: 0; }

.ref-list { padding-left: 18px; color: var(--body); }
.ref-list li { margin-bottom: 8px; }

/* Forms */
.form-grid { display: grid; gap: var(--sp-base); max-width: 560px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
}
.field input { height: 44px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.form-status {
  margin-top: var(--sp-sm);
  font-size: 14px;
  color: var(--success);
  min-height: 20px;
}
.field-hint { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* CTA band */
.cta-band { background: var(--canvas); border-top: 1px solid var(--hairline); padding: 96px 0; text-align: center; }
.cta-band h2 { margin-bottom: var(--sp-base); }

/* Footer */
.site-footer { background: var(--canvas); border-top: 1px solid var(--hairline); }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-xxl) var(--sp-lg);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-xl);
}
.footer-head { font-size: 11px; font-weight: 600; letter-spacing: 0.88px; text-transform: uppercase; color: var(--muted); margin-bottom: var(--sp-sm); }
.footer-link { display: block; color: var(--body); font-size: 14px; padding: 6px 0; }
.footer-link:hover { color: var(--ink); }
.footer-note { font-size: 14px; color: var(--body); max-width: 40ch; }
.footer-updated { font-size: 13px; color: var(--muted); }
.wordmark-footer { display: block; margin-bottom: var(--sp-sm); }
.footer-base {
  border-top: 1px solid var(--hairline);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-lg);
  font-size: 13px;
  color: var(--muted);
}
.disclaimer { color: var(--muted-soft); }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  width: calc(100% - 32px);
  max-width: 720px;
  background: var(--surface-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-base) var(--sp-md);
  display: flex;
  align-items: center;
  gap: var(--sp-base);
  z-index: 80;
}
.cookie-text { font-size: 14px; color: var(--body); margin: 0; }
.cookie-actions { display: flex; gap: var(--sp-xs); flex-shrink: 0; }

@media (max-width: 1024px) {
  h1 { font-size: 56px; letter-spacing: -1.4px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure img { height: 320px; }
  .article-wrap { grid-template-columns: 1fr; }
  .aside-card { position: static; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    padding: var(--sp-base) var(--sp-lg);
  }
  .nav-menu.open { display: flex; }
  .nav-link { padding: 10px 0; width: 100%; }
  .nav-cta { width: 100%; }
}

@media (max-width: 640px) {
  h1 { font-size: 32px; letter-spacing: -0.8px; }
  h2 { font-size: 28px; letter-spacing: -0.5px; }
  .section { padding: var(--sp-xxl) 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .cookie-banner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; }
}
