/* Custom CSS Variables */
:root {
    /* Brand Colors */
    --color-sage-bg: #D9E0D9;
    --color-sage-card: #EDF2ED;
    --color-sage-surface: #D8DFD8;
    --color-sage-primary: #8A9B8A;
    --color-sage-text: #2D332D;
    --color-sage-nav: rgba(226, 232, 226, 0.94);
    
    /* Spacing */
    --space-unit: 1rem;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Shadows */
    --shadow-soft: 0 4px 20px rgba(45, 51, 45, 0.08);
    --shadow-hover: 0 8px 30px rgba(45, 51, 45, 0.12);
    --shadow-phone: 0 20px 40px rgba(45, 51, 45, 0.15);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--color-sage-primary) 0%, #7a8a7a 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

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

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

.btn-secondary {
    background: var(--color-sage-card);
    color: var(--color-sage-text);
    border: 2px solid var(--color-sage-surface);
    box-shadow: var(--shadow-soft);
}

.btn-secondary:not(:disabled):hover {
    background: var(--color-sage-surface);
    transform: translateY(-1px);
}

/* Phone Mockup Styles */
.phone-mockup {
    transform: perspective(1000px) rotateY(-5deg) rotateX(2deg);
    transition: var(--transition-smooth);
}

.phone-mockup:hover {
    transform: perspective(1000px) rotateY(-2deg) rotateX(1deg) translateY(-10px);
}

/* iPhone 17 Frame - Light Titanium */
.phone-frame {
    position: relative;
    width: 280px;
    height: 580px;
    background: linear-gradient(145deg, #F5F5F0, #E8E8E3, #F0F0EB);
    border-radius: 52px;
    padding: 12px;
    box-shadow: 
        0 25px 60px rgba(0,0,0,0.15),
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.6),
        inset 0 -1px 0 rgba(0,0,0,0.05);
}

.phone-frame::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 28px;
    background: #1a1a1a;
    border-radius: 20px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 42px;
    overflow: hidden;
    background: #000;
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Small phone frames for showcase */
.phone-frame-small {
    position: relative;
    width: 180px;
    height: 380px;
    background: linear-gradient(145deg, #F5F5F0, #E8E8E3, #F0F0EB);
    border-radius: 34px;
    padding: 8px;
    box-shadow: 
        0 15px 40px rgba(0,0,0,0.12),
        0 4px 12px rgba(0,0,0,0.08),
        inset 0 1px 0 rgba(255,255,255,0.6);
    transition: var(--transition-smooth);
}

.phone-frame-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(45, 51, 45, 0.15);
}

.phone-frame-small::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 18px;
    background: #1a1a1a;
    border-radius: 14px;
    z-index: 10;
}

.phone-screen-small {
    width: 100%;
    height: 100%;
    border-radius: 27px;
    overflow: hidden;
    background: #000;
}

.phone-screen-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

/* Feature Card Animations */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(138, 155, 138, 0.05) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.feature-icon {
    position: relative;
    transition: var(--transition-bounce);
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* Floating Particles Animation */
.floating-particles {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.floating-particles::before,
.floating-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-sage-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 8s infinite ease-in-out;
}

.floating-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-particles::after {
    top: 60%;
    right: 15%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.2;
    }
    25% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-10px) translateX(-5px);
        opacity: 0.7;
    }
    75% {
        transform: translateY(-30px) translateX(15px);
        opacity: 0.4;
    }
}

/* Scroll Indicator Animation */
.scroll-indicator {
    animation: breathe 3s infinite ease-in-out;
}

@keyframes breathe {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

.scroll-arrow {
    color: var(--color-sage-primary);
}

/* Journey Timeline Animations */
.journey-timeline {
    min-height: 400px;
}

.journey-vine-animated {
    transform-origin: left center;
}

.journey-phase.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.journey-phase-mobile.animate-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Showcase Scroll Styles */
.showcase-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.showcase-item {
    min-width: 200px;
}

/* Trust Badge Styles */
.trust-badge {
    transition: var(--transition-smooth);
    border: 1px solid var(--color-sage-surface);
}

.trust-badge:hover {
    background: var(--color-sage-surface);
    transform: translateY(-1px);
}

/* Intersection Observer Fade In */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Parallax Effect */
.parallax {
    transform: translateY(0);
    transition: transform 0.1s ease-out;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .phone-mockup {
        transform: none !important;
    }
    
    .feature-card {
        transform: none !important;
    }
    
    .floating-particles::before,
    .floating-particles::after {
        animation: none;
        display: none;
    }
}

/* Focus Styles for Accessibility */
button:focus,
a:focus {
    outline: 2px solid var(--color-sage-primary);
    outline-offset: 2px;
}

.btn-primary:focus {
    outline-color: white;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .feature-card {
        border: 2px solid var(--color-sage-primary);
    }
    
    .phone-frame {
        border: 2px solid var(--color-sage-text);
    }
}

/* Dark Mode Support (for system preferences) */
@media (prefers-color-scheme: dark) {
    /* Keep light mode as specified, but add subtle adjustments */
    .phone-frame {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
    
    .feature-card {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Custom Utilities */
.text-balance {
    text-wrap: balance;
}

.container-fluid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container-fluid {
        padding: 0 2rem;
    }
}

@media (min-width: 1024px) {
    .container-fluid {
        padding: 0 3rem;
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    .phone-mockup {
        transform: translateZ(0);
    }
}

/* Performance optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Print styles */
@media print {
    .phone-mockup {
        transform: none !important;
    }
    
    .floating-particles {
        display: none;
    }
    
    nav {
        position: static !important;
    }
    
    section {
        break-inside: avoid;
    }
}