/* ============================================
   UpWise Landing Page Styles
   Based on iOS App Design System
   ============================================ */

/* ============================================
   CSS Variables - Matching DesignSystem.swift
   ============================================ */
:root {
    /* Premium Colors - Dark Theme */
    --color-background: rgb(20, 15, 13);
    --color-secondary-bg: rgb(31, 26, 20);
    --color-card-bg: rgb(38, 33, 28);
    --color-primary-text: rgb(242, 230, 217);
    --color-secondary-text: rgb(204, 191, 179);
    --color-tertiary-text: rgb(166, 153, 140);
    
    /* Rose Gold Accent */
    --color-accent: rgb(217, 178, 153);
    --color-accent-light: rgb(230, 195, 173);
    --color-accent-dark: rgb(204, 161, 133);
    
    /* Semantic Colors */
    --color-success: rgb(153, 191, 140);
    --color-warning: rgb(230, 191, 128);
    --color-error: rgb(217, 153, 153);
    
    /* Gradient */
    --gradient-primary: linear-gradient(135deg, 
        rgb(242, 217, 191) 0%, 
        rgb(230, 191, 166) 50%, 
        rgb(217, 178, 153) 100%);
    
    /* Spacing (8pt scale) */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    --space-xxxl: 80px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Typography */
    --font-serif: 'Instrument Serif', 'Georgia', serif;
    --font-sans: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Shadows */
    --shadow-card: 0 12px 24px rgba(0, 0, 0, 0.3);
    --shadow-button: 0 6px 12px rgba(0, 0, 0, 0.2);
    --shadow-overlay: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Reset & Base Styles
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-background);
    color: var(--color-primary-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Container
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ============================================
   Scroll Progress Indicator
   ============================================ */
.scroll-progress {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(217, 178, 153, 0.2);
    border-radius: 2px;
}

.progress-sections {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    position: relative;
    z-index: 1;
}

.progress-dot {
    position: relative;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(217, 178, 153, 0.3);
    border: 2px solid rgba(217, 178, 153, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.progress-dot:hover {
    transform: scale(1.3);
    background: rgba(217, 178, 153, 0.5);
    border-color: var(--color-accent);
}

.progress-dot.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 12px rgba(217, 178, 153, 0.5);
    transform: scale(1.3);
}

.progress-label {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: rgba(31, 26, 20, 0.95);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--color-secondary-text);
    border: 1px solid rgba(217, 178, 153, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.progress-dot:hover .progress-label,
.progress-dot.active .progress-label {
    opacity: 1;
}

/* Transform to horizontal on mobile/tablet */
@media (max-width: 1024px) {
    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); /* Space for horizontal progress bar + safe area */
    }
    
    .scroll-progress {
        right: auto;
        left: 0;
        top: auto;
        bottom: env(safe-area-inset-bottom, 0px);
        transform: none;
        width: 100%;
        padding: calc(var(--space-sm) + env(safe-area-inset-top, 0px)) calc(var(--space-md) + env(safe-area-inset-right, 0px)) calc(var(--space-sm) + env(safe-area-inset-bottom, 20px)) calc(var(--space-md) + env(safe-area-inset-left, 0px));
        background: rgba(31, 26, 20, 0.95);
        backdrop-filter: blur(20px);
        border-top: 1px solid rgba(217, 178, 153, 0.1);
        z-index: 9998; /* Below modals but above everything else */
    }
    
    .progress-line {
        top: auto;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 2px;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .progress-sections {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
        gap: var(--space-sm);
    }
    
    .progress-dot {
        width: 10px;
        height: 10px;
    }
    
    .progress-dot.active {
        transform: scale(1.2);
    }
    
    .progress-dot:hover {
        transform: scale(1.2);
    }
    
    .progress-label {
        right: auto;
        bottom: calc(100% + 8px);
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* ============================================
   Navigation
   ============================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(31, 26, 20, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(217, 178, 153, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) 0;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.nav-link {
    color: var(--color-secondary-text);
    font-size: 16px;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--color-accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.cta-link {
    color: var(--color-accent);
}

/* App Store Badge - Navigation */
.appstore-link-nav {
    display: inline-block;
    transition: all 0.3s ease;
}

.appstore-badge-nav {
    height: 50px;
    width: auto;
    transition: all 0.3s ease;
}

.appstore-link-nav:hover .appstore-badge-nav {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--color-accent);
    transition: all 0.3s ease;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    overflow: hidden;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, 
        rgba(217, 178, 153, 0.15) 0%, 
        rgba(217, 178, 153, 0.05) 40%, 
        transparent 70%);
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.8; transform: translateX(-50%) scale(1.1); }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(217, 178, 153, 0.1);
    border: 1px solid rgba(217, 178, 153, 0.2);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-accent);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.6s ease-out;
}

.badge-icon {
    font-size: 18px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(40px, 8vw, 72px);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

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

.hero-description {
    font-size: 20px;
    line-height: 1.8;
    color: var(--color-secondary-text);
    margin-bottom: var(--space-xxl);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-xxl);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

/* App Store Badge - Hero */
.appstore-link-hero {
    display: inline-block;
    transition: all 0.3s ease;
}

.appstore-badge-hero {
    height: 80px;
    width: auto;
    transition: all 0.3s ease;
}

.appstore-link-hero:hover .appstore-badge-hero {
    transform: translateY(-4px);
    filter: brightness(1.1);
}

.hero-stats {
    display: flex;
    gap: var(--space-xxl);
    justify-content: center;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

.stat {
    text-align: center;
}

.stat-number {
    font-family: var(--font-serif);
    font-size: 48px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 14px;
    color: var(--color-tertiary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-background);
    box-shadow: var(--shadow-button);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(217, 178, 153, 0.3);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-secondary:hover {
    background: rgba(217, 178, 153, 0.1);
    transform: translateY(-2px);
}

/* ============================================
   Sections
   ============================================ */
section {
    padding: var(--space-xxxl) 0;
    position: relative;
}

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

.section-badge {
    display: inline-block;
    padding: var(--space-sm) var(--space-lg);
    background: rgba(217, 178, 153, 0.1);
    border: 1px solid rgba(217, 178, 153, 0.2);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
}

.section-description {
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-secondary-text);
}

/* ============================================
   AI Analysis Section
   ============================================ */
.ai-section {
    background: linear-gradient(180deg, 
        var(--color-background) 0%, 
        var(--color-secondary-bg) 100%);
}

.ai-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xxl);
}

.ai-feature-card {
    background: var(--color-card-bg);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 0.3s ease;
}

.ai-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 178, 153, 0.3);
    box-shadow: var(--shadow-card);
}

