:root {
    --bg-dark: #02060c;
    --header-blue: #0a1e3d;
    --accent-cyan: #4db8ff;
    --accent-glow: rgba(77, 184, 255, 0.4);
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-title: 'Space Grotesk', sans-serif;
}

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

html { 
    scroll-behavior: auto !important; 
    scroll-snap-type: y mandatory;
    height: 100%;
}

/* Hilfsklasse für flüssiges Springen per JS */
html.no-snap {
    scroll-snap-type: none !important;
}

body { 
    font-family: var(--font-main); 
    background-color: var(--bg-dark); 
    color: var(--text-white); 
    line-height: 1.6; 
    overflow-x: hidden; 
    height: 100vh;
    overflow-y: scroll;
}

/* Sektions-Steuerung */
header#home,
main section {
    min-height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 20px 190px;
    position: relative;
}

main section {
    padding-top: 160px;
}

/* --- FLOATING DOCK --- */
.floating-nav {
    position: fixed;
    bottom: clamp(18px, 3vh, 32px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: auto;
    max-width: 95vw;
}

.nav-content {
    position: relative; 
    background: rgba(15, 23, 42, 0.5); 
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 100px;
    padding: 6px; 
    display: flex;
    gap: 0; 
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.6), 
        inset 0 0 15px rgba(255, 255, 255, 0.05);
}

.nav-indicator {
    position: absolute;
    height: calc(100% - 12px);
    top: 6px;
    left: 0;
    background: var(--accent-cyan);
    border-radius: 80px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
    box-shadow: 0 0 20px var(--accent-glow);
    will-change: transform, width;
}

.nav-item {
    position: relative;
    z-index: 2; 
    color: var(--text-white);
    text-decoration: none;
    font-size: clamp(0.8rem, 0.95vw, 1rem);
    font-weight: 500;
    padding: 11px 20px;
    border-radius: 80px;
    transition: color 0.4s ease, opacity 0.4s ease;
    white-space: nowrap;
    opacity: 0.6;
}

.nav-item:hover { opacity: 1; }

.nav-item.active {
    color: #000 !important;
    opacity: 1;
    font-weight: 700;
}

/* --- HEADER & HERO --- */
header {
    background: radial-gradient(circle at center, var(--header-blue) 0%, var(--bg-dark) 100%);
    text-align: center; 
}

.logo-wrapper {
    margin-bottom: 30px;
}

.main-logo { 
    max-width: 400px; 
    width: 100%; 
    height: auto; 
    filter: drop-shadow(0 0 15px rgba(77, 184, 255, 0.2)); 
}

main { 
    max-width: 1300px; 
    margin: 0 auto; 
    width: 100%;
}

.hero-section {
    text-align: center;
}

.hero-section h2 {
    color: var(--text-muted);
    letter-spacing: 5px;
    font-size: 1rem;
    margin-bottom: 10px;
}

.hero-section h1 { 
    font-family: var(--font-title); 
    font-size: clamp(2rem, 5vw, 3.5rem); 
    margin-bottom: 25px; 
    letter-spacing: 2px; 
}

.highlight { color: var(--accent-cyan); }

.hero-link {
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.hero-link:hover {
    color: var(--text-white);
    filter: drop-shadow(0 0 8px var(--accent-cyan));
    transform: translateY(-2px);
}

.section-title {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    text-align: center; 
    color: var(--accent-cyan); 
    font-size: clamp(1.2rem, 3vw, 1.4rem); 
    letter-spacing: 4px; 
    margin-bottom: 0; 
    text-transform: uppercase; 
    font-family: var(--font-title);
    z-index: 2;
    pointer-events: none;
}

/* --- GRID & CARDS --- */
.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center; 
    align-items: stretch;
    width: 100%;
}

.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: 
        transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), 
        opacity 0.8s ease-out,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(60px);
    flex: 0 1 calc(33.333% - 20px);
    min-width: 280px;
    position: relative;
    height: 100%;
}

.glass-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-cyan);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

/* Einheitliche Größen pro Sektion */
#dienstleistungen .glass-card {
    flex: 0 1 calc(33.333% - 28px);
    min-width: 240px;
    max-width: 320px;
    min-height: 355px;
    padding: 22px;
}

#dienstleistungen .card-img {
    height: 145px;
    margin-bottom: 16px;
}

#dienstleistungen .glass-card h3 {
    font-size: 1.08rem;
    margin-bottom: 10px;
    min-height: 2.6rem;
}

#dienstleistungen .glass-card p {
    font-size: 0.88rem;
    line-height: 1.5;
}

#partner .glass-card {
    flex: 0 1 calc(50% - 20px);
    max-width: 380px;
    min-height: 360px;
}

#referenzen .glass-card {
    min-height: 210px;
}

