/* CSS Custom Properties */
:root {
    --color-bg: #0D0D0D;
    --color-surface: #141414;
    --color-surface-hover: #1F1F1F;
    --color-text-primary: #FFFFFF;
    --color-text-secondary: #999999;
    --color-text-tertiary: #666666;
    --color-accent: #0AADA9;
    --color-accent-hover: #33F0EA;
    --color-accent-glow: rgba(10, 173, 169, 0.3);
    --color-border: #2A2A2A;

    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --max-width: 1000px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure background extends to safe area on iOS Safari */
    background-color: #0D0D0D;
}

body {
    font-family: var(--font-system);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
    background-color: #0D0D0D;
    position: relative;
    /* iOS Safari safe area support */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* High-quality noise overlay to reduce gradient banding */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 150px 150px;
}

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

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent-hover);
}

/* Section Titles */
.section-title {
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: var(--spacing-xl);
    color: var(--color-text-primary);
    font-weight: 600;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    position: relative;
}

/* Localized light source - only in top-left of hero */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 500px;
    height: 500px;
    background: radial-gradient(ellipse at 0% 0%, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.hero-icon-wrapper {
    perspective: 1000px;
    display: inline-block;
    position: relative;
    /* Shadow applied to wrapper since clip-path on icon clips its own filters */
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

.hero-icon {
    width: 160px;
    height: 160px;
    border-radius: 31px;
    transition: transform 0.15s ease-out;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1);
    will-change: transform;
    display: block;
}

/* Light source overlay - follows mouse on hover */
.hero-icon-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
    border-radius: 31px;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.15s ease-out, opacity 0.2s ease;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1);
    will-change: transform, opacity;
    background: radial-gradient(
        circle 120px at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        transparent 100%
    );
}

.hero-icon-wrapper.tilt-active .hero-icon-shine {
    opacity: 1;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    max-width: 600px;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 440px;
    line-height: 1.5;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: linear-gradient(135deg, #33F0EA 0%, #1DD9D4 50%, #0FBFBB 100%);
    color: var(--color-bg);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem var(--spacing-lg);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    margin-top: var(--spacing-xs);
    border: none;
    box-shadow: 0 4px 20px rgba(10, 173, 169, 0.25);
}

.cta-button:hover {
    background: linear-gradient(135deg, #5FF5F0 0%, #33F0EA 50%, #1DD9D4 100%);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(10, 173, 169, 0.35);
}

.apple-logo {
    width: 18px;
    height: 18px;
}

.system-req {
    font-size: 0.8125rem;
    color: var(--color-text-tertiary);
    margin-top: var(--spacing-xs);
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-tertiary);
    font-size: 0.8125rem;
    transition: color 0.2s ease;
    text-decoration: none;
}

.scroll-indicator:hover {
    color: var(--color-text-secondary);
}

.scroll-indicator svg {
    width: 20px;
    height: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(6px);
    }
    60% {
        transform: translateY(3px);
    }
}