.ai-feature-icon {
    margin-bottom: var(--space-lg);
}

.ai-feature-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-primary-text);
}

.ai-feature-description {
    color: var(--color-secondary-text);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.ai-feature-tech {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.tech-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(217, 178, 153, 0.15);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-accent);
}

/* Pipeline */
.ai-pipeline {
    background: var(--color-card-bg);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xxl);
    margin-top: var(--space-xxl);
}

.pipeline-title {
    font-family: var(--font-serif);
    font-size: 28px;
    text-align: center;
    margin-bottom: var(--space-xl);
    color: var(--color-primary-text);
}

.pipeline-flow {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--space-lg);
    overflow-x: auto;
    padding-bottom: var(--space-md);
    padding-top: var(--space-md);
}

.pipeline-step {
    flex: 1 1 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    background: var(--color-secondary-bg);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all 0.3s ease;
}

.pipeline-step-final {
    background: linear-gradient(135deg, 
        rgba(217, 178, 153, 0.08) 0%, 
        rgba(217, 178, 153, 0.04) 100%);
    border: 2px solid rgba(217, 178, 153, 0.3);
    box-shadow: 0 4px 16px rgba(217, 178, 153, 0.2),
                0 0 16px rgba(217, 178, 153, 0.12);
}

.pipeline-step-final:hover {
    border-color: rgba(217, 178, 153, 0.5);
    box-shadow: 0 8px 24px rgba(217, 178, 153, 0.25),
                0 0 24px rgba(217, 178, 153, 0.18);
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: var(--color-background);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.pipeline-step-final .step-number {
    background: var(--gradient-primary);
    box-shadow: 0 4px 12px rgba(217, 178, 153, 0.4),
                0 0 20px rgba(217, 178, 153, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(217, 178, 153, 0.4),
                    0 0 20px rgba(217, 178, 153, 0.2);
    }
    50% {
        box-shadow: 0 4px 16px rgba(217, 178, 153, 0.6),
                    0 0 30px rgba(217, 178, 153, 0.3);
    }
}

.step-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--color-primary-text);
}

.step-content p {
    font-size: 14px;
    color: var(--color-tertiary-text);
    line-height: 1.6;
}

.pipeline-arrow {
    color: var(--color-accent);
    font-size: 32px;
    flex-shrink: 0;
}

