/* =============== FONTS =============== */

/* Inter selbst gehostet (statt Google-Fonts-Import): keine IP-Weitergabe an Google
   (DSGVO) und die CSP kann komplett auf 'self' bleiben. Variable Font 400–900. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/Inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/Inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'ZIGZAG';
    src: url('../fonts/ZIGZAG-NotRounded.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Andron';
    src: url('../fonts/Andron Freefont LAT Reg.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

/* =============== CSS CUSTOM PROPERTIES =============== */
/* Responsive values using clamp(min, preferred, max) */

/* Themebewusst: verhindert das erzwungene Auto-Darkening mancher Android-Browser
   (Samsung Internet Dunkelmodus / Chrome „Force dark"), das Orange zu Dunkelrot und
   Menue-Icons zu Gelb/Gruen verfaelscht. Klasse liegt via setTheme() auf <html>. */
:root { color-scheme: light; }
:root.dark-mode { color-scheme: dark; }

:root {
    /* Colors */
    --color-primary: #ff6633;
    --color-dark: #333333;
    --color-light: #E9E9E4;
    --color-gray: #cccccc;
    --color-gray-dark: #666666;

    /* Typography - fluid scaling */
    --font-size-heading-large: clamp(48px, 8vw + 1rem, 108px);
    --font-size-heading-medium: clamp(36px, 6vw + 0.5rem, 81px);
    --font-size-body: clamp(14px, 1vw + 0.5rem, 18px);
    --font-size-body-large: clamp(16px, 1.2vw + 0.5rem, 20px);

    /* Spacing - fluid scaling */
    --spacing-section: clamp(40px, 8vh, 100px);
    --spacing-container: clamp(16px, 5vw, 80px);
    --spacing-box-padding: clamp(24px, 4vw, 80px);

    /* Frame sizes */
    --frame-width: clamp(12px, 1.5vw, 20px);
    --nav-height: 30px;
    --header-height-max: 123px;
    --header-height-min: 43px;

    /* Image sizes - responsive */
    --image-alex-width: clamp(288px, 50.4vw, 605px);
    --image-ben-height: clamp(200px, 40vh, 500px);

    /* Grid system (Müller-Brockmann) – 3 Spalten + 2 Gutters innerhalb der Seitenränder */
    --grid-gutter: 40px;
    /* 1 Spalte = (Viewport − 2×Seitenrand − 2×Gutter) / 3.
       Untergrenze 440px = der Wert am 2-Spalten-Bereich (≤1300px), damit die Bilder beim
       Überschreiten von 1300px nicht schrumpfen (stetiger Übergang statt Sprung 440→372). */
    --img-col-width: clamp(440px, calc((100vw - 2 * var(--spacing-container) - 2 * var(--grid-gutter)) / 3), 500px);

    /* Komposition: Abstand MALEREI-Oberkante zu Daniel-Oberkante.
       Font-proportional (statt clamp(50px, 8vw, 100px)), damit die Bild-Oberkante
       MALEREI bei jeder Fensterbreite zum gleichen Anteil penetriert.
       Kalibriert auf 1240px Fensterbreite: (99.2 + 17) / 108 — inkl. der früheren
       +17px des Desktop-Blocks (≥1025px), dessen Gap-Override damit entfällt. */
    --malerei-alex-gap: calc(var(--font-size-heading-large) * 1.0759);

    /* Komposition: Abstand KONZEPT-Anchor-Oberkante zu Box-Oberkante */
    --konzept-anchor-box-gap: 80px;
    /* Kalibrierung für Anchor-Position (fester Pixel-Wert) */
    --konzept-anchor-calibration: 200px;

    /* Position offsets - these replace hard-coded vh values */
    --heading-top-offset: clamp(100px, 18vh, 200px);
    --konzept-offset: clamp(300px, 53vh, 600px);
    --gesichten-offset: clamp(250px, 47vh, 550px);
    /* Box-Offset jetzt fix in Pixel für konstanten Anchor-Abstand */
    --box-margin-offset: 550px;
}

/* =============== RESET / BASIS =============== */

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

html {
    scroll-behavior: smooth;
    overflow-x: clip; /* clip statt hidden: verhindert horizontalen Overflow, OHNE die iOS-Fixed-Positionierung
                        zu brechen (overflow:hidden auf dem Root ließ position:fixed / das Grain mitscrollen). */
    background-color: #ff6633; /* orange Rahmenfarbe für Overscroll/Safe-Area-Ränder */
    overscroll-behavior-y: none;
    overflow-anchor: none; /* iOS-Scroll-Anchoring aus: die Spacer-Höhenänderung beim Klappen darf
                              scrollY NICHT verschieben (sonst zuckt scrollY → Parallax-Boxen springen). */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    position: relative;
    overflow-x: clip; /* s. html: clip bricht die Fixed-Positionierung auf iOS nicht */
    color: #333333;
    background-color: #ff6633; /* Match html background - prevents transparency issues */
    overscroll-behavior-y: none; /* Prevent rubber band effect */
    overflow-anchor: none; /* s. html: kein scrollY-Zucken bei Dokumenthöhen-Änderungen */
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* Fixed frame border - split into separate elements for different z-indexes */
/* Bottom border - above everything */
body::before {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    background-color: #E9E9E4;
    pointer-events: none;
    z-index: 9997; /* Über allem Inhalt (≤30), aber UNTER dem Klappentext/#bottom-stair-menu (9998) und dem Grain (10000) */
}

/* Left and right vertical frame borders - above content but below nav layers */
.frame-border-left,
.frame-border-right {
    position: fixed;
    top: 29px; /* 1px Überlappung mit stripe-top gegen Sub-Pixel-Linie */
    bottom: 19px; /* 1px Überlappung mit stripe-bottom */
    width: 20px;
    background-color: #E9E9E4;
    pointer-events: none;
    z-index: 999; /* Above header (998), below nav/stripe-top (1000) */
}

.frame-border-left {
    left: 0;
}

.frame-border-right {
    right: 0;
}

/* Fix for Safari bottom bar color sampling */
.bottom-bar-fix {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #E9E9E4; /* Match light frame */
    z-index: 10001; /* Above everything */
    pointer-events: none;
}

body.dark-mode .bottom-bar-fix {
    background-color: #1a1a1a; /* Match dark frame */
}

/* Paper texture overlay - coarser grain for main page */
body::after {
    content: '';
    position: fixed;
    /* Safe Areas aussparen, damit sich der Grain nicht mit den orangen Safe-Area-Flächen
       überlagert (auf iOS verdrängte das Overlay sonst die Flächen). Desktop: Insets = 0. */
    top: env(safe-area-inset-top, 0);
    bottom: env(safe-area-inset-bottom, 0);
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 10000;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0.3 0.3 0.3 0 0 0.3 0.3 0.3 0 0 0.3 0.3 0.3 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' fill='%23808080'/%3E%3C/svg%3E");
    background-size: 250px 250px;
    background-repeat: repeat;
    opacity: 0.25; /* Light mode - stronger grain */
    /* iOS: position:fixed „driftet" beim Momentum-Scroll mit, wenn das Element nicht auf einer
       eigenen GPU-Ebene liegt → Grain schien mitzuscrollen. Eigene Compositing-Ebene erzwingen,
       damit es wirklich viewport-fix stehen bleibt. */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
/* Grain-Diagnose (per URL-Hash gesetzt) */
body.no-grain::after,
body.no-grain #safe-area-top::after,
body.no-grain #safe-area-bottom::after { opacity: 0 !important; }
body.loud-grain::after { opacity: 0.9 !important; }

/* Grain testweise KOMPLETT entfernt (Nutzer-Wunsch — diesen Block einfach löschen zum Zurückholen). */
body::after,
#safe-area-top::after,
#safe-area-bottom::after,
#safe-area-bottom-dark::after { display: none !important; }

/* Dark mode grain - reduced opacity */
body.dark-mode::after {
    opacity: 0.20;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
    /* Grain als absolute-Layer statt fixed-Overlay: Das ganzflächige FIXED-Overlay
       verdrängte auf iOS die orangen Safe-Area-Flächen (Konflikt mehrfach bestätigt).
       Als absolute-Layer (body ist position:relative, #scroll-spacer streckt die volle
       Höhe) scrollt der Grain mit dem Inhalt → kein fixed-Geschwister mehr, die
       Safe-Area-Flächen bleiben erhalten. Bonus: absolute repaintet beim Scrollen nicht. */
    body::after {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        display: block;
    }
}

/* Touch-Mobile: MYTHUS-Sektion (und alles danach) im Dokumentfluss näher an RIVUS rücken.
   Negativer margin-top zieht den MYTHUS-Anker-Container + nachfolgende Geschwister
   (mythus-box-wrapper, Daniel, GESICHTEN, Michael) hoch → kleinerer docTop → kürzerer
   Scrollweg zwischen den Snaps. Nur echtes Touch (hover:none) → narrowHover bleibt unberührt.
   Wert tunbar. */
@media (hover: none) and (pointer: coarse) and (max-width: 600px) {
    /* Hinweis: Abstände der Snap-Blöcke werden NICHT hier per margin gesteuert
       (margin verändert den gemessenen docTop / s-Wert nicht zuverlässig), sondern
       direkt im JS über die gecachten docTops (z.B. _box2WrapperDocTop für RIVUS). */
    #mythus-anchor-container {
        margin-top: -600px;
    }
}

/* Klappbare Textblöcke – nur auf dem Smartphone per JS injiziert. Außerhalb von Touch
   ausgeblendet, damit der Pfeil nie auf Desktop/Tablet auftaucht. */
.block-arrow {
    display: none;
}
/* Initiales Einklappen ohne Animation: sonst misst ein schneller (gecachter) Load-Recalc die
   Boxen mitten in der 0,5s-Klapp-Animation (zu hoch) → loses Layout, das beim ersten Toggle
   zusammenrutscht. Klasse wird beim Init kurz gesetzt und nach 2 Frames wieder entfernt. */
body.no-collapse-anim .lang-container {
    transition: none !important;
}
@media (hover: none) and (pointer: coarse) and (max-width: 600px) {
    .content-box,
    .content-box-2 {
        position: relative; /* Anker für den absolut zentrierten Pfeil */
    }
    /* Text smooth ein-/ausklappen; oben Platz für den Pfeil, damit er IMMER über dem Text steht.
       clip-path = unsichtbare Linie an der Oberkante der ersten Zeile (46px): beim Zuklappen
       rutscht der Text (padding-top 46→0) HINTER dieser Linie weg statt sichtbar über der
       obersten Zeile in den Pfeilbereich zu ragen (overflow:hidden schneidet erst an der
       Padding-Box-Oberkante ab). Offen liegt der Text komplett unterhalb → clip wirkungslos. */
    .content-box .lang-container,
    .content-box-2 .lang-container {
        overflow: hidden;
        clip-path: inset(46px 0 0 0);
        max-height: 3000px;
        opacity: 1;
        padding-top: 46px;
        transition: max-height 0.5s ease, opacity 0.35s ease;
    }
    .content-box.collapsed .lang-container,
    .content-box-2.collapsed .lang-container {
        max-height: 0;
        opacity: 0;
        padding-top: 0; /* sonst bleiben 46px stehen (border-box) → ungleich hohe eingeklappte Boxen */
        /* NUR beim Zuklappen auch das Padding animieren: der Text gleitet sanft hinter die
           Clip-Linie. Beim Aufklappen bleibt das Padding schlagartig (wie bisher) — JS misst
           direkt nach dem Toggle scrollHeight für die max-height, ein animiertes Padding
           würde dort 46px zu wenig liefern (Text-Pop beim Settle). */
        transition: max-height 0.5s ease, opacity 0.35s ease, padding-top 0.5s ease;
    }
    /* content-box-2: erster Absatz sitzt durch das globale margin-top:-10px schon bei 36px
       (nicht 46) → Clip-Linie 10px höher, sonst schneidet sie offen die erste Zeile an. */
    .content-box-2 .lang-container {
        clip-path: inset(36px 0 0 0);
    }
    /* Smartphone: kleinerer Zeilenabstand der Box-Texte (war 1.8) */
    .content-box p,
    .content-box-2 p {
        line-height: 1.25;
    }
    /* Eingeklappt: alle Boxen 58px. */
    .content-box.collapsed,
    .content-box-2.collapsed {
        min-height: 58px;
    }
    /* MYTHUS: Basis-Padding 65px → eingeklappt auf 20px reduzieren, damit min-height:58 greift (wie die anderen). */
    #mythus-box.collapsed {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
    /* Padding-Wechsel (65↔20) beim Klappen mitanimieren, sonst springt die MYTHUS-Box schlagartig
       um +45px (weiter als die anderen Blöcke) und flackert. */
    #mythus-box {
        transition: padding-top 0.5s ease, padding-bottom 0.5s ease;
    }
    body.no-collapse-anim #mythus-box {
        transition: none !important;
    }

    /* Dropdown-Pfeil: links, knapp über dem Text, orange, dreht sich beim Aufklappen */
    .content-box .block-arrow,
    .content-box-2 .block-arrow {
        display: block;
        position: absolute;
        top: 23px;
        left: 24px; /* links, etwa auf Höhe des Text-Anfangs */
        z-index: 30;
        padding: 6px;
        background: none;
        border: none;
        cursor: pointer;
        line-height: 0;
        color: #ff6633; /* Light-Mode orange */
        pointer-events: auto; /* Wrapper sind pointer-events:none → Pfeil explizit aktivieren */
        /* Keine Container-Rotation mehr: der Auf/Zu-Wechsel morpht über die SVG-Linien (s.u.) */
        -webkit-tap-highlight-color: transparent; /* kein dunkler Tap-Schleier auf iOS */
        -webkit-touch-callout: none;
        outline: none;
    }
    .content-box .block-arrow:focus,
    .content-box-2 .block-arrow:focus { outline: none; }
    /* Dark-Mode: dunkelgrau wie der Seiten-Hintergrund (#333333), subtil auf der #1a1a1a-Box */
    body.dark-mode .content-box .block-arrow,
    body.dark-mode .content-box-2 .block-arrow {
        color: #333333;
    }
    .block-arrow svg {
        width: 38px;
        height: 38px;
        display: block;
        overflow: visible; /* Spitze fährt beim Morph bis y=2 hoch (Round-Cap ragt minimal über) */
    }
    /* Morph auf der Stelle: jede Linie dreht um ihren MITTELPUNKT (8.5,12.5)/(15.5,12.5).
       Die Spitze fährt vertikal (16→9), die äußeren Endpunkte gegenläufig (9→16) — der Pfeil
       bleibt als Ganzes an seiner Position (∨ → — → ∧). Basis-Zustand = offen (Spitze oben). */
    .block-arrow line {
        transform-box: view-box;
        transition: transform 0.45s ease;
    }
    .block-arrow .arrow-left  { transform-origin: 8.5px 12.5px;  transform: rotate(-90deg); }
    .block-arrow .arrow-right { transform-origin: 15.5px 12.5px; transform: rotate(90deg); }
    .content-box.collapsed .block-arrow .arrow-left,
    .content-box-2.collapsed .block-arrow .arrow-left,
    .content-box.collapsed .block-arrow .arrow-right,
    .content-box-2.collapsed .block-arrow .arrow-right {
        transform: rotate(0deg); /* zu: Spitze zeigt nach unten (= aufklappen) */
    }
    /* Pfeil bleibt beim Auf-/Zuklappen fix an seiner Position (top:23px, s. Basis) —
       die früheren :not(.collapsed)-top-Overrides ließen ihn vertikal mitwandern. */
}

/* Background stripes - dark gray frame behind navigation */
.background-stripe-top,
.background-stripe-bottom,
.background-stripe-left,
.background-stripe-right {
    position: fixed;
    background-color: #333333;
    z-index: 1; /* Above body background, below content (5) and header (998) */
    pointer-events: none;
}

.background-stripe-top {
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 1000; /* Same level as nav — covers frame-border corners at top */
}

.background-stripe-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
}

.background-stripe-left {
    top: 0;
    bottom: 0;
    left: 0;
    width: 20px;
}

.background-stripe-right {
    top: 0;
    bottom: 0;
    right: 0;
    width: 20px;
}

/* Vertikale Backing-Streifen hell wie der Rahmen (#E9E9E4). Sie liegen hinter den hellen
   frame-border-left/right und sind normal verdeckt — aber wenn die Safari-URL-Leiste beim
   Hochscrollen die Viewport-Höhe ändert, ziehen die fixierten Rahmen kurz nach und gäben sonst
   das dunkle #333333 frei (kurzes schwarzes Durchblitzen). Dark-Mode bleibt #1a1a1a. */
body:not(.dark-mode) .background-stripe-left,
body:not(.dark-mode) .background-stripe-right {
    background-color: #E9E9E4;
}

/* =============== NAVIGATION =============== */

/* Nav-Streifen-Hintergrund: nur Mobile sichtbar (s. @media unten); Desktop aus. */
.nav-bar-bg { display: none; }

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(51, 51, 51, 0.8); /* 80% opaque dark gray with blur */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 1000;
    box-shadow: none;
    height: 30px;
    cursor: pointer;
}

