/* =========================================
   1. ABOUT SECTION & PROFILBILD
   ========================================= */
.about {
    display: flex;
    align-items: center; 
    gap: 200px; 
    max-width: 1400px;
    margin-top: -10vh;
    padding: 0 20px;
}

.about-img {
    flex: 1;
}

/* Maske exklusiv für das Hauptprofilbild */
.about-img img {
    width: 100%;
    height: auto;
    display: block;
    -webkit-mask-image: url('../img/cloudmask.svg');
    mask-image: url('../img/cloudmask.svg');
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain; 
    mask-size: contain;
}

.about-text {
    flex: 1;
}

/* =========================================
   2. TREE-WRAPPER & VERZWEIGUNGEN
   ========================================= */
/* =========================================
   2. TREE-WRAPPER & VERZWEIGUNGEN
   ========================================= */
.tree-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 20px;
    z-index: 1; 
}

.center-line {
    position: absolute;
    top: 0;
    bottom: 100px; 
    left: 50%;
    transform: translateX(-50%);
    
    /* Breite von 160px auf 100px reduziert */
    width: 50px;
    background-color: var(--color-accent-green);
    
    pointer-events: none;
    z-index: -1; 
    
    /* 
       Angepasste SVG-Pfade: 
       Der Startpunkt (M) liegt jetzt bei 50 (genau in der Mitte von 100px).
       Die Kontrollpunkte (Q) schlagen deutlich weniger weit aus.
    */
    -webkit-mask-image: 
        linear-gradient(black, black),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='250'%3E%3Cpath d='M50,0 Q20,62.5 50,125 T50,250' fill='none' stroke='black' stroke-width='4'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='450'%3E%3Cpath d='M50,0 Q100,112.5 50,225 T50,450' fill='none' stroke='black' stroke-width='4'/%3E%3C/svg%3E");
        
    mask-image: 
        linear-gradient(black, black),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='250'%3E%3Cpath d='M50,0 Q20,62.5 50,125 T50,250' fill='none' stroke='black' stroke-width='4'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='450'%3E%3Cpath d='M50,0 Q100,112.5 50,225 T50,450' fill='none' stroke='black' stroke-width='4'/%3E%3C/svg%3E");

    -webkit-mask-size: 2px 100%, 100% 250px, 100% 450px;
    mask-size: 2px 100%, 100% 250px, 100% 450px;
    
    -webkit-mask-position: center, center, center;
    mask-position: center, center, center;
    
    -webkit-mask-repeat: no-repeat, repeat-y, repeat-y;
    mask-repeat: no-repeat, repeat-y, repeat-y;
}
.stem-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 100px; 
    margin-top: 50px;
}

.split-box {
    background-color: var(--color-bg); 
    padding: 30px;
    border: 2px solid var(--color-title);
    border-radius: 12px;
    position: relative;
    text-decoration: none;
    color: var(--color-text); 
    display: block; 
}

/* =========================================
   DIE SEITLICHEN ÄSTE (Beidseitig vertikale S-Kurven)
   ========================================= */
