:root {
    --bg-gradient: linear-gradient(180deg, rgba(243, 154, 74, 1) 15%, rgba(65, 54, 118, 1) 80%);
    --accent: #FFA726;
    --accent-hover: #FFB74D;
    --brand-dark: #413676;
    --text-light: #FFFFFF;
    --text-muted: #FFFFFF;
    
    --font-heading: 'Unbounded', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.15);
    --glow-container: 0 0 30px rgba(255, 167, 38, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    color: var(--text-light);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Noise texture overlay removed for better rendering */
body::before {
    display: none;
}

/* Cereal Rain Animation Background */
.cereal-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.falling-cereal {
    position: absolute;
    top: -100px;
    left: var(--left);
    width: var(--size);
    height: var(--size);
    animation: fall var(--duration) linear infinite;
    animation-delay: var(--delay);
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.landing-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem 1.5rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    animation: fadeIn 0.8s ease-out;
    position: relative;
    z-index: 10;
}

/* Hero Section */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1rem;
}

.headline {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 7vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    color: #FFFFFF;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.subline {
    font-size: 1.125rem;
    color: #FFFFFF;
    max-width: 480px;
    margin: 0 auto;
    font-weight: 400;
}

.carousel-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 1.5rem auto 0;
    overflow: hidden;
    padding-left: 0;
}

.carousel-container {
    width: 100%;
    margin: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
}

.carousel-track {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}

.carousel-track.grabbing {
    cursor: grabbing;
    transition: none;
}

.carousel-slide {
    flex: 0 0 calc(100% - 30px);
    padding-right: 16px;
    box-sizing: border-box;
}

.product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    background-color: var(--brand-dark);
    border: 2px solid var(--accent);
    border-radius: 16px;
    box-shadow: 0 0 16px rgba(255, 167, 38, 0.4);
    box-sizing: border-box;
    padding: 0;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    padding: 0;
}

.indicator-dot.active {
    background-color: var(--accent);
    transform: scale(1.3);
}

.auto-nudge {
    animation: nudge 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes nudge {
    0% { transform: translateX(0); }
    50% { transform: translateX(-15px); }
    100% { transform: translateX(0); }
}



/* Waitlist Section */
.waitlist {
    width: 100%;
    margin-top: 0.5rem;
}

.waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: var(--brand-dark);
    padding: 2.25rem 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft), var(--glow-container);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-group input {
    width: 100%;
    padding: 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: #FFFFFF;
    background-color: rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background-color: rgba(0, 0, 0, 0.3);
}

.input-group input::placeholder {
    color: #FFFFFF;
}

.cta-button {
    width: 100%;
    margin-top: 0.5rem;
    padding: 1.25rem;
    background-color: var(--accent);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(255, 167, 38, 0.3);
}

.cta-button:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 167, 38, 0.4);
}

.cta-button:active:not(:disabled) {
    transform: translateY(0);
}

.urgency-line {
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #FFFFFF;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.urgency-line::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Success Message */
.success-message {
    text-align: center;
    background: var(--brand-dark);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft), var(--glow-container);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: bounceIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

.success-message p {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: #FFFFFF;
    line-height: 1.4;
}

/* Footer */
.legal-footer {
    text-align: center;
    margin-top: auto;
    padding-bottom: 1rem;
}

.rgpd-text {
    font-size: 0.75rem;
    color: #FFFFFF;
    max-width: 400px;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

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

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 167, 38, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 167, 38, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 167, 38, 0); }
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox:not([hidden]) {
    opacity: 1;
    visibility: visible;
    display: flex; /* Ensure flex is active when not hidden */
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #FFFFFF;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    color: var(--accent);
}

/* Responsive Edge Cases */
@media (max-width: 768px) {
    .landing-container {
        padding: 0.5rem 1rem;
        gap: 1rem; /* Reduced to pull everything up */
    }

    /* iPhone 12 Pro Specific Optimization */
    @media (max-width: 430px) {
        body {
            padding-top: 0;
        }

        .landing-container {
            padding: 0.5rem 0.5rem;
            gap: 0.5rem;
        }

        .hero {
            gap: 0.25rem;
            margin-top: 0;
        }

        .headline {
            font-size: 1.6rem;
        }

        .subline {
            font-size: 0.85rem;
            max-width: 90vw;
        }

        .carousel-wrapper {
            width: 100vw;
            max-width: none;
            margin-left: calc(50% - 50vw);
            margin-right: calc(50% - 50vw);
            margin-top: 0.25rem;
            overflow: hidden;
            padding-left: 10vw;
        }

        .carousel-container {
            width: 100%;
            height: auto;
            aspect-ratio: auto;
            border: none;
            box-shadow: none;
            border-radius: 0;
            background-color: transparent;
        }

        .carousel-track {
            height: auto;
        }

        .carousel-slide {
            height: auto;
            aspect-ratio: auto;
            flex: 0 0 calc(80vw + 16px);
            padding-right: 16px;
            box-sizing: border-box;
        }

        .product-image {
            width: 100%;
            aspect-ratio: 1 / 1;
            object-fit: contain;
            background-color: var(--brand-dark);
            border: 2px solid var(--accent);
            border-radius: 16px;
            box-shadow: 0 0 16px rgba(255, 167, 38, 0.4);
            box-sizing: border-box;
            padding: 0;
        }

        .carousel-indicators {
            margin-top: 0.5rem;
        }

        .waitlist {
            margin-top: 0.25rem;
            width: 100%;
            display: block;
        }

        .waitlist-form {
            width: 90vw;
            margin: 0 auto;
            padding: 1rem;
            gap: 0.6rem;
        }
    }

    .hero {
        margin-top: 0;
        gap: 0.75rem;
    }

    .headline {
        font-size: 1.4rem; /* Smaller headline */
    }

    .subline {
        font-size: 0.95rem; /* More compact subline */
        line-height: 1.3;
    }

    .carousel-wrapper {
        margin-top: 0.5rem;
    }

    .carousel-container {
        max-width: 280px;
        border-width: 2px;
    }



    .waitlist-form {
        padding: 1.25rem 1rem;
        gap: 0.75rem;
    }

    .input-group input {
        padding: 0.875rem;
        font-size: 0.95rem;
    }

    .cta-button {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .urgency-line {
        font-size: 0.75rem;
        margin-top: 0.25rem;
    }
}

@media (max-width: 360px) {
    .headline {
        font-size: 1.25rem;
    }
}

@media (min-width: 768px) {
    .landing-container {
        padding: 4rem 2rem;
        gap: 3.5rem;
    }
    
    .hero {
        margin-top: 0;
    }
    
    .waitlist-form {
        padding: 3rem 2.5rem;
    }
}