/* Solid layer below nav - content scrolls between these layers */

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 30px;
    position: relative;
}

.nav-logo {
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu li a {
    color: #E9E9E4;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

/* Hover (Desktop) / kurzer Tap (iPad): Wort orange einfaerben (statt Unterstrich-Animation). */
.nav-menu li a:hover {
    color: #ff6633;
}

/* "Impressum & Datenschutz": In der Desktop-Leiste einzeilig — der <br> im Label
   gilt nur dem Burger-Menue (dort wieder display: inline). */
.nav-menu li a.nav-legal br {
    display: none;
}
body.dark-mode .nav-menu li a:hover {
    color: #ff6633; /* eigene Regel: sonst gewinnt body.dark-mode .nav-menu li a (gleiche Spezifitaet, spaeter) */
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: #E9E9E4;
    margin: 3px 0;
    transition: 0.3s;
}

/* =============== HEADER =============== */

/* Orange backdrop behind header - prevents blur artifacts */
.header-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 153px; /* Nav (30px) + shrinking Header max (123px) */
    background-color: #ff6633;
    z-index: 2; /* Above background-stripes (1), below content (5) */
    pointer-events: none;
}

.sub-page .header-backdrop {
    height: 73px; /* Nav (30px) + fixed header (43px) */
}

header {
    position: fixed;
    top: 30px;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    background-color: rgba(255, 102, 51, 0.75); /* 75% opaque orange with blur */
    backdrop-filter: blur(25px) saturate(100%);
    -webkit-backdrop-filter: blur(25px) saturate(100%);
    border-top: none;
    border-bottom: none;
    z-index: 998;
    box-shadow: none;
}

/* Shrinking header (landing page) - starts at 123px, shrinks to 43px */
.shrinking-header {
    height: 123px;
    transition: none; /* No CSS transition, JS handles it directly */
}

/* Fixed header (other pages) - always 43px */
.fixed-header {
    height: 43px;
}

.fixed-header .logo-gif {
    height: 32px;
    transform: translate(-50%, calc(-50% - 2px));
}

.header-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Logo video - replaces logo text */
.logo-video,
.logo-gif {
    height: 86px; /* 20% smaller than MALEREI (108px × 0.8 = 86px) */
    width: auto;
    max-width: calc(100vw - 2rem - 40px); /* Nie breiter als Fenster minus Padding und Rahmen */
    object-fit: contain; /* Seitenverhältnis beibehalten, nie stauchen */
    will-change: transform, height;
    transition: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
}

/* Logo text »MARTIN ZANKER« (ersetzt das frühere Logo-GIF). Auf der Landingpage
   skaliert die Shrink-Animation (updateHeaderSize) die font-size; der Clamp hier ist
   nur der initiale Wert vor dem ersten JS-Frame. Subseiten: feste Größe (s. unten). */
.logo-text {
    font-family: 'Inter', sans-serif;
    font-size: clamp(34px, 6vw, 86px);
    font-weight: 800;
    letter-spacing: -0.08em; /* Same tight spacing as MALEREI */
    text-transform: uppercase;
    margin: 0;
    color: var(--color-dark); /* exakt wie »MALEREI« (main-heading-filled) */
    will-change: transform, font-size;
    transition: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    white-space: nowrap;
    display: none; /* Standard (Desktop/iPad): animiertes Logo-Bild; Text nur auf Smartphones */
}
body.dark-mode .logo-text {
    color: #ff6633; /* orange im Dark-Mode (wie das frühere dunkle Logo) */
}
/* Subseiten haben einen fixen (nicht schrumpfenden) Header → feste Logo-Größe */
.fixed-header .logo-text {
    font-size: 28px;
}
/* Echte Smartphones: Text-Logo (mit Intro-Animation) statt animiertem Bild */
@media (hover: none) and (pointer: coarse) and (max-width: 600px) {
    .logo-gif { display: none !important; }
    .logo-text { display: block; }
}

/* =============== MAIN HEADING =============== */

.main-heading-container {
    position: relative;
    display: grid;
    place-items: start center;
    min-height: 100vh;
    padding-top: var(--heading-top-offset);
    z-index: 5;
}

/* =============== KONZEPT HEADING =============== */

.konzept-heading-container {
    position: relative;
    display: grid;
    place-items: start start;
    min-height: 100vh;
    padding-top: calc(50vh + 18.5vh);
    /* Bei schmalem Fenster nach rechts verschieben (26px bei ≤400px, 0px bei ≥1400px) */
    margin-left: max(0px, calc(26px - (100vw - 400px) * 0.026));
    padding-left: var(--spacing-container);
}

.konzept-heading {
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size-heading-large);
    font-weight: 850;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    margin: 0;
    white-space: nowrap; /* kein Zeilenumbruch (z.B. spanisch CONCEPTO) */
}

/* Spanisch: CONCEPTO ist breiter als das Fenster → Überschrift weiter nach links
   (Anker folgt automatisch, da _konzeptAnchorLeft aus der Filled-Position gemessen wird).
   NUR der echte KONZEPT-Container — der MYTHUS-Anker teilt sich die Klasse, soll aber wie auf
   der deutschen Seite stehen bleiben, daher per :not() ausgenommen. */
@media (max-width: 640px) {
    body.is-es .konzept-heading-container:not(#mythus-anchor-container) {
        margin-left: -20px;
    }
}

/* iPhone-Block-Rotation: X-Position der Anker mitrotieren. MYTHUS-Anker (zeigt RIVUS) verliert sein
   margin-left, GESICHTEN-Anker (zeigt MYTHUS) bekommt MYTHUS' margin-left. RIVUS-Anker = unverändert
   (RIVUS und GESICHTEN teilen ohnehin dieselbe X-Position). */
body.phone-blocks-rotated #mythus-anchor-container {
    margin-left: 135px !important; /* RIVUS-Schriften nach rechts (122 + 8 + 5) */
}
/* GESICHTEN-Anker zeigt jetzt MYTHUS → linksbündig (start start) + volle Größe wie das echte MYTHUS,
   statt rechtsbündig/60px der GESICHTEN-Position. */
body.phone-blocks-rotated #gesichten-anchor-container {
    place-items: start start !important;
    padding-left: var(--spacing-container) !important;
    padding-right: 0 !important;
    margin-left: max(0px, calc(26px - (100vw - 400px) * 0.026)) !important;
}
body.phone-blocks-rotated #gesichten-anchor-container .gesichten-anchor-filled,
body.phone-blocks-rotated #gesichten-anchor-container .gesichten-anchor-outline,
body.phone-blocks-rotated #gesichten-anchor-gray {
    font-size: var(--font-size-heading-large) !important;
}
/* RIVUS-Anker zeigt nach Rotation GESICHTEN (längeres Wort) → kleiner. */
body.phone-blocks-rotated .rivus-anchor-filled,
body.phone-blocks-rotated .rivus-anchor-outline,
body.phone-blocks-rotated .rivus-anchor-gray {
    font-size: calc(var(--font-size-heading-large) * 0.85) !important;
}
/* GESICHTEN (im rivus-anchor-Slot): z-Ebenen über die Bilder heben (gray z:3, filled z:4 – wie das
   MYTHUS/GESICHTEN-Anchor-System), sonst verschwindet GESICHTEN durch die Bild-Rotation hinter dem
   pos2-Bild (Bild erreicht beim Wipe z:2 und liegt im DOM nach .rivus-anchor-gray). Position bleibt
   nativ rivus (Basis-Top +40px), damit Anchor→Textblock-Abstand wie bei RIVUS ist. */
body.phone-blocks-rotated .rivus-anchor-gray   { z-index: 3 !important; }
body.phone-blocks-rotated .rivus-anchor-filled { z-index: 4 !important; }
/* GESICHTEN-Anchor filled+outline 15px tiefer (Basis +40px → +55px). */
body.phone-blocks-rotated #rivus-anchor-container .rivus-anchor-filled,
body.phone-blocks-rotated #rivus-anchor-container .rivus-anchor-outline {
    top: calc(var(--gesichten-offset) + 38px + 352px) !important;
}
/* RIVUS-Schriften (im mythus-anchor-Slot) filled+outline: ~320px tiefer, damit sie am Snap-Punkt
   auf dem grauen Anker liegen (Debug: fill lag ~342px über gray). Basis +352px → +912px. */
body.phone-blocks-rotated #mythus-anchor-container .konzept-heading-filled,
body.phone-blocks-rotated #mythus-anchor-container .konzept-heading-outline {
    top: calc(var(--konzept-offset) + 352px + 560px) !important;
}
/* Ben-Treppentext (nach Rotation im daniel-Slot) 2px höher. */
body.phone-blocks-rotated #mythus-daniel-image-with-info .words-stair {
    transform: translate3d(0, -2px, 0) !important;
}
/* Michael-Treppentext: Nach der Rotation liegen Michaels Zeilen in #ben-image-with-info (sichtbar
   bzw. als Klon im #ben-stair-overlay), während #michael-image-with-info jetzt Daniel enthält. Die
   michael-Treppen-Regeln (auf #michael-image-with-info gescoped) greifen dadurch nirgends mehr →
   nth-child-Fallback verschiebt die Stufen (versteckte name-full/desktop-3 mitgezählt). michael-*
   ist eindeutig, daher hier per Klasse global (gated) – greift im Container UND im Klon. */
body.phone-blocks-rotated .michael-name     { left: 16px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
body.phone-blocks-rotated .michael-paren    { left: 32px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
body.phone-blocks-rotated .michael-year     { left: 48px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
body.phone-blocks-rotated .michael-mobile-3 { left: 64px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
body.phone-blocks-rotated .michael-mobile-4 { left: 80px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
body.phone-blocks-rotated .michael-canvas   { left: 96px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
body.phone-blocks-rotated .michael-size     { left: 112px; transform: skew(60deg, -30deg) scaleY(0.66667); }
/* Michael-Treppentext (ben-Slot bzw. Overlay-Klon) 50px höher (ul-Transform, Zeilen-Skews bleiben). */
body.phone-blocks-rotated #ben-image-with-info .words-stair,
body.phone-blocks-rotated #ben-stair-overlay .words-stair {
    transform: translate3d(0, -50px, 0) !important;
}

/* Fading effect for filled headings */
.main-heading-filled,
.konzept-heading-filled,
.unterpunkt-heading-filled,
.gesichten-anchor-filled {
    transition: opacity 0.3s ease;
}

.faded-out {
    opacity: 0;
}

/* FOUC vermeiden: Anchor-Schriften (KONZEPT/RIVUS/MYTHUS/GESICHTEN) erst zeigen, wenn JS
   sie positioniert hat — vorher stehen sie per transform:0 oben links übereinander.
   body.layout-ready wird nach dem ersten recalculateLayout() gesetzt. */
.konzept-heading-container,
#rivus-anchor-container,
#gesichten-anchor-container,
.konzept-heading-anchor,
.rivus-anchor-gray,
#mythus-anchor,
#gesichten-anchor-gray {
    transition: opacity 0.25s ease;
}
body:not(.layout-ready) .konzept-heading-container,
body:not(.layout-ready) #rivus-anchor-container,
body:not(.layout-ready) #gesichten-anchor-container,
body:not(.layout-ready) .konzept-heading-anchor,
body:not(.layout-ready) .rivus-anchor-gray,
body:not(.layout-ready) #mythus-anchor,
body:not(.layout-ready) #gesichten-anchor-gray {
    opacity: 0; /* auch die GRAUEN Anker (separate h2 außerhalb der Container) — stapelten sonst beim Laden oben links */
}

.konzept-heading-filled {
    color: #333333;
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    position: relative;
    z-index: 1; /* Behind box (2) */
    pointer-events: none;
}

.konzept-heading-anchor {
    color: var(--color-gray);
    position: absolute;
    /* Position (top/left) wird per JavaScript auf load/resize gesetzt */
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size-heading-large);
    font-weight: 850;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    margin: 0;
    z-index: 0; /* Hinter box (DOM-Reihenfolge: Box überdeckt Anchor-Überlappung) */
}

.konzept-heading-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--color-dark);
    text-stroke: 2px var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    position: relative;
    z-index: 5;
    pointer-events: none;
}

/* =============== CONTENT BOX =============== */

.content-box-wrapper {
    position: relative;
    padding-top: 0px;
    margin-top: calc(var(--box-margin-offset) * -1);
    padding-left: var(--spacing-container);
    z-index: 2;
}

.content-box {
    background-color: var(--color-gray);
    padding: var(--spacing-box-padding);
    width: 120vw;
    max-width: none;
    border-radius: 0;
    position: relative;
    will-change: transform;
}

/* Hintergrund nach links verlängern (Boxen sind rechtsseitig positioniert) */
.content-box::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 100vw;
    background-color: var(--color-gray);
    z-index: 0;
}

/* Box-specific grain removed - using global page grain instead */

.content-box h2,
.content-box p {
    position: relative;
    z-index: 2;
}

.content-box h2 {
    color: #ff6633;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.content-box p {
    color: #1a1a1a; /* Light-Mode: dunkelgrau statt orange (Dark-Mode-Override bleibt #E9E9E4) */
    font-size: clamp(0.9rem, 0.7rem + 1vw, 1.2rem);
    line-height: 1.8;
    margin-bottom: 1.2rem;
    max-width: calc(80vw - 175px); /* Adjusted for frame, +80px weiter links */
    hyphens: auto;
    text-align: justify;
}

.content-box p:last-child {
    margin-bottom: 0;
}

/* =============== RIVUS ANCHOR CONTAINER =============== */

.gesichten-anchor-container,
.rivus-anchor-container {
    position: relative;
    display: grid;
    place-items: start end; /* Rechtsbündig */
    min-height: 100vh;
    padding-top: calc(50vh + 18.5vh);
    /* Abstand zum rechten Rand (gleich wie Box 1 zum linken Rand) */
    padding-right: var(--spacing-container);
}

.gesichten-anchor-filled,
.gesichten-anchor-outline,
.gesichten-anchor-gray,
.rivus-anchor-filled,
.rivus-anchor-outline,
.rivus-anchor-gray {
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size-heading-large);
    font-weight: 850;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    margin: 0;
}

.gesichten-anchor-filled,
.gesichten-anchor-outline,
.gesichten-anchor-gray {
    hyphens: none;
}

.gesichten-anchor-filled,
.rivus-anchor-filled {
    color: var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    position: relative;
    top: var(--gesichten-offset);
    z-index: 1;
    pointer-events: none;
}

.gesichten-anchor-gray,
.rivus-anchor-gray {
    color: var(--color-gray);
    position: absolute;
    /* Position (top/left) wird per JavaScript auf load/resize gesetzt */
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
    z-index: 0;
}

.gesichten-anchor-outline,
.rivus-anchor-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--color-dark);
    text-stroke: 2px var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    position: relative;
    top: var(--gesichten-offset);
    z-index: 5;
    pointer-events: none;
}

/* =============== SECOND CONTENT BOX =============== */

.content-box-wrapper-2 {
    position: relative;
    padding-top: 0px;
    margin-top: clamp(-500px, -74vh, -350px);
    /* Rechts-Offset wird per JavaScript im Transform gesteuert */
    padding-right: var(--spacing-container);
    z-index: 2;
}

.content-box-2 {
    background-color: var(--color-gray);
    padding: var(--spacing-box-padding);
    padding-top: calc(var(--spacing-box-padding) + 5px);
    width: 120vw;
    max-width: none;
    border-radius: 0;
    position: relative;
    will-change: transform;
    margin-left: -20vw;
}

/* RIVUS: Hintergrund nach rechts verlängern (linksseitig positioniert) */
.content-box-wrapper-2 > .content-box-2::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    width: 100vw;
    background-color: var(--color-gray);
    z-index: 0;
}

/* GESICHTEN: Hintergrund nach links verlängern (rechtsseitig positioniert) */
#gesichten-content-box::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 100vw;
    background-color: var(--color-gray);
    z-index: 0;
}

.content-box-2 h2,
.content-box-2 p {
    position: relative;
    z-index: 2;
}

/* RIVUS-Text: sanfter Übergang der per JS gesetzten Zentrierung/Breite bei Breiten-Änderung.
   An .theme-transitioning gekoppelt → beim ersten Laden kein Animations-Slide. */
body.theme-transitioning #rivus-content-box p {
    transition: transform 0.35s ease, max-width 0.35s ease;
}
/* Niveau-/Sprachwechsel (slideTransition, verdeckt unterm Overlay): Transition aussetzen,
   damit die Blockpositionierung die ENDhöhe der RIVUS-Box misst statt eines animierten
   Zwischenwerts (sonst variiert der RIVUS→MYTHUS-Abstand um bis zu ~70px). */
body.no-image-transition #rivus-content-box p {
    transition: none !important;
}

.content-box-2 h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #ff6633;
    font-weight: 700;
}

.content-box-2 p {
    color: #1a1a1a; /* Light-Mode: dunkelgrau statt orange (Dark-Mode-Override bleibt #E9E9E4) */
    font-size: clamp(0.9rem, 0.7rem + 1vw, 1.2rem);
    line-height: 1.8;
    margin-bottom: 1.2rem;
    max-width: calc(70vw - 20px - 10rem - 150px);
    margin-left: calc(20vw + 20px + 180px);
    text-align: justify;
}