.boring-card {
    flex: 0 1 calc(50% - 20px);
    min-width: 280px;
    max-width: 420px;
    min-height: 260px;
    justify-content: center;
}

.card-img {
    width: 100%;
    height: 180px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; 
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.glass-card h3 {
    color: var(--accent-cyan);
    font-size: 1.25rem;
    margin-bottom: 15px;
    text-align: center;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-title);
}

.glass-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    flex-grow: 1;
}

/* --- REFERENZEN --- */
.ref-grid .glass-card {
    flex: 0 1 calc(20% - 20px);
    min-width: 180px;
    padding: 15px;
    border-radius: 15px;
}

.ref-grid .glass-card h3 {
    font-size: 0.95rem;
    min-height: 2.5rem;
    margin-bottom: 0;
    line-height: 1.2;
}

.ref-grid .card-img {
    height: 100px;
    margin-bottom: 12px;
}

.ref-logo {
    padding: 12px !important;
    background: rgba(0, 0, 0, 0.2);
}

.ref-logo img {
    object-fit: contain !important;
}

.ref-logo img[src$=".svg"],
.ref-logo img[src*="white"],
.ref-logo img[src*="weiss"] {
    filter: brightness(0) invert(1);
}

/* --- LANGWEILIGES --- */
.boring-grid {
    max-width: 900px;
    margin: 0 auto;
}

.boring-card p {
    margin-bottom: 10px;
}

.boring-card a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.boring-card a:hover {
    color: var(--accent-cyan);
}

/* --- ANIMATIONEN --- */
@keyframes cardPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 rgba(77, 184, 255, 0); }
    50% { transform: scale(1.06) translateY(-15px); box-shadow: 0 20px 50px rgba(77, 184, 255, 0.4); border-color: var(--accent-cyan); }
    100% { transform: scale(1); box-shadow: 0 0 0 rgba(77, 184, 255, 0); }
}

.card-highlight-active {
    animation: cardPulse 2s ease-in-out;
    z-index: 10;
    position: relative;
}

/* --- FOOTER --- */
footer { 
    background: #010306; 
    padding: 30px 20px 140px; 
    border-top: 1px solid var(--glass-border); 
    scroll-snap-align: end;
}

.footer-bottom {
    text-align: center;
    color: #444;
    font-size: 0.8rem;
    padding-top: 10px;
}

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
    .ref-grid .glass-card { flex: 0 1 calc(25% - 20px); }
}

@media (max-width: 992px) {
    .glass-card { flex: 0 1 calc(50% - 20px); }
    .ref-grid .glass-card { flex: 0 1 calc(33.333% - 20px); }

    #dienstleistungen .glass-card {
        flex: 0 1 calc(50% - 20px);
        max-width: 360px;
        min-height: 355px;
    }

    #partner .glass-card {
        flex: 0 1 calc(50% - 20px);
        min-height: 360px;
    }
}

@media (max-width: 768px) {
    main section {
        padding-top: 140px;
        padding-bottom: 165px;
    }

    .ref-grid .glass-card { flex: 0 1 calc(50% - 20px); }

    .nav-item {
        padding: 9px 14px;
        font-size: 0.74rem;
    }

    .section-title {
        top: 60px;
    }

    .boring-card {
        flex: 1 1 100%;
        max-width: 100%;
        min-height: 240px;
    }
}

@media (max-width: 600px) {
    .glass-card,
    .ref-grid .glass-card,
    #dienstleistungen .glass-card,
    #partner .glass-card,
    .boring-card {
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }

    #dienstleistungen .glass-card,
    #partner .glass-card,
    #referenzen .glass-card,
    .boring-card {
        min-height: auto;
    }

    main section {
        padding-top: 130px;
        padding-bottom: 155px;
    }

    .hero-section h1 { font-size: 1.8rem; }

    .floating-nav { bottom: 14px; }

    .nav-content {
        padding: 5px;
    }

    .nav-item {
        padding: 8px 10px;
        font-size: 0.68rem;
    }

    .section-title {
        top: 50px;
        width: calc(100% - 24px);
        letter-spacing: 3px;
    }

    footer {
        padding-bottom: 125px;
    }
}

/* --- LEGAL OVERLAYS --- */
.legal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(2, 6, 12, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 20000;
    display: none; 
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.legal-overlay.active { display: flex !important; }

.legal-overlay .overlay-content.glass-card {
    opacity: 1 !important;
    transform: none !important;
    max-width: 800px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: clamp(20px, 5vw, 40px) !important;
    display: block;
}

.legal-text { 
    text-align: left; 
    color: var(--text-white); 
}

.legal-text h2,
.legal-text h3 {
    color: var(--accent-cyan);
    font-family: var(--font-title);
    margin: 20px 0 10px;
}

.close-btn {
    position: sticky;
    top: 0;
    float: right;
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    z-index: 100;
    margin-bottom: 10px;
}

.stretched-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}