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

/* Basics */
body {
    background: #000000;
    font-family: "Inter", sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* p5 Hintergrund */
#p5-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.85;
    pointer-events: none;
}

#p5-background canvas {
    z-index: 0 !important;
}

/* Navigation */
.nav-home {
    position: fixed;
    top: clamp(25px, 3.5vw, 45px);
    left: clamp(25px, 4.5vw, 65px);
    z-index: 102;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #f5f5f5;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.nav-home:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(-2px);
}

.nav-home::before {
    content: '←';
    font-size: 18px;
    margin-right: 4px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: clamp(50px, 7vw, 100px);
    padding-bottom: clamp(25px, 4vw, 50px);
    pointer-events: none;
    background: transparent;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: visible;
}

.header > * {
    pointer-events: auto;
}

/* Back-Button im Header - Desktop: versteckt (wird durch fixed nav-home ersetzt) */
.header .nav-home {
    display: none;
}

.title {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(50px, 5vw, 70px);
    font-weight: 800;
    letter-spacing: -2px;
    color: #ffffff;
    text-align: center;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: clamp(20px, 3vw, 30px);
}

.quote-in-header {
    text-align: center;
    max-width: 900px;
    padding: 0 clamp(30px, 5vw, 60px);
}

.quote-in-header .quote-text {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(18px, 1.8vw, 22px);
    font-style: italic;
    line-height: 1.5;
    color: #ffffff;
    font-weight: 300;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: clamp(12px, 1.5vw, 18px);
}

.quote-in-header .quote-author {
    display: block;
    font-size: clamp(14px, 1.6vw, 18px);
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 1px;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: clamp(20px, 3vw, 40px);
}

.lang-btn {
    position: fixed;
    top: clamp(25px, 3.5vw, 45px);
    right: clamp(25px, 4.5vw, 65px);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    padding: 10px 18px;
    font-family: "Inter", sans-serif;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #f5f5f5;
    letter-spacing: 1.5px;
    z-index: 101;
}

.lang-btn:hover {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Quote Section - entfernt, jetzt im Header */

/* Grid */
.bento-grid {
    position: relative;
    z-index: 10;
    padding-top: clamp(280px, 35vw, 380px);
    padding-bottom: clamp(80px, 10vw, 120px);
    display: grid;
    gap: clamp(25px, 3.5vw, 45px);
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    max-width: 1500px;
    margin: 0 auto;
    padding-left: clamp(30px, 5vw, 60px);
    padding-right: clamp(30px, 5vw, 60px);
}

/* Sicherstellen dass Inhalt unter Header scrollt */
.bento-grid {
    position: relative;
    z-index: 1;
}

/* Bento Box */
.bento-box {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: clamp(32px, 3vw, 48px);
    text-decoration: none;
    color: #ffffff;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    backdrop-filter: blur(2px);
    z-index: 5;
}

.bento-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.02);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bento-box:hover::before {
    opacity: 1;
}

.bento-box:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

/* Microline */
.micro-line {
    position: absolute;
    bottom: clamp(12px, 2vw, 20px);
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.bento-box:hover .micro-line {
    opacity: 0.3;
}

.micro-line path {
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 1;
}

.bento-box h2 {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(28px, 3.5vw, 42px);
    font-weight: 700;
    margin-bottom: clamp(12px, 1.5vw, 18px);
    color: #ffffff;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

.bento-box:hover h2 {
    transform: scale(1.08);
}

.bento-box p {
    font-size: clamp(18px, 2vw, 24px);
    color: #ffffff;
    font-weight: 300;
    line-height: 1.6;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10;
}

.bento-box:hover p {
    transform: scale(1.08);
}


/* Large Box */
.large {
    grid-column: span 2;
}

/* Responsive */
@media (max-width: 900px) {
    .large {
        grid-column: span 1;
    }
    
    .lang-btn {
        top: clamp(20px, 2.5vw, 30px);
        right: clamp(20px, 3.5vw, 35px);
    }
    
    .nav-home {
        top: clamp(20px, 2.5vw, 30px);
        left: clamp(20px, 3.5vw, 35px);
    }
}

@media (max-width: 600px) {
    /* Fixed Back-Button auf Desktop ausblenden */
    body > .nav-home {
        display: none;
    }
    
    /* Back-Button im Header auf Mobile anzeigen */
    .header .nav-home {
        display: flex;
        position: relative;
        top: 0;
        left: 0;
        margin: 0 auto clamp(20px, 4vw, 30px) auto;
        width: fit-content;
        align-self: center;
        order: -1;
    }
    
    .header {
        padding-top: clamp(60px, 8vw, 100px);
        padding-bottom: clamp(30px, 5vw, 50px);
        align-items: center;
    }
    
    .bento-grid {
        padding-top: clamp(50px, 8vw, 80px);
    }
    
    /* Mehr Abstand nach dem Zitat auf Mobile */
    .quote-in-header .quote-author {
        margin-bottom: clamp(50px, 8vw, 80px);
    }
    
    /* Sicherstellen, dass Titel nicht überlappt */
    .title {
        margin-top: 0;
    }
}

/* Pop-Up Overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Pop-Up Card */
.popup-card {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: clamp(40px, 5vw, 60px);
    width: min(90vw, 720px);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 
        0 25px 70px rgba(0, 0, 0, 0.8),
        0 0 120px rgba(255, 255, 255, 0.15);
    position: relative;
    transform: translateY(30px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

/* Scrollbar Styling für Popup */
.popup-card::-webkit-scrollbar {
    width: 8px;
}

.popup-card::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.popup-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.popup-card::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.popup-overlay.active .popup-card {
    transform: translateY(0);
    opacity: 1;
}

.popup-nav-home {
    display: none !important; /* Startseite-Button komplett entfernt */
}

/* Close Button */
.popup-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    width: 38px;
    height: 38px;
    font-size: 22px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Inter", sans-serif;
    z-index: 2001;
}

.popup-close:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

/* Inhalt */
.popup-content {
    position: relative;
    z-index: 1;
}

/* Popup Header für Scroll-Hide (falls verwendet) */
.popup-header {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Popup-Titel (groß, weiß, zentriert, wie Kachel-Titel) */
.popup-title {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    letter-spacing: -1.5px;
    color: #ffffff;
    text-align: center;
    margin: 0 0 clamp(32px, 4vw, 48px) 0;
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(255, 255, 255, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.6);
    line-height: 1.2;
}

.popup-content h3 {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(20px, 2.2vw, 26px);
    margin-top: 28px;
    margin-bottom: 14px;
    color: #ffffff;
    font-weight: 600;
}

.popup-content p {
    font-size: clamp(17px, 1.6vw, 21px);
    line-height: 1.8;
    color: #ffffff;
    margin-bottom: 18px;
    text-shadow: 
        0 0 8px rgba(255, 255, 255, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.6);
}

.popup-button {
    display: inline-block;
    margin-top: 36px;
    padding: 16px 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    text-decoration: none;
    color: #ffffff;
    font-family: "Inter", sans-serif;
    font-size: clamp(16px, 1.5vw, 19px);
    font-weight: 400;
    transition: all 0.3s ease;
    letter-spacing: 1.5px;
}

.popup-button:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 255, 255, 0.25);
}

/* Smooth transitions */
.lang-fade {
    transition: opacity 0.25s ease;
}