.content-box-2 p:first-child {
    margin-top: -10px;
}

#rivus-content-box .lang-container {
    padding-top: 1.5em;
}

#mythus-box .lang-container {
    margin-top: -1.5em;
}

/* GESICHTEN-Box: Text zentriert, breiter (Landscape + Desktop) */
#gesichten-content-box p {
    margin-left: 20vw;
    margin-right: auto;
    max-width: calc(60vw - 2 * var(--spacing-box-padding));
}


/* =============== UNTERPUNKT 1 HEADING =============== */

.unterpunkt-heading-container {
    position: relative;
    display: grid;
    place-items: start start;
    min-height: 100vh;
    padding-top: calc(50vh + 735px);
    padding-left: var(--spacing-container);
}

.unterpunkt-heading {
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size-heading-medium);
    font-weight: 850;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    margin: 0;
}

.unterpunkt-heading-filled {
    color: var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.unterpunkt-heading-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--color-dark);
    text-stroke: 2px var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    position: relative;
    z-index: 5;
    pointer-events: none;
}

.unterpunkt-heading-image {
    display: block;
    width: var(--img-col-width);
    height: auto;
    object-fit: cover;
    will-change: transform;
}

/* Container for unterpunkt heading image */
.unterpunkt-heading-container .image-with-info {
    position: absolute;
    right: calc(clamp(20px, 5vw, 55px) + 80px); /* 80px weiter links */
    /* top wird per JavaScript berechnet */
    grid-column: 1;
    grid-row: 1;
    z-index: 4; /* Unter RIVUS Outline (5) */
    transition: top 0.3s ease;
}

body.no-image-transition .unterpunkt-heading-container .image-with-info,
body.no-image-transition .content-box-wrapper,
body.no-image-transition .content-box-wrapper-2,
body.no-image-transition .mythus-box-wrapper,
body.no-image-transition .gesichten-content-box-wrapper,
body.no-image-transition .main-heading-image {
    transition: none !important;
}


.main-heading {
    font-family: 'Inter', sans-serif;
    font-size: var(--font-size-heading-large);
    font-weight: 850;
    letter-spacing: -0.08em;
    text-transform: uppercase;
    margin: 0;
}

/* MALEREI-Überschrift: 2° von links nach rechts ansteigend (nur CSS, kein JS-Transform) */
.main-heading {
    rotate: -2deg;
}
/* Alle anderen Überschriften: rotate(-2deg) wird im JS-Transform eingebaut */

.main-heading-filled {
    color: var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
}

.main-heading-image {
    display: block;
    width: 100%;
    max-width: var(--image-alex-width);
    height: auto;
    object-fit: cover;
    will-change: transform;
}

/* Container for main heading image */
/* Alex's top edge is --malerei-alex-gap below MALEREI's top edge */
.main-heading-container .image-with-info {
    grid-column: 1;
    grid-row: 1;
    z-index: 2;
    margin-top: var(--malerei-alex-gap);
}

/* iPad im Landscape: MALEREI (bzw. PAINTING/PINTURA) UNTER das Alex-Bild legen und das
   Bild höher setzen — ähnlich wie auf dem iPhone. Klasse wird per JS gesetzt (ipad-landscape),
   da iPad-Landscape per CSS nicht von Desktop unterscheidbar ist. Werte tunbar:
   - heading-top-offset: vertikale Position von MALEREI (größer = tiefer)
   - malerei-alex-gap : negativ → Bild über MALEREI (mehr negativ = Bild höher / mehr Abstand)
   - image-alex-width : Bildgröße (Alex ist ~quadratisch, Höhe ≈ Breite) */
body.ipad-landscape {
    --image-alex-width: clamp(431px, 43.1vw, 546px); /* wächst nach unten (Oberkante = margin-top, bleibt) */
    --heading-top-offset: 630px;                   /* MALEREI 160px tiefer */
    --malerei-alex-gap: calc(-30vw - 70px);        /* kompensiert die 160px, damit die Bild-Oberkante bleibt */
}

@media (min-width: 641px) {
    .main-heading-container .words-stair {
        margin-bottom: 36px; /* 40px höher (war -4) */
        margin-left: 72px;   /* 40px weiter rechts (war 32) */
    }
}

@media (min-width: 641px) {
    #mythus-daniel-container .words-stair {
        margin-left: 182px;  /* 230px weiter rechts als globale -48px */
        margin-bottom: -14px; /* 110px tiefer als globale 96px */
    }
    #michael-image-with-info .words-stair {
        margin-left: 152px;  /* 200px weiter rechts als globale -48px */
        margin-bottom: 1px;  /* 95px tiefer als globale 96px */
    }
}

@media (min-width: 1025px) {
    #michael-image-with-info .words-stair {
        width: max-content;    /* verhindert Flex-Stretch-Kollaps bei großem margin-left */
        margin-left: 432px;   /* 250px weiter rechts als 182px */
        margin-bottom: -99px; /* 100px tiefer als 1px */
    }
    #ben-image-with-info .words-stair {
        margin-bottom: 51px;
    }
    #mythus-daniel-image-with-info .image-info {
        top: 80px;
    }
    #mythus-daniel-image-with-info .words-stair {
        transform: translate(30px, 200px);
    }
}

.main-heading-outline {
    color: transparent;
    -webkit-text-stroke: 2px var(--color-dark);
    text-stroke: 2px var(--color-dark);
    grid-column: 1;
    grid-row: 1;
    z-index: 3;
}

/* =============== SECTIONS =============== */

section {
    position: relative;
    width: 100%;
    min-height: 50vh;
    padding: 5% 8%;
}

.hero-section {
    min-height: 60vh;
    padding-top: 3%;
    /* margin-top set dynamically by JavaScript */
}

.gallery-section {
    min-height: 100vh;
    padding-top: 10%;
}

.theory-section {
    min-height: 60vh;
    padding: 10% 8%;
}

.design-section {
    min-height: 60vh;
    padding: 10% 8%;
}

/* =============== TEXT-CONTAINER =============== */

.text-container {
    position: relative;
    font-family: 'Inter', sans-serif;
    line-height: 0.8;
    margin-bottom: 5%;
}

.text-container-2 {
    margin-bottom: 5%;
}

.text-container-3 {
    text-align: right;
    margin-left: auto;
    margin-right: 10%;
    max-width: 600px;
}

.text-container-4 {
    margin-top: 5%;
}

.andron-part {
    font-family: 'Inter', sans-serif;
    margin-left: 12%;
}

/* =============== TEXT-STYLES =============== */

.text-behind,
.text-front {
    position: absolute;
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: bold;
    transition: opacity 0.3s ease-in-out;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    white-space: nowrap;
}

/* =============== IMAGE GRID =============== */

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 5%;
}

/* =============== IMAGE CONTAINER =============== */

.image-container,
.image-container-2,
.image-container-3,
.image-container-4,
.image-container-5 {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.parallax-image,
.hover-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease;
}

.hover-image {
    opacity: 0;
}

.image-container:hover .hover-image,
.image-container-2:hover .hover-image,
.image-container-3:hover .hover-image,
.image-container-4:hover .hover-image,
.image-container-5:hover .hover-image {
    opacity: 1;
    z-index: 4;
}

.image-container:hover .parallax-image,
.image-container-2:hover .parallax-image,
.image-container-3:hover .parallax-image,
.image-container-4:hover .parallax-image,
.image-container-5:hover .parallax-image {
    opacity: 0;
    transform: scale(1.05);
}

/* =============== RESPONSIVE DESIGN =============== */
/* 3 Breakpoints: Desktop (>1024px), Tablet (641-1024px), Mobile (<=640px) */

/* ===== TABLET (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    :root {
        --spacing-container: clamp(16px, 4vw, 60px);
        --spacing-box-padding: clamp(20px, 3vw, 60px);
        --image-alex-width: clamp(180px, 40vw, 350px);
        --image-ben-height: clamp(180px, 35vh, 400px);
        /* Box-Offset und Kalibrierung fix für Tablet */
        --box-margin-offset: 450px;
        --konzept-anchor-calibration: 160px;
        /* Tablet: 2-Spalten-Raster (Bild + Text) statt 3-Spalten */
        --grid-gutter: 30px;
        --img-col-width: clamp(200px, calc((100vw - 2 * var(--spacing-container) - var(--grid-gutter)) / 2), 420px);
    }
}

/* ===== SCHMALMODUS HOVER-GERÄT (≤ 639px, Maus/Trackpad) ===== */
@media (hover: hover) and (pointer: fine) and (max-width: 639px) {
    :root {
        --image-alex-width: clamp(252px, 56vw, 490px);
    }
}

/* ===== SCHMALES DESKTOP (1025–1300px): noch 2-Spalten für größere Bilder ===== */
@media (min-width: 1025px) and (max-width: 1300px) {
    :root {
        --grid-gutter: 30px;
        --img-col-width: clamp(260px, calc((100vw - 2 * var(--spacing-container) - var(--grid-gutter)) / 2), 440px);
    }
}

/* ===== TABLET - Ben neben Text (601-1024px) ===== */
@media (max-width: 1024px) and (min-width: 641px) {
    .unterpunkt-heading-container .image-with-info {
        right: clamp(20px, 3vw, 40px);
    }

    .content-box-2 p {
        max-width: calc(60vw - 40px - 8rem);
        margin-left: calc(20vw + 20px + 120px);
    }

    #ben-container .words-stair {
        margin-left: -128px; /* 80px weiter links als globale -48px */
        margin-bottom: -154px; /* 250px tiefer als globale 96px */
    }
}

@media (max-width: 1024px) and (min-width: 641px) {
    body:not(.orient-landscape) #ben-container .words-stair {
        margin-left: -98px; /* +30px gegenüber iPad allgemein */
    }
}

@media (max-width: 1400px) and (min-width: 641px) {
    body.orient-landscape #ben-container .words-stair {
        margin-left: -38px;   /* 90px rechts von iPad allgemein (-128px) */
        margin-bottom: 21px;  /* 45px tiefer als vorher (66px) */
    }
    body.orient-landscape #mythus-daniel-container .words-stair {
        margin-left: -18px;   /* 200px links von Desktop (182px) */
        margin-bottom: 56px;  /* 70px höher als Desktop (-14px) */
    }
    /* iPad Portrait: Daniel-Treppentext 280px links, 30px hoch (ggü. global -48px/96px).
       Media bis 1400px (nicht 1024), da iPad-Safari im Desktop-Modus in Portrait oft >1024 meldet. */
    body:not(.orient-landscape) #mythus-daniel-container .words-stair {
        margin-left: -328px;
        margin-bottom: 126px;
    }
}

/* ===== MOBILE (max-width: 640px) ===== */
@media (max-width: 640px) {
    :root {
        --spacing-container: 16px;
        --spacing-box-padding: 20px;
        --image-alex-width: clamp(242px, 82.6vw, 386px);
        --image-ben-height: 80vh;
        --heading-top-offset: 490px; /* MALEREI + Alex 50px höher (war 540) */
        --malerei-alex-gap: clamp(-385px, 8vw, -335px); /* -385px tiefer als Standard */
        --konzept-offset: clamp(200px, 40vh, 350px);
        --gesichten-offset: clamp(180px, 35vh, 300px);
        /* Schriftgrößen proportional zum iPad skaliert (Faktor ~0.5) */
        --font-size-heading-large: clamp(63px, 19.6vw, 82px);
        --font-size-heading-medium: clamp(43px, 13.7vw, 59px);
        /* Box-Offset fix für Mobile */
        --box-margin-offset: 350px;
        /* Kalibrierung für Mobile (fester Pixel-Wert) */
        --konzept-anchor-calibration: 120px;
    }

    /* Letter-spacing-Kompensation: trailing -0.08em verschiebt visuellen Mittelpunkt */
    .main-heading {
        padding-right: 0.08em;
    }

/* Unterpunkt-Bild: Position wird per JS gesetzt */
    .unterpunkt-heading-container .image-with-info {
        position: absolute;
        right: auto;
        left: auto;
    }

    /* Wrapper-Container transparent — pointer-events werden über .content-box/.content-box-2 geregelt */
    .content-box-wrapper,
    .content-box-wrapper-2,
    #mythus-box-wrapper,
    #gesichten-content-box-wrapper {
        z-index: 10;
        pointer-events: none;
    }

    /* Mobile: Bilder hinter allem (Schriften + Textboxen) */
    #ben-image-with-info,
    #mythus-daniel-image-with-info,
    #michael-image-with-info,
    #marcus-image-with-info {
        position: fixed !important;
        left: 20px !important;
        width: calc(100vw - 40px) !important;
        height: auto !important;
        max-height: 80vh !important;
        overflow: visible;
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 0;
        transform: none !important;
        pointer-events: none;
    }

    /* Klappentexte (Bild-Captions) über die Rahmen (999/9997) heben – aber UNTER Grain (10000)
       und Hamburger (10002). Dazu die Bild-Container entkoppeln (kein Stacking-Context): auch die
       per JS beim Einblenden gesetzte inline z-index:0 wird mit !important überstimmt. Die
       Treppenschrift steigt dadurch im Root-Context auf 9998; die Bilder bleiben statisch dahinter.
       Gewollter Nebeneffekt: der Text liegt dann auch über den großen Schriftzügen (RIVUS/MYTHUS …). */
    #ben-image-with-info,
    #mythus-daniel-image-with-info,
    #michael-image-with-info,
    #marcus-image-with-info {
        z-index: auto !important;
    }
    #mythus-daniel-image-with-info .words-stair,
    #michael-image-with-info .words-stair,
    #marcus-image-with-info .words-stair {
        position: relative;
        z-index: 9998;
    }
    #ben-stair-overlay {
        z-index: 9998; /* war 20 – Ben-Caption liegt als Root-Overlay ebenfalls über dem Rahmen */
    }

    #ben-container,
    #mythus-daniel-container {
        z-index: auto; /* Kein Stacking-Context – Ben/Daniel landen im Root-Context */
    }


    #ben-image-with-info .unterpunkt-heading-image,
    #mythus-daniel-image-with-info .unterpunkt-heading-image,
    #michael-image-with-info .unterpunkt-heading-image,
    #marcus-image-with-info .unterpunkt-heading-image {
        width: 100% !important;
        height: auto !important;
        max-height: 80vh !important;
        margin-top: 0 !important;
        object-fit: cover;
        object-position: top center;
    }

    .konzept-heading-outline,
    .gesichten-anchor-outline,
    .rivus-anchor-outline {
        z-index: 15;
    }

    /* RIVUS: Bild+Gradient(0) < Anchor(2) < Filled(3) < Outline(15) < StairOverlay(20) < Ghost(21) */
    .rivus-anchor-gray   { z-index: 2; }
    .rivus-anchor-filled { z-index: 3; }

    /* Original-Treppentext im Bild-Container verstecken (Gradient bleibt sichtbar) */
    #ben-image-with-info .words-stair { visibility: hidden; }

    /* Ben-Treppentext-Overlay: eigener Stacking-Context im Root, über allen Anchor-Schriften */
    #ben-stair-overlay {
        position: fixed;
        z-index: 20;
        left: 20px;
        width: calc(100vw - 40px);
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 14px 16px;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease;
        box-sizing: border-box;
    }

    /* Anchor-Container transparent, aber sichtbare Kindelemente blockieren Taps */
    #rivus-anchor-container,
    #mythus-anchor-container,
    #gesichten-anchor-container { pointer-events: none; }

    /* Wipe-Z-Reihenfolge: Images(z:1/2) < Gray(z:3) < Filled(z:4) < TextBox(z:10) < Outline(z:15) */
    #mythus-anchor           { z-index: 3; }
    #gesichten-anchor-gray   { z-index: 3; }
    #mythus-anchor-container .konzept-heading-filled,
    #gesichten-anchor-container .gesichten-anchor-filled { z-index: 4; }


    /* Graue Ebenen blockieren weiterhin Taps auf verdeckten Bildbereichen. */
    .rivus-anchor-gray,
    .gesichten-anchor-gray { pointer-events: auto; }
    /* Filled + Outline tap-DURCHLÄSSIG machen: die Outline liegt mit z:15 über der Box (z:10) und
       damit über den Aufklapp-Pfeilen; sonst fängt sie deren Taps ab. Sie tragen keine eigene
       Interaktion, daher gefahrlos auf pointer-events:none. */
    .rivus-anchor-filled,
    .rivus-anchor-outline,
    .konzept-heading-filled,
    .konzept-heading-outline,
    .gesichten-anchor-filled,
    .gesichten-anchor-outline { pointer-events: none; }

    /* Content-Boxen blockieren Taps auf verdeckten Bildbereichen (Wrapper bleibt transparent) */
    .content-box,
    .content-box-2 { pointer-events: auto; }

    /* RIVUS-Schriften tiefer auf Mobile */
    #rivus-anchor-container .rivus-anchor-filled,
    #rivus-anchor-container .rivus-anchor-outline {
        top: calc(var(--gesichten-offset) + 40px + 352px) !important;
    }

    /* MYTHUS-Schriften tiefer auf Mobile (analog RIVUS) */
    #mythus-anchor-container .konzept-heading-filled,
    #mythus-anchor-container .konzept-heading-outline {
        top: calc(var(--konzept-offset) + 352px) !important;
    }

    /* GESICHTEN-Schriften tiefer auf Mobile (analog RIVUS/MYTHUS) */
    #gesichten-anchor-container .gesichten-anchor-filled,
    #gesichten-anchor-container .gesichten-anchor-outline {
        top: calc(var(--gesichten-offset) + 352px) !important;
        font-size: 60px !important;
    }

    #gesichten-anchor-gray {
        font-size: 60px !important;
    }

    /* Clip-Container übernimmt overflow:hidden; äußerer Container kann overflow:visible */
    .image-clip {
        position: absolute;
        top: 0; left: 0;
        width: 100%; height: 100%;
        overflow: hidden;
    }

    /* Mobile: Overlay deckt volle Bildfläche ab (inset: 0 aus Basis-Regel bleibt erhalten) */
    /* Zeichen werden via .info-active .char (aus Basis-Regel) sichtbar */
    .unterpunkt-heading-container .info-line {
        font-size: clamp(12px, 2.5vw, 16px);
    }

    .unterpunkt-heading-container .info-details {
        font-size: clamp(10px, 2vw, 14px);
        margin-left: 0;
    }

    /* KONZEPT-Box: Blocksatz, symmetrisch innerhalb des sichtbaren Bereichs */
    .content-box p {
        text-align: justify;
        max-width: calc(100vw - 72px); /* 2×spacing-container (16px) + 2×box-padding (20px) */
        margin-left: 0;
        margin-right: 0;
    }

    /* Text nimmt volle Breite ein (kein Ben daneben) */
    .content-box-2 p {
        max-width: calc(100vw - 40px - 3rem);
        margin-left: calc(20vw + 20px);
    }

    /* Boxen weniger breit auf Mobile */
    .content-box,
    .content-box-2 {
        width: 110vw;
    }

    .content-box-2 {
        margin-left: -10vw;
    }

    /* KONZEPT-Box: Volle Breite, Blocksatz, mittig */
    .content-box:not(#mythus-box) {
        padding-left: var(--spacing-box-padding) !important;
        padding-right: var(--spacing-box-padding) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    .content-box:not(#mythus-box) p {
        text-align: justify;
        max-width: calc(100vw - 80px) !important; /* je 4px mehr Abstand zum Rahmen (mit margin-left) */
        margin-left: 4px !important;
        margin-right: 0 !important;
    }

    /* RIVUS-Box: Volle Breite, Blocksatz — margin-left:0 damit ::after-Hintergrund lückenlos */
    /* padding-left = spacing-box-padding + spacing-container, damit Text bündig mit KONZEPT/MYTHUS */
    #rivus-content-box {
        padding-left: calc(var(--spacing-box-padding) + var(--spacing-container)) !important;
        padding-right: var(--spacing-box-padding) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    #rivus-content-box p {
        text-align: justify;
        max-width: calc(100vw - 80px) !important; /* je 4px mehr Abstand zum Rahmen (mit margin-left) */
        margin-left: 4px !important;
        margin-right: 0 !important;
    }

    /* MYTHUS-Box: Volle Breite, Blocksatz, mittig */
    #mythus-box {
        padding-left: var(--spacing-box-padding) !important;
        padding-right: var(--spacing-box-padding) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    #mythus-box p {
        text-align: justify;
        max-width: calc(100vw - 80px) !important; /* je 4px mehr Abstand zum Rahmen (mit margin-left) */
        margin-left: 4px !important;
        margin-right: 0 !important;
    }

    /* GESICHTEN-Box: Volle Breite, Blocksatz */
    #gesichten-content-box {
        width: 110vw !important;
        padding-left: var(--spacing-box-padding) !important;
        padding-right: var(--spacing-box-padding) !important;
        padding-top: calc(var(--spacing-box-padding) + 5px + 12px) !important;
        margin-top: -12px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    #gesichten-content-box p {
        text-align: justify;
        max-width: calc(100vw - 80px) !important; /* je 4px mehr Abstand zum Rahmen (mit margin-left) */
        margin-left: 4px !important;
        margin-right: 0 !important;
    }

    /* Michael: wrapper-transform entfernen, damit position:fixed korrekt zum Viewport funktioniert */
    #michael-marcus-wrapper {
        transform: none !important;
    }
}

