/* ==========================================================================
   RevenueWard Okanagan — Master Design System & Typographic Quiet Zones
   Swiss Modernism 2.0 + Liquid Slate Glass Architecture (Pass 4B HARMONIZED)
   Enforces: WCAG 4.5:1+ Contrast, Asymmetric Quiet Zones, Visual Rest Rhythm
   ========================================================================== */

:root {
    /* Color Tokens — Slate Obsidian Palette */
    --bg-canvas: #050811;
    --bg-surface-m0: #0b0f19;
    --bg-surface-m1: rgba(11, 15, 25, 0.85);
    --bg-surface-m2: rgba(15, 23, 42, 0.70);
    
    /* Text Hierarchy Tokens (High-Contrast Guaranteed >= 5.8:1) */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1; /* Slate 300 (7.5:1 contrast) */
    --text-muted: #94a3b8;     /* Slate 400 (5.8:1 contrast) */
    
    /* Telemetry State Palette */
    --state-azure: #38bdf8;
    --state-protected: #10b981;
    --state-amber: #f59e0b;
    --state-emergency: #f87171;
    
    /* Borders & Glass Hairlines */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hairline: rgba(255, 255, 255, 0.18);
    --border-azure: rgba(56, 189, 248, 0.35);
    --border-emerald: rgba(16, 185, 129, 0.35);
    
    /* Typography Rules */
    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Animation Easing */
    --ease-awwwards: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-canvas);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    overflow-x: hidden;
    position: relative;
}

/* Accessibility Skip Link */
.skip-link {
    position: absolute;
    top: -60px;
    left: 20px;
    background: var(--state-azure);
    color: #050811;
    padding: 10px 20px;
    font-weight: 700;
    border-radius: 8px;
    z-index: 1000;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 20px;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    margin-bottom: 20px;
}

h2 {
    font-size: clamp(2.0rem, 3.5vw, 3.0rem);
    margin-bottom: 16px;
}

h3 {
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    margin-bottom: 12px;
}

p {
    color: var(--text-secondary);
    max-width: 65ch; /* Comfortable reading line length */
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.mono-data {
    font-family: var(--font-mono);
    letter-spacing: -0.01em;
}

/* Kinetic Gradient Typography */
.gradient-azure {
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 50%, #0284c7 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: azureSweep 6s ease infinite;
}

@keyframes azureSweep {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Layout Containers & Grid */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 96px 0;
    position: relative;
}

/* Asymmetric Hero Grid & Typographic Quiet Zone */
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
    min-height: 80vh;
}

.hero-quiet-zone {
    background: linear-gradient(135deg, rgba(5, 8, 17, 0.94) 0%, rgba(5, 8, 17, 0.85) 60%, rgba(5, 8, 17, 0.4) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 44px;
    border-radius: 28px;
    border: 1px solid var(--border-hairline);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* Buttons & Interactive Elements (44px Minimum Touch Targets) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    min-height: 48px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.98rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s var(--ease-awwwards), box-shadow 0.25s var(--ease-awwwards), border-color 0.25s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    border-color: rgba(56, 189, 248, 0.5);
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 45%, rgba(255,255,255,0.3) 50%, transparent 55%);
    transform: rotate(30deg) translateY(-100%);
    transition: transform 0.6s var(--ease-awwwards);
}

.btn-primary:hover::after {
    transform: rotate(30deg) translateY(100%);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(2, 132, 199, 0.5);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    color: #ffffff;
    border-color: var(--border-hairline);
}

.btn-secondary:hover {
    background: rgba(30, 41, 59, 0.85);
    transform: translateY(-2px);
    border-color: var(--state-azure);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.05rem;
    min-height: 52px;
}

