/* ==========================================================
   GruselGeist Portfolio
   Clean Version
========================================================== */

/* ===========================
   Reset
=========================== */

:root{
    --theme-transition:.35s;
    --body-font:system-ui,sans-serif;
    --minecraft:"Minecraft",system-ui,sans-serif;
    --billo:"Billo",system-ui,sans-serif;
}

@font-face{
    font-family:"Minecraft";
    src:url("../thumbs/images/fonts/minecraft.woff2") format("woff2");
}

@font-face{
    font-family:"Billo";
    src:url("../thumbs/images/fonts/billo.woff2") format("woff2");
}

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    width:100%;
    height:100%;
    overflow:hidden;
    font-family:var(--body-font);
}

body{
    position:relative;
}

/* ===========================
   Background Layers
=========================== */

.bg{
    position:fixed;
    top:0;
    height:100vh;
    pointer-events:none;
    background-repeat:repeat;
    background-size:auto;
    transition:
        opacity var(--theme-transition) ease,
        width .7s cubic-bezier(.25,.9,.2,1),
        height .7s cubic-bezier(.25,.9,.2,1);

    will-change:opacity,width,height,background-position;
}

/* ---------- LEFT ---------- */

.bg-left{
    left:0;
    width:50vw;
    z-index:1;
    animation:bgLeftMove 18s linear infinite alternate;
}

.bg-left-light{
    background-image:url("../thumbs/images/background/light.jpg");
}

.bg-left-dark{
    background-image:url("../thumbs/images/background/dark.jpg");
}

/* ---------- RIGHT ---------- */

.bg-right{
    right:0;
    width:50vw;
    z-index:0;
    animation:bgRightMove 18s linear infinite alternate;
}

.bg-right-light{
    background-image:url("../images/background/light.png");
}

.bg-right-dark{
    background-image:url("../images/background/dark.png");
}

/* ===========================
   Theme Crossfade
=========================== */

body.light-mode .bg-left-light,
body.light-mode .bg-right-light{
    opacity:1;
}

body.light-mode .bg-left-dark,
body.light-mode .bg-right-dark{
    opacity:0;
}

body.dark-mode .bg-left-light,
body.dark-mode .bg-right-light{
    opacity:0;
}

body.dark-mode .bg-left-dark,
body.dark-mode .bg-right-dark{
    opacity:1;
}

/* ===========================
   Background Animation
=========================== */

@keyframes bgLeftMove{

    from{
        background-position:0 0;
    }

    to{
        background-position:180px 180px;
    }

}

@keyframes bgRightMove{

    from{
        background-position:100% 0;
    }

    to{
        background-position:calc(100% - 180px) 180px;
    }

}

/* ===========================
   Expansion Animation
=========================== */

.bg-left.is-expanding,
.bg-right.is-expanding{
    width:100vw;
    z-index:20;
}
/* ==========================================================
   Main Layout
========================================================== */

.page{
    position:relative;
    width:100%;
    min-height:100vh;

    display:flex;
    flex-direction:column;
    align-items:center;

    padding:3rem 1.5rem 7rem;

    z-index:10;

    transition:
        opacity .5s ease,
        transform .7s cubic-bezier(.25,.9,.2,1);
}

.page.slide-left{
    opacity:0;
    transform:translateX(-100px);
    pointer-events:none;
}

.page.slide-right{
    opacity:0;
    transform:translateX(100px);
    pointer-events:none;
}

/* ==========================================================
   Hero
========================================================== */

.hero{
    margin:0 auto;
    max-width:900px;
    text-align:center;
}

.hero h1{
    display:inline-block;      /* WICHTIG: sorgt dafür, dass die Box sich am Text orientiert */
    font-family:var(--body-font);
    font-size:clamp(3.8rem,6vw,6rem);
    letter-spacing:.08em;
    line-height:1;
    text-transform:uppercase;
    margin-right:-0.08em;      /* wirkt jetzt tatsächlich, weil die Box jetzt schrumpft */
    max-width:100%;            /* Sicherheitsnetz gegen Overflow bei sehr langen Titeln */
    transition:
        color var(--theme-transition),
        text-shadow var(--theme-transition);
}

.hero p{

    margin-top:.7rem;

    font-size:clamp(1.1rem,1.5vw,1.4rem);

    transition:
        color var(--theme-transition),
        text-shadow var(--theme-transition);

}

/* ---------- Hero Theme ---------- */

body.light-mode .hero h1,
body.light-mode .hero p{
    color:#111;
}

body.dark-mode .hero h1,
body.dark-mode .hero p{
    color:#fff;
}

