﻿/* CSS Reset & Universal Fixes */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* General Body Styles */
body {
    background: linear-gradient(
        to bottom,
        #2a2a2e 0%,
        #1a1a1c 30%,
        #0d0d0f 70%,
        #0d0d0f 100%
    );
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    color: #f4f4f5;
    font-family: "DM Sans", sans-serif;
    text-align: center;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Safe area padding for notched devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background:
        radial-gradient(
            ellipse 60% 50% at 50% 20%,
            rgba(0, 229, 255, 0.1) 0%,
            rgba(0, 229, 255, 0.04) 35%,
            transparent 70%
        ),
        radial-gradient(
            ellipse 80% 60% at 50% 15%,
            rgba(255, 255, 255, 0.07) 0%,
            transparent 50%
        );
    pointer-events: none;
    z-index: 0;
    animation: light-sway 15s ease-in-out infinite;
}

@keyframes light-sway {
    0%,
    100% {
        transform: translateX(0);
    }
    33% {
        transform: translateX(-8%);
    }
    66% {
        transform: translateX(8%);
    }
}

.container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    /* Safe area for notched devices */
    padding-bottom: max(40px, env(safe-area-inset-bottom));
}

/* Logo */
.logo-image {
    width: 250px;
    height: auto;
    margin-bottom: 30px;
    animation:
        float 6s ease-in-out infinite,
        logo-sway 15s ease-in-out infinite,
        logo-glow 6s ease-in-out infinite;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9))
        drop-shadow(0 0 8px rgba(0, 229, 255, 0.8))
        drop-shadow(0 0 25px rgba(0, 229, 255, 0.5))
        drop-shadow(0 0 50px rgba(0, 229, 255, 0.25));
}

@keyframes logo-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 8px rgba(0, 229, 255, 0.8))
            drop-shadow(0 0 25px rgba(0, 229, 255, 0.5))
            drop-shadow(0 0 50px rgba(0, 229, 255, 0.25));
    }
    50% {
        filter: drop-shadow(0 0 5px rgba(255, 255, 255, 1))
            drop-shadow(0 0 12px rgba(0, 229, 255, 0.9))
            drop-shadow(0 0 35px rgba(0, 229, 255, 0.6))
            drop-shadow(0 0 70px rgba(0, 229, 255, 0.3));
    }
}

@keyframes logo-sway {
    0%,
    100% {
        transform: translateX(0) translateY(0);
    }
    33% {
        transform: translateX(-8%) translateY(-10px);
    }
    50% {
        transform: translateX(0) translateY(0);
    }
    66% {
        transform: translateX(8%) translateY(-10px);
    }
}

/* Title and Subtitle */
.title {
    font-size: 144px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(
        90deg,
        #00e5ff 0%,
        #00e5ff 10%,
        #08e6ff 18%,
        #15e8ff 25%,
        #25eaff 32%,
        #40edff 38%,
        #60f0ff 43%,
        #80f3ff 47%,
        #a0f6ff 50%,
        #80f3ff 53%,
        #60f0ff 57%,
        #40edff 62%,
        #25eaff 68%,
        #15e8ff 75%,
        #08e6ff 82%,
        #00e5ff 90%,
        #00e5ff 100%
    );
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation:
        chrome-shine 10s ease-in-out infinite,
        title-glow 5s ease-in-out infinite;
}

@keyframes chrome-shine {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

@keyframes title-glow {
    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.2))
            drop-shadow(0 0 10px rgba(0, 229, 255, 0.1));
    }
    50% {
        filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.35))
            drop-shadow(0 0 16px rgba(0, 229, 255, 0.2));
    }
}

.letter {
    display: inline-block;
    margin: 0 -2px;
}

.subtitle {
    font-size: 18px;
    color: #a1a1aa;
    max-width: 500px;
    margin: 0 auto 30px auto;
}

/* Coming Soon Badge */
.badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 229, 255, 0.12);
    color: #00e5ff;
    padding: 8px 16px;
    border-radius: 9999px;
    font-weight: 500;
    margin-bottom: 40px;
    animation: hazy-glow 3s ease-in-out infinite;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background-color: #00e5ff;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background-color: #131316;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    transition:
        transform 0.3s,
        box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow:
        0 0 10px rgba(0, 200, 220, 0.55),
        0 0 20px rgba(0, 200, 220, 0.4),
        0 0 30px rgba(0, 200, 220, 0.25);
    border-color: rgba(0, 200, 220, 0.75);
}

.feature-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #f4f4f5;
}

.feature-description {
    color: #a1a1aa;
}

/* Newsletter Signup */
.signup {
    padding: 0;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.signup-content {
    background-color: #131316;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(0, 200, 220, 0.3);
    position: relative;
    overflow: hidden;
}

#racing-light-canvas {
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    pointer-events: none;
    z-index: 0;
}