/* ===== MOBILE NAVIGATION (max-width: 980px) ===== */
@media (max-width: 980px) {
    .lang-switch {
        right: auto;
        left: 60px;
    }
    .nav-menu {
        position: fixed;
        bottom: 25px;
        right: 0;
        left: auto;
        width: auto;
        min-width: 140px;
        background: rgba(233, 233, 228, 0.95);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 0;
        display: none;
        box-shadow: none;
        border-radius: 0;
        z-index: 10002; /* über dem Link-Klappentext (#bottom-stair-menu: 9998) */
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%; /* ganze Zeile klickbar, nicht nur das Wort */
    }

    .nav-menu li a {
        display: block;
        width: 100%;
        padding: 9px 14px;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        text-decoration: none;
        color: #333;
        transition: none;
    }

    .nav-menu li a::after {
        display: none;
    }

    .nav-menu li a:hover {
        opacity: 1;
        background: #333333;
        color: #E9E9E4;
    }

    /* "Impressum &<br>Datenschutz": im Burger-Menue zweizeilig mit sehr engem
       Zeilenabstand (Desktop-Leiste unterdrueckt den <br>, s. Basisregel). */
    .nav-menu li a.nav-legal br {
        display: inline;
    }
    .nav-menu li a.nav-legal {
        line-height: 1.05;
    }

    body.dark-mode .nav-menu {
        background: rgba(26, 26, 26, 0.95);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-container {
        padding: 0 5%;
        justify-content: flex-end;
    }

    .shrinking-header {
        height: 83px;
    }

    .fixed-header {
        height: 43px;
    }

    .fixed-header .logo-gif {
        height: 28px;
    }

    .page-title-section {
        margin-top: 73px;
    }

    .text-behind,
    .text-front {
        font-size: clamp(2rem, 10vw, 5rem);
        white-space: normal;
    }

    .andron-part {
        margin-left: 5%;
    }

    section {
        padding: 8% 5%;
    }

    .image-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .text-container-3 {
        text-align: left;
        margin-right: 0;
    }

    .content-wrapper {
        padding: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    /* Dropdowns öffnen nach oben, nur Inhaltshöhe, kein Schatten */
    .mobile-dropdown__menu {
        top: auto !important;
        bottom: 25px !important;
        box-shadow: none !important;
    }

    #gesichten-anchor-container {
        pointer-events: none;
    }

    #mythus-daniel-image-with-info .words-stair {
        margin-left: -60px;
    }

    .daniel-desktop-1,
    .daniel-desktop-3 {
        display: none !important;
    }

    .daniel-mobile-1,
    .daniel-mobile-2,
    .daniel-mobile-3,
    .daniel-mobile-4 {
        display: list-item !important;
    }

    #mythus-daniel-image-with-info .daniel-mobile-1 { left: 16px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    #mythus-daniel-image-with-info .daniel-mobile-2 { left: 32px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #mythus-daniel-image-with-info .daniel-year     { left: 48px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    #mythus-daniel-image-with-info .daniel-mobile-3 { left: 64px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #mythus-daniel-image-with-info .daniel-mobile-4 { left: 80px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    #mythus-daniel-image-with-info .daniel-canvas   { left: 96px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #mythus-daniel-image-with-info .daniel-size     { left: 112px; transform: skew(60deg, -30deg) scaleY(0.66667); }

    /* Michael Mobile (≤768): Name in zwei Zeilen splitten (MICHAEL / (AT THE CROSS)). 7 sichtbare
       Zeilen, alle explizit positioniert → unabhängig von nth-child. */
    .michael-name-full, .michael-desktop-3 { display: none !important; }
    .michael-name, .michael-paren, .michael-mobile-3, .michael-mobile-4 { display: list-item !important; }

    #michael-image-with-info .michael-name     { left: 16px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    #michael-image-with-info .michael-paren    { left: 32px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #michael-image-with-info .michael-year     { left: 48px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    #michael-image-with-info .michael-mobile-3 { left: 64px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #michael-image-with-info .michael-mobile-4 { left: 80px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    #michael-image-with-info .michael-canvas   { left: 96px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #michael-image-with-info .michael-size     { left: 112px; transform: skew(60deg, -30deg) scaleY(0.66667); }


    body:not(.dark-mode) .image-info {
        background: linear-gradient(to bottom, transparent 15%, rgba(255,102,51,0) 100%);
        transition: background 0.2s ease;
    }

    body:not(.dark-mode) .info-active .image-info,
    body:not(.dark-mode) #ben-image-with-info.info-active .image-info,
    body:not(.dark-mode) #mythus-daniel-image-with-info.info-active .image-info,
    body:not(.dark-mode) .main-heading-container .info-active .image-info,
    body:not(.dark-mode) #michael-image-with-info.info-active .image-info {
        background: linear-gradient(to bottom, transparent 15%, rgba(255,102,51,0.85) calc(100% - 15px), rgba(255,102,51,1) 100%);
    }

    body:not(.dark-mode) .words-stair__line p {
        color: #E9E9E4;
    }

    body.dark-mode .words-stair__line p {
        color: #E9E9E4;
    }

    /* Dark-Mode-Tap-Gradient für ALLE Bilder. Zuvor global definiert; ging beim
       Refactor auf .image-info::after verloren (das ::after-Fade greift erst ab 641px,
       Mobile nutzt aber sein eigenes background-System). */
    body.dark-mode .info-active .image-info,
    body.dark-mode #ben-image-with-info.info-active .image-info,
    body.dark-mode #mythus-daniel-image-with-info.info-active .image-info,
    body.dark-mode .main-heading-container .info-active .image-info,
    body.dark-mode #michael-image-with-info.info-active .image-info {
        background: linear-gradient(to bottom, transparent 15%, rgba(51,51,51,0.72) calc(100% - 15px), rgba(51,51,51,1) 100%);
    }


    #stair-ghost .words-stair {
        transform: perspective(700px) rotateY(-8deg);
        transform-origin: left bottom;
    }

}

/* ===== SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
    :root {
        --nav-height: 25px;
    }

    .main-nav {
        font-size: 14px;
        height: 25px;
        top: auto;
        /* +4px: Platz fuer die Toenung-Sampling-Streifen (#safe-area-bottom/-dark) an der
           Unterkante — die Nav muss >3px vom Rand weg, sonst sampelt iOS 26 SIE fuer die
           Leisten-Toenung und der Dark/Light-Toggle greift nicht (s. Safe-Area-Block unten). */
        bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); /* über dem iOS-Home-Indicator halten */
        color: #333333;
        /* Hintergrund (cremefarbener Rahmenstreifen) kommt jetzt aus .nav-bar-bg (z-index 9997,
           UNTER der Treppe). .main-nav selbst bleibt transparent + hoch (z 9999), damit das
           geöffnete Menü/die Dropdowns ÜBER der Treppe (9998) liegen. */
        background-color: transparent!important;
        backdrop-filter: none!important;
        -webkit-backdrop-filter: none!important;
        z-index: 9999;
    }
    /* Sichtbarer Nav-Streifen als eigenes Element UNTER der Link-Treppe (9998). */
    .nav-bar-bg {
        display: block;
        position: fixed;
        left: 0; right: 0;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 4px); /* +4px wie .main-nav (Sampling-Streifen) */
        height: 25px;
        background-color: #E9E9E4;
        z-index: 9997;
        pointer-events: none;
    }
    body.dark-mode .nav-bar-bg { background-color: #1a1a1a; }

    /* Unterer Rahmen wird durch Nav ersetzt */
    body::before {
        display: none;
    }

    .nav-container {
        height: 25px;
    }

    /* Originale Toggles auf Mobile verstecken */
    .locale-switch,
    .lang-switch {
        display: none !important;
    }

    /* Mobile Dropdowns anzeigen */
    .mobile-dropdown {
        display: flex;
        align-items: center;
        position: relative;
        margin-left: 20px; /* doppelter Abstand zwischen den rechten Buttons */
    }

    /* Abstand zwischen Aa-Button und Hamburger (doppelt: 10px → 20px) */
    .nav-toggle {
        margin-left: 20px;
        /* Hitbox nach rechts bis zum Bildschirmrand: padding fuellt das Container-Padding (5%),
           das gleich grosse negative margin haelt die sichtbaren Striche an ihrer Position. */
        padding-right: 5vw;
        margin-right: -5vw;
    }

    /* Light-Dark-Toggle: sichtbare Position bleibt bei left:20px (alte Position).
       Die Hitbox wird per unsichtbarem Pseudo-Element bis zum linken Bildschirmrand
       erweitert – der Klick landet im <label> und schaltet die Checkbox. */
    .theme-switch {
        left: 20px;
    }
    .theme-switch::before {
        content: "";
        position: absolute;
        top: -12px;
        bottom: -12px;
        right: 100%;
        width: 24px;
    }

    /* KONZEPT: Text zentriert — Box bei wrapper-padding(16px) + box-padding(20px) = 36px
       Text mit margin-left:0 startet exakt bei 36px, endet bei 354px → symmetrisch */
    .content-box p {
        max-width: calc(100vw - 72px) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    header {
        top: 30px; /* Unterhalb des 30px stripe-top – gleich wie Desktop */
    }

    .header-backdrop {
        height: 76px; /* stripe-top (30px) + shrinking Header (46px) */
    }

    .frame-border-left,
    .frame-border-right {
        top: 29px;    /* 1px Überlappung mit stripe-top (30px) – gleich wie Desktop */
        bottom: 24px; /* Nav (25px) - 1px Überlappung */
    }

    .shrinking-header {
        height: 46px;
    }

    .logo-gif {
        height: 34px;
    }

    .fixed-header {
        height: 33px;
    }

    .fixed-header .logo-gif {
        height: 24px;
    }

    .hero-section {
        /* margin-top set dynamically by JavaScript */
    }

    .page-title-section {
        margin-top: 58px; /* Nav (25px) + Fixed Header (33px on smallest mobile) */
    }

    section {
        padding: 10% 5%;
    }

    .text-behind,
    .text-front {
        font-size: clamp(1.5rem, 12vw, 3.5rem);
    }

    /* Horizontale Balken im Light Mode weiß */
    .background-stripe-top {
        background-color: #E9E9E4;
    }

    /* Rahmen oben/unten über Viewport hinaus — verdeckt orange Subpixel-Linien */
    .background-stripe-top {
        top: -4px;
        height: 34px;
    }
    body::before {
        bottom: -4px;
        height: 24px;
    }

    /* Hamburger-Streifen kleiner */
    .nav-toggle span {
        width: 18px;
        height: 2px;
        margin: 2px 0;
        background-color: #333333;
    }

    /* Theme-Toggle dunkel im Light Mode */
    .theme-switch__sun,
    .theme-switch__moon {
        filter: invert(1);
    }

    /* Dark Mode: Farben zurücksetzen */
    body.dark-mode .main-nav {
        background-color: transparent!important; /* Streifen kommt aus .nav-bar-bg (dark) */
        backdrop-filter: none!important;
        -webkit-backdrop-filter: none!important;
        color: #E9E9E4;
    }

    body.dark-mode .nav-toggle span {
        background-color: #E9E9E4;
    }

    body.dark-mode .theme-switch__sun,
    body.dark-mode .theme-switch__moon {
        filter: none;
    }

}

/* =============== PERFORMANCE OPTIMIERUNG =============== */

.parallax-image,
.hover-image,
.text-front,
.text-behind,
.logo {
    will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* =============== PAGE TITLES =============== */

.page-title-section {
    padding: 2% 8% 0 8%;
    text-align: center;
    margin-top: 73px; /* Nav (30px) + Fixed Header (43px) */
}

.page-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--color-dark);
    margin: 0;
    -webkit-text-stroke: 1px var(--color-dark);
    text-stroke: 1px var(--color-dark);
    color: transparent;
}

/* =============== WORKS GALLERY =============== */

.works-gallery {
    padding: 4% 8% 8% 8%;
}

.gallery-categories {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.category-filter {
    padding: 0.8rem 2rem;
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border-radius: 30px;
}

.category-filter:hover {
    background-color: var(--color-primary);
    color: white;
}

.category-filter.active {
    background-color: var(--color-primary);
    color: white;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.work-item {
    opacity: 0;
    transform: scale(0.95);
    animation: fadeInScale 0.5s ease forwards;
}

.work-item:nth-child(1) { animation-delay: 0.1s; }
.work-item:nth-child(2) { animation-delay: 0.2s; }
.work-item:nth-child(3) { animation-delay: 0.3s; }
.work-item:nth-child(4) { animation-delay: 0.4s; }
.work-item:nth-child(5) { animation-delay: 0.5s; }
.work-item:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.work-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.work-image-wrapper:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.work-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.work-image-wrapper:hover .work-image {
    transform: scale(1.05);
}

.dummy-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    transition: transform 0.5s ease;
}

.work-image-wrapper:hover .dummy-image {
    transform: scale(1.05);
}

.work-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(51, 51, 102, 0.95), transparent);
    color: white;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.work-image-wrapper:hover .work-overlay {
    transform: translateY(0);
}

