﻿/* ================== Variables ================== */
:root {
    --bg1: #0f172a;
    --bg2: #1e3a8a;
    --bg3: #1294d6;
    --grid: rgba(34,211,238,.14);
    --fg: #e2e8f0;
    --muted: #94a3b8;
}
/* === Inter Variable Font === */
@font-face {
  font-family: 'InterVariable';
  src: url('/fonts/Inter-Variable.woff2') format('woff2-variations'),
       url('/fonts/Inter-Variable.woff2') format('woff2');
  font-weight: 100 900;   /* Variable: von Thin bis Black */
  font-style: normal;
  font-display: swap;     /* Text wird mit Fallback sofort angezeigt */
}

:root{ font-family:"InterVar", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* ================== Base ================== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--fg);
    background: linear-gradient(-45deg,var(--bg1),var(--bg2),var(--bg3),var(--bg1));
    background-size: 400% 400%;
    animation: gradientMove 18s ease infinite;
    overflow-x: hidden;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%
    }

    50% {
        background-position: 100% 50%
    }

    100% {
        background-position: 0% 50%
    }
}

/* Animated background layers (immer hinter UI) */
#bg-canvas {
    position: fixed;
    inset: 0;
    display: block;
    z-index: -10 !important;
    pointer-events: none !important;
}

/* Grid-Overlay dezenter */
.bg-grid{
  position: fixed; inset: 0; pointer-events:none; z-index:0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px, 48px 48px;
  background-position: -1px -1px, -1px -1px;
  mix-blend-mode: soft-light;
}


/* Inhalte über dem Hintergrund */
main, .container, .tri-card {
    position: relative;
    z-index: 10;
}

/* ================== Layout ================== */
.container {
    width: min(1200px,92vw);
    margin-inline: auto;
    padding-inline: 1rem;
}

.hero {
    min-height: 72vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 4rem 1rem;
}

    .hero h1 {
        margin: .2rem 0 .4rem;
        font-size: clamp(1.8rem,2.2vw + 1rem,3.2rem);
        text-shadow: 0 0 24px rgba(0,255,255,.25);
    }

    .hero .sub {
        color: var(--muted);
        margin: .25rem 0 1.25rem;
    }

.hero-top {
    min-height: auto;
    padding-top: 2rem;
    padding-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

    .hero-top h1 {
        margin: .5rem 0;
        font-size: clamp(2rem,2.5vw + 1rem,3.5rem);
        text-shadow: 0 0 20px rgba(0,255,255,.25);
    }

.hero-subline {
    font-size: 1.6rem;
    font-weight: 400;
    margin: 1rem 0 2rem;
    color: var(--fg);
    text-shadow: 0 0 12px rgba(0,255,255,.15);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: .65rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    color: var(--fg);
    text-decoration: none;
}

    .btn:hover {
        background: rgba(255,255,255,.10);
    }

    .btn.primary {
        border: none;
        background: linear-gradient(135deg,#38bdf8,#1294d6);
        color: #00111a;
        font-weight: 700;
    }

    .btn.link {
        background: transparent;
        border: none;
        padding: .45rem .5rem;
        text-decoration: underline;
        opacity: .9;
        cursor: pointer;
    }

        .btn.link:hover {
            opacity: 1;
        }

/* ================== Header (zweizeilig) ================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10000 !important;
    backdrop-filter: blur(8px);
    isolation: isolate; /* eigener Stacking-Context */
    transform: none;
}

.brand-row {
    display: flex;
    align-items: center;
    padding: 14px 0;
    white-space: nowrap;
    overflow: visible;
}

.brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    width: 320px;
    height: auto;
    display: block;
}

