/* ALLGEMEINE GRUNDLAGEN */
body {
    background-color: rgb(0, 0, 0);
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
}

*{
    color: rgb(210, 210, 210);
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    margin: 0;
}

/* ------------------------------------- */
/* --- HEADER & NAVIGATION (DESKTOP DEFAULT) --- */
/* ------------------------------------- */

header {
    position: fixed; 	 
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    box-shadow: 0px 2px 20px rgba(0,0,0,0.75);
    z-index: 10;
    display: flex; 	 
    justify-content: center; /* Zentriert die Navigationsleiste */
}

/* Hamburger Icon und Checkbox auf Desktop/Standard verbergen */
.menu-toggle,
.menu-icon {
    display: none;
}

/* Navigationsleiste (Desktop Default: Links nebeneinander) */
header nav {
    display: flex; 	
    justify-content: center; 
    gap: 14px; 	 
    width: auto;
}

/* Desktop: Visuelle Reihenfolge (Home in der Mitte) */
header nav a {
    order: 2; /* Standard-Reihenfolge */
}

.home-link {
    order: 3; /* Home in die Mitte (3. von 5) */
}

header nav a:nth-child(2), /* Leistungen */
header nav a:nth-child(3)  /* Referenzen */
{
    order: 1; /* Links von Home */
}

header nav a:nth-child(4), /* Über mich */
header nav a:nth-child(5)  /* Kontakt */
{
    order: 4; /* Rechts von Home */
}


header a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    text-decoration: none;
    color: rgb(210, 210, 210);
    font-size: clamp(0.7rem, 1vw, 1rem);
    text-shadow: 0 0 8px black;
    white-space: nowrap;
    justify-content: center;
    width: 100px;
    overflow: hidden;
}

/* Desktop: Text fährt beim Hovern aus */
header a span {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: max-width 0.6s ease-out, opacity 0.6s ease-out, color 0.2s linear;
}

header a:hover span {
    opacity: 1;
    max-width: 150px;
}

header img {
    width: 22px;
    height: 22px;
    filter: invert(1);
}

/* ------------------------------------- */
/* --- HERO SEKTION & TEXTFELD --- */
/* ------------------------------------- */

.hero{
    position: relative;
    width: 100vmax;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center; 	 	
}

.startbild {
    position: fixed; 
    text-align: center;
    color: rgb(210, 210, 210);
    height: 100vh;
    width: 100vw; 
    top: 0; 
    left: 0;
    object-fit: cover;
    display: block;
    z-index: -5; 
}

.textfeld {
    /* Zentrieren im Viewport */
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Größe definieren */
    width: 100vh; /* Oder passen Sie die gewünschte Breite an */
    height: 70vh; /* NEU: Feste Höhe, z.B. 80% des Viewports */
    max-width: 90%; /* Responsive Anpassung */
    
    /* Scrollen nur INNERHALB des Containers erlauben */
    overflow-y: scroll; 
    
    /* Visuelle Anpassungen */
    background-color: rgba(35, 35, 35, 0.25); /* Halbdurchsichtiger weißer Hintergrund */
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0px 5px 25px rgba(0,0,0,0.75);
    z-index: 5; /* Über dem startbild */
    
    /* Text-Formatierung (basierend auf Ihrer Datei) */
    font-size: 1.1em;
    color: #333;
}


/* Entferne absolute Positionierungen */
.Überschrift,
.unterschrift,
.Wilkommen-text {
    position: static;
    transform: none;
    width: 100%;
}

/* Schriftgrößen */
.Überschrift, h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 0.3rem;
    margin-top: 0.5rem;
    text-align: center;
}

.unterschrift, h2, h3 {
    font-size: clamp(1.2rem, 2.6vw, 2rem);
    margin-bottom: 0.3rem;
    margin-top: 0.5rem;
    text-align: center;
}

.Wilkommen-text {
    /* Anpassung: Mindestgröße leicht erhöht für bessere Lesbarkeit auf Handys */
    font-size: clamp(1.1rem, 1.4vw, 1.3rem);
    margin-bottom: 1rem;
}

/* ------------------------------------- */
/* --- BOTTOM LINKS / FOOTER BEREICH --- */
/* ------------------------------------- */

