:root {
    --bg-dark: #0b1219;
    /* Dark Slate Blue from app schedule/ticker background */
    --bg-card: #152232;
    /* Lighter Slate Blue from app cards */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-primary: #2c3e50;
    /* Muted Blue for buttons/active states */
    --accent-hover: #34495e;
    --font-family: 'Inter', sans-serif;
    --border-color: #1e2d3d;
}

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

html {
    background-color: var(--bg-dark);
    /* Safari iOS: scroll-snap must be on body, not html */
    height: 100%;
    overflow: hidden;
    /* Let body handle scrolling */
}

body {
    font-family: var(--font-family);
    background-color: transparent;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: scroll;
    height: 100%;

    /* Scroll Snap - applied to body for Safari iOS compatibility */
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    /* Smooth momentum scrolling on iOS */
}

/* ... existing styles ... */

/* Fluid Background */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    /* use dvh to handle mobile browser address bars */
    z-index: -1;
    overflow: hidden;
    /* Moved from body to here */
    background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 40%, #020617 100%);
}

.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    /* Slightly less blur for more definition */
    opacity: 0.6;
    /* Increased opacity */
    will-change: transform, left;
    transition: left 1.5s ease-in-out;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    /* Lighter Slate Blue for contrast against dark bg */
    background: #334155;
    animation: moveBlob1 10s infinite alternate ease-in-out;
}

.background-container.blob-shifted .blob-1 {
    left: 10%;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 10vw;
    height: 10vw;
    /* Darker but visible Slate */
    background: #1e293b;
    animation: moveBlob2 22s infinite alternate ease-in-out;
}

.blob-3 {
    top: 40%;
    left: 30%;
    width: 20vw;
    height: 20vw;
    /* Accent Blue */
    background: rgba(56, 189, 248, 0.15);
    animation: moveBlob3 5s infinite alternate ease-in-out;
}

@keyframes moveBlob1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(10%, 10%) scale(1.1);
    }

    66% {
        transform: translate(-5%, 20%) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes moveBlob2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-10%, -10%) scale(1.1);
    }

    66% {
        transform: translate(5%, -15%) scale(0.95);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes moveBlob3 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(15%, -15%) scale(1.05);
    }

    66% {
        transform: translate(-10%, 10%) scale(0.9);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

/* Update Mockup Image styles to fit new structure */
.mockup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

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

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-hover) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Store Buttons */
.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.75rem;
    /* Slightly larger */
    background: rgba(255, 255, 255, 0.08);
    /* More subtle */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Intro Section */
#intro-section {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center align */
    text-align: left;
    position: relative;
    z-index: 10;
    background: transparent;
    /* Allow particles to show */
}

.intro-container {
    width: 100%;
    max-width: 1400px;
    /* Wider container */
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    /* Split layout */
    align-items: center;
    gap: 4rem;
}

.intro-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Align start */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.intro-logo {
    width: 64px;
    /* Slightly smaller */
    height: 64px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.intro-title {
    font-size: 6rem;
    /* Larger */
    font-weight: 800;
    margin-bottom: 0;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
    line-height: 1;
}

.intro-title2 {
    font-size: 3.5rem;
    /* Larger */
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
    line-height: 1.2;
    padding-bottom: 0.1em;
    /* Prevent descender clipping */
    max-width: 100%;
}

.intro-subtitle {
    font-size: 1.25rem;
    /* Larger */
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 400;
    margin-top: 1rem;
    max-width: 100%;
    line-height: 1.6;
}

.intro-buttons {
    display: flex;
    justify-content: flex-start;
    /* Align start */
    gap: 1.5rem;
}

/* Hide scrollbar but keep functionality */
html::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Individual Snap Sections */
.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for mobile */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 5%;
    position: relative;
    z-index: 5;
    /* Above the 3D phone container */
}

/* Intro section specific - override flex alignment */
#intro-section.snap-section {
    align-items: center;
    padding-bottom: 0;
}

.phone-3d-container {
    width: 100%;
    height: 100%;
    position: fixed;
    /* Fixed background */
    top: 0;
    left: 0;
    z-index: 1;
    /* Behind text but above particles/bg */
    pointer-events: none;
}

.phone-blur {
    filter: blur(10px);
    transition: filter 0.8s ease;
}

