        /* ==========================================================================
           0. SELF-HOSTED HEADING FONT (Lexend, SIL OFL 1.1 — see assets/fonts/Lexend-OFL.txt)
           - size-adjust: renders every Lexend heading slightly larger site-wide,
             so per-page font-size rules don't need to be edited individually.
           - font-weight 500–700: the variable file only covers this range, so any
             rule asking for 800/900 is clamped to 700 (Bold, never ExtraBold).
           ========================================================================== */
        @font-face {
            font-family: 'Lexend';
            font-style: normal;
            font-weight: 500 700;
            font-display: swap;
            size-adjust: 108%;
            src: url('../assets/fonts/lexend-latin-wght-500-700.woff2') format('woff2');
            unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
        }

        @font-face {
            font-family: 'Lexend';
            font-style: normal;
            font-weight: 500 700;
            font-display: swap;
            size-adjust: 108%;
            src: url('../assets/fonts/lexend-latin-ext-wght-500-700.woff2') format('woff2');
            unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
        }

        /* ==========================================================================
           1. CSS RESET & UNIFIED DESIGN TOKENS (60-30-10 RULE)
           ========================================================================== */
        :root {
            /* Dark Mode (Default Obsidian & Precision Cyan) */
            --bg: #070B14;
            --bg-secondary: #0D1424;
            --bg-tertiary: #111B2E;
            --card-bg: rgba(13, 20, 36, 0.75);
            --card-bg-hover: rgba(17, 27, 46, 0.9);
            --card-surface: #0E172A;
            --text: #FFFFFF;
            --text-secondary: #CBD5E1;
            --text-muted: #94A3B8;
            --accent: #38BDF8;
            --accent-hover: #0284C7;
            --accent-glow: rgba(56, 189, 248, 0.15);
            --accent-gradient: linear-gradient(135deg, #38BDF8 0%, #00F0FF 100%);
            --border: rgba(255, 255, 255, 0.08);
            --border-hover: rgba(56, 189, 248, 0.35);
            --navbar-bg: rgba(7, 11, 20, 0.85);
            --glass-border: rgba(255, 255, 255, 0.08);
            --badge-bg: rgba(0, 240, 255, 0.12);
            --badge-border: rgba(0, 240, 255, 0.35);
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
            --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
            --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.7);
            --glow: 0 0 30px rgba(56, 189, 248, 0.2);
            --gutter: clamp(1.5rem, 5vw, 6rem);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            --accent-teal: #00F0FF;
            --accent-amber: #f59e0b;
            --accent-emerald: #10b981;

            /* Typography — single source of truth for site fonts (theme-independent) */
            --font-heading: 'Lexend', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
            --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        }

        /* Light Mode — multi-tone industrial SaaS foundation */
        [data-theme="light"],
        html.light-mode {
            /* Deeper blueprint paper — not empty white */
            --bg: #F3F7FB;
            --bg-secondary: #EAF1F8;
            --bg-tertiary: #DCE7F2;
            --card-bg: #FFFFFF;
            --card-bg-hover: #FFFFFF;
            --card-surface: #FFFFFF;
            --text: #071526;
            --text-secondary: #1E293B;
            --text-muted: #475569;
            --accent: #0A5FBF;
            --accent-hover: #084A96;
            --accent-glow: rgba(10, 95, 191, 0.16);
            --accent-teal: #0E7490;
            --accent-amber: #D97706;
            --accent-emerald: #059669;
            --accent-gradient: linear-gradient(135deg, #0A5FBF 0%, #0284C7 50%, #0891B2 100%);
            --border: #A8C0D9;
            --border-hover: rgba(10, 95, 191, 0.5);
            --navbar-bg: rgba(255, 255, 255, 0.97);
            --glass-border: #A8C0D9;
            --badge-bg: rgba(10, 95, 191, 0.1);
            --badge-border: rgba(10, 95, 191, 0.25);
            --shadow-sm: 0 1px 2px rgba(7, 21, 38, 0.08);
            --shadow-md: 0 16px 32px -16px rgba(7, 21, 38, 0.28), 0 2px 8px rgba(7, 21, 38, 0.06);
            --shadow-lg: 0 30px 60px -24px rgba(7, 21, 38, 0.35), 0 4px 12px rgba(7, 21, 38, 0.08);
            --glow: 0 16px 36px -10px rgba(10, 95, 191, 0.4);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html {
            scroll-behavior: smooth;
            overflow-x: hidden !important;
            max-width: 100vw;
            width: 100%;
        }

        /* Hide fallback font flash until heading/body fonts are ready */
        html.fonts-loading body {
            opacity: 0;
        }

        html.fonts-ready body {
            opacity: 1;
            transition: opacity 0.18s ease;
        }

        body {
            background: var(--bg);
            color: var(--text);
            font-family: var(--font-body);
            overflow-x: hidden !important;
            line-height: 1.65;
            font-size: 16px;
            max-width: 100vw;
            position: relative;
            width: 100%;
            transition: background 0.3s ease, color 0.3s ease;
        }

        [data-theme="light"] body,
        html.light-mode body {
            background-color: var(--bg);
            background-image:
                linear-gradient(rgba(10, 95, 191, 0.07) 1px, transparent 1px),
                linear-gradient(90deg, rgba(10, 95, 191, 0.07) 1px, transparent 1px),
                linear-gradient(rgba(10, 95, 191, 0.12) 1px, transparent 1px),
                linear-gradient(90deg, rgba(10, 95, 191, 0.12) 1px, transparent 1px),
                radial-gradient(ellipse at 15% 0%, rgba(14, 165, 233, 0.28), transparent 42%),
                radial-gradient(ellipse at 90% 20%, rgba(8, 145, 178, 0.2), transparent 40%),
                radial-gradient(ellipse at 50% 100%, rgba(10, 95, 191, 0.18), transparent 50%);
            background-size:
                28px 28px,
                28px 28px,
                140px 140px,
                140px 140px,
                auto,
                auto,
                auto;
            background-attachment: fixed;
        }

        [data-theme="light"] .bg-grid,
        html.light-mode .bg-grid {
            opacity: 0.55;
            background-image:
                linear-gradient(to right, rgba(10, 95, 191, 0.14) 1px, transparent 1px),
                linear-gradient(to bottom, rgba(10, 95, 191, 0.14) 1px, transparent 1px);
        }

        [data-theme="light"] #webgl,
        html.light-mode #webgl {
            opacity: 0.2;
        }

        [data-theme="light"] .method-section,
        html.light-mode .method-section,
        [data-theme="light"] .stats-section,
        html.light-mode .stats-section {
            background:
                linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0.15)),
                var(--bg-secondary);
        }

        h1, h2, h3, h4, h5, h6 {
            font-family: var(--font-heading);
            font-weight: 700;
            letter-spacing: -0.02em;
            line-height: 1.15;
            color: var(--text);
        }

        .container {
            max-width: 1320px;
            margin: 0 auto;
            padding: 0 var(--gutter);
            position: relative;
        }

        section {
            padding: 6.5rem 0;
            position: relative;
            overflow: hidden;
        }

        /* Ambient background subtle grid */
        .bg-grid {
            position: absolute;
            inset: 0;
            background-size: 40px 40px;
            background-image: 
                linear-gradient(to right, var(--border) 1px, transparent 1px),
                linear-gradient(to bottom, var(--border) 1px, transparent 1px);
            opacity: 0.45;
            pointer-events: none;
            mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
            -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
        }

        [data-theme="light"] .bg-grid,
        html.light-mode .bg-grid {
            opacity: 0.35;
        }

        /* Cursor */
        #cursor {
            position: fixed;
            width: 12px;
            height: 12px;
            background: var(--accent);
            border-radius: 50%;
            pointer-events: none;
            z-index: 9999;
            mix-blend-mode: difference;
            transform: translate(-50%, -50%);
            transition: transform 0.15s ease-out, width 0.3s ease, height 0.3s ease;
        }

        #cursor.active {
            width: 50px;
            height: 50px;
            background: transparent;
            border: 2px solid var(--accent);
        }

        /* WebGL Background */
        #webgl {
            position: fixed;
            inset: 0;
            z-index: 0;
            opacity: 0.35;
            pointer-events: none;
            max-width: 100vw;
            overflow: hidden;
        }

        [data-theme="light"] #webgl,
        html.light-mode #webgl {
            opacity: 0.2;
        }