.work-overlay h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.work-overlay p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* =============== EXHIBITIONS PAGE =============== */

.exhibitions-section {
    padding: 4% 8%;
}

.exhibition-list {
    max-width: 900px;
    margin: 0 auto;
}

.exhibition-item {
    border-left: 4px solid var(--color-primary);
    padding: 2rem;
    margin-bottom: 3rem;
    background-color: #f9f9f9;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.exhibition-item:hover {
    transform: translateX(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.exhibition-date {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.exhibition-item h2 {
    color: var(--color-dark);
    margin: 0 0 1rem 0;
    font-size: 1.8rem;
}

.exhibition-location {
    font-style: italic;
    color: #666;
    margin-bottom: 1rem;
}

.exhibition-description {
    line-height: 1.8;
    color: #333;
}

/* =============== CONTACT PAGE =============== */

.contact-section {
    padding: 4% 8%;
    max-width: 800px;
    margin: 0 auto;
}

.contact-content {
    background-color: #f9f9f9;
    padding: 3rem;
    border-radius: 8px;
}

.contact-info {
    margin-bottom: 3rem;
}

.contact-info h2 {
    color: var(--color-dark);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.contact-info p {
    margin: 0.8rem 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.contact-info a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.3s;
}

.contact-info a:hover {
    opacity: 0.7;
}

.contact-form {
    margin-top: 3rem;
}

.contact-form h2 {
    color: var(--color-dark);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-button {
    background-color: var(--color-primary);
    color: white;
    padding: 1rem 3rem;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.3s;
}

.submit-button:hover {
    opacity: 0.8;
}

/* Clip-Wrapper: auf Desktop unsichtbar für Layout, auf Mobile überschrieben */
.image-clip {
    display: contents;
}

/* =============== IMAGE HOVER INFO =============== */

.image-with-info {
    position: relative;
    display: inline-block;
    will-change: transform;
}

/* Overlay: deckt das gesamte Bild ab */
.image-info {
    position: absolute;
    inset: 0;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    color: #333333;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px 16px;
    white-space: normal;
}

/* Gradient als separates Pseudo-Element → per opacity sanft ein-/ausblendbar.
   (Gradienten/background-image selbst sind in CSS nicht transitionierbar → das
   bloße Umschalten des background würde aufploppen.) */
.image-info::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    /* Caption-Gradient als zwei uebereinandergelegte Ebenen (Alpha addiert sich), Farbe ueber
       --cap (RGB-Tripel): (1) linearer Grundverlauf 12% -> 0.82 ueber die volle Hoehe; (2) darueber
       eine graduelle, nicht-lineare (t^2) Verstaerkung in den UNTEREN 60px bis volle Deckkraft
       (opak) an der Kante. --cap default = Seitenfarbe Orange; im Dark-Mode Grau (#333333).
       Nie cremefarben. */
    --cap: 255,102,51;
    background:
        linear-gradient(to bottom,
            transparent calc(100% - 60px),
            rgba(var(--cap),0.11) calc(100% - 40px),
            rgba(var(--cap),0.34) calc(100% - 25px),
            rgba(var(--cap),0.59) calc(100% - 14px),
            rgba(var(--cap),0.81) calc(100% - 6px),
            rgba(var(--cap),1) 100%),
        linear-gradient(to bottom, transparent 12%, rgba(var(--cap),0.82) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
body.dark-mode .image-info::after { --cap: 51,51,51; } /* Dark = Seitenhintergrund #333333 (Grau) */

/* Hover — nur Desktop (Maus/Trackpad) */
@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
    .image-with-info:hover .image-info {
        pointer-events: auto;
    }
    .image-with-info:hover .image-info::after {
        opacity: 1;
    }
    .main-heading-container .image-info {
        overflow: visible;
    }
    .main-heading-container .image-info .words-stair {
        position: absolute;
        left: 100%;
        bottom: 0;
        transform: translate(-100%, 0%);
        margin: 0;
    }
    #mythus-daniel-image-with-info .image-info {
        overflow: visible;
    }
    #mythus-daniel-image-with-info .image-info .words-stair {
        position: absolute;
        left: 100%;
        bottom: 0;
        transform: translate(-100%, 0%);
        margin: 0;
    }
    #ben-image-with-info .image-info {
        overflow: visible;
    }
    #ben-image-with-info .image-info .words-stair {
        position: absolute;
        left: -32px;
        bottom: 65px;
        margin: 0;
    }
    .image-with-info:not(.info-active):hover .words-stair__line p {
        transform: translate3d(0, -42px, 0);
        opacity: 1;
        transition: transform 0.4s ease-in-out, opacity 0.35s ease-out;
    }
}

/* Bild-Beschriftungen auf Desktop tiefer (überschreibt den Hover-Block) */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    #ben-image-with-info .image-info .words-stair {
        bottom: 15px;  /* 50px tiefer als 65px */
        left: -82px;   /* 50px weiter links als -32px */
    }
    #mythus-daniel-image-with-info .image-info .words-stair {
        transform: translate(calc(-100% - 200px), 100px); /* 100px tiefer + 200px weiter links */
    }
    .main-heading-container .image-info .words-stair {
        transform: translate(calc(-100% + 20px), 0%); /* 20px weiter rechts */
    }
}

/* Tap/Klick — alle Geräte: Gradient über .info-active (Farbe kommt aus .image-info::after) */
.info-active .image-info {
    pointer-events: auto;
}
/* ::after-Fade nur ab 641px (Desktop/Tablet); Mobile (<640) nutzt sein eigenes,
   eingefrorenes Gradient-System und würde sonst doppelt überlagern. */
@media (min-width: 641px) {
    .info-active .image-info::after {
        opacity: 1;
    }
}

/* narrowHover (Desktop-Schmalfenster). Der Caption-Gradient kommt jetzt – wie bei Touch-Mobile –
   aus dem globalen .image-info::after (via <640-Block unten); hier nur noch die Schriftgroesse. */
@media (hover: hover) and (pointer: fine) and (max-width: 639px) {
    /* GESICHTEN-Schriften (filled/outline/anchor) 1,35× größer als die 60px aus dem Mobile-Block
       (= 81px). !important, um die Mobile-Regel zu überschreiben. Touch-Mobile bleibt bei 60px. */
    #gesichten-anchor-container .gesichten-anchor-filled,
    #gesichten-anchor-container .gesichten-anchor-outline,
    #gesichten-anchor-gray {
        font-size: 81px !important;
    }
}

/* Schmal (<640): Touch-Mobile UND narrowHover-Desktop nutzen dasselbe ::after-opacity-System
   wie Desktop (statt des eingefrorenen direkten .image-info-background, der nicht transitionierbar
   ist und hart aufploppt). Gradient-Rezept + Farbe (--cap: Orange bzw. Dark Grau) kommen aus dem
   globalen .image-info::after; hier nur der direkte Mobile-background abgeschaltet und das Fade
   aktiviert. Nur Startseite (body:not(.sub-page)) → Werke-Seite hat ihr eigenes Mobile-System. */
@media (max-width: 639px) {
    /* bisherigen direkten Mobile-background abschalten (ID-Selektoren → !important) */
    body:not(.sub-page) .image-info,
    body:not(.sub-page) .info-active .image-info {
        background: none !important;
    }
    /* ::after-Fade auf Mobile aktivieren (Desktop hat es ab 641px) */
    body:not(.sub-page) .info-active .image-info::after {
        opacity: 1;
    }
}

/* Schmales Fenster / Tablet (481–980px): Die Nav sitzt hier oben (der untere
   Nav-Modus greift erst < 480px). Das Dropdown öffnet im 980er-Block aber unten
   (bottom:25px) → es erscheint am unteren Fensterrand, weit weg vom Hamburger oben
   und wirkt dadurch "kaputt". Daher hier unter die obere Nav setzen. Gilt auch für
   Touch-Tablets (iPad) – dort greift die hover/pointer-Bedingung sonst nicht. */
@media (min-width: 481px) and (max-width: 980px) {
    .nav-menu {
        top: 30px;
        bottom: auto;
    }
}

/* Burger-Dropdown auf Desktop (hover/Maus) im Lightmode: Farben wie oberer
   Menüstreifen/Header – dunkler Grund, heller Text; das gehoverte (ausgewählte)
   Feld ist hell → genau vertauscht zum bisherigen Zustand. Touch/Mobile bleibt
   unverändert (eingefroren). */
@media (hover: hover) and (pointer: fine) and (max-width: 980px) {
    body:not(.dark-mode) .nav-menu {
        background: rgba(51, 51, 51, 0.95);
    }

    body:not(.dark-mode) .nav-menu li a {
        color: #E9E9E4;
    }

    body:not(.dark-mode) .nav-menu li a:hover {
        background: #E9E9E4;
        color: #333333;
    }
}


/* =============== STAIRCASE TEXT EFFECT (nach CodePen bosworthco/YWBLpR) =============== */
/*
 * Jede .words-stair__line hat overflow:hidden + feste Höhe (--stair-clip).
 * Darin zwei <p>: erste leer, zweite mit Text – beide gestapelt.
 * Normal: leere <p> sichtbar (= nichts zu sehen).
 * Hover: beide <p> schieben um --stair-clip nach oben → Text erscheint.
 * Stufenversatz (left) + skew/scaleY erzeugen 3D-Perspektive.
 */

/* iPad-Portrait-spezifische Zeilen (Ben) – standardmäßig versteckt */
.ben-ipad-3,
.ben-ipad-4,
.ben-ipad-5 {
    display: none;
}

/* Mobile-spezifische Zeilen (Daniel) – standardmäßig versteckt */
.daniel-mobile-1,
.daniel-mobile-2,
.daniel-mobile-3,
.daniel-mobile-4,
.michael-mobile-3,
.michael-mobile-4,
.michael-name,
.michael-paren,
.alex-en {
    display: none;
}

/* Michael Desktop (≥769px): explizite Stufen-Positionen (1:1 wie der bisherige nth-child-Zustand:
   16/32/64/80/96). Hält das Desktop-Layout stabil, obwohl die Mobile-Split-Zeilen im DOM stehen. */
@media (min-width: 769px) {
    #michael-image-with-info .michael-name-full { left: 16px; transform: skew(60deg, -30deg) scaleY(0.66667); }
    #michael-image-with-info .michael-year      { left: 32px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #michael-image-with-info .michael-desktop-3 { left: 64px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #michael-image-with-info .michael-canvas    { left: 80px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #michael-image-with-info .michael-size      { left: 96px; transform: skew(60deg, -30deg) scaleY(0.66667); }
}

.words-stair {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.2px;
    transform: translate3d(0, 0, 0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-left: -48px;        /* links über den Bildrand */
    margin-bottom: 96px;       /* vier Zeilen höher */
}

.words-stair__line {
    height: 42px; /* --stair-clip */
    overflow: visible;
    clip-path: inset(0 -500px); /* nur vertikal clippen, horizontal freigeben */
    position: relative;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Alternierende 3D-Perspektive */
.words-stair__line:nth-child(odd) {
    transform: skew(60deg, -30deg) scaleY(0.66667);
}
.words-stair__line:nth-child(even) {
    transform: skew(0deg, -30deg) scaleY(1.33333);
}

/* Stufenversatz: jede Zeile 16px weiter rechts */
.words-stair__line:nth-child(1)  { left:  16px; }
.words-stair__line:nth-child(2)  { left:  32px; }
.words-stair__line:nth-child(3)  { left:  48px; }
.words-stair__line:nth-child(4)  { left:  64px; }
.words-stair__line:nth-child(5)  { left:  80px; }
.words-stair__line:nth-child(6)  { left:  96px; }
.words-stair__line:nth-child(7)  { left: 112px; }
.words-stair__line:nth-child(8)  { left: 128px; }
.words-stair__line:nth-child(9)  { left: 144px; }
.words-stair__line:nth-child(10) { left: 160px; }
.words-stair__line:nth-child(11) { left: 176px; }

/* Alex-Größenzeile fest auf Stufe 6 halten. Sie steht im DOM an Position 9, weil die
   EN-Mobile-Umbruchzeilen (alex-en) dazwischen liegen (sonst nur versteckt) – ohne diese
   feste Position würde nth-child(9) sie auf Stufe 9 schieben. Gilt Desktop + Mobile (DE/ES). */
.words-stair__line.alex-size {
    left: 96px;
    transform: skew(0deg, -30deg) scaleY(1.33333);
}

/* Daniel Desktop: fehlende left-Positionen und korrekter Transform für desktop-3 */
@media (min-width: 769px) {
    #mythus-daniel-image-with-info .daniel-desktop-3 { transform: skew(60deg, -30deg) scaleY(0.66667); }
    #mythus-daniel-image-with-info .daniel-canvas    { left: 128px; }
    #mythus-daniel-image-with-info .daniel-size      { left: 144px; }
}

/* =============== Treppentext-Menü am Seitenende (nur iPhone) =============== */
#bottom-stair-menu { display: none; }
/* Nur Touch-Phones (<=600): Treppe erscheint am Seitenende und ist per Tap nutzbar.
   iPad (coarse, >600) und Desktop (Maus/Hover, jede Breite) bleiben aussen vor. */
@media (max-width: 600px) and (hover: none) and (pointer: coarse) {
    #bottom-stair-menu {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        top: 58%;                 /* Mitte der unteren Bildschirmhälfte */
        z-index: 9998;            /* über dem Rahmen (frame-border 999), aber UNTER dem globalen Grain (10000) → gleiche Körnung wie die Seite */
        pointer-events: none;
        transform: translate3d(-20px, 23px, 0); /* 20px nach links, 23px nach unten (globaler Standard; Sub-Seiten mit Spacer-Aenderung ueberschreiben pro Seite) */
    }
    body.bottom-stair-visible #bottom-stair-menu {
        pointer-events: auto;
    }
    #bottom-stair-menu ul {
        list-style: none;
        margin: 0;
        padding-left: 40px;
    }
    #bottom-stair-menu .bottom-stair__line {
        height: 56px;             /* geringerer Zeilenabstand */
        position: relative;
        clip-path: inset(0 -500px); /* nur vertikal clippen → Text kommt unter der Linie hervor (wie words-stair) */
        will-change: transform;
        backface-visibility: hidden;
    }
    #bottom-stair-menu .bottom-stair__line:nth-child(1) { left: 0;    transform: skew(60deg, -30deg) scaleY(0.66667); }
    #bottom-stair-menu .bottom-stair__line:nth-child(2) { left: 30px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    #bottom-stair-menu .bottom-stair__line:nth-child(3) { left: 60px; transform: skew(60deg, -30deg) scaleY(0.66667); }
    #bottom-stair-menu .bottom-stair__line:nth-child(4) { left: 90px; transform: skew(0deg,  -30deg) scaleY(1.33333); } /* 4. Zeile (Impressum) */
    #bottom-stair-menu a {
        position: relative;
        display: inline-block;
        font-family: 'Inter', sans-serif;
        font-weight: 900;         /* bold/black (höchstes Gewicht) */
        font-size: 60px;          /* deutlich größer als die übrigen Treppentexte (32px) */
        letter-spacing: -0.2px;
        line-height: 62px;
        text-transform: uppercase;
        text-decoration: none;
        white-space: nowrap;
        -webkit-text-stroke: 1.5px var(--color-dark); /* dunkelgrau wie die filled-Schriften */
        text-stroke: 1.5px var(--color-dark);
        /* Reveal-Animation wie die übrigen Treppentexte: Text schiebt sich von unten unter der
           (Clip-)Linie hervor (kein Fade). Alle Zeilen gleichzeitig, 0.4s ease. */
        transform: translate3d(0, 100%, 0);
        transition: transform 0.4s ease;
    }
    body.bottom-stair-visible #bottom-stair-menu a {
        transform: translate3d(0, 0, 0);
    }
    #bottom-stair-menu .bottom-stair__line:nth-child(1) a,
    #bottom-stair-menu .bottom-stair__line:nth-child(2) a,
    #bottom-stair-menu .bottom-stair__line:nth-child(3) a,
    #bottom-stair-menu .bottom-stair__line:nth-child(4) a { color: var(--color-dark); }
    /* Dark-Mode: Link-Treppentext orange */
    body.dark-mode #bottom-stair-menu a {
        color: #ff6633 !important;
        -webkit-text-stroke: 1.5px #ff6633;
        text-stroke: 1.5px #ff6633;
    }
    /* Verlaengert Subseiten (Kontakt/Impressum/Texte) am Ende um 700px, damit die
       Link-Treppe erst am Seitenende erscheint und beim Hochscrollen wieder verschwindet. */
    .bottom-stair-spacer { height: 300px; } /* Seitenende 400px hoeher (war 700px) */
}
/* KEINE globale height:0-Regel danach: sie wuerde (gleiche Spezifitaet, spaeter im Quelltext)
   die 700px aus der Media-Query ueberschreiben. Ein leeres Div ist ohnehin 0px hoch. */

