:root {
    --page-header-top-height: 30vh;
    --page-header-top-hover-height: 35vh;
    --page-header-scrolled-height: 20vh;
    --page-header-scrolled-hover-height: 25vh;
}

html,
body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    display: block;
    overflow-x: hidden;
    overscroll-behavior: none;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow-x: hidden;
    overscroll-behavior: none;
    text-align: center;
    font-family: "legitima", serif;
    font-weight: bolder;
}

button,
input,
textarea,
select {
    font-family: "legitima", serif;
}

header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    flex-direction: row;
    width: 100%;
    height: var(--page-header-top-height);
    position: fixed;
    top: 0;
    overflow: hidden;
    transition: height 0.18s ease-in-out, padding 0.18s ease-in-out;
    z-index: 100;
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: height;
}

header:hover {
    height: var(--page-header-top-hover-height);
}

header.scrolled {
    height: var(--page-header-scrolled-height);
    padding: 0;
}

header.scrolled:hover {
    height: var(--page-header-scrolled-hover-height);
}

/* Applied briefly by JS around a genuine viewport-size change (window resize,
   devtools/device-toolbar toggling, phone rotation), so that change lands
   instantly instead of sliding in via the transitions above - those stay
   reserved for the hover/scroll interactions they were built for. */
header.no-resize-transition,
main.no-resize-transition {
    transition: none !important;
}

#video {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
    object-fit: cover;
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: paint;
    will-change: transform, opacity;
}

main {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: var(--page-header-top-height);
    transition: margin-top 0.18s ease-in-out;
}

main.scrolled-main {
    margin-top: var(--page-header-scrolled-height);
}

header:hover ~ main {
    margin-top: var(--page-header-top-hover-height);
}

header.scrolled:hover ~ main.scrolled-main {
    margin-top: var(--page-header-scrolled-hover-height);
}

.stefan-intro {
    --stefan-intro-space: clamp(14px, 2.5vh, 28px);
    --stefan-about-font-size: 1.22rem;
    --stefan-first-view-height: calc(100vh - var(--page-header-top-height));
    width: 100%;
    height: var(--stefan-first-view-height);
    min-height: var(--stefan-first-view-height);
    margin: 0 auto;
    padding: var(--stefan-intro-space);
    display: grid;
    grid-template-columns: minmax(180px, 0.52fr) minmax(520px, 1.85fr);
    align-items: stretch;
    gap: clamp(14px, 2vw, 36px);
    text-align: left;
    overflow: visible;
}

/* Only the scroll state changes this height - deliberately NO hover-based
   override: hovering the header should push the first-view content down
   (via main's margin-top above), not shrink/resize it. */
main.scrolled-main .stefan-intro {
    --stefan-first-view-height: calc(100vh - var(--page-header-scrolled-height));
}

.stefan-portrait-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.stefan-portrait {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.stefan-intro-copy {
    max-width: none;
    height: 100%;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
}

.stefan-kicker {
    margin: 0 0 0.55rem;
    color: #800020;
    font-size: clamp(0.86rem, 1.2vw, 1rem);
    line-height: 1.2;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.stefan-intro h1 {
    margin: 0 0 clamp(0.55rem, 1.25vh, 0.95rem);
    font-family: "filosofia-grand", serif;
    font-size: clamp(1.68rem, 3.45vw, 3.6rem);
    line-height: 0.95;
    font-weight: 700;
    text-transform: uppercase;
}

.stefan-intro-copy p {
    margin: 0;
    font-size: 1em;
    line-height: var(--stefan-about-line-height, 1.06);
    font-weight: 500;
}

.stefan-intro-copy p:last-child {
    margin-bottom: 0;
}

.stefan-about-text {
    min-height: 0;
    flex: 1 1 auto;
    max-height: none;
    font-size: var(--stefan-about-font-size);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: calc(var(--stefan-about-gap-em, 1) * 1em);
    overflow: visible;
}

.row {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: calc(100vw / 3);
    height: 100%;
}

#hamburger {
    display: flex;
    flex-wrap: wrap;
    text-align: center;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    overflow: visible;
    background: none;
    z-index: 20;
}

input#hamburg {
    display: none;
}

label.hamburg {
    width: 100%;
    height: 100%;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: auto;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    overflow: visible;
    background: transparent;
    z-index: 21;
}

.hamburg:hover {
    width: 100%;
    height: 100%;
}