.logo-large {
    width: 320px;
    height: auto;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

    .brand-text .title {
        margin: 0;
        font-size: 3.2rem;
        font-weight: 800;
        color: #fff;
        line-height: 1.2;
    }

    .brand-text .tagline {
        margin-top: 6px;
        font-size: 1.1rem;
        color: #a5f3fc;
        text-align: center;
        align-self: center;
    }

/* Menü-Zeile */
.menu-row {
    border-top: 1px solid rgba(255,255,255,.1);
    background: rgba(10,16,28,.6);
    position: relative;
    z-index: 10010 !important;
    overflow: visible !important;
}

.main-nav {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 10px 0;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: visible !important;
    position: relative;
    z-index: 10020 !important;
}

    .main-nav a {
        color: var(--fg);
        text-decoration: none;
        opacity: .9;
        padding: 6px 2px;
    }

        .main-nav a:hover {
            opacity: 1;
            text-decoration: underline;
        }

        .main-nav a.active {
            text-decoration: underline;
            opacity: 1;
        }

.nav-track {
    display: flex;
    gap: 24px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
}

.nav-end {
    display: flex;
    gap: 28px;
    margin-left: 40px;
}

    .nav-end a {
        color: var(--fg);
        text-decoration: none;
        opacity: .9;
    }

        .nav-end a:hover {
            opacity: 1;
            text-decoration: underline;
        }

/* ================== Dropdown (nur Hover) ================== */
.dropdown {
    position: relative;
    display: inline-block;
    z-index: 10030 !important;
}

.dropbtn {
    color: var(--fg);
    text-decoration: none;
    opacity: .9;
    padding: 6px 2px;
}

    .dropbtn:hover {
        opacity: 1;
        text-decoration: underline;
    }

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(15,23,42,.98);
    min-width: 200px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,.45);
    z-index: 11000 !important; /* über allem in der Header-Zeile */
}

    .dropdown-content a {
        display: block;
        white-space: nowrap;
        padding: 10px 14px;
        color: var(--fg);
        text-decoration: none;
        opacity: .95;
    }

        .dropdown-content a:hover {
            background: rgba(34,211,238,.12);
        }

.dropdown:hover .dropdown-content {
    display: block;
}

/* ================== Cards / Grids ================== */
/* 4 → 2 → 1 Spalten */
.tri-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 18px;
    padding: 1rem 0 3rem;
}

@media (max-width:1200px) {
    .tri-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width:680px) {
    .tri-grid {
        grid-template-columns: 1fr;
    }
}

.tri-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,.02));
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    min-height: 420px;
    z-index: 1500;
    transition: transform .3s ease, box-shadow .3s ease;
}

    .tri-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 16px 40px rgba(34,211,238,0.25);
    }

    .tri-card h2 {
        margin-top: 1rem;
        margin-bottom: .5rem;
    }

    .tri-card p {
        margin: .2rem 0 .6rem;
        color: var(--muted);
    }

    .tri-card ul {
        margin: 0 0 1rem;
        padding-left: 1.2rem;
    }

    .tri-card li {
        margin: .25rem 0;
    }

    .tri-card .btn {
        margin-top: auto;
        align-self: flex-start;
    }

/* Icon oben */
.tri-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
    display: block;
}

/* „Mehr anzeigen“ – Collapsible */
.more {
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease, padding-top .35s ease;
    border-top: 1px dashed rgba(255,255,255,.15);
    margin-top: .5rem;
    padding-top: 0;
}

.tri-card.expanded .more {
    max-height: 560px;
    padding-top: .6rem;
}

.more h4 {
    margin: .4rem 0 .2rem;
}

/* Aktionen unten bündig */
.card-actions {
    margin-top: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ================== Kalkulationsformular ================== */
#calcForm .form-field {
    display: flex;
    flex-direction: column;
}

#calcForm label {
    margin-bottom: .3rem;
    font-size: .9rem;
    color: var(--muted);
}

#calcForm input, #calcForm select {
    width: 100%;
    padding: .4rem .5rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.05);
    color: var(--fg);
}

/* ================== Anfrage-Form (Grid) ================== */
.req-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 14px 18px;
    max-width: 900px;
    margin-inline: auto;
    align-items: start;
}

    .req-grid label {
        justify-self: end;
        color: var(--muted);
        font-weight: 500;
    }

        .req-grid label.top {
            align-self: start;
            padding-top: .35rem;
        }

    .req-grid .field {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .req-grid input, .req-grid textarea, .req-grid select {
        width: 100%;
        padding: .55rem .6rem;
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,.2);
        background: rgba(255,255,255,.06);
        color: var(--fg);
        font-size: 1rem;
    }

    .req-grid textarea {
        min-height: 120px;
    }

    .req-grid .field-inline {
        display: flex;
        gap: 10px;
        align-items: center;
    }

#colorPicker {
    width: 44px;
    height: 38px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255,255,255,.2) inset;
    border-radius: 6px;
}

.req-grid .val {
    color: #f87171;
    font-size: .9rem;
}

.req-grid .actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 14px;
    margin-top: 4px;
}