.words-stair__line p {
    height: 42px; /* --stair-clip */
    line-height: 34px;
    padding: 0 6px;
    margin: 0;
    /* Exit-Transition: zurückgleiten, Opacity erst danach sofort auf 0 */
    transition: transform 0.4s ease-in-out, opacity 0s linear 0.4s;
    transform: translate3d(0, 0, 0);
    white-space: nowrap;
    color: #333333;
    opacity: 0;
    font-size: 32px;
    font-weight: 900;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

#stair-ghost {
    position: fixed;
    z-index: 21;
    pointer-events: none;
    overflow: visible;
    opacity: 0;
    transition: opacity 0.35s ease;
}
#stair-ghost .words-stair {
    margin: 0;
}

/* Staircase iPhone: 16px (proportional skaliert) */
@media (max-width: 480px) {
    .words-stair {
        font-size: 16px;
        margin-left: -10px;
        margin-bottom: 17px;
    }

    .main-heading-container .words-stair {
        margin-left: -10px;
        margin-bottom: -3px;
    }

    .words-stair__line {
        height: 41px;
    }

    .words-stair__line p {
        height: 41px;
        line-height: 32px;
        font-size: 31px;
        padding: 0 6px;
    }

    .words-stair__line:nth-child(1) { left: 8px; }
    .words-stair__line:nth-child(2) { left: 16px; }
    .words-stair__line:nth-child(3) { left: 24px; }
    .words-stair__line:nth-child(4) { left: 32px; }
    .words-stair__line:nth-child(5) { left: 40px; }
    .words-stair__line:nth-child(6) { left: 48px; }

    .main-heading-container .words-stair__line:nth-child(1) { left: 16px; }
    .main-heading-container .words-stair__line:nth-child(2) { left: 32px; }
    .main-heading-container .words-stair__line:nth-child(3) { left: 48px; }
    .main-heading-container .words-stair__line:nth-child(4) { left: 64px; }
    .main-heading-container .words-stair__line:nth-child(5) { left: 80px; }
    .main-heading-container .words-stair__line:nth-child(6) { left: 96px; }

    /* Alex EN auf Mobile: längeren Materialtext anders umbrechen
       (AND COLOURED / PENCIL ON / CANVAS,). Nur englische Seite (body.is-en).
       DE/ES behalten ihren kürzeren 2-Zeilen-Umbruch (alex-tail-default). */
    body.is-en .alex-tail-default { display: none; }
    body.is-en .words-stair__line.alex-en { display: list-item; }
    body.is-en .words-stair__line.alex-en-a { left: 64px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    body.is-en .words-stair__line.alex-en-b { left: 80px; transform: skew(60deg, -30deg) scaleY(0.66667); }
    body.is-en .words-stair__line.alex-en-c { left: 96px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    body.is-en .words-stair__line.alex-size { left: 112px; transform: skew(60deg, -30deg) scaleY(0.66667); }

    .info-active .words-stair__line p {
        transform: translate3d(0, -41px, 0);
    }
}

/* =============== IMPRESSUM PAGE =============== */

.impressum-section {
    padding: 0 8%;
    max-width: 800px;
    margin: 0 auto;
}

.impressum-content {
    background-color: #f9f9f9;
    padding: 3rem;
    border-radius: 8px;
    line-height: 1.8;
}

.impressum-content h2 {
    color: var(--color-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.impressum-content h2:first-child {
    margin-top: 0;
}

.impressum-content p {
    margin: 0.5rem 0;
    color: #333;
}

/* =============== THEME TOGGLE SWITCH =============== */

/* =============== LOCALE SWITCH (DE/EN) =============== */

/* Mobile Dropdowns: auf Desktop versteckt */
@media (min-width: 481px) {
    .mobile-dropdown {
        display: none;
    }
}

.mobile-dropdown__trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 25px;
    opacity: 0.85;
}

.mobile-dropdown__trigger:hover { opacity: 1; }

.mobile-dropdown__trigger svg {
    width: 15px;
    height: 15px;
    display: block;
}

.mobile-aa-icon {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

.mobile-dropdown__menu {
    display: none;
    position: fixed;
    top: 25px;
    right: 0;
    list-style: none;
    padding: 4px 0;
    margin: 0;
    z-index: 10002; /* über dem Link-Klappentext (#bottom-stair-menu: 9998) */
    min-width: 140px;
    border-radius: 0;
    background: rgba(233, 233, 228, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.mobile-dropdown__menu.open {
    display: block;
}

.mobile-dropdown__menu li button {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 9px 14px;
    text-align: left;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.mobile-dropdown__menu li button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.mobile-dropdown__menu li button:hover,
.mobile-dropdown__menu li button.active {
    background: rgba(255,255,255,0.25);
}

@media (max-width: 640px) {
    .mobile-dropdown__menu li button.active {
        background: #333333;
        color: #E9E9E4;
    }
}

body.dark-mode .mobile-dropdown__menu {
    background: rgba(26, 26, 26, 0.95);
}

body.dark-mode .mobile-dropdown__menu li button {
    color: #ff6633;
}

body.dark-mode .mobile-dropdown__trigger {
    color: #E9E9E4;
}

/* Deutschlandflagge in der Sprachauswahl (iPhone-Dropdown): Symbol generell vertikal spiegeln
   (Light- und Dark-Mode). */
#mobile-locale-menu button[data-locale="de"] svg {
    transform: scaleY(-1);
}

.locale-switch {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--color-gray);
    border-radius: 20px;
    padding: 3px;
    z-index: 1001;
}

.locale-switch__btn {
    background: none;
    border: none;
    padding: 2px 3px;
    cursor: pointer;
    border-radius: 14px;
    color: var(--color-dark);
    opacity: 0.35;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.locale-switch__btn svg {
    width: 22px;
    height: 14px;
}

.locale-switch__btn.active {
    background: var(--color-dark);
    color: var(--color-light);
    opacity: 1;
}

.locale-switch__btn:hover { opacity: 0.7; }
.locale-switch__btn.active:hover { opacity: 1; }

/* Locale-Texte */
.locale-de, .locale-en, .locale-es { display: none; }
.locale-de.active, .locale-en.active, .locale-es.active { display: block; }

/* Dark mode */
body.dark-mode .locale-switch__btn { color: var(--color-light); }
body.dark-mode .locale-switch__btn.active {
    background: var(--color-light);
    color: var(--color-dark);
}
.locale-switch__btn.active[data-locale="de"] {
    transform: rotate(180deg);
}
body.dark-mode .locale-switch__btn:not(.active)[data-locale="de"] {
    transform: rotate(180deg);
}
body.dark-mode .locale-switch__btn.active[data-locale="de"] {
    transform: none;
}

@media (max-width: 980px) {
    .locale-switch {
        right: auto;
        left: 60px;
    }
}

/* =============== LANG SWITCH =============== */

.lang-switch {
    position: absolute;
    right: 118px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--color-gray);
    border-radius: 20px;
    padding: 3px;
    z-index: 1001;
}

.lang-switch__btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    border-radius: 14px;
    color: var(--color-dark);
    opacity: 0.35;
    transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.lang-switch__btn svg {
    width: 16px;
    height: 16px;
}

.lang-switch__btn.active {
    background: var(--color-dark);
    color: var(--color-light);
    opacity: 1;
}

.lang-switch__btn:hover {
    opacity: 0.7;
}

.lang-switch__btn.active:hover {
    opacity: 1;
}

/* Mobile: lang-switch links vom Menü-Toggle (Kaskaden-Fix) */
@media (max-width: 980px) {
    .lang-switch {
        right: auto;
        left: 165px;
    }
}

/* Textversionierung */
.lang-text {
    display: none;
}

.lang-text.active {
    display: block;
}

/* Dark mode */
body.dark-mode .lang-switch,
body.dark-mode .locale-switch {
    background: #666666;
}

body.dark-mode .lang-switch__btn {
    color: var(--color-light);
}

body.dark-mode .lang-switch__btn.active {
    background: var(--color-light);
    color: var(--color-dark);
}

/* =============== THEME SWITCH =============== */

.theme-switch {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    cursor: pointer;
    z-index: 1001;
}

body.dark-mode .gesichten-anchor-container .gesichten-anchor-filled,
body.dark-mode .rivus-anchor-container .rivus-anchor-filled {
    color: #ff6633;
}

body.dark-mode .gesichten-anchor-container .gesichten-anchor-outline,
body.dark-mode .rivus-anchor-container .rivus-anchor-outline {
    color: transparent;
    -webkit-text-stroke-color: #ff6633;
    text-stroke-color: #ff6633;
}

.theme-switch__checkbox {
    display: none;
}

.theme-switch__sun,
.theme-switch__moon {
    width: 16px;
    height: 16px;
    position: absolute;
    transition: opacity 0.3s, transform 0.3s;
}

.theme-switch__sun {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23E9E9E4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>');
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.theme-switch__moon {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23E9E9E4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>');
    opacity: 0;
    transform: scale(0.6) rotate(-90deg);
}

.theme-switch__checkbox:checked ~ .theme-switch__sun {
    opacity: 0;
    transform: scale(0.6) rotate(90deg);
}

.theme-switch__checkbox:checked ~ .theme-switch__moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* =============== DARK MODE STYLES =============== */

/* Dark mode variable overrides */
body.dark-mode {
    --color-primary: #ff6633;
    --color-dark: #ff6633;
    --color-gray: #1a1a1a;
    --color-gray-dark: #1e1e1e;
    background-color: #333333;
    color: var(--color-primary);
}

/* Dark mode html background - needed because header is semi-transparent */
html.dark-mode {
    background-color: #1a1a1a; /* Dark frame color for overscroll */
}

/* Dark mode frame borders + background stripes — alle auf einheitlich #1a1a1a */
body.dark-mode::before,
body.dark-mode .frame-border-left,
body.dark-mode .frame-border-right,
body.dark-mode .background-stripe-top,
body.dark-mode .background-stripe-left,
body.dark-mode .background-stripe-right,
body.dark-mode .background-stripe-bottom {
    background-color: #1a1a1a;
}

/* Dark mode navigation */
body.dark-mode .main-nav {
    background-color: rgba(26, 26, 26, 0.8); /* Darker semi-transparent */
}

body.dark-mode .nav-lower-layer {
    background-color: #1a1a1a; /* Solid dark background */
}

body.dark-mode .nav-menu li a {
    color: #E9E9E4;
}

body.dark-mode .nav-menu li a::after {
    background-color: #E9E9E4;
}

@media (max-width: 640px) {
    body.dark-mode .nav-menu li a {
        color: #ff6633;
    }
}

.logo-gif-dark {
    display: none;
}

body.dark-mode .logo-gif-light {
    display: none;
}

body.dark-mode .logo-gif-dark {
    display: block;
}

body.dark-mode .logo-gif {
}

/* Dark mode header */
body.dark-mode header {
    background-color: rgba(51, 51, 51, 0.75); /* Frosted Glass im body-Hintergrundton #333333 */
}

body.dark-mode .header-backdrop {
    background-color: #333333; /* = body-Hintergrund im Dark-Mode → kein dunkles Rechteck mehr */
}

/* Dark mode headings */
body.dark-mode .main-heading-filled,
body.dark-mode .konzept-heading-filled,
body.dark-mode .unterpunkt-heading-filled,
body.dark-mode .gesichten-anchor-filled,
body.dark-mode .rivus-anchor-filled {
    color: #ff6633;
}

body.dark-mode .main-heading-outline,
body.dark-mode .konzept-heading-outline,
body.dark-mode .unterpunkt-heading-outline,
body.dark-mode .gesichten-anchor-outline,
body.dark-mode .rivus-anchor-outline {
    -webkit-text-stroke-color: #ff6633;
    text-stroke-color: #ff6633;
}

body.dark-mode .konzept-heading-anchor,
body.dark-mode .gesichten-anchor-gray,
body.dark-mode .rivus-anchor-gray {
    color: #1a1a1a;
}

/* Dark mode content boxes */
body.dark-mode .content-box,
body.dark-mode .content-box-2 {
    background-color: #1a1a1a;
}

body.dark-mode .content-box::before,
body.dark-mode .content-box-wrapper-2 > .content-box-2::after,
body.dark-mode #gesichten-content-box::before {
    background-color: #1a1a1a;
}

body.dark-mode .content-box p,
body.dark-mode .content-box-2 p {
    color: #E9E9E4; /* Light gray text on dark boxes */
}

/* Dark mode image info */
body.dark-mode .image-info {
    color: #ff6633;
}
@media (min-width: 769px) {
    body.dark-mode .words-stair__line p {
        color: #ff6633;
    }
}


/* Dark mode for specific pages */
body.dark-mode .page-title {
    -webkit-text-stroke-color: #ff6633;
    text-stroke-color: #ff6633;
}

body.dark-mode .category-filter {
    border-color: #ff6633;
    color: #ff6633;
}

body.dark-mode .category-filter.active,
body.dark-mode .category-filter:hover {
    background-color: #ff6633;
    color: #333333;
}

body.dark-mode .exhibition-item {
    border-left-color: #ff6633;
    background-color: #1a1a1a;
}

body.dark-mode .exhibition-item h2 {
    color: #ff6633;
}

body.dark-mode .exhibition-location,
body.dark-mode .exhibition-date,
body.dark-mode .exhibition-description {
    color: #E9E9E4;
}

body.dark-mode .contact-content,
body.dark-mode .impressum-content {
    background-color: #1a1a1a;
}

body.dark-mode .contact-info h2,
body.dark-mode .contact-form h2,
body.dark-mode .impressum-content h2 {
    color: #ff6633;
}

body.dark-mode .contact-info p,
body.dark-mode .impressum-content p {
    color: #E9E9E4;
}

body.dark-mode .form-group label {
    color: #ff6633;
}

body.dark-mode .form-group input,
body.dark-mode .form-group textarea {
    background-color: #333333;
    border-color: #4d4d4d;
    color: #E9E9E4;
}

body.dark-mode .form-group input:focus,
body.dark-mode .form-group textarea:focus {
    border-color: #ff6633;
}

body.dark-mode .submit-button {
    background-color: #ff6633;
    color: #333333;
}

/* =============== SANFTE THEME-ÜBERGÄNGE =============== */
/* Nur aktiv wenn .theme-transitioning gesetzt (nach initialem Laden) */
/* prefers-reduced-motion überschreibt dies automatisch (Zeile 1146) */

body.theme-transitioning,
body.theme-transitioning .content-box,
body.theme-transitioning .content-box-2,
body.theme-transitioning .header-backdrop,
body.theme-transitioning header,
body.theme-transitioning .main-nav {
    transition: background-color 0.5s ease, color 0.5s ease;
}

html.theme-transitioning {
    transition: background-color 0.5s ease;
}

body.theme-transitioning::before,
body.theme-transitioning::after,
body.theme-transitioning .bottom-bar-fix {
    transition: background-color 0.5s ease;
}

body.theme-transitioning .main-heading-filled,
body.theme-transitioning .konzept-heading-filled,
body.theme-transitioning .gesichten-anchor-filled,
body.theme-transitioning .rivus-anchor-filled,
body.theme-transitioning .unterpunkt-heading-filled {
    transition: opacity 0.3s ease, color 0.5s ease, -webkit-text-stroke-color 0.5s ease;
}

body.theme-transitioning .main-heading-outline,
body.theme-transitioning .konzept-heading-outline,
body.theme-transitioning .konzept-heading-anchor,
body.theme-transitioning .gesichten-anchor-outline,
body.theme-transitioning .gesichten-anchor-gray,
body.theme-transitioning .rivus-anchor-outline,
body.theme-transitioning .rivus-anchor-gray,
body.theme-transitioning .unterpunkt-heading-outline {
    transition: color 0.5s ease, -webkit-text-stroke-color 0.5s ease;
}

body.theme-transitioning .content-box p,
body.theme-transitioning .content-box-2 p,
body.theme-transitioning .content-box h2,
body.theme-transitioning .content-box-2 h2 {
    transition: color 0.5s ease;
}

body.theme-transitioning .frame-border-left,
body.theme-transitioning .frame-border-right {
    transition: background-color 0.5s ease;
}

/* =============== RESPONSIVE ADDITIONS =============== */

@media (max-width: 768px) {
    .page-title-section {
        padding: 12% 5% 6% 5%;
    }

    .works-gallery {
        padding: 6% 5%;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gallery-categories {
        gap: 0.5rem;
    }

    .category-filter {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .exhibition-item {
        padding: 1.5rem;
    }

    .contact-content,
    .impressum-content {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .works-grid {
        gap: 1rem;
    }

    .category-filter {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .contact-content,
    .impressum-content {
        padding: 1.5rem;
    }
}

#rivus-anchor-gray {
    color: var(--color-gray);
}


#gesichten-anchor-container {
    place-items: start center; /* Mittig */
    padding-left: 0;
    padding-right: 0;
}


#gesichten-content-box {
    width: 60vw;
    margin-left: 0; /* Override -20vw from .content-box-2 */
}

/* iPad Portrait: GESICHTEN-Text mittig (zwischen den beiden Nachbar-Kanten, aber im Bildbereich). */
@media (orientation: portrait) and (min-width: 601px) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    #gesichten-content-box {
        width: 72vw;
        margin-left: auto;
        margin-right: auto;
    }
    #gesichten-content-box p {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
#gesichten-content-box {
        width: calc(100vw - 40px);
        margin-left: auto;
        margin-right: auto;
    }

    #gesichten-content-box p {
        max-width: calc(100vw - 72px);
        margin-left: 0;
        margin-right: 0;
    }
}


#gesichten-content-box p {
    margin-left: 0;
    max-width: 90%;
}

#michael-marcus-wrapper {
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    width: 100%;
    transform: translate(-40px, 10px);
}