/* ==========================================================
   Bottom Sections
========================================================== */

.left-section,
.right-section{

    position:absolute;

    bottom:80px;

    width:min(340px,28vw);

}

.left-section{

    left:80px;

}

.right-section{

    right:80px;

    text-align:right;

}

/* ---------- Headings ---------- */

.left-section h2{

    font-family:var(--minecraft);

    font-size:3rem;

    margin-bottom:20px;

}

.right-section h2{

    font-size:3rem;

    margin-bottom:20px;

}

/* ---------- Theme ---------- */

body.light-mode .left-section h2,
body.light-mode .right-section h2{
    color:#111;
}

body.dark-mode .left-section h2,
body.dark-mode .right-section h2{
    color:#fff;
}

/* ==========================================================
   Visit Button
========================================================== */

.visit-button{

    display:inline-flex;

    justify-content:center;

    align-items:center;

    padding:16px 40px;

    border-radius:999px;

    cursor:pointer;

    border:none;

    font-size:1rem;

    font-family:var(--body-font);

    transition:
        transform .25s ease,
        background .25s ease,
        border-color .25s ease,
        color .25s ease,
        box-shadow .25s ease;

}

.left-section .visit-button{

    font-family:var(--billo);

}

/* ---------- Light ---------- */

body.light-mode .visit-button{

    color:#111;

    background:rgba(255,255,255,.92);

    border:1px solid rgba(0,0,0,.08);

    box-shadow:0 10px 24px rgba(0,0,0,.08);

}

/* ---------- Dark ---------- */

body.dark-mode .visit-button{

    color:#fff;

    background:rgba(255,255,255,.06);

    border:1px solid rgba(255,255,255,.08);

    box-shadow:0 10px 24px rgba(0,0,0,.32);

}

/* ---------- Hover ---------- */

.visit-button:hover{

    transform:translateY(-3px) scale(1.03);

}

.visit-button:active{

    transform:translateY(-1px) scale(.98);

}

body.light-mode .visit-button:hover{

    background:#fff;

    border-color:rgba(0,0,0,.18);

    box-shadow:0 14px 28px rgba(0,0,0,.14);

}

body.dark-mode .visit-button:hover{

    background:rgba(255,255,255,.15);

    border-color:rgba(255,255,255,.25);

    box-shadow:0 14px 28px rgba(0,0,0,.45);

}
/* ==========================================================
   Theme Toggle
========================================================== */

.theme-toggle{

    position:fixed;

    left:50%;
    bottom:20px;

    transform:translateX(-50%);

    width:58px;
    height:58px;

    border:none;
    border-radius:999px;

    cursor:pointer;

    background-repeat:no-repeat;
    background-position:center;
    background-size:55%;

    z-index:100;

    transition:
        background-color var(--theme-transition),
        background-image var(--theme-transition),
        transform .25s ease,
        box-shadow .25s ease;

}

.theme-toggle:hover{

    transform:translateX(-50%) translateY(-2px);

}

body.light-mode .theme-toggle{

    background-image:url("../thumbs/images/darklight/dark.png");
    background-color:rgba(0,0,0,.08);

    box-shadow:0 16px 35px rgba(0,0,0,.15);

}

body.dark-mode .theme-toggle{

    background-image:url("../thumbs/images/darklight/light.png");
    background-color:rgba(255,255,255,.16);

    box-shadow:0 16px 35px rgba(0,0,0,.40);

}

/* ==========================================================
   Transition Cover
========================================================== */

.transition-cover{

    position:fixed;
    inset:0;

    pointer-events:none;

    background:linear-gradient(
        90deg,
        rgba(255,255,255,.10),
        rgba(255,255,255,0)
    );

    transform:translateX(-100%);

    transition:transform .7s cubic-bezier(.25,.9,.2,1);

    z-index:15;

}

.transition-cover.is-active{

    transform:translateX(0);

}

/* ==========================================================
   Handy – Hochformat
========================================================== */

@media (max-width:600px) and (orientation:portrait){

    .bg-left,
    .bg-right{
        width:100%;
        height:50vh;
    }

    .bg-left{
        top:0;
        left:0;
        animation:bgTopMove 18s linear infinite alternate;
    }

    .bg-right{
        top:auto;
        bottom:0;
        right:0;
        animation:bgBottomMove 18s linear infinite alternate;
    }

    .bg-left.is-expanding,
    .bg-right.is-expanding{
        width:100%;
        height:100vh;
    }

    .page{
        padding:2rem 1rem 7rem;
    }

    .hero{
        width:100%;
        padding:1rem;
    }

    .hero h1{
        font-size:clamp(2.8rem,10vw,4.2rem);
        margin-right:-0.08em;
    }

    .hero p{
        font-size:clamp(1rem,4vw,1.2rem);
    }

    .left-section,
    .right-section{
        position:relative;
        left:auto;
        right:auto;
        bottom:auto;
        width:min(360px,90vw);
        text-align:center;
    }

    .left-section{
        margin:2rem auto;
    }

    .right-section{
        margin:4rem auto 2rem;
    }

    .left-section h2,
    .right-section h2{
        font-size:2.3rem;
    }

    .visit-button{
        min-width:180px;
    }

}

