/* ── Analify Public CSS ── */
/* Extracted from templates/base_public.html for caching (S2+S3) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #060703;
    --bg-card: #0f1210;
    --bg-card-hover: #171717;
    --green: #068162;
    --green-light: rgba(6, 129, 98, 0.1);
    --green-mid: rgba(6, 129, 98, 0.4);
    --green-bright: #9cf35b;
    --text: #fafafa;
    --text-secondary: #e8ece8;
    --text-muted: #888;
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
}
[data-theme="light"] {
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f5;
    --green: #068162;
    --green-light: rgba(6, 129, 98, 0.06);
    --green-mid: rgba(6, 129, 98, 0.2);
    --text: #171717;
    --text-secondary: #262626;
    --text-muted: #666;
    --border: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(0, 0, 0, 0.15);
    color-scheme: light;
}
[data-theme="light"] .card { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
[data-theme="light"] .cta-block { background: linear-gradient(135deg, #e8f5f0 0%, #f0faf6 100%); border-color: rgba(6,129,98,0.2); }
[data-theme="light"] .pill { background: #fff; border-color: rgba(0,0,0,0.1); }
[data-theme="light"] .pill.active { background: var(--green); color: #fff; border-color: var(--green); }
[data-theme="light"] .badge-category { background: rgba(6,129,98,0.08); }
.nav-brand .logo-light { display: inline; }
.nav-brand .logo-dark { display: none; }
[data-theme="light"] .nav-brand .logo-light { display: none; }
[data-theme="light"] .nav-brand .logo-dark { display: inline; }
[data-theme="light"] .post-content code { background: #f0f0f0; }
[data-theme="light"] .post-content pre { background: #f5f5f5; border: 1px solid rgba(0,0,0,0.06); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #fff; border-color: rgba(0,0,0,0.12); color: #171717; }
[data-theme="light"] .theme-toggle { color: #666; }

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; transition: background 0.2s, color 0.2s; padding-bottom: 60px; }
a { color: var(--green); text-decoration: none; }
a:hover { opacity: 0.85; }

/* Theme toggle */
.theme-toggle { background: none; border: none; cursor: pointer; padding: 0.4rem; color: var(--text-muted); display: flex; align-items: center; border-radius: 6px; transition: all 0.15s; }
.theme-toggle:hover { color: var(--green); background: var(--green-light); }
.theme-toggle svg { width: 18px; height: 18px; }

/* Navigation */
.nav-wrap { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: color-mix(in srgb, var(--bg) 85%, transparent); }
[data-theme="light"] .nav-wrap { background: rgba(250,250,250,0.85); }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 2rem; max-width: 1200px; margin: 0 auto; }
.nav-brand { display: flex; align-items: center; text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 0.2rem; }
.nav-links a { padding: 0.5rem 0.9rem; border-radius: 8px; font-size: 0.88rem; font-weight: 500; color: var(--text-muted); transition: all 0.15s; }
.nav-links a:hover { color: var(--text); background: var(--green-light); }
.nav-links a.active { color: var(--green); background: var(--green-light); font-weight: 600; }

/* Bottom sticky bar */
.bottom-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--bg-card); border-top: 1px solid var(--border); padding: 0.7rem 1.5rem; display: flex; align-items: center; justify-content: center; gap: 1rem; transform: translateY(0); transition: transform 0.3s; }
.bottom-bar.hidden { transform: translateY(100%); }
[data-theme="light"] .bottom-bar { background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,0.06); }
.bottom-bar p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.bottom-bar strong { color: var(--text); }
.bottom-bar .btn { flex-shrink: 0; }
.bottom-bar-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 0.3rem; font-size: 1.2rem; line-height: 1; }
.bottom-bar-close:hover { color: var(--text); }
@media (max-width: 600px) { .bottom-bar { flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 1rem; } .bottom-bar p { font-size: 0.82rem; text-align: center; } }

.nav-right { display: flex; align-items: center; gap: 0.5rem; }
.nav-right a { font-size: 0.85rem; }

/* Hamburger */
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; color: var(--text-muted); }
.nav-hamburger:hover { color: var(--green); }
.nav-hamburger svg { width: 22px; height: 22px; }