/* ============================================
   Features Section
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--color-card-bg);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 178, 153, 0.3);
    box-shadow: var(--shadow-card);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: var(--space-lg);
}

.feature-title {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-primary-text);
}

.feature-description {
    color: var(--color-secondary-text);
    line-height: 1.7;
}

/* ============================================
   Exercises Section
   ============================================ */
.exercises-section {
    background: var(--color-secondary-bg);
}

/* Viewport container - shows only 1.85 rows */
.exercises-viewport {
    height: 750px;
    overflow: hidden;
    position: relative;
    margin-bottom: var(--space-xxl);
}

/* Fade effect at bottom of viewport */
.exercises-viewport::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, transparent, var(--color-secondary-bg));
    pointer-events: none;
    z-index: 10;
}

/* Grid with auto-scroll animation */
.exercises-grid {
    columns: 4;
    column-gap: var(--space-lg);
    animation: autoScroll 40s ease-in-out infinite;
}

/* Auto-scroll animation - smooth up and down */
@keyframes autoScroll {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-50%);
    }
    100% {
        transform: translateY(0);
    }
}

@media (max-width: 1200px) {
    .exercises-grid {
        columns: 3;
    }
    .exercises-viewport {
        height: 700px;
    }
}

@media (max-width: 900px) {
    .exercises-grid {
        columns: 2;
    }
    .exercises-viewport {
        height: 650px;
    }
}

@media (max-width: 600px) {
    .exercises-grid {
        columns: 1;
    }
    .exercises-viewport {
        height: 600px;
    }
}

.exercise-card {
    background: #ffffff;
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out calc(var(--delay) * 0.1s) both;
    display: inline-block;
    width: 100%;
    margin-bottom: var(--space-lg);
    break-inside: avoid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.exercise-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.exercise-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: block;
    background: #ffffff;
}

.exercise-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
}

/* Placeholder Gradients for exercises without images */
.placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding: var(--space-md);
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.placeholder-gradient-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.placeholder-gradient-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.placeholder-gradient-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.placeholder-gradient-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.placeholder-gradient-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.placeholder-gradient-6 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

.placeholder-gradient-7 {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.placeholder-gradient-8 {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6a88 100%);
}

.placeholder-gradient-9 {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.placeholder-gradient-10 {
    background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%);
}

.exercise-card:hover .exercise-image img {
    transform: scale(1.1);
}

.exercise-overlay {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    z-index: 1;
}

.exercise-difficulty {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(153, 191, 140, 0.9);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-background);
    text-transform: uppercase;
    backdrop-filter: blur(10px);
}

.exercise-difficulty.hard {
    background: rgba(230, 191, 128, 0.9);
}

.exercise-info {
    padding: var(--space-lg);
}

.exercise-name {
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: #1a1a1a;
}

.exercise-tags {
    font-size: 14px;
    color: #666666;
}

.exercises-cta {
    text-align: center;
    margin-top: var(--space-xxl);
}

.exercises-cta-text {
    font-size: 20px;
    color: var(--color-secondary-text);
    margin-bottom: var(--space-lg);
}

/* ============================================
   Routines Section
   ============================================ */
.routines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.routine-card {
    background: var(--color-card-bg);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    transition: all 0.3s ease;
}

.routine-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 178, 153, 0.3);
    box-shadow: var(--shadow-card);
}

.routine-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.routine-icon {
    font-size: 32px;
}

.routine-category {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.routine-name {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-primary-text);
}

.routine-description {
    color: var(--color-secondary-text);
    line-height: 1.7;
    margin-bottom: var(--space-lg);
}

.routine-meta {
    display: flex;
    gap: var(--space-lg);
    font-size: 14px;
    color: var(--color-tertiary-text);
}

/* ============================================
   Download Section
   ============================================ */
.download-section {
    background: linear-gradient(180deg, 
        var(--color-secondary-bg) 0%, 
        var(--color-background) 100%);
    text-align: center;
}

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

.download-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    background: rgba(153, 191, 140, 0.1);
    border: 1px solid rgba(153, 191, 140, 0.2);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-success);
    margin-bottom: var(--space-lg);
}

.download-title {
    font-family: var(--font-serif);
    font-size: clamp(40px, 6vw, 56px);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-lg);
}

.download-description {
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-secondary-text);
    margin-bottom: var(--space-xl);
}

.waitlist-form {
    display: flex;
    gap: var(--space-md);
    max-width: 500px;
    margin: 0 auto var(--space-lg);
}