/* How It Works Section */
.how-it-works {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(180deg, var(--color-surface) 0%, rgba(20, 20, 20, 0.8) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.how-it-works .container {
    padding: 0 var(--spacing-xl);
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

/* Video Container */
.video-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(145deg, #1a1a1a 0%, #0d0d0d 100%);
    aspect-ratio: 4 / 3;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.demo-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-controls {
    position: absolute;
    bottom: var(--spacing-sm);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--spacing-xs);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-container:hover .video-controls {
    opacity: 1;
}

.video-btn {
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: background-color 0.2s ease;
}

.video-btn:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.video-btn svg {
    width: 20px;
    height: 20px;
}

/* Play/Pause icon visibility */
.video-container.paused .play-icon {
    display: block;
}

.video-container.paused .pause-icon {
    display: none;
}

.video-container:not(.paused) .play-icon {
    display: none;
}

.video-container:not(.paused) .pause-icon {
    display: block;
}

/* Value Props */
.value-props {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.value-prop {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
    padding: var(--spacing-sm);
    margin: calc(-1 * var(--spacing-sm));
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.value-prop:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.value-prop:hover .value-prop-indicator {
    opacity: 1;
}

.value-prop-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
}

.value-prop-icon svg {
    width: 32px;
    height: 32px;
}

.value-prop-indicator {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1;
    opacity: 0.7;
}

.value-prop-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--color-text-primary);
}

.value-prop-content p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Platforms Section */
.platforms {
    padding: var(--spacing-xl) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.platforms-label {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    letter-spacing: 0.05em;
}

.platforms-grid {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
    flex-wrap: wrap;
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-text-secondary);
    transition: color 0.2s ease, transform 0.2s ease;
    min-width: 120px;
}

.platform-item:hover {
    color: var(--color-text-primary);
    transform: translateY(-2px);
}

.platform-logo {
    width: 64px;
    height: 64px;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.platform-item:hover .platform-logo {
    opacity: 1;
    filter: grayscale(0%);
}

.platform-item span {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Pricing Section */
.pricing {
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
}

.pricing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.pricing-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.pricing-free {
    text-align: center;
}

.pricing-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.pricing-detail {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-top: 0.125rem;
}

.pricing-divider {
    width: 1px;
    height: 48px;
    /* Safari fix: use rgba instead of 'transparent' */
    background: linear-gradient(180deg, rgba(42, 42, 42, 0) 0%, var(--color-border) 50%, rgba(42, 42, 42, 0) 100%);
}

.pricing-paid {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
}

.pricing-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.pricing-term {
    font-size: 1rem;
    color: var(--color-text-secondary);
}

.pricing-features {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--spacing-sm);
}

.pricing-features li {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.pricing-features li svg {
    width: 14px;
    height: 14px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.buy-button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    /* Solid color fallback for Safari, then gradient */
    background-color: #ffffff;
    background-image: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%);
    color: #0D0D0D;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0.75rem var(--spacing-lg);
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    margin-top: var(--spacing-md);
    box-shadow: 0 2px 12px rgba(255, 255, 255, 0.1);
    /* Safari iOS fixes */
    -webkit-appearance: none;
    -webkit-text-fill-color: #0D0D0D;
}

.buy-button:hover {
    background-color: #f5f5f5;
    background-image: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    color: #0D0D0D;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

/* FAQ Section */
.faq {
    padding: var(--spacing-2xl) 0;
    /* Use simpler background to avoid banding artifacts */
    background-color: var(--color-surface);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.faq-list {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.faq-item[open] {
    background: rgba(255, 255, 255, 0.04);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    cursor: pointer;
    list-style: none;
    font-weight: 500;
    color: var(--color-text-primary);
    font-size: 0.9375rem;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question span {
    flex: 1;
}

.faq-icon {
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.faq-item[open] .faq-icon {
    transform: rotate(45deg);
    color: var(--color-accent);
}

.faq-answer {
    padding: 0 var(--spacing-md) var(--spacing-md);
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
    /* Animation handled by JS */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.faq-item[open] .faq-answer {
    opacity: 1;
}

/* Footer */
.footer {
    padding: var(--spacing-xl) 0;
    /* iOS Safari safe area support for bottom bar */
    padding-bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg);
}

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

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

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

.footer-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.footer-separator {
    width: 1px;
    height: 14px;
    background-color: var(--color-border);
}

.powered-by {
    color: var(--color-text-tertiary);
    font-size: 0.8125rem;
}

.powered-by a {
    color: var(--color-text-secondary);
}

.powered-by a:hover {
    color: var(--color-text-primary);
}

.footer-links > a {
    color: var(--color-text-tertiary);
    font-size: 0.8125rem;
}

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

/* Responsive Design */

/* Tablet */
@media (max-width: 900px) {
    .how-it-works .container {
        padding: 0 var(--spacing-lg);
    }

    .how-it-works-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .video-container {
        max-width: 560px;
        margin: 0 auto;
        aspect-ratio: 16 / 9;
    }

    .scroll-indicator {
        display: none;
    }

    .pricing-row {
        gap: var(--spacing-lg);
    }

    .pricing-divider {
        width: 60px;
        height: 1px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .platforms-grid {
        gap: var(--spacing-xl);
    }
}

/* Mobile */
@media screen and (max-width: 600px) {
    :root {
        --spacing-xl: 2rem;
        --spacing-2xl: 2.5rem;
    }

    /* Noise overlay on mobile - subtle but visible */
    body::before {
        opacity: 0.08 !important;
    }

    /* Mobile hero light source - slightly more visible */
    .hero::before {
        width: 300px;
        height: 300px;
        background: radial-gradient(ellipse at 0% 0%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .how-it-works {
        padding: var(--spacing-xl) 0 var(--spacing-2xl);
    }

    .how-it-works .container {
        padding: 0 var(--spacing-lg);
    }

    .how-it-works .section-title {
        margin-bottom: var(--spacing-lg);
    }

    .value-props {
        gap: var(--spacing-xl);
    }

    .value-prop {
        padding: var(--spacing-sm) 0;
    }

    .hero-icon {
        width: 120px;
        height: 120px;
        border-radius: 23px;
    }

    .hero-icon-shine {
        width: 120px;
        height: 120px;
        border-radius: 23px;
    }

    .hero-title {
        font-size: 1.875rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .cta-button {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .section-title {
        font-size: 1.375rem;
    }

    .value-prop {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Hide chevron indicators on mobile - they don't make sense when stacked vertically */
    .value-prop-indicator {
        display: none;
    }

    .value-prop-content h3 {
        font-size: 1rem;
    }

    .value-prop-content p {
        font-size: 0.875rem;
    }

    /* Platforms section - force horizontal single row on mobile, properly centered */
    .platforms {
        border-bottom: 1px solid #2A2A2A;
    }

    .platforms-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }

    .platform-item {
        /* Fixed width for even spacing regardless of label length */
        width: 100px;
        min-width: 100px;
        flex: 0 0 100px;
        text-align: center;
    }

    .platform-logo {
        width: 48px;
        height: 48px;
    }

    .platform-item span {
        font-size: 0.6875rem;
        display: block;
        white-space: nowrap;
    }

    .pricing-row {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .pricing-divider {
        width: 40px;
        height: 1px;
    }

    .pricing-amount {
        font-size: 2rem;
    }

    .pricing-features {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-xs);
    }

    /* Force Buy Now button to white on mobile - Safari needs explicit background shorthand */
    a.buy-button,
    .pricing a.buy-button,
    .buy-button {
        background: #ffffff !important;
        -webkit-background-clip: padding-box;
        background-clip: padding-box;
        color: #0D0D0D !important;
        -webkit-text-fill-color: #0D0D0D;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        opacity: 1 !important;
    }

    .video-controls {
        opacity: 1;
    }

    /* Improve FAQ container visibility on mobile - subtle but visible */
    .faq-item {
        background-color: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .faq-item:hover,
    .faq-item[open] {
        background-color: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.12);
    }

    .faq-question {
        font-size: 0.875rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .faq-answer {
        font-size: 0.8125rem;
        padding: 0 var(--spacing-md) var(--spacing-sm);
    }

    /* Fix footer layout on mobile - stack vertically */
    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .footer-separator {
        display: none;
    }

    .footer-links > a,
    .powered-by {
        font-size: 0.875rem;
    }
}

/* Focus states for accessibility */
.cta-button:focus-visible,
.buy-button:focus-visible,
.video-btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Safari iOS 26+ specific fixes */
/* Safari has unique support for hanging-punctuation and -apple-system-body font */
@supports (hanging-punctuation: first) and (font: -apple-system-body) and (-webkit-appearance: none) {
    /* Safari-specific hero light source */
    .hero::before {
        background: radial-gradient(ellipse at 0% 0%, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 70%);
    }

    /* Reduce noise on Safari mobile */
    body::before {
        opacity: 0.03;
    }

    /* Force Buy Now button to white on Safari */
    .buy-button {
        background: #ffffff !important;
        background-color: #ffffff !important;
        color: #0D0D0D !important;
        -webkit-text-fill-color: #0D0D0D !important;
    }

    /* Fix FAQ containers for Safari */
    .faq-item {
        background-color: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    /* Fix platforms centering for Safari */
    .platforms-grid {
        display: flex;
        justify-content: center;
        gap: 0;
    }

    .platform-item {
        width: 100px;
        flex: 0 0 100px;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .cta-button,
    .buy-button,
    .video-controls,
    a {
        transition: none;
    }

    .scroll-indicator svg {
        animation: none;
    }

    .demo-video {
        animation: none;
    }
}
