/* Local Font Definitions */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/Inter-Bold.woff2') format('woff2');
}

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

body {
    overflow: hidden;
    background: #0a0a0a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Images - Place generated images in static/images/ */
/* WebP with PNG fallback for better performance */

#plesslburkhardt.has-background {
    background: url('../images/plessl-burkhardt-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/plessl-burkhardt-bg.webp') type('image/webp'),
        url('../images/plessl-burkhardt-bg.png') type('image/png')
    );
}

#nuvibit.has-background {
    background: url('../images/nuvibit-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/nuvibit-bg.webp') type('image/webp'),
        url('../images/nuvibit-bg.png') type('image/png')
    );
}

#jugendspiel.has-background {
    background: url('../images/jugendspiel-rohrdorferberg-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/jugendspiel-rohrdorferberg-bg.webp') type('image/webp'),
        url('../images/jugendspiel-rohrdorferberg-bg.png') type('image/png')
    );
}

#agfam.has-background {
    background: url('../images/agfam-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/agfam-bg.webp') type('image/webp'),
        url('../images/agfam-bg.png') type('image/png')
    );
}

#apotheke.has-background {
    background: url('../images/schwanen-apotheke-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/schwanen-apotheke-bg.webp') type('image/webp'),
        url('../images/schwanen-apotheke-bg.png') type('image/png')
    );
}

#harmonie.has-background {
    background: url('../images/harmonie-rohrdorf-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/harmonie-rohrdorf-bg.webp') type('image/webp'),
        url('../images/harmonie-rohrdorf-bg.png') type('image/png')
    );
}

#buecher.has-background {
    background: url('../images/buecher-bg.png') center/cover no-repeat;
    background-image: image-set(
        url('../images/buecher-bg.webp') type('image/webp'),
        url('../images/buecher-bg.png') type('image/png')
    );
}

#linkedin-left.has-background,
#linkedin-right.has-background {
    background: url('../images/linkedin-bg.png') 100%;
    background-image: image-set(
        url('../images/linkedin-bg.webp') type('image/webp'),
        url('../images/linkedin-bg.png') type('image/png')
    );
}

/* Main Container - 3D Z-Layered Layout */

.main-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 100vh;
    width: 100vw;
    background: #1a1a1a;
    gap: 1px;
    padding: 1px;
}

.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px;
    background: #1a1a1a;
    position: relative;
}

.video-tile {
    position: relative;
}

.tile {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-decoration: none;
    background: #fff;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 20px;
}

/* Center icons and text as a group */
.tile > .icon,
.tile > .swan,
.tile > .cherry,
.tile > .title,
.tile > .subtitle,
.tile > .logo {
    align-self: center;
    text-align: center;
}

/* Background image overlay for text readability */
.tile.has-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.5), rgba(0,0,0,0.3));
    z-index: 1;
    transition: opacity 0.4s ease;
}

.tile.has-background:hover::after {
    opacity: 0.7;
}

/* Ensure content is above overlay */
.tile > * {
    position: relative;
    z-index: 2;
}

.tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

.tile:hover::before {
    opacity: 1;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 10;
}

.tile:active {
    transform: translateY(0);
}

.video-tile {
    cursor: pointer;
}

.video-tile video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
}

#plesslburkhardt {
    background: linear-gradient(135deg, #2d4059, #3e5571);
    color: white;
}

#plesslburkhardt .icon {
    font-size: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

#plesslburkhardt .title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

#plesslburkhardt .subtitle {
    font-size: 16px;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.3px;
}

#nuvibit {
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: white;
}

#nuvibit .icon {
    font-size: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

#nuvibit .logo {
    font-size: 46px;
    font-weight: 700;
    letter-spacing: 2.5px;
    margin-bottom: 10px;
}

#nuvibit .subtitle {
    font-size: 16px;
    opacity: 0.95;
    letter-spacing: 0.5px;
    font-weight: 500;
}

#jugendspiel {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: white;
}