.hero-cta-group {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

/* Badge Chips */
.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.chip-azure {
    background: rgba(56, 189, 248, 0.12);
    color: var(--state-azure);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.chip-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: var(--state-protected);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chip-amber {
    background: rgba(245, 158, 11, 0.12);
    color: var(--state-amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.chip-red {
    background: rgba(248, 113, 113, 0.12);
    color: var(--state-emergency);
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.dot-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
}

/* Glass Panels & Material Surface Scale */
.glass-panel {
    background: var(--bg-surface-m1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-top: 1px solid var(--border-hairline); /* Specular top edge */
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s var(--ease-awwwards), border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: var(--border-azure);
    box-shadow: 0 24px 48px rgba(2, 132, 199, 0.2);
}

.surface-m0 {
    background: var(--bg-surface-m0);
    border: 1px solid var(--border-subtle);
    border-top: 1px solid var(--border-hairline);
    border-radius: 20px;
    padding: 32px;
}

/* Navigation Bar */
.navbar {
    padding: 20px 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 15, 25, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-hairline);
    border-radius: 100px;
    padding: 10px 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: #ffffff;
    text-decoration: none;
}

.logo-shield {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffffff;
}

/* Telemetry Simulation Overlay Box */
.hero-core-wrapper {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.telemetry-pipeline {
    width: 100%;
    background: rgba(11, 15, 25, 0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-azure);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.pipeline-step {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.pipeline-step.active-step {
    border-color: var(--state-azure);
    background: rgba(56, 189, 248, 0.08);
}

.pipeline-step.protected-step {
    border-color: var(--state-protected);
    background: rgba(16, 185, 129, 0.08);
}

/* Revenue Leak Simulator Component */
.simulator-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.range-group {
    margin-bottom: 24px;
}

.range-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

input[type=range] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #1e293b;
    outline: none;
    -webkit-appearance: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--state-azure);
    cursor: pointer;
    box-shadow: 0 0 12px var(--state-azure);
}

.sim-output-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(11, 15, 25, 0.95) 100%);
    border: 1px solid var(--border-hairline);
    border-radius: 20px;
    padding: 32px;
    text-align: center;
}

.sim-amount {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 4vw, 3.8rem);
    font-weight: 700;
    color: var(--state-emergency);
    margin: 12px 0;
}

/* Comparison Section Flows */
.flow-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.flow-column {
    background: var(--bg-surface-m0);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid var(--border-subtle);
}

.leak-column {
    border-top: 3px solid var(--state-emergency);
}

.protected-column {
    border-top: 3px solid var(--state-protected);
    background: rgba(16, 185, 129, 0.04);
}

.flow-step-item {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.95rem;
}

/* Stepper Narrative Cards */
.story-stepper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.story-card {
    background: var(--bg-surface-m0);
    border: 1px solid var(--border-subtle);
    border-top: 1px solid var(--border-hairline);
    border-radius: 16px;
    padding: 24px;
}

.story-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.15);
    color: var(--state-azure);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 16px;
}

/* Bento Recovery Grid */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.bento-item-large {
    grid-column: span 2;
}

/* Pricing Cards */
.pricing-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.pricing-card.featured {
    border-color: var(--state-azure);
    box-shadow: 0 0 40px rgba(56, 189, 248, 0.2);
}

/* Helper Utilities */
.text-center { text-align: center; }
.full-width { width: 100%; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* SVG Icon Helper */
.icon-svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Mobile Drawer & Responsive Rules */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}

.mobile-nav-drawer {
    display: none;
    position: fixed;
    top: 80px;
    left: 20px;
    right: 20px;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-hairline);
    border-radius: 20px;
    padding: 24px;
    z-index: 999;
    flex-direction: column;
    gap: 16px;
}

.mobile-nav-drawer.open {
    display: flex;
}

.mobile-nav-drawer a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 991px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }
    .hero-quiet-zone {
        padding: 32px 24px;
    }
    .simulator-box, .flow-comparison, .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    .story-stepper {
        grid-template-columns: 1fr 1fr;
    }
    .bento-grid {
        grid-template-columns: 1fr;
    }
    .bento-item-large {
        grid-column: span 1;
    }
    .nav-links {
        display: none;
    }
    .mobile-nav-toggle {
        display: block;
    }
}

@media (max-width: 600px) {
    .story-stepper {
        grid-template-columns: 1fr;
    }
    .hero-cta-group {
        flex-direction: column;
    }
    .btn {
        width: 100%;
    }
}