.signup-content > *:not(#racing-light-canvas) {
    position: relative;
    z-index: 1;
}

.signup-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.signup-form {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.email-input {
    width: 100%;
    max-width: 350px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #0d0d0f;
    color: #f4f4f5;
    border-radius: 8px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    outline: none;
    transition:
        border-color 0.3s,
        box-shadow 0.3s;
    /* iOS input styling fixes */
    -webkit-appearance: none;
    appearance: none;
}

.email-input:focus {
    border-color: rgba(0, 200, 220, 0.7);
    box-shadow:
        inset 0 0 8px rgba(0, 200, 220, 0.4),
        inset 0 0 16px rgba(0, 200, 220, 0.2);
}

.submit-button {
    padding: 12px 24px;
    border: 1px solid #00e5ff;
    background-color: #0a0a0c;
    color: #00e5ff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    text-shadow:
        0 0 6px rgba(0, 180, 200, 0.4),
        0 0 12px rgba(0, 180, 200, 0.25);
    /* iOS button fixes */
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.submit-button:hover,
.submit-button:active {
    background-color: #0a0a0c;
    box-shadow:
        0 0 6px rgba(0, 180, 200, 0.4),
        0 0 12px rgba(0, 180, 200, 0.25);
}

/* Active state for touch devices */
@media (hover: none) {
    .submit-button:active {
        transform: scale(0.98);
    }

    .feature-card:active {
        transform: translateY(-3px);
        box-shadow:
            0 0 10px rgba(0, 200, 220, 0.55),
            0 0 20px rgba(0, 200, 220, 0.4),
            0 0 30px rgba(0, 200, 220, 0.25);
        border-color: rgba(0, 200, 220, 0.75);
    }
}

/* Footer */
.footer {
    color: #a1a1aa;
    font-size: 14px;
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

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

@keyframes hazy-glow {
    0%,
    100% {
        box-shadow:
            0 0 8px rgba(0, 229, 255, 0.4),
            0 0 16px rgba(0, 229, 255, 0.3),
            0 0 24px rgba(0, 229, 255, 0.3);
    }
    50% {
        box-shadow:
            0 0 15px rgba(0, 229, 255, 0.7),
            0 0 30px rgba(0, 229, 255, 0.6),
            0 0 45px rgba(0, 229, 255, 0.5);
    }
}

/* Responsive Styles */

/* Tablet */
@media (max-width: 900px) {
    .container {
        padding: 30px 15px;
        padding-bottom: max(30px, env(safe-area-inset-bottom));
    }

    .logo-image {
        width: 180px;
        margin-bottom: 20px;
    }

    .title {
        font-size: 72px;
        /* Ensure text gradient works on all devices */
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .letter {
        padding: 0 2px;
    }

    .subtitle {
        font-size: 16px;
        max-width: 400px;
        padding: 0 10px;
        line-height: 1.5;
    }

    .feature-card {
        padding: 20px;
    }

    .feature-title {
        font-size: 18px;
    }

    .signup-title {
        font-size: 20px;
        line-height: 1.4;
    }

    .signup-form {
        flex-direction: column;
        align-items: center;
    }

    .email-input {
        max-width: 100%;
    }

    .submit-button {
        width: 100%;
        max-width: 350px;
    }
}

/* Small tablet / large mobile - stack cards */
@media (max-width: 700px) {
    .features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .container {
        padding: 20px 10px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .logo-image {
        width: 140px;
        margin-bottom: 15px;
    }

    .title {
        font-size: 48px;
        line-height: 1.1;
        /* Ensure text gradient works on all devices */
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .letter {
        padding: 0 1px;
    }

    .subtitle {
        font-size: 14px;
        max-width: 300px;
        line-height: 1.5;
    }

    .badge {
        padding: 6px 12px;
        font-size: 14px;
    }

    .feature-card {
        padding: 15px;
    }

    .feature-title {
        font-size: 16px;
    }

    .feature-description {
        font-size: 14px;
        line-height: 1.4;
    }

    .signup-content {
        padding: 20px 15px;
    }

    .signup-title {
        font-size: 18px;
        line-height: 1.4;
    }

    .email-input,
    .submit-button {
        font-size: 16px; /* Keep at 16px to prevent iOS zoom */
        padding: 12px;
    }

    .footer {
        font-size: 12px;
    }
}

/* Small mobile devices */
@media (max-width: 360px) {
    .title {
        font-size: 40px;
    }

    .logo-image {
        width: 120px;
    }

    .signup-title {
        font-size: 16px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .logo-image {
        width: 100px;
        margin-bottom: 10px;
    }

    .title {
        font-size: 48px;
        margin-bottom: 5px;
    }

    .subtitle {
        margin-bottom: 15px;
    }

    .badge {
        margin-bottom: 20px;
    }

    .features {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .feature-card {
        padding: 12px;
    }
}

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