.alert-success {
    padding: 1rem;
    background: rgba(34,197,94,.15);
    border: 1px solid rgba(34,197,94,.35);
    border-radius: 8px;
    margin-bottom: 1rem;
    color: #bbf7d0;
}
/* Pflichtstern */
.req-grid label.req::after {
    content: " *";
    color: #f87171;
    margin-left: 4px;
    font-weight: 700;
}

/* ================== Responsive ================== */
@media (max-width:1200px) {
    .brand-text .title {
        font-size: 2.4rem;
    }
}

@media (max-width:980px) {
    .logo {
        width: 200px;
    }

    .brand-text .title {
        font-size: 2rem;
    }
}

@media (max-width:760px) {
    .logo {
        width: 160px;
    }

    .brand-text .title {
        font-size: 1.6rem;
    }

    .brand-text .tagline {
        font-size: .95rem;
    }

    .req-grid {
        grid-template-columns: 1fr;
    }

        .req-grid label {
            justify-self: start;
        }
}

/* ================== Accessibility ================== */
@media (prefers-reduced-motion:reduce) {
    body {
        animation: none;
        background: var(--bg1);
    }
}
/* ===== Hintergrund sicher nach hinten, Menü sicher nach vorn ===== */
#bg-wrap {
    position: fixed;
    inset: 0;
    z-index: -100000 !important; /* eigener, sehr tiefer Stacking-Context */
    pointer-events: none; /* klick-durchlässig */
}

    #bg-wrap > * {
        position: absolute;
        inset: 0;
        pointer-events: none !important;
        transform: none !important;
        filter: none !important;
    }

/* Header & Menü ganz nach vorn, eigener Kontext */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100000 !important;
    isolation: isolate; /* separater Stacking-Context */
}

/* Dropdown-Panels immer ganz oben */
.menu-row {
    position: relative;
    z-index: 100010 !important;
    overflow: visible !important;
}

.main-nav {
    position: relative;
    z-index: 100020 !important;
    overflow: visible !important;
}

.dropdown {
    position: relative;
    z-index: 100030 !important;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 200000 !important; /* über allem UI */
}

/* Sicherheit: nichts im Header clippen */
.container, .brand-row, .menu-row {
    overflow: visible !important;
}

/* Inhalt unter dem Header halten */
main, .tri-grid, .tri-card {
    position: relative;
    z-index: 1;
}
/* Collapsible: sauberer Startzustand + flüssige Animation */
.more {
    max-height: 0; /* Start: zu */
    overflow: hidden;
    will-change: max-height;
    transition: max-height .35s ease, padding-top .35s ease;
    border-top: 1px dashed rgba(255,255,255,.15);
    margin-top: .5rem;
    padding-top: 0;
}
/* Die Regel .tri-card.expanded .more kannst du behalten oder ignorieren,
   die JS-Variante setzt max-height inline und ist zuverlässiger. */
/* Dropdown-Trigger immer aktiv darstellen */
.main-nav .dropbtn {
  background: transparent;
  color: #e6eef7;
  opacity: 1;
  pointer-events: auto;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: .45rem .65rem;
}

/* wichtig: :visited von alten <a>-Triggern neutralisieren,
   falls irgendwo noch vorhanden */
.main-nav .dropbtn:visited,
.main-nav .dropdown > a.dropbtn:visited {
  color: inherit;
}

/* Falls irgendwo pauschal Opacity gesetzt wurde (z. B. bei "inactive") */
.main-nav .dropdown.inactive .dropbtn { opacity: 1; }

/* Hover/Focus für gute Erkennbarkeit */
.main-nav .dropbtn:hover,
.main-nav .dropbtn:focus-visible {
  background: rgba(255,255,255,.08);
  outline: none;
}
/* --- Fix: Dropdown-Menü Buttons immer aktiv darstellen --- */
.main-nav .dropbtn {
  background: transparent;
  color: #e6eef7;              /* Menüfarbe */
  opacity: 1 !important;       /* nie ausgegraut */
  pointer-events: auto !important;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  padding: .45rem .65rem;
}

/* :visited-Farbe überschreiben, falls noch <a>-Trigger */
.main-nav .dropbtn:visited,
.main-nav .dropdown > a.dropbtn:visited {
  color: inherit !important;
}

/* Hover/Focus für visuelles Feedback */
.main-nav .dropbtn:hover,
.main-nav .dropbtn:focus-visible {
  background: rgba(255,255,255,.08);
  outline: none;
}

