/* Baqio theme for the documentation site, aligned with baqio.com (baqio-site) */
:root {
  --brand: #689534;
  --brand-darker: #386641;
  --brand-light: #c3d4ae;
  --brand-soft: #eef3e8;
  --bg: #ffffff;
  --bg-cream: #f9f7f1;
  --fg: #1c2620;
  --muted: #5d6670;
  --border: #e6e4dc;
  --card: #ffffff;
  --code-bg: #0f1a14;
  --code-fg: #e6eee0;
  --radius: 0.625rem;
  --shadow: 0 1px 2px rgb(28 38 32 / 0.04), 0 8px 24px -12px rgb(28 38 32 / 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8eba54;
    --brand-darker: #a9cd7a;
    --brand-light: #3c5226;
    --brand-soft: #1d2a1a;
    --bg: #0f1412;
    --bg-cream: #141a16;
    --fg: #eef1ea;
    --muted: #9aa49c;
    --border: #26302a;
    --card: #161d19;
    --code-bg: #0a100c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-darker); }

h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; margin: 0; }

code, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; font-size: .875em; }

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 1.5rem; height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--fg); font-weight: 600; }
.brand img { height: 26px; width: auto; display: block; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand .logo-light { display: none; }
  .brand .logo-dark { display: block; }
}
.brand-badge {
  font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand-darker); background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  padding: .1rem .45rem; border-radius: 999px;
}
.site-nav { display: none; gap: 1.5rem; font-size: .9rem; font-weight: 500; }
.site-nav a { color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
@media (min-width: 768px) { .site-nav { display: flex; } }
.header-actions { margin-left: auto; display: flex; gap: .5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .9rem; font-weight: 600; line-height: 1;
  padding: .7rem 1.1rem; border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn-primary { background: #689534; color: #fff; }
.btn-primary:hover { background: #386641; color: #fff; }
.btn-outline { background: var(--card); color: var(--fg); border-color: var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--fg); }
.btn-sm { padding: .5rem .8rem; font-size: .82rem; }
.btn svg { width: 1em; height: 1em; }

/* Hero */
.hero {
  background:
    radial-gradient(60rem 30rem at 85% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-cream), var(--bg));
  border-bottom: 1px solid var(--border);
  padding: 4rem 0 4.5rem;
}
.hero-grid { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 1fr; } .hero { padding: 6rem 0; } }
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 500; color: var(--fg);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: .25rem .75rem .25rem .3rem; box-shadow: var(--shadow);
}
.pill b { background: #689534; color: #fff; font-weight: 600; font-size: .72rem; padding: .15rem .5rem; border-radius: 999px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; margin-top: 1.25rem; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead { font-size: 1.15rem; color: var(--muted); margin: 1.25rem 0 2rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Code window */
.code-window {
  background: var(--code-bg); color: var(--code-fg);
  border-radius: calc(var(--radius) + 4px); overflow: hidden;
  box-shadow: 0 24px 60px -24px rgb(15 26 20 / .45); border: 1px solid #1f2b23;
  min-width: 0;
}
.code-window-bar { display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem; border-bottom: 1px solid #1f2b23; }
.code-window-bar span { width: .65rem; height: .65rem; border-radius: 50%; background: #2c3a31; }
.code-window-bar em { margin-left: .5rem; font-style: normal; font-size: .75rem; color: #8b9a8f; }
.code-window pre { margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto; line-height: 1.7; }
.tok-c { color: #6f8174; } .tok-k { color: #8eba54; } .tok-s { color: #e8d3a0; } .tok-n { color: #9cc3e6; }

/* Sections */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-cream); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.section-title { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 650; margin-top: .5rem; }
.section-lead { color: var(--muted); font-size: 1.05rem; margin-top: .75rem; max-width: 42rem; }

.grid { display: grid; gap: 1rem; margin-top: 2.5rem; }
@media (min-width: 640px) { .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow); min-width: 0;
}
a.card { color: inherit; display: block; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.card h3 { font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; }
.card p { color: var(--muted); font-size: .93rem; margin: .5rem 0 0; }
.card .count { margin-left: auto; font-size: .75rem; font-weight: 500; color: var(--muted); }
.icon-tile {
  display: inline-grid; place-items: center; flex: none;
  width: 2.2rem; height: 2.2rem; border-radius: .55rem;
  background: var(--brand-soft); color: var(--brand);
}
.icon-tile svg { width: 1.15rem; height: 1.15rem; }

.step-num {
  display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: #689534; color: #fff; font-size: .85rem; font-weight: 700;
}
.card pre {
  background: var(--code-bg); color: var(--code-fg); border-radius: calc(var(--radius) - 2px);
  padding: .85rem 1rem; overflow-x: auto; margin: 1rem 0 0; font-size: .8rem;
}
:not(pre) > code {
  background: var(--brand-soft); color: var(--brand-darker);
  padding: .1em .35em; border-radius: .3rem;
}

.env-list { display: grid; gap: .6rem; margin-top: 1rem; }
.env { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .9rem; }
.env b { min-width: 6rem; }
.env code { overflow-wrap: anywhere; }

/* CTA */
.cta {
  background: linear-gradient(135deg, #386641, #689534); color: #fff;
  border-radius: calc(var(--radius) + 6px); padding: 2.5rem;
  display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
}
.cta h2 { font-size: 1.6rem; }
.cta p { margin: .4rem 0 0; color: rgb(255 255 255 / .85); }
.cta .btn-outline { background: #fff; color: #386641; border-color: #fff; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; font-size: .85rem; color: var(--muted); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

/* Guide pages (rendered from docs/*.md) */
.guide-layout { display: grid; gap: 2.5rem; padding: 3rem 0 5rem; }
@media (min-width: 960px) { .guide-layout { grid-template-columns: 14rem minmax(0, 1fr); } }
.guide-nav { font-size: .9rem; }
.guide-nav h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .75rem; }
.guide-nav a { display: block; padding: .35rem .7rem; border-radius: .4rem; color: var(--muted); }
.guide-nav a:hover { color: var(--fg); background: var(--bg-cream); }
.guide-nav a[aria-current="page"] { color: var(--brand-darker); background: var(--brand-soft); font-weight: 600; }
@media (min-width: 960px) { .guide-nav { position: sticky; top: 5.5rem; align-self: start; } }

.prose { max-width: 46rem; min-width: 0; }
.prose h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 1rem; }
.prose h2 { font-size: 1.45rem; margin: 2.5rem 0 .75rem; }
.prose h3 { font-size: 1.15rem; margin: 2rem 0 .5rem; }
.prose p, .prose li { color: color-mix(in srgb, var(--fg) 85%, var(--muted)); }
.prose ul { padding-left: 1.25rem; }
.prose li::marker { color: var(--brand); }
.prose pre {
  background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius);
  padding: 1rem 1.25rem; overflow-x: auto;
}
.prose table { border-collapse: collapse; width: 100%; font-size: .9rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; }
.prose th { background: var(--bg-cream); }
.prose strong { color: var(--fg); }

@media (max-width: 479px) {
  .header-actions .btn-outline { display: none; }
}