.waitlist-input {
    flex: 1;
    padding: 16px 24px;
    background: var(--color-card-bg);
    border: 1px solid rgba(217, 178, 153, 0.2);
    border-radius: var(--radius-lg);
    color: var(--color-primary-text);
    font-size: 16px;
    transition: all 0.3s ease;
}

.waitlist-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(217, 178, 153, 0.1);
}

.waitlist-input::placeholder {
    color: var(--color-tertiary-text);
}

.download-note {
    font-size: 14px;
    color: var(--color-tertiary-text);
}

/* App Store Badge - Download Section */
.download-appstore {
    margin: var(--space-xxl) 0;
}

.appstore-link-download {
    display: inline-block;
    transition: all 0.3s ease;
}

.appstore-badge-download {
    height: 90px;
    width: auto;
    transition: all 0.3s ease;
}

.appstore-link-download:hover .appstore-badge-download {
    transform: translateY(-4px);
    filter: brightness(1.1);
}

/* Download Divider */
.download-divider {
    position: relative;
    margin: var(--space-xxl) 0;
    text-align: center;
}

.download-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(217, 178, 153, 0.2);
    transform: translateY(-50%);
}

.download-divider span {
    position: relative;
    display: inline-block;
    padding: 0 var(--space-lg);
    background: var(--color-background);
    color: var(--color-tertiary-text);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Updates Section */
.updates-section {
    margin: var(--space-xl) 0;
    padding: var(--space-xl);
    background: rgba(217, 178, 153, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(217, 178, 153, 0.1);
}

/* Updates section in hero section */
.hero-updates {
    margin: var(--space-lg) 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.updates-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-secondary-text);
    margin-bottom: var(--space-xl);
}

/* Completed State */
.updates-completed {
    text-align: center;
    padding: var(--space-lg) 0;
}

.completed-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-lg);
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--color-background);
    font-weight: bold;
    animation: checkmark 0.6s ease-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.completed-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin-bottom: var(--space-md);
    font-family: var(--font-serif);
}

.completed-description {
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-secondary-text);
    margin: 0;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--color-secondary-bg);
    border-top: 1px solid rgba(217, 178, 153, 0.1);
    padding: var(--space-xxl) 0 var(--space-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--space-xxl);
    margin-bottom: var(--space-xxl);
}

.footer-brand {
    max-width: 300px;
}

.footer-tagline {
    color: var(--color-secondary-text);
    margin-top: var(--space-md);
}

.footer-heading {
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--color-primary-text);
}

.footer-link {
    display: block;
    color: var(--color-secondary-text);
    margin-bottom: var(--space-sm);
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-accent);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(217, 178, 153, 0.1);
}

.footer-copyright {
    color: var(--color-tertiary-text);
    font-size: 14px;
}

.footer-legal {
    display: flex;
    gap: var(--space-lg);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero {
        min-height: auto;
        padding: 120px 0 60px;
    }
    
    .hero-actions {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--space-sm);
    }
    
    .appstore-badge-hero {
        height: 50px;
    }
    
    .btn-secondary {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .hero-stats {
        gap: var(--space-lg);
    }
    
    .ai-features {
        grid-template-columns: 1fr;
    }
    
    .pipeline-flow {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pipeline-arrow {
        transform: rotate(90deg);
    }
    
    .waitlist-form {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 36px;
    }
    
    .section-title {
        font-size: 32px;
    }
    
    .stat-number {
        font-size: 36px;
    }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   Utilities
   ============================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--color-background);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10001;
    animation: slideUp 0.4s ease;
}

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

.modal-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    width: 40px;
    height: 40px;
    background: rgba(217, 178, 153, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--color-accent);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Mobile safe area for close button */
@media (max-width: 768px) {
    .modal-close {
        top: calc(var(--space-lg) + env(safe-area-inset-top, 0px) + 20px);
        right: calc(var(--space-lg) + env(safe-area-inset-right, 0px));
    }
}

.modal-close:hover {
    background: rgba(217, 178, 153, 0.2);
    transform: scale(1.1);
}

.modal-header {
    padding: var(--space-xxl) var(--space-xxl) var(--space-lg);
    border-bottom: 1px solid rgba(217, 178, 153, 0.1);
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin: 0;
}

.modal-body {
    padding: var(--space-xxl);
    line-height: 1.8;
}

.modal-body p {
    margin-bottom: var(--space-lg);
    color: var(--color-secondary-text);
}

.modal-body ul, .modal-body ol {
    margin: var(--space-md) 0 var(--space-lg) var(--space-lg);
    color: var(--color-secondary-text);
}

.modal-body li {
    margin-bottom: var(--space-sm);
    padding-left: var(--space-sm);
}