#michael-marcus-wrapper .image-with-info {
    position: relative;
    right: auto;
}

#michael-marcus-container {
    padding-left: 0;
    place-items: start center;
}

#marcus-image-with-info {
    left: 80px;
}

/* Marcus 7/6 so hoch wie Michael (140cm vs 120cm Originalgemälde) */
#marcus-image-with-info .unterpunkt-heading-image {
    height: calc(var(--image-ben-height) * 7 / 6);
}

/* Non-Mobile: Nur Michael, so groß wie möglich unter dem GESICHTEN-Block */
@media (min-width: 641px) {
    #marcus-image-with-info {
        display: none !important;
    }

    #michael-marcus-wrapper {
        display: flex;
        justify-content: center;
        transform: none;
        gap: 0;
    }

    #michael-image-with-info {
        position: relative;
        left: auto;
        right: auto;
    }

    #michael-image-with-info .unterpunkt-heading-image {
        width: 100%;
        max-width: calc(2 * var(--img-col-width) + var(--grid-gutter));
        height: auto;
        max-height: 80vh;
    }
}

/* "Großer Michael" (hohe Desktop-Fenster): aus dem Fluss genommen wie die Textboxen,
   damit er die Dokumenthöhe nicht aufbläht. Breite = Bildbreite (nicht volle Fensterbreite),
   damit Gradient & Hover-Text zum Bild passen; horizontal per left:50% + Transform zentriert.
   Vertikalposition per JS-Transform (translateX(-50%) bleibt für die Zentrierung erhalten). */
body.michael-tall #michael-image-with-info {
    position: fixed;
    top: 0;
    left: 50%;
    width: auto;
    z-index: 1;
    will-change: transform;
}
/* Großer Michael: Hover-Text 150px über und 150px links von der unteren rechten Bildecke */
body.michael-tall #michael-image-with-info .image-info .words-stair {
    position: absolute;
    right: 150px;
    bottom: 150px;
    left: auto;
    transform: none;
    margin: 0;
}

/* RIVUS-Schriften 20px tiefer + 15px weiter links */
#rivus-anchor-container {
    padding-right: calc(var(--spacing-container) + 15px);
}
#rivus-anchor-container .rivus-anchor-filled,
#rivus-anchor-container .rivus-anchor-outline {
    top: calc(var(--gesichten-offset) + 40px);
}

/* Bild-Container: pointer-events nur auf das Bild selbst, nicht den leeren Container */
#ben-container,
#mythus-daniel-container,
#michael-marcus-container {
    pointer-events: none;
}
#ben-image-with-info,
#mythus-daniel-image-with-info,
#michael-image-with-info,
#marcus-image-with-info {
    pointer-events: auto;
}

/* Ben-Bild bei RIVUS: Grid-Breite, rechtsbündig zum Container */
#ben-container .unterpunkt-heading-image {
    width: var(--img-col-width);
    height: auto;
    margin-top: 0;
}
#ben-container .image-with-info {
    right: calc(var(--spacing-container) + 50px);
}

/* =============== MYTHUS BLOCK (gespiegelt wie KONZEPT) =============== */

/* MYTHUS Box: Text weiter rechts (Daniel-Bild links) – Feinabstimmung per JS */
#mythus-box {
    padding-left: calc(var(--spacing-box-padding) + 150px);
    padding-top: calc(var(--spacing-box-padding) + 45px);
    padding-bottom: calc(var(--spacing-box-padding) + 45px);
}

/* Zeilenumbruch: max-width um 150px reduziert (Ausgleich für extra padding) */
#mythus-box p {
    max-width: calc(80vw - 175px - 150px);
}

/* MYTHUS Daniel: links statt rechts (gespiegelt), Grid-Breite */
#mythus-daniel-container .image-with-info {
    right: auto;
    left: var(--spacing-container);
}
#mythus-daniel-container .unterpunkt-heading-image {
    width: var(--img-col-width);
    height: auto;
}

/* =============== PORTRAIT-MODUS (height/width > 1.2) ===============
   Greift bei max-aspect-ratio: 5/6 (entspricht JS-Check: innerHeight/innerWidth > 1.2).

   Seitenstruktur (von oben nach unten):
     MALEREI (Hauptüberschrift) → Alex (Bild) → KONZEPT-Box → Ben (Bild) →
     MYTHUS-Box → Daniel (Bild) → GESICHTEN-Box → Michael + Marcus (Bilder)

   Portrait-Anpassungen hier (CSS):
     --image-alex-width ........... Größe des Alex-Bildes (KONZEPT-Block)
     --malerei-alex-gap ........... Abstand MALEREI-Überschrift ↔ Alex-Bild
     --heading-top-offset ......... Vertikale Position der MALEREI-Überschrift
     --font-size-heading-large .... Schriftgröße MALEREI
     min-height / padding-top ..... Abstände zwischen den Heading-Containern
     #ben-container ............... Größe des Ben-Bildes (RIVUS-Block)

   Portrait-Anpassungen im JS (script.js):
     getMeetingRatio() ............ Treffpunkt der Parallax-Schriften (Zeile ~32)
     PORTRAIT_BOX_OFFSET ......... Zusätzlicher Abstand Alex → KONZEPT-Box (Zeile ~354)
     getBoxAlexGap() .............. Addiert PORTRAIT_BOX_OFFSET wenn Portrait (Zeile ~356)
*/
/* Aktivierung per JS-Body-Klasse statt (max-aspect-ratio: 5/6), damit Höhen-Ziehen
   das Layout nicht live umschaltet. JS: _updateAspectClasses() (eingefrorenes Verhältnis
   auf Hover-Geräten, live auf Touch). */
@media (min-width: 641px) {
    body.aspect-portrait {
        --image-alex-width: clamp(440px, 82.5vw, 770px);    /* Alex-Bild: Breite */
        --malerei-alex-gap: calc(clamp(50px, 8vw, 100px) + 50px); /* MALEREI ↔ Alex */
        --font-size-heading-large: 108px;                    /* MALEREI Schriftgröße */
        --heading-top-offset: calc(clamp(100px, 18vh, 200px) - 50px); /* MALEREI Position */
        /* Portrait: Bilder breiter (ca. 40% der Seite statt 1/3), aber weiterhin aus Grid abgeleitet */
        --grid-gutter: 30px;
        --img-col-width: clamp(220px, calc((100vw - 2 * var(--spacing-container) - var(--grid-gutter)) / 2), 440px);
    }
    body.aspect-portrait .konzept-heading-container,
    body.aspect-portrait .gesichten-anchor-container,
    body.aspect-portrait .rivus-anchor-container {
        min-height: 75vh;    /* Blockabstände (Landscape: 100vh) */
        padding-top: 51vh;   /* Blockabstände (Landscape: 68.5vh) */
    }
    /* Ben im Portrait: Grid-Breite (--img-col-width bereits oben überschrieben) */
    body.aspect-portrait #ben-container .image-with-info {
        right: var(--spacing-container);
    }
    /* Erster Absatz der RIVUS-Box: Zeilenumbruch weiter rechts (nur Portrait) */
    body.aspect-portrait .content-box-2:not(#gesichten-content-box) p:first-of-type {
        max-width: calc(70vw - 20px - 10rem + 460px);
    }
    /* GESICHTEN-Box: Im Portrait fast Rand-zu-Rand (Box startet bei x=0 durch JS-Transform) */
    /* GESICHTEN-Box: lang-container auf volle Box-Breite zwingen */
    body.aspect-portrait #gesichten-content-box .lang-container,
    body.aspect-portrait #gesichten-content-box .lang-text,
    body.aspect-portrait #gesichten-content-box .locale-de,
    body.aspect-portrait #gesichten-content-box .locale-en,
    body.aspect-portrait #gesichten-content-box .locale-es {
        width: 100%;
        margin-left: 0 !important;
    }
    body.aspect-portrait #gesichten-content-box p {
        margin-left: 0 !important;
        max-width: calc(100vw - 2 * var(--spacing-box-padding)) !important;
    }
    /* Nach der iPhone-Rotation zeigt #gesichten-content-box den MYTHUS-Text: die obige
       "fast Rand-zu-Rand"-Regel (für den alten GESICHTEN-Inhalt) neutralisieren →
       gleiche Einzüge wie die anderen Blöcke (Text berührte sonst beidseitig den Rahmen). */
    body.phone-blocks-rotated.aspect-portrait #gesichten-content-box p {
        margin-left: 4px !important;
        max-width: calc(100vw - 80px) !important;
    }
    body.aspect-portrait #gesichten-content-box p:first-child {
        margin-top: 20px;
    }
    /* RIVUS-Box: Text 50px tiefer, Box nach unten verlängert */
    body.aspect-portrait .content-box-2:not(#gesichten-content-box) {
        padding-top: calc(var(--spacing-box-padding) - 10px + 50px);
    }
    /* MYTHUS-Box Text: linke Kante 30px nach rechts, Umbruch 15px nach rechts */
    body.aspect-portrait #mythus-box {
        padding-left: calc(var(--spacing-box-padding) + 230px);
    }
    body.aspect-portrait #mythus-box p {
        max-width: calc(80vw - 175px - 215px);
    }
    body.aspect-portrait #michael-marcus-wrapper {
        gap: 0px;
        transform: none;
    }
    body.aspect-portrait #marcus-image-with-info {
        left: 40px;
    }
}

#slide-overlay {
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 9999;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.18s ease-in-out;
    will-change: transform;
}

/* iOS Safe Areas (Notch oben / Home-Indicator unten) mit der Rahmenfarbe füllen,
   damit dort keine Seiteninhalte hinter den durchscheinenden Safari-Balken sichtbar
   bleiben (iOS 26). Höhe = 0, wenn es keine Safe-Area gibt (Desktop/Android) → harmlos.
   Erfordert viewport-fit=cover (per JS gesetzt). */
@supports (top: env(safe-area-inset-top)) {
    #safe-area-top,
    #safe-area-bottom,
    #safe-area-bottom-dark {
        position: fixed;
        left: 0;
        right: 0;
        background-color: #ff6633; /* orange Rahmenfarbe */
        pointer-events: none;
    }
    /* Über ALLEN Ebenen (auch Grain z10000 und Slide-Overlay z9999), damit kein
       Seiteninhalt in die Safe Areas durchscheint. Die Bars liegen räumlich außerhalb
       von Nav/Inhalt (nur Notch- bzw. Home-Indicator-Bereich), verdecken also nichts Klickbares. */
    #safe-area-top { top: 0; height: env(safe-area-inset-top); z-index: 99999; }
    /* UNTEN (iOS-26-Sampling-Regeln, s. jahir.dev/blog/safari-toolbar + nasedk.in):
       Safari waehlt das Toenung-Sampling-Element beim Render aus den fixed Elementen an der
       Unterkante (Kriterien: <=3px vom Rand, >=80% Breite, >=3px Hoehe) und beobachtet danach
       KEINE Farbwechsel mehr — deshalb blieb die Leiste nach dem Dark/Light-Toggle stehen.
       display:none-Elemente werden aber NICHT gesampelt. Loesung: ZWEI Streifen (hell/dunkel),
       der Toggle schaltet per display um -> das gesampelte Element verschwindet -> Safari muss
       neu waehlen und findet den anderen.
       Der Streifen muss der EINZIGE Kandidat an der Unterkante sein und darf nichts uebermalen:
       Auf dem iPhone (<=480px) ist die Nav-Leiste (.main-nav/.nav-bar-bg) deshalb 4px angehoben
       (> 3px-Kriterium -> Nav scheidet als Kandidat aus), der Streifen fuellt exklusiv die
       untersten env()+4px in Rahmenfarbe. Bei z9996 unter der Nav brach der Toggle (Safari
       nahm die Nav als Kandidaten, die wechselt nur die Farbe -> kein Re-Sampling), bei z99999
       UEBER der nicht angehobenen Nav uebermalte der Streifen ihre Buttons. */
    #safe-area-bottom,
    #safe-area-bottom-dark {
        bottom: 0;
        height: env(safe-area-inset-bottom);
        z-index: 99999;
    }
    @media (max-width: 480px) {
        #safe-area-bottom,
        #safe-area-bottom-dark {
            height: calc(env(safe-area-inset-bottom, 0px) + 4px); /* schliesst buendig an die 4px angehobene Nav an */
        }
    }
    /* Unten ist der Rahmen hell (#E9E9E4, wie die vertikalen Streifen), nicht orange wie oben. */
    #safe-area-bottom { background-color: #E9E9E4; }
    #safe-area-bottom-dark { background-color: #1a1a1a; display: none; }
    body.dark-mode #safe-area-top { background-color: #1a1a1a; } /* dunkle Rahmenfarbe */
    body.dark-mode #safe-area-bottom { display: none; }
    body.dark-mode #safe-area-bottom-dark { display: block; }
    /* Gleiche Körnung wie der Rest: die Safe-Area-Balken liegen mit z99999 ÜBER dem Grain-Overlay
       (body::after, z10000) und bekämen sonst keine Körnung. Die Kante zwischen "kein Grain"
       (Balken) und "Grain" (Inhalt) erscheint als helle/dunkle Linie (oben im Dark-Mode, unten
       auf iPad mit Home-Indicator). Daher denselben Grain direkt per ::after auf beide auflegen. */
    #safe-area-top::after,
    #safe-area-bottom::after,
    #safe-area-bottom-dark::after {
        content: '';
        position: absolute;
        inset: 0;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0.3 0.3 0.3 0 0 0.3 0.3 0.3 0 0 0.3 0.3 0.3 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' fill='%23808080'/%3E%3C/svg%3E");
        background-size: 250px 250px;
        background-repeat: repeat;
        opacity: 0.25;
        pointer-events: none;
    }
    body.dark-mode #safe-area-top::after,
    body.dark-mode #safe-area-bottom::after,
    body.dark-mode #safe-area-bottom-dark::after { opacity: 0.20; }
}

/* »(als Patroklos)« aus dem Daniel-Treppentext entfernt: reine Zusatz-Zeile ausblenden.
   display:none lässt die nth-child-Staffelung der Hero-Treppe unberührt. */
.daniel-mobile-2 { display: none !important; }

/* Daniel-Hero-Treppe (Desktop): explizit alternierende Ausrichtung. Nach dem Alex↔Daniel-Tausch
   liegt Daniel im Hero und erhielt nur die rohe nth-child-Alternation; die versteckten Mobile-
   Varianten im DOM verschoben die Parität → ab (2015) mehrere flache Zeilen. Hier fest gesetzt
   (Daniel flach, danach abwechselnd). Nur Desktop, damit die mobile Daniel-Treppe unberührt bleibt.
   FLACH = skew(0,-30) scaleY(1.33333); STEIL = skew(60,-30) scaleY(0.66667). */
@media (min-width: 641px) {
    .main-heading-container .daniel-desktop-1 { transform: skew(0deg,  -30deg) scaleY(1.33333) !important; }
    .main-heading-container .daniel-year      { transform: skew(60deg, -30deg) scaleY(0.66667) !important; }
    .main-heading-container .daniel-desktop-3 { transform: skew(0deg,  -30deg) scaleY(1.33333) !important; }
    .main-heading-container .daniel-canvas    { transform: skew(60deg, -30deg) scaleY(0.66667) !important; }
    .main-heading-container .daniel-size      { transform: skew(0deg,  -30deg) scaleY(1.33333) !important; }
}

/* =============== iPHONE-OVERRIDES (Dateiende: gewinnen die Kaskade) =============== */
/* MYTHUS-Text (nach Rotation in #gesichten-content-box): exakt dieselben Einzüge wie die anderen
   Blöcke. Ans Dateiende gesetzt + hohe Spezifität, um alle Portrait-/Legacy-Regeln des alten
   GESICHTEN-Inhalts sicher zu überstimmen (Text stand sonst Rahmen-zu-Rahmen). */
