/* 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;
}

/* 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;
}

/* p5 Hintergrund */
#p5-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.85;
    pointer-events: none;
}

/* Header */
.header {
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: clamp(60px, 8vw, 120px);
    padding-bottom: clamp(30px, 4vw, 50px);
    pointer-events: none;
}

.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;
    margin-bottom: clamp(20px, 3vw, 30px);
    line-height: 0.95;
    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);
}

/* Subtitle entfernt - Navigation nicht mehr benötigt */

.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);
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    padding: 0 clamp(30px, 5vw, 60px) clamp(80px, 10vw, 120px);
}

/* Tiles Grid */
.tiles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: clamp(30px, 4vw, 50px);
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(40px, 5vw, 60px) clamp(30px, 4vw, 50px);
}

.tile-kunst {
    grid-column: 1;
    grid-row: 1;
}

.tile-lehre {
    grid-column: 2;
    grid-row: 1;
}

.tile-forschung {
    grid-column: 1 / -1;
    grid-row: 2;
}

/* Tile Box (exakt wie content-overlay im Kunst-Overlay und bento-box im Lehre-Overlay) */
.tile-box {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: clamp(40px, 5vw, 60px);
    min-height: 300px;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    cursor: pointer;
    backdrop-filter: blur(6px);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tile-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.02);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tile-box:hover::before {
    opacity: 1;
}

.tile-box:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

.tile-box h2 {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(32px, 4.5vw, 56px);
    font-weight: 700;
    letter-spacing: -1.5px;
    color: #ffffff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    margin: 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);
}

.tile-box:hover h2 {
    transform: scale(1.02);
    text-shadow: 
        0 0 20px rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 255, 255, 0.4),
        0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Untertitel entfernt - nur Titel bleibt */
.tile-box p {
    display: none;
}

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    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;
}

.popup-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    padding: clamp(45px, 6vw, 65px);
    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(6px);
}

/* 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;
}

.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;
}

.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);
}

.popup-content h2 {
    font-family: "Inter Tight", sans-serif;
    font-size: clamp(30px, 4vw, 44px);
    margin-bottom: 28px;
    color: #ffffff;
    font-weight: 700;
    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);
}

.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: #f5f5f5;
    margin-bottom: 18px;
}

.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);
}

/* Responsive */
@media (max-width: 768px) {
    .tiles-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: clamp(20px, 3vw, 35px);
    }

    .tile-kunst {
        grid-column: 1;
        grid-row: 1;
    }

    .tile-lehre {
        grid-column: 1;
        grid-row: 2;
    }

    .tile-forschung {
        grid-column: 1;
        grid-row: 3;
    }

    .lang-btn {
        top: clamp(20px, 2.5vw, 30px);
        right: clamp(20px, 3.5vw, 35px);
    }
}

/* Mobile Styles für Overlays (Kunst, Lehre) */
@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(40px, 6vw, 80px);
        padding-bottom: clamp(30px, 5vw, 50px);
        align-items: center;
    }
    
    /* Mehr Padding für Kunst-Main auf Mobile */
    .kunst-main {
        padding-top: clamp(40px, 6vw, 60px);
    }
}

/* Smooth transitions */
.lang-fade {
    transition: opacity 0.25s ease;
}
