/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* iOS-inspired color palette */
    --ios-blue: #007AFF;
    --ios-orange: #FF9500;
    --ios-green: #34C759;
    --ios-red: #FF3B30;
    --ios-purple: #AF52DE;
    --ios-gray: #8E8E93;
    --ios-light-gray: #F2F2F7;
    --ios-dark-gray: #1C1C1E;
    
    /* Semantic colors */
    --primary: var(--ios-blue);
    --secondary: var(--ios-orange);
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --background: #FFFFFF;
    --surface: #F5F5F7;
    --border: #D2D2D7;
    
    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Hero Section */
.hero {
    padding: var(--space-2xl) 0;
    background: linear-gradient(135deg, #F5F7FA 0%, #C3CFE2 100%);
    text-align: center;
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.02'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.ios-badge {
    display: inline-flex;
    align-items: center;
    background: var(--ios-blue);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    letter-spacing: 0.025em;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-xl) auto;
    line-height: 1.7;
}

.cta-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-2xl);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-width: 160px;
    justify-content: center;
}

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

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

/* Device Mockups */
.hero-mockup {
    display: flex;
    gap: var(--space-xl);
    justify-content: center;
    align-items: flex-start;
    margin-top: var(--space-2xl);
    flex-wrap: wrap;
}

.device-mockup {
    background: #1C1C1E;
    border-radius: var(--radius-xl);
    padding: 8px;
    box-shadow: var(--shadow-xl);
    position: relative;
}

.device-mockup.iphone {
    width: 200px;
    height: 400px;
}

.device-mockup.ipad {
    width: 280px;
    height: 360px;
}

.device-screen {
    background: white;
    border-radius: calc(var(--radius-xl) - 8px);
    height: 100%;
    overflow: hidden;
    position: relative;
}

.app-interface {
    padding: var(--space-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.status-bar {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.nav-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    text-align: center;
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xs);
    flex: 1;
}

.photo-item {
    background: var(--surface);
    border-radius: var(--radius-sm);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 2px solid transparent;
}

.photo-item.selected {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.1);
}

.split-view {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-sm);
    height: 100%;
}

.sidebar {
    background: var(--surface);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

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

.polaroid-preview {
    background: white;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.polaroid-frame {
    background: white;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    width: 80px;
}

.polaroid-photo {
    background: var(--surface);
    aspect-ratio: 1;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

.polaroid-text {
    font-size: 0.6rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Features Section */
.features {
    padding: var(--space-2xl) 0;
    background: var(--background);
}

.features h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.feature-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border);
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
    display: block;
}

.feature-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    line-height: 1.3;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Technical Specs */
.technical-specs {
    padding: var(--space-2xl) 0;
    background: var(--surface);
}

.technical-specs h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    letter-spacing: -0.02em;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.spec-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.spec-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.spec-card ul {
    list-style: none;
}

.spec-card li {
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.spec-card li:last-child {
    border-bottom: none;
}

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

/* Screenshots */
.screenshots {
    padding: var(--space-2xl) 0;
    background: var(--background);
}

.screenshots h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.screenshot-placeholder {
    text-align: center;
}

.device-frame {
    background: linear-gradient(135deg, var(--ios-light-gray) 0%, var(--border) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--space-md);
}

.device-frame.iphone-frame {
    max-width: 200px;
    margin: 0 auto var(--space-md) auto;
}

.device-frame.ipad-frame {
    max-width: 280px;
    margin: 0 auto var(--space-md) auto;
}

.screenshot-content {
    background: white;
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.screenshot-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.screenshot-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Installation */
.installation {
    padding: var(--space-2xl) 0;
    background: var(--surface);
}

.installation h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    letter-spacing: -0.02em;
}

.install-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: var(--space-xl);
}

.install-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.install-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.code-block {
    background: var(--ios-dark-gray);
    color: #F8F8F2;
    padding: var(--space-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.code-block code {
    font-family: inherit;
}

/* Contributing */
.contributing {
    padding: var(--space-2xl) 0;
    background: var(--background);
}

.contributing h2 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    margin-bottom: var(--space-2xl);
    letter-spacing: -0.02em;
}

.contributing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.contrib-card {
    background: white;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.contrib-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.contrib-card ul {
    list-style: none;
}

.contrib-card li {
    padding: var(--space-xs) 0;
    color: var(--text-secondary);
    position: relative;
    padding-left: var(--space-md);
}

.contrib-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--ios-dark-gray);
    color: white;
    padding: var(--space-2xl) 0 var(--space-lg) 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: white;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    font-size: 0.875rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-xs);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--space-lg);
    text-align: center;
}

.footer-branding {
    max-width: 600px;
    margin: 0 auto;
}

.footer-branding p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.footer-branding .app-credit {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.footer-branding .company-credit {
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

.footer-branding .company-credit a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-branding .company-credit a:hover {
    color: #66B2FF;
    text-decoration: underline;
}

.footer-branding .tagline {
    font-size: 0.8rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .hero {
        padding: var(--space-xl) 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .hero-mockup {
        flex-direction: column;
        align-items: center;
        gap: var(--space-lg);
    }
    
    .device-mockup.iphone {
        width: 160px;
        height: 320px;
    }
    
    .device-mockup.ipad {
        width: 240px;
        height: 300px;
    }
    
    .features-grid,
    .specs-grid,
    .screenshot-grid,
    .install-grid,
    .contributing-grid {
        grid-template-columns: 1fr;
    }
    
    .install-grid {
        grid-template-columns: 1fr;
    }
    
    .install-card {
        min-width: auto;
    }
    
    .features h2,
    .technical-specs h2,
    .screenshots h2,
    .installation h2,
    .contributing h2 {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

@media (max-width: 480px) {
    :root {
        --space-xs: 0.25rem;
        --space-sm: 0.75rem;
        --space-md: 1rem;
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 2.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 1.125rem;
    }
    
    .feature-card,
    .spec-card,
    .install-card,
    .contrib-card {
        padding: var(--space-lg);
    }
    
    .device-mockup.iphone {
        width: 140px;
        height: 280px;
    }
    
    .device-mockup.ipad {
        width: 200px;
        height: 250px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0000EE;
        --secondary: #FF6600;
        --text-primary: #000000;
        --text-secondary: #333333;
        --border: #000000;
    }
    
    .feature-card,
    .spec-card,
    .install-card,
    .contrib-card {
        border: 2px solid var(--border);
    }
    
    .btn-primary {
        background: #0000EE;
        border: 2px solid #0000EE;
    }
    
    .btn-secondary {
        border: 2px solid #0000EE;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .feature-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* Focus indicators for accessibility */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #F5F5F7;
        --text-secondary: #A1A1A6;
        --background: #000000;
        --surface: #1C1C1E;
        --border: #38383A;
    }
    
    .hero {
        background: linear-gradient(135deg, #1C1C1E 0%, #2C2C2E 100%);
    }
    
    .feature-card,
    .spec-card,
    .install-card,
    .contrib-card {
        background: var(--surface);
    }
    
    .device-screen {
        background: var(--surface);
    }
    
    .footer {
        background: #000000;
    }
}

/* Print styles */
@media print {
    .hero-mockup,
    .screenshot-grid {
        display: none;
    }
    
    .hero {
        background: white;
    }
    
    * {
        color: black !important;
        background: white !important;
    }
}

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

/* Loading state for images */
img {
    transition: opacity 0.3s ease;
}

img[data-loading="true"] {
    opacity: 0.5;
}

/* Selection styles */
::selection {
    background: rgba(0, 122, 255, 0.2);
    color: var(--text-primary);
}