/* ==========================================================
   Tablet – Hochformat
========================================================== */

@media (min-width:601px) and (max-width:1024px) and (orientation:portrait){

    .bg-left,
    .bg-right{
        width:100%;
        height:50vh;
    }

    .bg-left{
        top:0;
        left:0;
        animation:bgTopMove 18s linear infinite alternate;
    }

    .bg-right{
        top:auto;
        bottom:0;
        right:0;
        animation:bgBottomMove 18s linear infinite alternate;
    }

    .bg-left.is-expanding,
    .bg-right.is-expanding{
        width:100%;
        height:100vh;
    }

    .page{
        padding:3rem 2rem 8rem;
    }

    .hero h1{
        font-size:clamp(3.2rem,8vw,5rem);
        margin-right:-0.08em;
    }

    .hero p{
        font-size:clamp(1.1rem,2.5vw,1.3rem);
    }

    .left-section,
    .right-section{
        position:relative;
        left:auto;
        right:auto;
        bottom:auto;
        width:min(420px,70vw);
        text-align:center;
    }

    .left-section{
        margin:3rem auto;
    }

    .right-section{
        margin:5rem auto 2rem;
    }

    .left-section h2,
    .right-section h2{
        font-size:2.6rem;
    }

    .visit-button{
        min-width:200px;
        padding:18px 44px;
    }

}

/* ==========================================================
   Widescreen – Handy Querformat & Tablet Querformat
========================================================== */

@media (orientation:landscape) and (max-width:1200px){

    .bg-left,
    .bg-right{
        width:50vw;
        height:100vh;
    }

    .bg-left{
        top:0;
        left:0;
        animation:bgLeftMove 18s linear infinite alternate;
    }

    .bg-right{
        top:0;
        right:0;
        bottom:auto;
        animation:bgRightMove 18s linear infinite alternate;
    }

    .bg-left.is-expanding,
    .bg-right.is-expanding{
        width:100vw;
        height:100vh;
    }

    .page{
        padding:2rem 1.5rem 5rem;
    }

    .hero h1{
        font-size:clamp(2.2rem,5vw,3.4rem);
        margin-right:-0.08em;
    }

    .hero p{
        font-size:clamp(0.9rem,2vw,1.1rem);
    }

    .left-section,
    .right-section{
        position:absolute;
        bottom:8%;              /* statt fixer 30px: prozentual = skaliert mit der Höhe */
        width:min(260px,26vw);
    }

    .left-section{
        left:30px;
    }

    .right-section{
        right:30px;
        text-align:right;
    }

    .left-section h2,
    .right-section h2{
        font-size:2rem;
        margin-bottom:12px;
    }

    .visit-button{
        padding:12px 28px;
        font-size:.9rem;
    }

}

/* ==========================================================
   Mobile Background Animation
========================================================== */

@keyframes bgTopMove{

    from{

        background-position:0 0;

    }

    to{

        background-position:0 180px;

    }

}

@keyframes bgBottomMove{

    from{

        background-position:0 0;

    }

    to{

        background-position:0 -180px;

    }

}

/* ==========================================================
   Widescreen – sehr flache Bildschirme (Handy quer)
========================================================== */

@media (orientation:landscape) and (max-height:420px){

    .page{
        padding:1rem 1.5rem 3rem;
    }

    .hero{
        margin-top:0.5rem;
    }

    .hero h1{
        font-size:clamp(2.8rem,10vw,4.2rem);
        letter-spacing:.04em; /* optional: etwas kleiner für mobile */
        margin-right:-0.04em; /* muss zum letter-spacing-Wert passen */
    }

    .hero p{
        font-size:clamp(.75rem,1.8vw,.95rem);
        margin-top:.3rem;
    }

    .left-section,
    .right-section{
        bottom:6%;
        width:min(200px,24vw);
    }

    .left-section h2,
    .right-section h2{
        font-size:1.4rem;
        margin-bottom:8px;
    }

    .visit-button{
        padding:8px 20px;
        font-size:.8rem;
    }

}