/* ============================================
   global.css — shared tokens, nav, footer, buttons,
   focus rings, and reduced-motion handling for every
   TrustStrike Labs page. Page-specific CSS still
   lives in each page's inline <style> block and can
   override anything below.
   ============================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Design tokens (full palette) */
:root {
    --white: #ffffff;
    --g50: #f9fafb; --g100: #f3f4f6; --g200: #e5e7eb;
    --g300: #d1d5db; --g400: #9ca3af; --g500: #6b7280;
    --g600: #4b5563; --g700: #374151; --g800: #1f2937;
    --g900: #111827; --g950: #030712;

    --accent-50: #ecfdf5; --accent-100: #d1fae5; --accent-200: #a7f3d0;
    --accent-300: #6ee7b7; --accent-400: #34d399; --accent-500: #10b981;
    --accent-600: #059669; --accent-700: #047857; --accent-800: #065f46;
    --accent-900: #064e3b;

    --red-50: #fef2f2; --red-100: #fee2e2; --red-400: #f87171;
    --red-500: #ef4444; --red-700: #b91c1c; --red-800: #991b1b;

    --blue-50: #eff6ff; --blue-100: #dbeafe; --blue-200: #bfdbfe;
    --blue-300: #93c5fd; --blue-500: #3b82f6; --blue-600: #2563eb;
    --blue-700: #1d4ed8; --blue-800: #1e40af;

    --green-50: #f0fdf4; --green-500: #22c55e; --green-600: #16a34a;

    --amber-50: #fffbeb; --amber-100: #fef3c7;
    --amber-400: #fbbf24; --amber-500: #f59e0b;

    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;

    --max-w: 1200px;
    --nav-h: 72px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 24px rgba(5,150,105,0.12);
}

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
    font-family: var(--font);
    color: var(--g800);
    background: var(--white);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* a11y: visible focus ring for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--accent-600);
    outline-offset: 2px;
    border-radius: 4px;
}
.btn:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, a:focus-visible, button:focus-visible {
    outline: 2px solid var(--accent-600);
    outline-offset: 2px;
}

/* a11y: respect users who set "reduce motion" in OS */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* NAVBAR */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    height: var(--nav-h);
    background: rgba(255,255,255,0.88);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--g200);
    transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 1px 12px rgba(0,0,0,0.06); }
.nav-inner {
    max-width: var(--max-w); margin: 0 auto; height: 100%;
    padding: 0 28px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-weight: 800; font-size: 1.365rem; color: var(--g900);
    text-decoration: none; letter-spacing: 0.06em;
    display: inline-flex; align-items: flex-end; gap: 0;
    line-height: 1;
}
.nav-logo-img { height: 32px; width: 32px; margin-right: 8px; }
.nav-logo .labs-text {
    color: var(--g900); font-weight: 800; font-size: 0.6em;
    margin-left: 4px; letter-spacing: 0.02em;
}
.nav-links { display: flex; align-items: center; gap: 8px; list-style: none; }
.nav-links a {
    font-size: 0.875rem; font-weight: 500; color: var(--g500);
    text-decoration: none; padding: 8px 14px; border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--g900); background: var(--g50); }
