/**
 * SteadyFlow Design System
 * Unique Identity - Baby Blue Accent
 */

:root {
    /* Colors - Light Mode */
    --white: #FFFFFF;
    --off-white: #FAFAFA;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Dark Mode Base */
    --dark: #0F172A;
    --dark-card: #1E293B;
    --dark-border: #334155;

    /* Accent - Baby Blue */
    --accent: #60A5FA;
    --accent-light: #93C5FD;
    --accent-dark: #3B82F6;
    --accent-glow: rgba(96, 165, 250, 0.3);

    /* Gradient */
    --gradient-primary: linear-gradient(135deg, #60A5FA 0%, #818CF8 100%);
    --gradient-hero: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);

    /* Semantic */
    --success: #34D399;
    --success-light: #A7F3D0;
    --warning: #FBBF24;
    --warning-light: #FDE68A;
    --danger: #F87171;
    --danger-light: #FECACA;

    /* Typography */
    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Sizing */
    --container: 1200px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-dark-bg: rgba(30, 41, 59, 0.8);
    --glass-dark-border: rgba(255, 255, 255, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--white);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--gray-900);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
}

h2 {
    font-size: clamp(1.875rem, 4vw, 2.75rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
}

h4 {
    font-size: 1.25rem;
}

p {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 65ch;
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md), 0 0 0 0 var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
    background: var(--gray-900);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-800);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--gray-900);
    border: 2px solid var(--gray-300);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

/* Section */
.section {
    padding: 100px 0;
}

.section-dark {
    background: var(--gradient-hero);
    color: var(--white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3 {
    color: var(--white);
}

.section-dark p {
    color: var(--gray-400);
}

/* Glass Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.glass-card-dark {
    background: var(--glass-dark-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-dark-border);
    border-radius: var(--radius-xl);
}

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 40px;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-900);
    z-index: 1001;
}

.nav-logo svg {
    width: 36px;
    height: 36px;
}

.nav-links {
    display: flex;
    gap: 8px;
    height: 100%;
    align-items: center;
}

.nav-item {
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 16px;
}

.nav-links>a,
.nav-item>a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.nav-links>a:hover,
.nav-item:hover>a {
    color: var(--gray-900);
}

/* Mega Menu */
.mega-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 60px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.nav-item:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 60px;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.mega-menu-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 24px;
}

.mega-menu-list {
    display: flex;
    flex-direction: column;
}

.mega-menu-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: var(--gray-900);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    text-decoration: none;
}

.mega-menu-link:hover {
    background: var(--gray-100);
}

.mega-menu-link.active {
    background: var(--gray-900);
    color: var(--white);
}

.mega-menu-link svg {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    transition: transform var(--transition-fast);
}

.mega-menu-link:hover svg {
    transform: translateX(4px);
    opacity: 1;
}

.mega-menu-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}

.service-item {
    display: block;
    padding: 12px 0;
    color: var(--gray-600);
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition-fast);
}

.service-item:hover {
    color: var(--accent);
    padding-left: 8px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--gradient-hero);
    padding: 140px 40px 100px;
    position: relative;
    overflow: hidden;
}

/* Wave Background */
.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 1440 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23FAFAFA' d='M0,100 C360,200 720,0 1080,100 C1260,150 1380,50 1440,100 L1440,200 L0,200 Z'/%3E%3C/svg%3E") no-repeat bottom;
    background-size: cover;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    /* Expanded for ultra-wide look */
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glass-dark-bg);
    border: 1px solid var(--glass-dark-border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    margin-bottom: 24px;
}

.hero-badge span {
    font-size: 0.875rem;
    color: var(--gray-300);
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.hero h1 {
    color: var(--white);
    margin-bottom: 24px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gray-400);
    margin-bottom: 40px;
    max-width: 600px;
}

/* Scanner Box */
.scanner-box {
    background: rgba(255, 255, 255, 0.85);
    /* Apple Glass Base */
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    padding: 32px 48px;
    /* Significantly more compact */
    max-width: 1200px;
    /* Ultra-wide presence */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), var(--shadow-glow);
    margin-top: 24px;
}

.scanner-input-group {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .scanner-box {
        padding: 32px 20px 24px;
        /* More compact on mobile */
        max-width: 100%;
    }

    .scanner-input-group {
        flex-direction: column;
    }

    .scanner-hint {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        font-size: 0.875rem;
        flex-wrap: nowrap;
        white-space: normal;
    }

    .scanner-hint span {
        flex-shrink: 0;
        text-align: left;
    }

    /* Hide separator dots on mobile when stacked */
    .scanner-hint span:nth-child(even) {
        display: none;
    }
}

.scanner-input {
    flex: 1;
    padding: 20px 24px;
    font-size: 1.125rem;
    font-family: var(--font-body);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
    background: var(--gray-50);
}

.scanner-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 5px var(--accent-glow);
}

.scanner-input::placeholder {
    color: var(--gray-400);
}

.scanner-hint {
    font-size: 0.9375rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 24px;
    /* Slightly larger gap for clarity in single line */
    flex-wrap: nowrap;
    /* Force single line on desktop */
}

.scanner-hint span {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    /* Prevent text wrapping within hints */
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 60px;
    position: relative;
    z-index: 2;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 36px;
    transition: var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-light);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--white);
    font-size: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 1rem;
    color: var(--gray-600);
}

/* CTA Section */
.cta-section {
    padding: 120px 40px;
    background: var(--gradient-hero);
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--gray-400);
    margin: 0 auto 40px;
    max-width: 500px;
}

/* Footer */
.footer {
    padding: 80px 40px 40px;
    background: var(--gray-900);
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 0.9375rem;
    color: var(--gray-400);
    max-width: 300px;
}

.footer-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 0.9375rem;
    color: var(--gray-400);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid var(--gray-800);
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--gradient-hero);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-base);
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--gray-700);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 24px;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--white);
}

.loading-progress {
    width: 280px;
    height: 4px;
    background: var(--gray-800);
    border-radius: var(--radius-full);
    margin-top: 16px;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.3s ease;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero {
        padding: 120px 24px 80px;
    }

    .scanner-input-group {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}