.left-branch::before,
.right-branch::before {
    content: '';
    position: absolute;
    top: -120px;
    height: 120px;
    width: calc(50% + 50px); 
    z-index: -2;
    background-color: var(--color-accent-green);
    
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* Linker Ast: Startet senkrecht, schwingt nach links, landet senkrecht */
.left-branch::before {
    left: calc(50% - 49px);
    width: calc(50% + 50px + 50px);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 100,0 C 100,45 0,55 0,100 M 100,0 C 100,50 15,50 15,100 M 100,0 C 100,55 30,45 30,100' stroke='black' stroke-width='1' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 100,0 C 100,45 0,55 0,100 M 100,0 C 100,50 15,50 15,100 M 100,0 C 100,55 30,45 30,100' stroke='black' stroke-width='1' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Rechter Ast: Startet senkrecht, schwingt nach rechts, landet senkrecht */
.right-branch::before {
    right: calc(50% - 49px);
    width: calc(50% + 50px + 50px);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 0,0 C 0,45 100,55 100,100 M 0,0 C 0,50 85,50 85,100 M 0,0 C 0,55 70,45 70,100' stroke='black' stroke-width='1' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M 0,0 C 0,45 100,55 100,100 M 0,0 C 0,50 85,50 85,100 M 0,0 C 0,55 70,45 70,100' stroke='black' stroke-width='1' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

.final-section {
    margin-top: 150px;
    display: flex;
    justify-content: center;
}

.final-box {
    background-color: var(--color-bg);
    padding: 40px;
    border: 2px solid var(--color-title);
    border-radius: 12px;
    width: 60%;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    display: block;
    position: relative;
}

/* =========================================
   BUTTON: Rahmen blendet beim Hover aus
   ========================================= */
.split-box,
.final-box {
    transition: border-color 0.3s ease 0.05s;
}
.split-box:hover,
.final-box:hover {
    border-color: transparent;
}

/* =========================================
   1. CONTAINER (Startzustand = exakt die Button-Größe)
   ========================================= */
.left-branch .preview-wrapper,
.right-branch .preview-wrapper,
.final-box .preview-wrapper {
    position: absolute;
    opacity: 0;
    z-index: 50;
    pointer-events: none;          /* im Ruhezustand nicht klickbar/hoverbar */
    cursor: pointer;
    transition:
        width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        height 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.25s ease;

    /* Outline (4 Richtungen, folgt der Maske) + weicher Schatten ganz zum Schluss */
    filter:
        drop-shadow(2px 0 0 var(--color-title))
        drop-shadow(-2px 0 0 var(--color-title))
        drop-shadow(0 2px 0 var(--color-title))
        drop-shadow(0 -2px 0 var(--color-title))
        drop-shadow(0 15px 25px rgba(0, 0, 0, 0.45));
}

/* =========================================
   2. BILD (Maske & Hintergrund)
   ========================================= */
.left-branch .preview-wrapper::after,
.right-branch .preview-wrapper::after,
.final-box .preview-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* Linker Ast (Games) – wächst nach links aus dem Button */
.left-branch .preview-wrapper {
    top: 50%;
    right: 0;
    width: 100%;
    height: 100%;
    transform: translateY(-50%);
}
.left-branch .preview-wrapper::after {
    background: url('../img/gamepreview.png') center/cover no-repeat;
    -webkit-mask-image: url('../img/masksideleft.png');
    mask-image: url('../img/masksideleft.png');
}

/* Rechter Ast (Writing) – wächst nach rechts aus dem Button */
.right-branch .preview-wrapper {
    top: 50%;
    left: 0;
    width: 100%;
    height: 100%;
    transform: translateY(-50%);
}
.right-branch .preview-wrapper::after {
    background: url('../img/writingpreview.png') center/cover no-repeat;
    -webkit-mask-image: url('../img/masksideright.png');
    mask-image: url('../img/masksideright.png');
    -webkit-mask-position: left center;
    mask-position: left center;
}

/* Finaler Ast (Resume) – wächst nach oben */
.final-box .preview-wrapper {
    bottom: 0;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translateX(-50%);
}
.final-box .preview-wrapper::after {
    background: url('../img/preview.png') center/cover no-repeat;
    -webkit-mask-image: url('../img/masksidebottom.png');
    mask-image: url('../img/masksidebottom.png');
}

/* =========================================
   3. HOVER: auf Zielgröße wachsen
   ========================================= */
.left-branch:hover .preview-wrapper {
    opacity: 1;
    pointer-events: auto;
    width: calc(50vw - 50px);
    height: calc(50vw - 50px);   /* ersetzt aspect-ratio 1/1, damit height animierbar ist */
}
.right-branch:hover .preview-wrapper {
    opacity: 1;
    pointer-events: auto;
    width: calc(50vw - 59px);
    height: calc(50vw - 59px);
}
.final-box:hover .preview-wrapper {
    opacity: 1;
    pointer-events: auto;
    width: 80vw;
    height: 90vh;
}

/* =========================================
   4. RESPONSIVE DESIGN (MOBILE)
   ========================================= */
@media (max-width: 768px) {
    .tree-wrapper {
        padding: 60px 16px;
    }

    /* Namensbild: HTML-Attribut height überschreiben */
    img.center {
        height: auto;
        max-width: 90%;
    }

    .pre-title {
        font-size: 18px;
    }

    /* About */
    .about {
        flex-direction: column;
        text-align: center;
        gap: 30px;
        margin-top: 0;

        /* Box wie die anderen Buttons */
        background-color: var(--color-bg);
        border: 2px solid var(--color-title);
        border-radius: 12px;
        padding: 30px 20px;
    }
    .about-img {
        width: 80%;
    }

    /* Games / Writing untereinander */
    .split-section {
        grid-template-columns: 1fr;
        gap: 70px;
        margin-top: 70px;
    }

    /* Äste: statt S-Kurve ein kurzes gerades Verbindungsstück */
    .left-branch::before,
    .right-branch::before {
        -webkit-mask-image: none;
        mask-image: none;
        left: 50%;
        right: auto;
        width: 2px;
        top: -70px;
        height: 70px;
        transform: translateX(-50%);
    }

    /* Resume */
    .final-section {
        margin-top: 90px;
    }
    .final-box {
        width: 100%;
    }
}

/* Touch-Geräte: keine Hover-Vorschau */
@media (hover: none) {
    .preview-wrapper {
        display: none;
    }
    .split-box:hover,
    .final-box:hover {
        border-color: var(--color-title);
    }
}