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

:root {
    --background: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #515154;
    --border: #d2d2d7;
    --hero-gradient-start: #ffffff;
    --hero-gradient-end: #f5f5f7;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #000000;
        --text-primary: #f5f5f7;
        --text-secondary: #86868b;
        --text-tertiary: #a1a1a6;
        --border: #424245;
        --hero-gradient-start: #000000;
        --hero-gradient-end: #161617;
    }
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 19px;
    letter-spacing: -0.022em;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(180deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    position: relative;
}

.hero-content {
    max-width: 980px;
    margin: 0 auto 60px;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
}

.hero-title {
    font-size: 120px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 60px;
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-tertiary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title::before {
    content: "○";
    font-size: 120px;
    font-weight: 100;
    position: absolute;
    margin-left: -1.15em;
    margin-top: -0.12em;
    opacity: 0.3;
}

.hero-tagline {
    font-size: 48px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
    margin-top: 60px;
}

.hero-visual {
    opacity: 0;
    animation: fadeIn 1.2s ease 0.3s forwards;
}

.device-container {
    width: 300px;
    height: 400px;
    background: var(--border);
    border-radius: 40px 40px 0 0;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    padding: 2px;
    padding-bottom: 0;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .device-container {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    }
}

.device-screen {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 38px 38px 0 0;
    overflow: hidden;
}

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

/* Feature Sections */
.feature {
    padding: 120px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
}

.feature.in-view {
    animation: fadeInUp 0.8s ease forwards;
}

.feature.reverse {
    grid-template-columns: 1fr 1fr;
    direction: rtl;
}

.feature.reverse > * {
    direction: ltr;
}

.feature-title {
    font-size: 64px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
}

.feature-description {
    font-size: 28px;
    line-height: 1.4;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.placeholder-screenshot {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--border);
    border-radius: 20px;
    opacity: 0.1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Placeholder Icons */
.placeholder-icon {
    width: 120px;
    height: 120px;
    opacity: 1;
    filter: invert(1) opacity(0.6);
}

@media (prefers-color-scheme: dark) {
    .placeholder-icon {
        filter: invert(0) opacity(0.3);
        opacity: 1;
    }
}

.placeholder-device .placeholder-icon {
    width: 140px;
    height: 140px;
}

/* Bold Punctuation */
.punct {
    font-weight: 700;
    color: var(--text-primary);
}

/* AI Word with Halo Effect */
.ai-word {
    position: relative;
    display: inline-block;
    font-weight: 600;
    background: linear-gradient(
        90deg,
        #FF3B30 0%,
        #FF9500 15%,
        #FFCC00 30%,
        #34C759 45%,
        #00C7BE 50%,
        #30B0C7 55%,
        #007AFF 65%,
        #5856D6 75%,
        #AF52DE 85%,
        #FF2D55 95%,
        #FF3B30 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 300% 100%;
    background-position: 0% 50%;
    animation: shimmer 8s ease-in-out 1;
    animation-fill-mode: forwards;
}

.ai-word::before {
    content: 'Improved';
    position: absolute;
    top: 0;
    left: 0;
    background: inherit;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: inherit;
    background-position: inherit;
    filter: blur(12px);
    opacity: 0.4;
    z-index: -1;
    animation: inherit;
}

@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* CTA Section */
.cta {
    padding: 160px 20px;
    text-align: center;
    background: var(--hero-gradient-end);
    display: flex;
    justify-content: center;
}

/* App Store Button - Glass Effect with Rainbow Border */
.app-store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 36px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 980px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.app-store-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 980px;
    padding: 2px;
    background: linear-gradient(
        90deg,
        #FF3B30,
        #FF9500,
        #FFCC00,
        #34C759,
        #00C7BE,
        #30B0C7,
        #007AFF,
        #5856D6,
        #AF52DE,
        #FF2D55,
        #FF3B30
    );
    background-size: 300% auto;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.5;
    animation: shimmer-button 20s linear infinite;
}

@keyframes shimmer-button {
    to {
        background-position: -300% center;
    }
}

@media (prefers-color-scheme: dark) {
    .app-store-button {
        background: rgba(255, 255, 255, 0.08);
    }
    .app-store-button::before {
        opacity: 0.6;
    }
}

.app-store-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.app-store-button:hover::before {
    opacity: 0.8;
}

.button-text {
    font-size: 21px;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Footer */
footer {
    padding: 40px 20px;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

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

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

/* Animations */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 72px;
    }
    
    .hero-title::before {
        font-size: 72px;
    }
    
    .hero-tagline {
        font-size: 32px;
        margin-top: 40px;
        line-height: 1.2;
    }
    
    .feature {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 80px 20px;
        display: flex;
        flex-direction: column;
    }
    
    .feature.reverse {
        direction: ltr;
        flex-direction: column;
    }
    
    .feature-visual {
        width: 100%;
        order: 2;
    }
    
    .feature-content {
        order: 1;
    }
    
    .feature-title {
        font-size: 40px;
    }
    
    .feature-description {
        font-size: 21px;
    }
    
    .app-store-button {
        padding: 16px 32px;
    }
    
    .button-text {
        font-size: 19px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .device-container {
        width: 200px;
        height: 280px;
        padding: 2px;
        padding-bottom: 0;
    }
    
    .device-screen {
        border-radius: 28px 28px 0 0;
    }
}

/* iOS-specific enhancements */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .hero-title {
        font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont;
        font-weight: 700;
    }
    
    body {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Smooth momentum scrolling on iOS */
    html {
        -webkit-overflow-scrolling: touch;
    }
}

/* Intersection Observer for scroll animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}