.bottom-links{
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.bottom-links a{
    text-shadow: 0 0 8px black;
    line-height: 1;
    font-size: clamp(0.85rem, 1.4vw, 1rem); 
    text-decoration: none;
    color: rgb(210, 210, 210);
}

.bottom-links a:hover {
    color: rgb(170, 170, 170);
}

.bottom-links img{
    width: 18px;
    filter: invert(1);
    transition: transform 0.3s ease;
}

.bottom-links img:hover {
    transform: scale(1.15);
}

.link-row {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center; 
    align-items: center;
    gap: 10px;
}

/* Desktop/Standard: Links nebeneinander */
.left-link {
    position: absolute;
    right: 50%; 
    transform: translateX(-10px); 
    text-align: right;
}

.right-link {
    position: absolute;
    left: 50%; 
    transform: translateX(10px); 
    text-align: left;
}

.separator {
    color: rgb(210, 210, 210);
    user-select: none;
    z-index: 1;
}

/* ------------------------------------- */
/* --- MOBILE & TABLET ANPASSUNGEN (max-width: 768px) --- */
/* ------------------------------------- */

@media (max-width: 768px) {
    
    /* Zuerst: Das horizontale Scrollen komplett verhindern */
    body {
        overflow-x: hidden;
    }
    
    header {
        width: 60px; 
        padding: 1.5rem 0; 
        height: auto; 
        left: 0;
        right: auto;
        top: 0;
        display: block; 
    }
    
    .menu-icon {
        display: flex; 
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        cursor: pointer;
        z-index: 20;
        position: absolute; 
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    
    .icon-line {
        display: block;
        height: 3px;
        width: 100%;
        background-color: rgb(210, 210, 210);
        border-radius: 1px;
        transition: all 0.3s ease-in-out;
    }

    /* ------------------------------------- */
    /* --- TEXTFELD ANPASSUNGEN (MOBILE) --- */
    /* ------------------------------------- */
    
    .textfeld {
        /* Zentrierung bleibt */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        position: absolute;
        
        /* Korrektur: Flexible Breite (90%) und eine maximale Breite (z.B. 400px) nutzen. 
           Die feste '25rem' wurde entfernt, da sie den Überlauf verursacht hat. */
        height: auto; 
        max-height: 30rem; 
        width: 80vw; 
        /* Weiterhin großzügiger Abstand unten für Bottom-Links */
        margin-bottom: 3rem; 
        
        overflow-y: auto; 
        overflow-x: hidden; 
        
        /* Kleinere Polsterung für mehr Platz */
        padding: 20px;
        
        /* Visuelle Anpassungen beibehalten */
        background-color: rgba(35, 35, 35, 0.8); 
        backdrop-filter: blur(6px); 
        border-radius: 10px;
        box-shadow: 0px 3px 15px rgba(0,0,0,0.75);
    }
    
    /* Hover-Effekt entfernen, da er auf Touch-Geräten Probleme macht */
    .textfeld:hover {
        transform: translate(-50%, -50%);
    }
    .hero {
        padding-top: 0;
        width: calc(100%); 
        margin-left: 0; 
        
        overflow: visible;
    }
    /* ------------------------------------- */
    /* --- BOTTOM LINKS ANPASSUNGEN (MOBILE) --- */
    /* ------------------------------------- */
    
    .bottom-links {
        position: fixed; /* 'fixed' stellen, damit sie sichtbar bleiben */
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 6; 
    }

    /* ------------------------------------- */
    /* --- Restlicher Mobile Code ... */
    /* ------------------------------------- */

    header nav {
        position: fixed; 
        top: 0;
        left: 0;
        height: 100vh;
        width: min(80vw, 300px); 
        background: rgba(35, 35, 35, 0.95);
        backdrop-filter: blur(8px);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.8);
        flex-direction: column;
        justify-content: flex-start; 
        padding-top: 60px; 
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out;
        z-index: 15;
        pointer-events: none;
    }
    
    header nav a {
        order: 0 !important;
        justify-content: flex-start; 
        width: 100%;
        padding: 12px 20px;
        text-shadow: none;
        font-size: 1.2rem; 
    }

    header a span {
        opacity: 1; 
        max-width: none; 
        overflow: visible;
        transition: none; 
        margin-left: 10px; 
    }
    
    header a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .menu-toggle:checked ~ .main-nav {
        transform: translateX(0);
        pointer-events: auto;
    }

    .menu-toggle:checked + .menu-icon .icon-line:nth-child(1) {
        transform: translateY(11px) rotate(45deg);
    }

    .menu-toggle:checked + .menu-icon .icon-line:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle:checked + .menu-icon .icon-line:nth-child(3) {
        transform: translateY(-11px) rotate(-45deg);
    }
    
}