#jugendspiel .icon {
    font-size: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
    animation: pulse 3s ease-in-out infinite;
}

#jugendspiel .title {
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 8px;
}

#jugendspiel .subtitle {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Matrix */
#matrix {
    background: #000;
    position: relative;
}

#matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#matrix .matrix-content {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#matrix .matrix-text {
    color: #00ff41;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.6);
    opacity: 0.95;
}

#agfam {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

#agfam .icon {
    font-size: 64px;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

#agfam .title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
}

#agfam .subtitle {
    font-size: 16px;
    opacity: 0.95;
    font-weight: 500;
    letter-spacing: 0.3px;
}

#apotheke {
    background: linear-gradient(135deg, #c0392b, #d63031);
    color: white;
}

#apotheke .swan {
    font-size: 68px;
    margin-bottom: 12px;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

#apotheke .title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 8px;
}

#apotheke .subtitle {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 500;
    font-style: italic;
}

#harmonie {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
}

#harmonie .icon {
    font-size: 66px;
    margin-bottom: 12px;
    animation: pulse 3s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.95; }
}

#harmonie .title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 8px;
}

#harmonie .subtitle {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 500;
    font-style: italic;
}

#buecher {
    background: linear-gradient(135deg, #d35400, #e67e22);
    color: white;
}

#buecher .icon,
#buecher .title {
    display: none;
}

/* Z-Elevated LinkedIn Tiles (3D Overlay) */

.tile-linkedin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-decoration: none;
    background: linear-gradient(135deg, #0077b5, #005885);
    color: white;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 119, 181, 0.5),
                0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 100;
    padding: 5px;
}

.tile-linkedin::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
    border-radius: 12px;
}

.tile-linkedin:hover::before {
    opacity: 1;
}

.tile-linkedin:hover {
    transform: translate(-50%, -50%) translateY(-8px) scale(1.05);
    box-shadow: 0 20px 60px rgba(0, 119, 181, 0.5),
                0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 150;
}

.tile-linkedin .linkedin-icon {
    width: 60%;
    height: 60%;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    position: relative;
    z-index: 2;
}

.tile-linkedin:hover .linkedin-icon {
    filter: brightness(0) invert(1) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.tile-linkedin:active {
    transform: translate(-50%, -50%) translateY(-4px) scale(1.02);
}

.tile:hover .icon,
.tile:hover .swan,
.tile:hover .cherry {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.tile:hover .title,
.tile:hover .logo {
    letter-spacing: 1px;
    transition: letter-spacing 0.3s ease;
}

/* Responsive - Vertical Mobile Layout */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    .main-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        gap: 1px;
    }

    /* Roman's and Jeannette's sections stack vertically with 5 tiles each */
    .section-grid {
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

    /* Tiles get equal height */
    .tile,
    .tile-linkedin {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        min-height: 150px;
        height: auto;
        aspect-ratio: auto;
        border-radius: 0;
    }

    .tile-linkedin:hover {
        transform: translateY(-2px) scale(1.02);
    }

    .tile-linkedin:active {
        transform: translateY(0) scale(1);
    }

    .tile-linkedin .linkedin-icon {
        width: 50%;
        height: 50%;
    }

    /* Video tiles */
    .video-tile {
        min-height: 200px;
        height: 40vh;
    }

    /* Adjust text sizes for mobile */
    .tile .title {
        font-size: 85%;
    }

    .tile .logo {
        font-size: 85%;
    }

    .tile .subtitle {
        font-size: 75%;
    }

    #agfam .title {
        font-size: 90%;
    }

    #plesslburkhardt .title {
        font-size: 85%;
    }

    #nuvibit .logo {
        font-size: 85%;
    }

    #apotheke .title,
    #harmonie .title {
        font-size: 80%;
    }

    #jugendspiel .title {
        font-size: 75%;
    }

    .tile .icon,
    .tile .swan {
        font-size: 48px;
    }

    #matrix .matrix-text {
        font-size: 12px;
    }
}