.modal-body a {
    color: var(--color-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(217, 178, 153, 0.3);
    transition: border-color 0.3s ease;
}

.modal-body a:hover {
    border-bottom-color: var(--color-accent);
}

.modal-section-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin: var(--space-xl) 0 var(--space-md);
}

.modal-section-title:first-child {
    margin-top: 0;
}

.modal-date,
.modal-intro {
    font-size: 16px;
    color: var(--color-tertiary-text);
    margin-bottom: var(--space-xl);
}

/* About Modal - Principles */
.modal-principles {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.principle-item {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(217, 178, 153, 0.05);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

.principle-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.principle-content h4 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin: 0 0 var(--space-sm);
}

.principle-content p {
    margin: 0;
    font-size: 14px;
    color: var(--color-secondary-text);
}

.modal-signature {
    margin-top: var(--space-xxl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(217, 178, 153, 0.1);
    text-align: center;
}

.modal-signature p {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--color-primary-text);
}

.signature-title {
    font-size: 14px !important;
    color: var(--color-tertiary-text) !important;
    margin-top: var(--space-xs) !important;
}

/* Contact Modal */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin: var(--space-xl) 0;
}

.contact-method {
    text-align: center;
    padding: var(--space-xl);
    background: rgba(217, 178, 153, 0.05);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.contact-method:hover {
    background: rgba(217, 178, 153, 0.08);
    transform: translateY(-4px);
}

.contact-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.contact-method h4 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin: 0 0 var(--space-sm);
}

.contact-method p {
    margin: 0;
}

.contact-response {
    display: block;
    font-size: 12px;
    color: var(--color-tertiary-text);
    margin-top: var(--space-xs);
}

.contact-note {
    margin-top: var(--space-xl);
    padding: var(--space-lg);
    background: rgba(217, 178, 153, 0.05);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-accent);
}

.contact-note p {
    margin: 0;
    font-size: 14px;
}

/* Support Modal - FAQ */
.faq-item {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(217, 178, 153, 0.1);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin: 0 0 var(--space-md);
}

.faq-answer {
    margin: 0;
    color: var(--color-secondary-text);
}

/* Modal Responsive */
@media (max-width: 768px) {
    .modal {
        padding: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    .modal-content {
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: 0;
        margin-top: env(safe-area-inset-top, 0px);
        margin-bottom: env(safe-area-inset-bottom, 0px);
    }
    
    .modal-header {
        padding: calc(var(--space-xl) + env(safe-area-inset-top, 20px)) var(--space-lg) var(--space-lg);
        padding-top: calc(var(--space-xxl) + env(safe-area-inset-top, 20px) + 20px);
    }
    
    .modal-title {
        font-size: 24px;
        padding-right: var(--space-xxl);
    }
    
    .modal-body {
        padding: var(--space-lg);
        padding-top: var(--space-md);
    }
    
    .modal-section-title {
        font-size: 20px;
    }
    
    .modal-principles,
    .contact-methods {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Routine Page Styles
   ============================================ */
.routine-hero {
    padding-bottom: var(--space-xxl);
    min-height: 80vh;
}

.routine-stats-grid {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(217, 178, 153, 0.3);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: var(--space-sm);
}

.stat-card .stat-value {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 600;
    color: var(--color-primary-text);
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--color-tertiary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.routine-details-section {
    padding-top: 0;
    margin-top: -60px;
    position: relative;
    z-index: 2;
}

.routine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.routine-detail-card {
    background: var(--color-card-bg);
    border: 1px solid rgba(217, 178, 153, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    height: 100%;
    transition: all 0.3s ease;
}

.routine-detail-card:hover {
    transform: translateY(-4px);
    border-color: rgba(217, 178, 153, 0.3);
    box-shadow: var(--shadow-card);
}

.routine-detail-card h3 {
    font-family: var(--font-serif);
    font-size: 24px;
    margin-bottom: var(--space-md);
    color: var(--color-primary-text);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.routine-detail-card p {
    color: var(--color-secondary-text);
    line-height: 1.8;
}

/* Mobile Optimization for Routine Page */
@media (max-width: 768px) {
    .routine-stats-grid {
        gap: var(--space-sm);
    }
    
    .stat-card {
        flex: 1;
        min-width: 100px;
        padding: var(--space-md);
    }
    
    .stat-card .stat-value {
        font-size: 20px;
    }
    
    .routine-hero {
        min-height: auto;
        padding-top: 120px;
    }
    
    .routine-details-section {
        margin-top: 0;
    }
}

