/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:            #f8f7f4;
  --bg-subtle:     #f0efe9;
  --bg-panel:      #eceae2;
  --text:          #1a1918;
  --text-muted:    #6a6965;
  --text-faint:    #a5a49f;
  --accent:        #2e5244;
  --accent-hover:  #244338;
  --accent-light:  #e8f0ec;
  --border:        #dddcd6;
  --border-subtle: #e8e7e1;
  --ok:            #2e7d52;
  --warn:          #b86a00;
  --bad:           #b83232;
  --code-bg:       #1c1b19;
  --code-text:     #d4d3ce;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;

  --max-w:   1200px;
  --prose-w: 720px;
  --gap:     clamp(4rem, 8vw, 8rem);
  --section-gap: clamp(5rem, 10vw, 10rem);

  --radius: 4px;
  --radius-lg: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #141312;
    --bg-subtle:     #1c1b18;
    --bg-panel:      #242220;
    --text:          #eeede8;
    --text-muted:    #9a9994;
    --text-faint:    #6a6965;
    --accent:        #5aaa88;
    --accent-hover:  #6bbf9a;
    --accent-light:  #1e302a;
    --border:        #2e2d2a;
    --border-subtle: #262522;
    --ok:            #5aaa88;
    --warn:          #d4900a;
    --bad:           #e05252;
    --code-bg:       #0e0d0c;
    --code-text:     #c8c7c2;
  }
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }
input { font-family: inherit; }

/* ─── Container ──────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--text-muted); }
.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.2s ease, border-color 0.2s ease, backdrop-filter 0.2s ease;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(248, 247, 244, 0.92);
  border-color: var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
@media (prefers-color-scheme: dark) {
  .site-header.scrolled {
    background: rgba(20, 19, 18, 0.92);
  }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}
.wordmark {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.wordmark span {
  color: var(--accent);
}

/* ─── Footer ──────────────────────────────────────────────── */
footer {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--border-subtle);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}
.footer-brand { max-width: 340px; }
.footer-wordmark {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.footer-tagline {
  font-size: 0.8125rem;
  color: var(--text-faint);
  line-height: 1.55;
}
.footer-nav {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}
.footer-nav-col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-nav-col a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-nav-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-copy { font-size: 0.8125rem; color: var(--text-faint); }
.footer-email {
  font-size: 0.8125rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-email:hover { color: var(--text); }