@media (max-width: 640px) {
    body.phone-blocks-rotated #gesichten-content-box {
        /* linker Einzug wie GESICHTEN-Block (#rivus-content-box): pad + container */
        padding-left: calc(var(--spacing-box-padding) + var(--spacing-container)) !important;
        padding-right: var(--spacing-box-padding) !important;
    }
    /* Alle Klappboxen wie KONZEPT: Text-Abstand zur Box-Oberkante = padding-top 20px + lang-container
       46px = 66px. Neutralisiert die globalen em-Alt-Overrides (nur iPhone; Desktop/iPad unberührt).
       Nebeneffekt MYTHUS: offen = eingeklappt (20px) → kein Padding-Sprung beim Klappen mehr. */
    body.phone-blocks-rotated #rivus-content-box,
    body.phone-blocks-rotated #gesichten-content-box {
        padding-top: 20px !important;
    }
    body.phone-blocks-rotated #mythus-box {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
    body.phone-blocks-rotated #rivus-content-box:not(.collapsed) .lang-container {
        padding-top: 46px !important; /* war 1.5em (globaler Override); NUR offen — sonst überschreibt
                                         das !important das collapsed-padding-top:0 → höhere zu-Box */
    }
    body.phone-blocks-rotated #mythus-box .lang-container {
        margin-top: 0 !important;     /* war −1.5em (globaler Override) */
    }
    /* Klapppfeile alle auf die X-Position des GESICHTEN-Pfeils. Der Pfeil sitzt zwar überall bei
       left:24px, aber relativ zur Box: GESICHTEN/RIVUS (content-box-2) haben margin-left:0 → Pfeil
       bei Screen-x 24px; KONZEPT/MYTHUS (content-box) sind mit margin:auto/110vw zentriert →
       Box-Kante 5vw weiter links → Pfeil 5vw weiter links. Ausgleich: +5vw. */
    body.phone-blocks-rotated .content-box .block-arrow {
        left: calc(24px + 5vw) !important;
    }
    body.phone-blocks-rotated #gesichten-content-box .lang-container,
    body.phone-blocks-rotated #gesichten-content-box .lang-text {
        width: auto !important;
        max-width: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    body.phone-blocks-rotated #gesichten-content-box p {
        text-align: justify !important;
        max-width: calc(100vw - 80px) !important;
        margin-left: 4px !important;
        margin-right: 0 !important;
    }

    /* Unterer horizontaler Rahmenstreifen +15% (20px → 23px; Seitenränder-Überlappung 19 → 22). */
    body.phone-blocks-rotated::before { height: 23px; }
    body.phone-blocks-rotated .background-stripe-bottom { height: 23px; }
    body.phone-blocks-rotated .frame-border-left,
    body.phone-blocks-rotated .frame-border-right { bottom: 22px; }

    /* Bottom-Bar-Symbole +15%: Dark/Light-Toggle, Sprache (Globus), Sprachniveau (Aa), Menü. */
    body.phone-blocks-rotated .theme-switch { transform: translateY(-50%) scale(1.15); }
    body.phone-blocks-rotated .mobile-dropdown__trigger { transform: scale(1.15); }
    body.phone-blocks-rotated .nav-toggle { transform: scale(1.15); }

    /* Ben-Treppe (nach Rotation im daniel-Slot): lückenlose Stufen. Die versteckten
       Desktop-Zeilen (Kind 3+4) erzeugen sonst einen 48px-left-Sprung zwischen (2015)
       und den ipad-Umbruchzeilen; die Skew-Parität stimmt bereits. */
    body.phone-blocks-rotated .ben-ipad-3 { left: 48px !important; }
    body.phone-blocks-rotated .ben-ipad-4 { left: 64px !important; }
    body.phone-blocks-rotated .ben-ipad-5 { left: 80px !important; }
    body.phone-blocks-rotated .ben-masse  { left: 96px !important; }

    /* Alex-Treppentext (nach Tausch+Rotation im michael-Slot): explizite, lückenlose Stufen wie bei
       den anderen Porträts. Die generische nth-child-Staffelung zählt Alex' drei VERSTECKTE
       EN-Umbruchzeilen (Pos. 6–8) mit → Versatz-Lücke und Paritätsbruch vor der Größenzeile.
       DE/ES: sichtbar sind Kind 1–5 und die Größenzeile (als 6. Stufe). */
    body.phone-blocks-rotated:not(.is-en) #michael-image-with-info .words-stair__line:nth-child(1) { left: 16px; transform: skew(60deg, -30deg) scaleY(0.66667); }
    body.phone-blocks-rotated:not(.is-en) #michael-image-with-info .words-stair__line:nth-child(2) { left: 32px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    body.phone-blocks-rotated:not(.is-en) #michael-image-with-info .words-stair__line:nth-child(3) { left: 48px; transform: skew(60deg, -30deg) scaleY(0.66667); }
    body.phone-blocks-rotated:not(.is-en) #michael-image-with-info .words-stair__line:nth-child(4) { left: 64px; transform: skew(0deg,  -30deg) scaleY(1.33333); }
    body.phone-blocks-rotated:not(.is-en) #michael-image-with-info .words-stair__line:nth-child(5) { left: 80px; transform: skew(60deg, -30deg) scaleY(0.66667); }
    body.phone-blocks-rotated:not(.is-en) #michael-image-with-info .words-stair__line.alex-size    { left: 96px !important; transform: skew(0deg, -30deg) scaleY(1.33333) !important; }
    /* EN: sichtbar 1,2,3 + en-a/b/c + Größenzeile — Stufen 4–7 */
    body.phone-blocks-rotated.is-en #michael-image-with-info .words-stair__line.alex-en-a { left: 64px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    body.phone-blocks-rotated.is-en #michael-image-with-info .words-stair__line.alex-en-b { left: 80px;  transform: skew(60deg, -30deg) scaleY(0.66667); }
    body.phone-blocks-rotated.is-en #michael-image-with-info .words-stair__line.alex-en-c { left: 96px;  transform: skew(0deg,  -30deg) scaleY(1.33333); }
    body.phone-blocks-rotated.is-en #michael-image-with-info .words-stair__line.alex-size { left: 112px !important; transform: skew(60deg, -30deg) scaleY(0.66667) !important; }
}

/* Logo: Text-Wortmarke »MARTIN ZANKER« ersetzt das animierte Bild-Logo auf ALLEN Geräten
   (wie bisher nur auf dem iPhone). Größen: Landingpage skaliert das JS (updateHeaderSize,
   gleiche startTextSize-Werte wie zuvor die Bildhöhen); Subseiten fest wie alte Bildhöhen. */
.logo-gif { display: none !important; }
.logo-text { display: block; }
.fixed-header .logo-text { font-size: 32px; } /* Subseiten Desktop (Bild-Logo war 32px hoch) */
@media (max-width: 768px) {
    .fixed-header .logo-text { font-size: 28px; } /* Subseiten mobil (wie bisher) */
}
/* iPhone: Subseiten-Header exakt wie der eingerastete (geschrumpfte) Zustand der
   Landingpage — MARTIN ZANKER 34px (etwas hoeher), glasiger Header-Streifen.
   Backdrop nur noch oberer Streifen (30px) solide, damit der glasige Header (blur, 75% orange)
   selbst der sichtbare Streifen ist und Inhalt beim Scrollen durchscheint — wie auf der Landingpage. */
@media (max-width: 480px) {
    .fixed-header { height: 46px; }
    .fixed-header .logo-text { font-size: 34px; top: 50%; }
    .sub-page .header-backdrop { height: 30px; }
}

/* Desktop: Hero-Bild (jetzt Daniel) 12% kleiner (Basis: clamp(288px, 50.4vw, 605px)).
   Der frühere Gap-Override (+17px) ist in den font-proportionalen Basis-Gap in :root
   eingerechnet. MALEREI selbst wird auf Desktop per JS positioniert
   (applyFrozenViewportMetrics setzt paddingTop inline, dort −30px). */
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) {
    :root {
        --image-alex-width: clamp(253px, 44.35vw, 532px);
    }
}

/* Schmales DESKTOP-Fenster (Hover-Geraet, <640px): Michael nicht mehr auf 80vh kappen —
   das Mobile-CSS schneidet ihn sonst unten ab (object-fit: cover, top center).
   Nur Hover-Geraete: echtes Touch-Mobile (eingefroren) behaelt die 80vh-Grenze. */
@media (hover: hover) and (pointer: fine) and (max-width: 640px) {
    #michael-image-with-info {
        max-height: none !important;
    }
    #michael-image-with-info .unterpunkt-heading-image {
        max-height: none !important;
    }
}

/* Browserleiste (Safari macOS) im Light-Mode dunkel wie die Menueleiste:
   Safari sampelt die background-color-EIGENSCHAFT des body. Diese auf #333333 setzen
   (-> dunkle Leiste), den sichtbaren Body aber per background-image weiter orange malen
   -> Seite optisch unveraendert. Nur Hover-Desktop; Touch (iPhone/iPad) nutzt theme-color.
   Worst Case (Safari sampelt gerenderte Pixel statt Property): Leiste bleibt orange, kein Schaden. */
@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
    body:not(.dark-mode) {
        background-color: #333333;
        background-image: linear-gradient(#ff6633, #ff6633);
    }
    /* Dark-Mode: Leiste = dunkle Menueleiste (#1a1a1a); sichtbarer Seitenhintergrund bleibt #333333 */
    body.dark-mode {
        background-color: #1a1a1a;
        background-image: linear-gradient(#333333, #333333);
    }
}

/* 50px-Raster-Overlay (Dev-Hilfe, per URL-Hash #raster / #grid, s. script.js _applyDevGrid).
   50px feine Linien + jede 5. Linie (250px) staerker; blau fuer Kontrast auf Orange. */
#dev-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100000;
    background-image:
        repeating-linear-gradient(to right,  rgba(0,120,255,0.45) 0 1px, transparent 1px 50px),
        repeating-linear-gradient(to bottom, rgba(0,120,255,0.45) 0 1px, transparent 1px 50px),
        repeating-linear-gradient(to right,  rgba(0,90,255,0.9) 0 1px, transparent 1px 250px),
        repeating-linear-gradient(to bottom, rgba(0,90,255,0.9) 0 1px, transparent 1px 250px);
}

/* iPad (>=600px): Treppentext im Light-Mode dunkelgrau wie MARTIN ZANKER (#333333).
   BREITENBASIERT (nicht hover/pointer): iPad-Safari laeuft im Desktop-Modus und meldet
   hover:hover/pointer:fine -> eine Touch-Media-Query greift dort nicht. iPhone (<600px)
   bleibt weiss; Desktop ist ohnehin schon #333 (Basisfarbe), also keine Aenderung dort. */
@media (min-width: 600px) {
    body:not(.dark-mode) .words-stair__line p { color: #333333; }
}

/* iPad-Landscape-Feinpositionierung (Bilder Ben/Michael via JS-Offset, s. applyParallaxEffect).
   Am Dateiende -> gewinnt per Quelltext-Reihenfolge gegen frühere @media/orient-landscape-Regeln. */
/* Achtung: Alex + Daniel sind vertauscht -> das Alex-Bild steckt im #mythus-daniel-Element,
   das Daniel-Bild im .main-heading (Hero). Die Alex-Werte liegen daher auf #mythus-daniel,
   die Daniel-Werte auf .main-heading. */
body.ipad-landscape .main-heading-container .words-stair { margin-left: 122px; margin-bottom: -4px; } /* Daniel-Treppe: 40px runter, 50px rechts (ggue. 72/36) */
body.ipad-landscape #mythus-daniel-container .words-stair { margin-left: -141px; margin-bottom: 206px; } /* Alex-Treppe: 150px hoeher, 123px links (ggue. orient-landscape -18/56) */
body.ipad-landscape #ben-image-with-info .words-stair { margin-left: -88px; margin-bottom: 71px; } /* Ben-Treppe 50px links, 50px hoeher (margin-bottom war 21) */
body.ipad-landscape #michael-image-with-info .words-stair { margin-left: 222px; margin-bottom: 21px; } /* Michael-Treppe: 70px rechts, 20px hoeher (ggue. 152/1) */

/* iPad Portrait (>=600px, kein Landscape): Treppen-Feinpositionen (andere als Landscape).
   Am Dateiende + body:not(.orient-landscape) -> gewinnt gegen frühere @media/portrait-Regeln. */
@media (min-width: 600px) {
    body:not(.orient-landscape) .main-heading-container .words-stair { margin-left: -48px; margin-bottom: 61px; }    /* Daniel-Treppe: 120px links, 25px hoeher */
    body:not(.orient-landscape) #ben-container .words-stair { margin-left: -48px; margin-bottom: -54px; }           /* Ben: 50px rechts, 100px hoch */
    body:not(.orient-landscape) #mythus-daniel-container .words-stair { margin-left: -78px; margin-bottom: -74px; } /* Alex: 250px rechts, 200px tiefer */
    body:not(.orient-landscape) #michael-image-with-info .words-stair { margin-left: 352px; margin-bottom: 1px; }   /* Michael 200px rechts (war 152) */
}

/* Ben-Treppentext 80px weiter links, aber NUR im Band, in dem der Hamburger schon erscheint
   (<=980px) und die Mobile-Variante noch nicht greift (>=641px), auf Hover-Geraeten (Desktop).
   Muss nach den obigen Basisregeln (3928 Portrait -48, 1345 Landscape -38) stehen -> gewinnt
   per Quelltext-Reihenfolge. margin-left wirkt unabhaengig vom JS-Split-Transform (applySplit
   setzt inline translate 125px -> margin komponiert damit, ergibt "80px links des Ist-Standes"). */
@media (hover: hover) and (pointer: fine) and (min-width: 641px) and (max-width: 980px) {
    body:not(.orient-landscape) #ben-container .words-stair { margin-left: -128px; } /* Basis -48 -> 80px links */
    body.orient-landscape       #ben-container .words-stair { margin-left: -118px; } /* Basis -38 -> 80px links */
}

/* =============== PERFORMANCE: iPad-Scroll-Ruckeln ===============
   backdrop-filter (Nav 20px / Header 25px Blur) rastert auf iPads beim Scrollen jeden Frame
   den darunterliegenden Inhalt neu — Hauptursache des Ruckelns. Auf Touch-Tablets (iPad,
   nicht iPhone < 601px, nicht Desktop) Blur-Radius halbieren: optisch kaum sichtbar
   (Flächen sind ohnehin 75–80% deckend), Rasterkosten sinken quadratisch mit dem Radius. */
@media (hover: none) and (pointer: coarse) and (min-width: 601px) {
    .main-nav {
        backdrop-filter: blur(10px) saturate(180%);
        -webkit-backdrop-filter: blur(10px) saturate(180%);
    }
    header {
        backdrop-filter: blur(12px) saturate(100%);
        -webkit-backdrop-filter: blur(12px) saturate(100%);
    }
}

/* Desktop (Hover, Landscape): Hero-Bild (Daniel) behält bis zur Mobilbreite (< 640px)
   die Standardfenster-Größe (532px = Wert bei >= 1200px), statt im 640-1024er-Band
   auf 350px (40vw-Regel) zu schrumpfen. Portrait (aspect-portrait) und Touch-Geräte
   behalten ihre eigenen Größen. Am Dateiende -> gewinnt gegen frühere :root-@media-Regeln. */
@media (hover: hover) and (pointer: fine) and (min-width: 640px) {
    body:not(.aspect-portrait) {
        --image-alex-width: 532px;
    }
}

/* =============== HOVER-TREPPENTEXTE: ECKPUNKT-KOPPLUNG (Daniel + Michael) ===============
   Position der Treppentexte von der UNTEREN RECHTEN ECKE des Bildes aus definiert,
   unabhängig von Fenster-/Bildgröße. Technik: right:0/bottom:0 pinnt die untere rechte
   Ecke der Textbox auf die Bildecke; translate(50%,50%) legt die BOX-MITTE exakt auf die
   Ecke (Prozente beziehen sich auf die eigene Boxgröße); die px-Werte verschieben die
   Mitte von dort (negativ = links/hoch). margin:0 neutralisiert die älteren
   margin-basierten Feinpositionen (inkl. des iPad-Portrait-Blocks oben, der per
   body:not(.orient-landscape) auch auf hohen Desktop-Fenstern griff).
   Am Dateiende + body-Präfix -> gewinnt per Reihenfolge/Spezifität. Nur Hover-Desktop;
   Touch (iPad/iPhone) und "großer Michael" (eigene Eckpunkt-Regel) bleiben unberührt. */
@media (hover: hover) and (pointer: fine) and (min-width: 641px) {
    body .main-heading-container .image-info {
        overflow: visible;
    }
    /* Daniel (Hero): Textmitte 170px links, 160px über der Ecke rechts unten */
    body .main-heading-container .image-info .words-stair {
        position: absolute;
        left: auto;
        right: 0;
        bottom: 0;
        width: max-content;
        transform: translate(calc(50% - 170px), calc(50% - 160px));
        margin: 0;
    }
    body:not(.michael-tall) #michael-image-with-info .image-info {
        overflow: visible;
    }
    /* Michael: Textmitte 150px links, 180px über der Ecke rechts unten */
    body:not(.michael-tall) #michael-image-with-info .image-info .words-stair {
        position: absolute;
        left: auto;
        right: 0;
        bottom: 0;
        width: max-content;
        transform: translate(calc(50% - 150px), calc(50% - 180px));
        margin: 0;
    }
}