/* Premium Lightbox Style */
.step-text {
    width: 90%;
    max-width: 500px;
    position: fixed;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    /* Ensure lightbox is in front of 3D model */

    /* Lightbox Styling */
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    pointer-events: auto;

    /* Fade In/Out Animation */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.step-text.active {
    opacity: 1;
    visibility: visible;
}

.step-text h2 {
    font-size: 1.5rem;
    /* Decreased from 2rem */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.step-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Mobile Adjustments for Pinned Layout */
@media (max-width: 900px) {

    /* Fix for mobile cut-off: Align to top */
    #intro-section.snap-section {
        align-items: flex-start;
        height: auto;
        min-height: 100dvh;
    }

    .intro-container {
        grid-template-columns: 1fr;
        /* Stack layout */
        text-align: center;
        padding-top: calc(6rem + env(safe-area-inset-top));
        /* Add space at top */
        gap: 2rem;
    }

    .intro-content {
        align-items: center;
        /* Center align on mobile */
        text-align: center;
        min-height: auto;
        /* Allow content to flow */
        padding-bottom: 20rem;
        /* Space for phone at bottom */
    }

    .intro-header {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
    }

    .intro-title {
        font-size: 3.5rem;
    }

    .intro-title2 {
        font-size: 2rem;
    }

    .intro-buttons {
        justify-content: center;
        flex-direction: column;
        width: 100%;
        max-width: 100%;
    }

    .store-btn {
        width: 100%;
        justify-content: center;
    }

    .step-text {
        width: 90%;
        bottom: 15%;
        /* Moved up from 5% to avoid address bar */
    }

    .phone-3d-container {
        /* Move phone up slightly on mobile to make room for lightbox */
        height: 100%;
        top: 0;
        width: 90%;
        left: 5%;
    }
}

/* Footer */
.footer {
    padding: 4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    background: rgba(11, 18, 25, 0.98);
    position: relative;
    z-index: 10;
}

/* Footer as snap section - override default snap-section styles */
.footer.snap-section {
    height: auto;
    min-height: 30vh;
    align-items: center;
    justify-content: center;
    padding-bottom: 0;
    scroll-snap-align: end;
    /* Snap to end so footer is fully visible */
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

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

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

/* Responsive Adjustments */
@media (max-width: 600px) {
    .intro-title {
        font-size: 3rem;
    }

    .intro-title2 {
        font-size: 1.75rem;
    }

    .intro-logo {
        width: 60px;
        height: 60px;
    }

    .step-text h2 {
        font-size: 1.3rem;
    }

    .step-text p {
        font-size: 0.9rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Animations */
.fade-in-section {
    opacity: 0;
    /*transform: translateY(30px);*/
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-section.visible {
    opacity: 1;
    transform: none;
}

/* Staggered Animation for Hero */
.hero-content .hero-logo,
.hero-content h1,
.hero-content p,
.hero-content .hero-buttons {
    opacity: 0;
    /*transform: translateY(20px);*/
    animation: fadeInUp 0.8s ease forwards;
}

.hero-content .hero-logo {
    animation-delay: 0.1s;
}

.hero-content h1 {
    animation-delay: 0.2s;
}

.hero-content p {
    animation-delay: 0.4s;
}

.hero-content .hero-buttons {
    animation-delay: 0.6s;
}

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

/* Loader Styles */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
    pointer-events: none;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    color: var(--text-primary);
    position: relative;
    transition: transform 0.3s ease;
}

/* Desktop Adjustment: Phone starts at x=3.5 (approx 25vw to the right of center) */
@media (min-width: 901px) {
    .loader-content {
        transform: translateX(25vw);
    }

    /* Make intro sticky only on desktop */
    #intro-section {
        position: sticky;
        top: 0;
    }
}

/* Mobile Adjustment: Phone starts at y=-7 (at the bottom/below screen) 
   Moving spinner down to indicate position at bottom */
@media (max-width: 900px) {
    .loader-content {
        transform: translateY(60vh);
    }
}

.loader-content p {
    margin-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #3b82f6;
    /* Hardcode a nice blue if var isn't perfect, or use var(--intro-highlight) if exists. using blue */
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Legal Pages (Datenschutz & Impressum) */
.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(8rem + env(safe-area-inset-top)) 2rem 4rem 2rem;
    /* Added top padding for header space */
    position: relative;
    z-index: 10;
    color: var(--text-secondary);
}

.legal-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
}

.legal-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.legal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.legal-content p {
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px solid transparent;
}

.legal-content a:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    transform: translateX(-5px);
}

@media (max-width: 600px) {
    .legal-content {
        padding: 6rem 1.5rem 3rem 1.5rem;
    }

    .legal-content h1 {
        font-size: 2.25rem;
    }

    .legal-content h2 {
        font-size: 1.5rem;
    }

    /* Mobile Footer Adjustments */
    .footer {
        padding: 2rem 0;
        /* Reduced from 4rem */
    }

    .footer.snap-section {
        min-height: auto;
        /* Allow it to be as short as needed */
        padding-bottom: 2rem;
        /* Ensure some space at bottom */
    }

    .footer-container {
        gap: 1.5rem;
        /* Reduced from 2rem */
    }

    .footer-brand {
        font-size: 1.5rem;
        /* Smaller brand text */
    }

    .footer-logo {
        width: 32px;
        height: 32px;
    }

    .footer-links {
        gap: 0.75rem;
        /* Tighter links */
    }
}