.nav-links a.active { color: var(--accent-700); background: var(--accent-50); font-weight: 600; }
.nav-links a.btn-primary { color: #ffffff !important; }
.nav-links a.btn-primary:hover { color: #ffffff !important; background: #065f46; }

/* Hamburger */
.hamburger {
    display: none; background: none; border: none; cursor: pointer;
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    align-items: center; justify-content: center;
    transition: background 0.2s;
}
.hamburger:hover { background: var(--g100); }
.hamburger svg { width: 20px; height: 20px; color: var(--g700); transition: transform 0.3s ease; }
.hamburger.active svg { transform: rotate(90deg); }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: var(--radius-sm);
    font-family: var(--font); font-size: 0.875rem; font-weight: 600;
    text-decoration: none; cursor: pointer; border: none;
    transition: all 0.2s ease;
}
.btn-primary { background: #064e3b; color: #ffffff; box-shadow: 0 1px 3px rgba(6,78,59,0.3); }
.btn-primary:hover { background: #065f46; box-shadow: 0 4px 16px rgba(6,78,59,0.35); transform: translateY(-1px); }
.btn-white { background: var(--white); color: var(--g900); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.btn-white:hover { background: var(--g50); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-outline-white { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,0.2); }
.btn-outline-white:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.35); }
.btn-ghost { background: transparent; color: var(--g700); border: 1px solid var(--g200); }
.btn-ghost:hover { background: var(--g50); color: var(--g900); border-color: var(--g300); }

/* Footer (covers both .site-footer and index.html's .footer naming) */
.site-footer, .footer {
    padding: 64px 24px 32px;
    border-top: 1px solid var(--g200);
    background: var(--white);
}
.site-footer-inner, .footer .container { max-width: var(--max-w); margin: 0 auto; }
.site-footer-grid, .footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
    margin-bottom: 48px;
}
.site-footer-brand .nav-logo, .footer-brand .nav-logo { display: inline-flex; margin-bottom: 12px; }
.site-footer-brand p, .footer-brand p {
    font-size: 0.84rem; color: var(--g400); line-height: 1.7; max-width: 260px;
}
.site-footer-col h4, .footer-col h4 {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--g400); margin-bottom: 16px;
}
.site-footer-col ul, .footer-col ul { list-style: none; padding: 0; }
.site-footer-col li, .footer-col li { margin-bottom: 10px; }
.site-footer-col a, .footer-col a {
    font-size: 0.84rem; color: var(--g500); text-decoration: none;
    transition: color 0.2s;
}
.site-footer-col a:hover, .footer-col a:hover { color: var(--g900); }
.site-footer-bottom, .footer-bottom {
    padding-top: 24px; border-top: 1px solid var(--g200);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.78rem; color: var(--g400);
}

/* Responsive */
@media (max-width: 1024px) {
    .site-footer-grid, .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
    .nav-links.open {
        display: flex !important; flex-direction: column;
        position: fixed;
        top: var(--nav-h); left: 0; right: 0;
        height: calc(100vh - var(--nav-h));
        height: calc(100dvh - var(--nav-h));
        background: #ffffff;
        padding: 8px 0 24px; gap: 0;
        box-shadow: 0 8px 32px rgba(0,0,0,0.08);
        overflow-y: auto;
        z-index: 1001;
        animation: menuSlide 0.22s ease-out;
    }
    @keyframes menuSlide {
        from { transform: translateY(-8px); opacity: 0.6; }
        to { transform: translateY(0); opacity: 1; }
    }
    .nav-links.open li { width: 100%; }
    .nav-links.open a {
        display: flex; align-items: center; justify-content: space-between;
        padding: 18px 24px; width: 100%;
        border-radius: 0;
        font-size: 1.1rem; font-weight: 600; color: var(--g900);
    }
    .nav-links.open a::after {
        content: '\203A';
        font-size: 1.4rem; color: var(--g300); font-weight: 400;
    }
    .nav-links.open a:hover, .nav-links.open a:active {
        background: var(--accent-50); color: var(--accent-700);
    }
    .nav-links.open a.active { background: var(--accent-50); color: var(--accent-700); }
    .nav-links.open li:not(:last-child) { border-bottom: 1px solid var(--g100); }
    .nav-links.open li:last-child {
        margin-top: auto; padding: 20px 20px 0;
        border-top: 1px solid var(--g100);
        border-bottom: none !important;
    }
    .nav-links.open li:last-child a.btn-primary {
        display: flex; justify-content: center; align-items: center;
        padding: 18px 24px; font-size: 1rem; font-weight: 700;
        color: #ffffff !important; background: #064e3b;
        border-radius: var(--radius);
    }
    .nav-links.open li:last-child a.btn-primary::after { content: none; }
}
@media (max-width: 600px) {
    .site-footer-grid, .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .site-footer-bottom, .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
    .site-footer, .footer { padding: 48px 20px 24px; }
}
