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

:root {
    /* Pro Dark Color System - Linear Inspired */
    --bg-primary: #0d0d0f;
    --bg-secondary: #131316;
    --bg-tertiary: #1a1a1e;
    --bg-quaternary: #222226;
    --bg-overlay: rgba(13, 13, 15, 0.8);
    
    --border-primary: rgba(255, 255, 255, 0.08);
    --border-secondary: rgba(255, 255, 255, 0.12);
    --border-focus: rgba(99, 102, 241, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    --text-quaternary: rgba(255, 255, 255, 0.3);
    
    --primary: #6366f1;
    --primary-hover: #5856eb;
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --accent: #8b5cf6;
    --accent-light: rgba(139, 92, 246, 0.1);
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Typography */
    --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --space-32: 8rem;
    
    /* Border Radius */
    --radius-1: 0.125rem;
    --radius-2: 0.25rem;
    --radius-3: 0.375rem;
    --radius-4: 0.5rem;
    --radius-6: 0.75rem;
    --radius-8: 1rem;
    --radius-12: 1.5rem;
    --radius-full: 9999px;
    
    /* Animation Durations */
    --duration-instant: 0ms;
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
    --duration-slower: 750ms;
    --duration-slowest: 1000ms;
    
    /* Advanced Easing Functions */
    --ease-linear: linear;
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-elastic: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.05), 0 1px 2px rgba(99, 102, 241, 0.2);
    --shadow-glow-lg: 0 0 0 1px rgba(99, 102, 241, 0.1), 0 10px 30px rgba(99, 102, 241, 0.3);
}

/* Base Styles */
html {
    font-size: 16px;
    line-height: 1.5;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Advanced Background Effects */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: -1;
}

/* Enhanced Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: 1000;
    background: rgba(13, 13, 15, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-primary);
    transition: all var(--duration-normal) var(--ease-out);
    will-change: transform, background-color;
}

.header.scrolled {
    background: rgba(13, 13, 15, 0.95);
    border-bottom-color: var(--border-secondary);
    box-shadow: var(--shadow-lg);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    position: relative;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    transition: all var(--duration-normal) var(--ease-out);
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    transition: width var(--duration-normal) var(--ease-out);
}

.logo:hover::after {
    width: 100%;
}

/* Advanced Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-6);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
    user-select: none;
    outline: none;
    will-change: transform, box-shadow;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--duration-slow) var(--ease-out);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    box-shadow: var(--shadow-glow);
    transform: translateY(0);
}

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

.btn-primary:active {
    transform: translateY(-1px);
    transition-duration: var(--duration-fast);
}

.btn-secondary {
    background: var(--bg-tertiary);
    border-color: var(--border-primary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-quaternary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-24) var(--space-6) var(--space-16);
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 60%;
    background: radial-gradient(ellipse 60% 40% at 50% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
    z-index: -1;
}

.hero-content {
    max-width: 900px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-8);
    opacity: 0;
    animation: slideInUp var(--duration-slower) var(--ease-spring) 0.2s forwards;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-6);
    opacity: 0;
    animation: slideInUp var(--duration-slower) var(--ease-spring) 0.4s forwards;
}

.hero-highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-10);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: slideInUp var(--duration-slower) var(--ease-spring) 0.6s forwards;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: center;
    margin-bottom: var(--space-8);
    opacity: 0;
    animation: slideInUp var(--duration-slower) var(--ease-spring) 0.8s forwards;
}

.hero-note {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-style: italic;
    opacity: 0;
    animation: slideInUp var(--duration-slower) var(--ease-spring) 1s forwards;
}

/* Advanced Section Styling */
.section {
    padding: var(--space-24) var(--space-6);
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Advanced Card System */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-8);
    padding: var(--space-8);
    position: relative;
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-out);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--border-secondary);
    box-shadow: var(--shadow-xl);
}

.card:hover::before {
    opacity: 1;
}

/* Keyframe Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: var(--shadow-glow);
    }
    50% {
        box-shadow: var(--shadow-glow-lg);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Scroll-triggered animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: all var(--duration-slower) var(--ease-spring);
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.animate-on-scroll.slide-left {
    transform: translateX(-40px);
}

.animate-on-scroll.slide-left.animate-in {
    transform: translateX(0);
}

.animate-on-scroll.slide-right {
    transform: translateX(40px);
}

.animate-on-scroll.slide-right.animate-in {
    transform: translateX(0);
}

/* Enhanced Media Queries */
@media (min-width: 768px) {
    .hero-actions {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    /* Mobile Navigation */
    .nav {
        padding: 0 var(--space-4);
        height: 56px;
    }
    
    .header {
        height: 56px;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    /* Mobile Hero */
    .hero {
        padding: var(--space-20) var(--space-4) var(--space-12);
        min-height: 85vh;
    }
    
    .hero::before {
        width: 100%;
        height: 80%;
        top: 10%;
    }
    
    /* Mobile Sections */
    .section {
        padding: var(--space-16) var(--space-4);
    }
    
    /* Mobile Buttons */
    .btn {
        width: 100%;
        max-width: 320px;
        font-size: 1rem;
        padding: var(--space-4) var(--space-6);
    }
    
    .btn-lg {
        padding: var(--space-4) var(--space-7);
        font-size: 1.1rem;
    }
    
    .btn-xl {
        padding: var(--space-5) var(--space-8);
        font-size: 1.125rem;
    }
    
    /* Mobile Cards */
    .card {
        padding: var(--space-6);
    }
    
    /* Mobile Animations - Reduce motion for better performance */
    .animate-on-scroll {
        transform: translateY(20px);
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .nav {
        padding: 0 var(--space-3);
    }
    
    .logo {
        font-size: 1.125rem;
    }
    
    .hero {
        padding: var(--space-16) var(--space-3) var(--space-10);
        min-height: 80vh;
    }
    
    .section {
        padding: var(--space-12) var(--space-3);
    }
    
    .btn {
        max-width: 100%;
        font-size: 0.95rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 48px; /* Minimum touch target size */
    }
    
    .email-input {
        min-height: 48px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Disable hover effects on touch devices */
    .card:hover,
    .btn:hover,
    .pain-card:hover,
    .bonus-card:hover {
        transform: none !important;
    }
    
    /* Better tap targets */
    .outcome-card,
    .pain-card,
    .step-card {
        min-height: 48px;
        padding: var(--space-4);
    }
}