/* Waste Pilot Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@450;500;600&display=swap');

:root {
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --header-h: 64px;
    --sidebar-w: 280px;
    --toc-w: 220px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 0.2s;
}

[data-theme="dark"] {
    --bg: #06080c;
    --bg-subtle: #0c1017;
    --surface: #111820;
    --surface-hover: #171f2a;
    --border: rgba(255,255,255,0.07);
    --border-strong: rgba(255,255,255,0.12);
    --text: #f4f7fb;
    --text-secondary: #9aa8bc;
    --text-muted: #64748b;
    --primary: #4d9fff;
    --primary-hover: #6eb1ff;
    --primary-soft: rgba(77,159,255,0.12);
    --primary-glow: rgba(77,159,255,0.35);
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;
    --hero-glow: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(77,159,255,0.2), transparent 70%);
    --grid-color: rgba(255,255,255,0.03);
    --shadow: 0 8px 40px rgba(0,0,0,0.45);
    --code-bg: #0a0e14;
}

[data-theme="light"] {
    --bg: #fafbfc;
    --bg-subtle: #f1f5f9;
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --border: rgba(15,23,42,0.08);
    --border-strong: rgba(15,23,42,0.14);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37,99,235,0.08);
    --primary-glow: rgba(37,99,235,0.2);
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --info: #2563eb;
    --hero-glow: radial-gradient(ellipse 70% 50% at 50% -10%, rgba(37,99,235,0.08), transparent 70%);
    --grid-color: rgba(15,23,42,0.04);
    --shadow: 0 8px 40px rgba(15,23,42,0.08);
    --code-bg: #f1f5f9;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
code, pre { font-family: var(--font-mono); }
.hidden { display: none !important; }

.container { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }
.container-narrow { width: min(780px, 100% - 2.5rem); margin-inline: auto; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.65rem 1.25rem; border-radius: var(--radius-sm);
    font-size: 0.875rem; font-weight: 600; font-family: inherit;
    border: 1px solid transparent; cursor: pointer; transition: all var(--duration) var(--ease);
    text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-hover); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text); background: var(--primary-soft); }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.8rem; }

/* Header */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 300;
    display: flex; align-items: center; padding: 0 1.5rem;
    border-bottom: 1px solid transparent; transition: all var(--duration) var(--ease);
}
.site-header.scrolled {
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(16px);
    border-bottom-color: var(--border);
}
.header-inner { display: flex; align-items: center; width: 100%; max-width: 1200px; margin: 0 auto; gap: 2rem; }
.header-logo { display: flex; align-items: center; gap: 0.65rem; font-weight: 700; font-size: 0.95rem; color: var(--text); text-decoration: none; }
.header-logo-mark { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), #6366f1); display: grid; place-items: center; color: #fff; font-size: 0.7rem; font-weight: 800; }
.header-nav { display: flex; align-items: center; gap: 0.25rem; flex: 1; }
.header-nav a { padding: 0.45rem 0.75rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.875rem; font-weight: 500; text-decoration: none; transition: var(--duration); }
.header-nav a:hover, .header-nav a.active { color: var(--text); background: var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary); cursor: pointer; display: grid; place-items: center; transition: var(--duration); }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.menu-btn { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 4rem 0 2rem; margin-top: 4rem; background: var(--bg-subtle); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2.5rem; margin-bottom: 3rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.875rem; max-width: 280px; margin: 0.75rem 0 0; }
.footer-col h4 { margin: 0 0 1rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.footer-col a { display: block; color: var(--text-secondary); font-size: 0.875rem; padding: 0.3rem 0; text-decoration: none; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { padding-top: 2rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; font-size: 0.8rem; color: var(--text-muted); }

/* Sections */
.page-main { padding-top: var(--header-h); }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); margin-bottom: 0.75rem; }
.section-title { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 1rem; line-height: 1.15; }
.section-desc { color: var(--text-secondary); font-size: 1.05rem; max-width: 620px; margin: 0 0 2.5rem; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: all var(--duration) var(--ease); }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: 1rem; color: var(--primary); }
.card h3 { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; }
.card p { margin: 0; font-size: 0.875rem; color: var(--text-secondary); line-height: 1.55; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Callouts (docs) */
.callout { border-radius: var(--radius-sm); padding: 1rem 1.15rem; margin: 1.25rem 0; border-left: 3px solid; font-size: 0.875rem; }
.callout-info { background: var(--primary-soft); border-color: var(--primary); }
.callout-warn { background: rgba(251,191,36,0.1); border-color: var(--warning); }
.callout strong { display: block; margin-bottom: 0.25rem; }

/* Code blocks */
.code-block { position: relative; margin: 1.25rem 0; border-radius: var(--radius-sm); background: var(--code-bg); border: 1px solid var(--border); overflow: hidden; }
.code-block-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.code-block pre { margin: 0; padding: 1rem 1.15rem; overflow-x: auto; font-size: 0.8rem; line-height: 1.6; color: var(--text-secondary); }
.copy-code-btn { padding: 0.2rem 0.5rem; border-radius: 4px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 0.7rem; cursor: pointer; }
.copy-code-btn:hover { color: var(--primary); }

/* Mobile nav drawer */
.mobile-drawer { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.mobile-drawer.open { pointer-events: auto; }
.mobile-drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity var(--duration); }
.mobile-drawer.open .mobile-drawer-backdrop { opacity: 1; }
.mobile-drawer-panel { position: absolute; top: 0; right: 0; width: min(300px, 85vw); height: 100%; background: var(--surface); border-left: 1px solid var(--border); padding: 1.5rem; transform: translateX(100%); transition: transform var(--duration) var(--ease); }
.mobile-drawer.open .mobile-drawer-panel { transform: translateX(0); }
.mobile-drawer-panel a { display: block; padding: 0.65rem 0; color: var(--text-secondary); font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--border); transition: color var(--duration), background var(--duration); }
.mobile-drawer-panel a:hover,
.mobile-drawer-panel a.active { color: var(--primary); background: var(--primary-soft); margin: 0 -1.5rem; padding-left: 1.5rem; padding-right: 1.5rem; }

@media (max-width: 900px) {
    .header-nav { display: none; }
    .menu-btn { display: grid; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; }
}