.line {
    height: 7px;
    width: 78px;
    background: black;
    border-radius: 8px;
    display: block;
    margin: 7px 0;
    position: relative;
    overflow: hidden;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
    z-index: 22;
    cursor: pointer;
}

.line::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background: var(--ee-gold-laser-core-gradient), var(--ee-gold-sweep-gradient);
    background-size: 100vw 100vh;
    background-position: 0 0;
    background-repeat: no-repeat;
    background-attachment: fixed;
    filter: saturate(var(--gold-light-saturate)) contrast(var(--gold-light-contrast)) drop-shadow(0 0 8px rgba(255, 215, 72, 1)) drop-shadow(0 0 var(--gold-light-glow-a) rgba(246, 213, 106, 1)) drop-shadow(0 0 var(--gold-light-glow-b) rgba(237, 189, 60, 0.95)) drop-shadow(0 0 calc(var(--gold-light-glow-b) * 1.65) rgba(240, 200, 77, 0.52));
    transform: translateZ(0);
    backface-visibility: hidden;
}

.line:hover {
    background: var(--ee-gallery-gold-gradient);
    box-shadow: 0 0 10px gold;
}

.line:hover::after {
    opacity: 1;
}

.line:nth-child(1),
.line:nth-child(2),
.line:nth-child(3) {
    top: 5%;
}

#hamburg:checked + .hamburg .line:nth-child(1) {
    transform: rotate(-45deg) translate(0%, 0%);
}

#hamburg:checked + .hamburg .line:nth-child(2) {
    opacity: 0;
}

#hamburg:checked + .hamburg .line:nth-child(3) {
    transform: rotate(45deg) translate(0%, 0%);
}

.topmenu {
    height: auto;
    max-height: 0;
    overflow: hidden;
    pointer-events: none;
    transition: all 0.1s;
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 23%;
    z-index: 30;
}

#hamburg:checked + .hamburg + .topmenu {
    height: 100%;
    max-height: 30vh;
    overflow: visible;
    pointer-events: auto;
}

#menu {
    font-size: 3vh;
    list-style-type: none;
    padding-left: 0;
}

#menu ul {
    list-style-type: none;
    padding-left: 0;
}

#menu li {
    color: #800020;
}

#menu li::before {
    content: "► ";
    color: #800020;
    margin-right: 10px;
}

#menu a {
    color: #800020;
    text-decoration: none;
}

#EDZADa,
#EDZAD {
    display: flex;
    justify-content: center;
    align-items: center;
}

#EDZADa {
    width: calc(100vw / 9);
    height: 90%;
    z-index: 2;
}

#EDZAD {
    object-fit: contain;
    width: calc(100vw / 3);
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

#EDZAD:hover {
    transform: scale(1.08);
}

@keyframes pulse-rotate {
    0% { transform: rotate(90deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.15); }
    100% { transform: rotate(90deg) scale(1); }
}

#hover-Knopf {
    width: calc(100vw / 11);
    height: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin: 0;
    padding: 0;
    transition: transform 0.3s ease-in-out;
}

#Anmeldeknopf {
    object-fit: contain;
    width: 31%;
    height: auto;
    cursor: pointer;
    animation: pulse-rotate 5s infinite;
    animation-fill-mode: forwards;
    transition: transform 0.3s ease-in-out;
}

#Abmeldeknopf {
    display: none;
    object-fit: contain;
    max-width: 100%;
    max-height: 31%;
}

#hover-Knopf:hover {
    transform: scale(1.5);
}

footer {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    font-size: 0.9em;
    text-align: center;
    padding: 10px 0;
    background: none;
    letter-spacing: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-legal-row {
    text-transform: uppercase;
}

.footer-legal-row a {
    text-transform: uppercase;
    color: inherit;
    text-decoration: none;
}

@media (max-width: 760px) {
    .stefan-intro {
        grid-template-columns: minmax(76px, 0.28fr) minmax(0, 0.72fr);
        gap: 8px;
        text-align: left;
    }

    .stefan-portrait-frame {
        width: 100%;
        max-width: none;
        height: 100%;
        justify-self: center;
    }

    .stefan-portrait {
        max-width: 100%;
    }

    .stefan-intro-copy {
        max-width: none;
    }

    .stefan-intro h1 {
        margin-bottom: 0.35rem;
        font-size: clamp(1.05rem, 3.4vh, 1.9rem);
        line-height: 0.9;
    }

    .stefan-intro-copy p {
        margin-bottom: 0;
        font-size: 1em;
        line-height: var(--stefan-about-line-height, 1.04);
    }
}