/* Mobile drawer */
.mobile-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; }
.mobile-backdrop.open { display: block; }
.mobile-drawer { position: fixed; top: 0; right: -300px; width: 300px; height: 100vh; background: var(--bg-card); border-left: 1px solid var(--border); padding: 1.2rem; z-index: 201; transition: right 0.25s; overflow-y: auto; }
[data-theme="light"] .mobile-drawer { background: #fff; }
.mobile-drawer.open { right: 0; }
.mobile-drawer-close { text-align: right; margin-bottom: 0.5rem; }
.mobile-drawer-close button { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 0.3rem; }
.mobile-drawer-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0.5rem 0.6rem 0.2rem; }
.mobile-drawer a { display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.6rem; color: var(--text); text-decoration: none; border-radius: 8px; font-size: 0.9rem; }
.mobile-drawer a:hover, .mobile-drawer a.active { background: var(--green-light); color: var(--green); }

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-hamburger { display: flex; }
    .nav-right > *:not(.theme-toggle):not(.nav-hamburger) { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.6rem 1.4rem; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { opacity: 0.9; color: #fff; }
.btn-outline { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn-outline:hover { background: var(--green-light); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }

/* Container */
.container { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: border-color 0.2s; }
.card:hover { border-color: var(--green-mid); }
.card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem; }
.card p { color: var(--text-muted); font-size: 0.9rem; }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.stat-card .value { font-size: 2rem; font-weight: 800; color: var(--green); }
.stat-card .label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.2rem; }

/* Badges / Tags */
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.badge-passed { background: var(--green-light); color: var(--green); }
.badge-failed { background: rgba(189,38,38,0.15); color: #ef5350; }
.badge-category { background: var(--green-light); color: var(--green); }
.tag { display: inline-block; background: var(--green-light); color: var(--green); padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; }

/* Category pills */
.pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.pill { padding: 0.4rem 0.9rem; border-radius: 20px; font-size: 0.82rem; font-weight: 500; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; text-decoration: none; transition: all 0.15s; }
.pill:hover { border-color: var(--green); color: var(--green); }
.pill.active { background: var(--green); color: #fff; border-color: var(--green); }

/* Test card */
.test-card { display: block; text-decoration: none; color: inherit; }
.test-card .meta { display: flex; gap: 0.8rem; margin-top: 0.8rem; font-size: 0.8rem; color: var(--text-muted); }
.test-card .meta span { display: flex; align-items: center; gap: 0.3rem; }

/* Cert card */
.cert-card { border-left: 4px solid var(--green); }

/* Progress bar */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.3s; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; padding: 0.6rem 0.8rem; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--border); }
td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }

/* Form elements */
input, select, textarea { background: var(--bg); border: 1px solid var(--border); color: var(--text); padding: 0.6rem 0.8rem; border-radius: var(--radius-sm); font-family: inherit; font-size: 0.9rem; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-light); }
label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; font-weight: 500; }
textarea { min-height: 120px; resize: vertical; }

/* Section headings */
.section-title { font-size: 1.8rem; font-weight: 800; margin-bottom: 0.5rem; }
.section-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 2rem; }

/* Text utilities */
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Blog post content */
.post-content { line-height: 1.8; font-size: 1rem; }
.post-content h1 { font-size: 1.8rem; margin: 2rem 0 1rem; }
.post-content h2 { font-size: 1.4rem; margin: 1.8rem 0 0.8rem; }
.post-content h3 { font-size: 1.15rem; margin: 1.5rem 0 0.6rem; }
.post-content p { margin-bottom: 1rem; color: var(--text-muted); }
.post-content ul, .post-content ol { margin: 0 0 1rem 1.5rem; color: var(--text-muted); }
.post-content code { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); padding: 2px 7px; border-radius: 5px; font-size: 0.85rem; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace; color: var(--green); }
.post-content pre { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); padding: 1.2rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1.5rem; line-height: 1.6; }
.post-content pre code { background: none; border: none; padding: 0; color: var(--text-secondary); font-size: 0.85rem; }
.post-content a { color: var(--green); text-decoration: underline; }
[data-theme="light"] .post-content code { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #0d6e4f; }
[data-theme="light"] .post-content pre { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); }
[data-theme="light"] .post-content pre code { color: #333; }

/* CTA block */
.cta-block { background: linear-gradient(135deg, var(--bg-card) 0%, #000d3d 100%); border: 1px solid var(--green-mid); border-radius: var(--radius); padding: 2rem; text-align: center; margin: 2rem 0; }
.cta-block h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.cta-block p { color: var(--text-muted); margin-bottom: 1.2rem; }

/* Page transitions */
.htmx-settling main { opacity: 0; }
main { transition: opacity 0.15s ease; }

/* Top loading bar */
.htmx-request .loading-bar { transform: scaleX(0.6); }
.loading-bar { position: fixed; top: 0; left: 0; height: 2px; background: var(--green); z-index: 999; transform: scaleX(0); transform-origin: left; transition: transform 0.4s ease; pointer-events: none; }

/* Footer */
.footer { text-align: center; padding: 3rem 1rem; color: var(--text-muted); font-size: 0.82rem; border-top: 1px solid var(--border); margin-top: 3rem; }
.footer a { color: var(--green); }

/* ── Animations ── */
@keyframes fadeIn { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }

/* ── Skip to content (A11y - S7) ── */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--green); color: #fff; padding: 0.5rem 1rem; z-index: 1000; border-radius: 0 0 8px 0; font-weight: 600; font-size: 0.85rem; }
.skip-link:focus { top: 0; }

/* ── Focus visible (A11y - S7) ── */
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
