/* ==========================================================================
   BUILT LANDING PAGE STYLES
   Modern, semantic, performance-optimized stylesheet
   ========================================================================== */

/* ==========================================================================
   CSS VARIABLES & DESIGN TOKENS
   ========================================================================== */

:root {
    /* Colors */
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-primary-light: #3b82f6;
    --color-accent: #f59e0b;
    --color-accent-dark: #d97706;
    
    --color-background: #ffffff;
    --color-surface: #f9fafb;
    --color-surface-elevated: #ffffff;
    
    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
    --color-text-tertiary: #9ca3af;
    
    --color-border: #e5e7eb;
    --color-border-subtle: #f3f4f6;
    
    /* Recovery heatmap colors (matching app) */
    --color-recovery-low: #ef4444;
    --color-recovery-medium: #f97316;
    --color-recovery-high: #84cc16;
    --color-recovery-full: #d1d5db;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
    
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Layout */
    --container-max-width: 1200px;
    --container-padding: 1.5rem;
    
    /* Effects */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Dark mode support (optional progressive enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0f172a;
        --color-surface: #1e293b;
        --color-surface-elevated: #334155;
        
        --color-text-primary: #f1f5f9;
        --color-text-secondary: #cbd5e1;
        --color-text-tertiary: #94a3b8;
        
        --color-border: #334155;
        --color-border-subtle: #1e293b;
    }
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-background);
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
}

p {
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: 600;
    color: var(--color-text-primary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

ul, ol {
    margin-left: var(--space-lg);
}

li {
    margin-bottom: var(--space-sm);
    line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

.container {
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
    padding: var(--space-4xl) 0;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-background) 100%);
    border-bottom: 1px solid var(--color-border-subtle);
}

.hero-section .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

@media (min-width: 768px) {
    .hero-section .container {
        grid-template-columns: 1.2fr 1fr;
    }
}

.hero-content {
    max-width: 650px;
}

.hero-title {
    font-size: var(--font-size-4xl);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-xl);
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: var(--font-size-5xl);
    }
}

.hero-subtitle {
    font-size: var(--font-size-xl);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.hero-question {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text-primary);
    padding: var(--space-lg);
    background: var(--color-surface);
    border-left: 4px solid var(--color-accent);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-align: center;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-size-lg);
}

.btn-large .btn-icon {
    width: 24px;
    height: 24px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover {
    background-color: var(--color-surface);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ==========================================================================
   PHONE MOCKUP
   ========================================================================== */

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-mockup {
    position: relative;
    width: 100%;
    max-width: 340px;
    aspect-ratio: 9 / 19.5;
    background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: var(--space-xl);
    padding: var(--space-md);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    overflow: hidden;
}

.hero-app-screenshot,
.hero-app-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: var(--space-md);
    display: block;
}

/* Hide content visually but keep for screen readers/SEO */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Typewriter effect styling */
.typing-active::after {
    content: '|';
    animation: blink 0.7s infinite;
    margin-left: 2px;
}

.typing-complete::after {
    content: '';
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Legacy phone-screen class (for backwards compatibility) */
.phone-screen {
    width: 100%;
    height: 100%;
    background-color: var(--color-surface);
    border-radius: var(--space-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   FEATURE SECTIONS
   ========================================================================== */

.feature-section {
    padding: var(--space-4xl) 0;
    border-bottom: 1px solid var(--color-border-subtle);
}

.feature-section:nth-child(even) {
    background-color: var(--color-surface);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-3xl);
}

.section-intro {
    font-size: var(--font-size-xl);
    color: var(--color-text-secondary);
}

.feature-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

@media (min-width: 768px) {
    .feature-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .feature-content.reverse {
        direction: rtl;
    }
    
    .feature-content.reverse > * {
        direction: ltr;
    }
}

.feature-text {
    max-width: 600px;
}

.feature-list {
    list-style: none;
    margin-left: 0;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.feature-list li {
    padding-left: var(--space-xl);
    position: relative;
    margin-bottom: var(--space-lg);
    color: var(--color-text-secondary);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--font-size-xl);
}

.feature-insight {
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-md);
}

.comparison-box {
    padding: var(--space-xl);
    background-color: var(--color-surface-elevated);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-top: var(--space-xl);
}

.comparison-box p {
    color: var(--color-text-primary);
}

.comparison-box p:first-child {
    font-weight: 600;
    font-size: var(--font-size-lg);
}

/* ==========================================================================
   VISUAL CARDS / PLACEHOLDERS
   ========================================================================== */

.feature-visuals {
    display: grid;
    gap: var(--space-lg);
}

.visual-card {
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Recovery video container - flexible aspect ratio */
.recovery-video-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.recovery-video-container:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.recovery-demo-video {
    width: 100%;
    height: auto;
    display: block;
    background-color: #000;
}

.video-fallback {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--color-text-secondary);
}

/* Specific visual card types */
.recovery-heatmap {
    background: linear-gradient(135deg, 
        var(--color-recovery-low) 0%, 
        var(--color-recovery-medium) 50%, 
        var(--color-recovery-full) 100%
    );
}

.ai-chat-interface {
    background: linear-gradient(135deg, 
        var(--color-primary-light) 0%, 
        var(--color-primary) 100%
    );
}

.social-feed {
    background: linear-gradient(135deg, 
        var(--color-accent) 0%, 
        var(--color-accent-dark) 100%
    );
}

.placeholder-content {
    text-align: center;
    padding: var(--space-xl);
}

.placeholder-label {
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    opacity: 0.9;
    margin-bottom: var(--space-sm);
}

.placeholder-text {
    font-size: var(--font-size-sm);
    color: white;
    opacity: 0.8;
    line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   FAQ SECTION
   ========================================================================== */

.faq-section {
    padding: var(--space-4xl) 0;
    background-color: var(--color-surface);
}

.faq-section h2 {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: var(--color-surface-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.faq-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.faq-item h3 {
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

.faq-item p {
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

/* ==========================================================================
   DOWNLOAD CTA SECTION
   ========================================================================== */

.download-cta-section {
    padding: var(--space-4xl) 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    text-align: center;
}

.download-cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.download-cta-section h2 {
    color: white;
    margin-bottom: var(--space-md);
}

.download-cta-section p {
    color: rgba(255, 255, 255, 0.9);
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-xl);
}

.download-note {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--space-md);
    margin-bottom: 0;
}

.download-cta-section .btn-primary {
    background-color: white;
    color: var(--color-primary);
}

.download-cta-section .btn-primary:hover {
    background-color: var(--color-surface);
    color: var(--color-primary-dark);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    padding: var(--space-3xl) 0;
    text-align: center;
    background-color: var(--color-text-primary);
    color: var(--color-surface);
}

.footer-brand {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-sm);
}

.footer-year {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-lg);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    flex-wrap: wrap;
    margin-top: var(--space-lg);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

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

/* Intersection Observer animation classes (added via JS) */
[data-animation="fade-in-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
}

[data-animation="fade-in-up"].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   RESPONSIVE TYPOGRAPHY
   ========================================================================== */

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 2rem;
        --font-size-5xl: 2.5rem;
    }
    
    h1 {
        font-size: var(--font-size-3xl);
    }
    
    h2 {
        font-size: var(--font-size-2xl);
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .hero-visual,
    .feature-visuals,
    .btn {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
}
