/* -------------------------------------------------------------------------- */
/* BASIS & VARS                                */
/* -------------------------------------------------------------------------- */
:root {
            --info-padding: 1.5rem; 
            --ink: #2f3438;
            --muted: #6f7880;
            --brand: #8d959c;
            --accent: #6f7f8c;
            --cta-bg-color: #f36f21;
            --background: #f8f9fa;
            --surface: #ffffff;
            --border-color: rgba(47, 52, 56, 0.15);
            --header-bg: none; 
            --overlay-bg: rgba(255, 255, 255, 0.98);
            --panel-backdrop: rgba(47, 52, 56, 0.5);
            --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
            --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
            --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
            --bottom-safe-area: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
            /* Einheitlicher Mobile-Bottom-Offset für Buttons (stabiler als max()-Variante)
               -> sorgt dafür, dass linke/rechte Buttons wirklich auf einer Linie sitzen */
            --phone-bottom: calc(env(safe-area-inset-bottom, 0px) + 1rem);
            --safe-top: env(safe-area-inset-top, 0px);
            --safe-right: env(safe-area-inset-right, 0px);
            --safe-left: env(safe-area-inset-left, 0px);
            --safe-bottom: env(safe-area-inset-bottom, 0px);
            --main-header-h: 96px; /* wird per JS auf die Höhe des Fixed-Headers gesetzt */

            --mobile-controls-offset: 4.25rem; /* Abstand der Infobox zur unteren Button-Reihe (Mobile Portrait) */
        }

*, *::before, *::after {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

html {
            -webkit-text-size-adjust: 100%;
            font-size: 100%; /* Basisgröße */
            transition: font-size 0.2s ease;
        }

body {
            margin: 0;
            font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", sans-serif;
            line-height: 1.6;
            color: var(--ink);
            background-color: var(--background);
            transition: background-color 0.3s ease, color 0.3s ease;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            overflow-x: hidden; 
        }

body.split-view-active { overflow: hidden; }

/* UI Hiding Logic */
body.is-ui-hidden .main-header,
        body.is-ui-hidden .stage-nav,
        body.is-ui-hidden .info-overlay,
        body.is-ui-hidden .bottom-right-controls,
        body.is-ui-hidden #thumbnail-bar,
        body.is-ui-hidden #gallery-trigger,
        body.is-ui-hidden #info-trigger,
        body.is-ui-hidden #progress-bar { 
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
            transition: opacity 0.5s ease 0s, visibility 0.5s ease 0s !important;
        }

/* -------------------------------------------------------------------------- */
/* VOLLBILD-BÜHNE                                 */
/* -------------------------------------------------------------------------- */
#stage {
            position: fixed; inset: 0;
            width: 100vw; height: 100vh; height: 100svh; height: 100dvh;
            overflow: hidden; background-color: var(--background);
            z-index: 1; margin: 0; padding: 0;
            transition: width 0.8s cubic-bezier(0.7, 0, 0.3, 1);
            touch-action: pan-y; cursor: grab;
        }

#stage:active { cursor: grabbing; }

body.split-view-active #stage { width: 50vw; }

#stage.full-bleed { left: 50%; margin-left: -50vw; }

body.split-view-active #stage.full-bleed { width: 50vw; left: 25%; margin-left: -25vw; }

#stage .slide {
            position: absolute; inset: 0;
            width: 100%; height: 100%;
            opacity: 0; visibility: hidden;
            transition: opacity 1.5s ease-in-out;
        }

#stage .slide.active { opacity: 1; visibility: visible; }

#stage .slide img { 
            width: 100%; height: 100%; 
            object-fit: cover; object-position: center; 
            transition: object-fit 0.3s ease, transform 0.3s ease; 
            pointer-events: none; 
        }

/* -------------------------------------------------------------------------- */
/* PROGRESS BAR                                  */
/* -------------------------------------------------------------------------- */
#progress-bar {
            position: fixed; top: 0; left: 0;
            width: 100%; height: 3px; z-index: 65;
            opacity: 0; transform: scaleX(0); transform-origin: left;
            pointer-events: none;
            transition: opacity 0.3s ease, transform 0.001s linear; 
            background: linear-gradient(to right, var(--accent), var(--cta-bg-color) 50%, var(--accent));
            background-size: 200% 100%;
        }

#progress-bar.is-active {
            opacity: 1; animation: progress-pulse 2s infinite linear;
            transform: scaleX(0.95); transition: opacity 0.3s ease, transform 5s linear;
        }

#progress-bar.is-active.is-complete {
             transform: scaleX(1); transition: opacity 0.3s ease, transform 0.5s ease-out; opacity: 0;
        }

@keyframes progress-pulse {
0% { background-position: 0% 0; }

100% { background-position: -200% 0; }

}

/* -------------------------------------------------------------------------- */
/* HEADER & NAVIGATION                                */
/* -------------------------------------------------------------------------- */
.main-header {
            position: fixed; top: 0; left: 0; width: 100%; z-index: 51;
            background: var(--header-bg); border-bottom: 0px solid var(--border-color);
            transition: background 0.4s ease, border-color 0.4s ease;
        }

.main-header .header-content {
            padding-top: calc(1.25rem + var(--safe-top));
            padding-bottom: 1.25rem;
            padding-left: max(2rem, var(--safe-left));
            padding-right: max(2rem, var(--safe-right));
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

.main-header .logo { 
            position: static; transform: none; background: white; 
            padding:10px; border-radius: 8px; overflow: hidden; 
            transition: background-color 0.3s ease, box-shadow 0.3s ease, max-width 0.3s ease; 
            width: 100%; max-width: 320px; margin-right: auto;
        }

.logo .logo-light { 
            display: block; width: 100%; max-width: 290px; 
            height: auto; object-fit: contain; 
            transition: max-width 300ms ease-in-out; 
        }

.header-actions { display: flex; align-items: center; justify-content: flex-end; }

.header-btn {
            pointer-events: all; display: flex; align-items: center; gap: 0.5rem;
            background: white; border: none; padding: 0.5rem; cursor: pointer;
            font-size: 0.9rem; color: var(--muted); border-radius: 4px;
            transition: color 0.2s, background-color 0.2s, box-shadow 0.2s, transform 0.2s; 
        }

.header-btn svg { stroke: var(--muted); transition: stroke 0.2s; }

.header-btn:hover, .header-btn:focus-visible { 
            color: var(--ink); background-color: var(--surface); 
            box-shadow: var(--shadow-md); transform: scale(1.05); 
        }

.header-btn:active { transform: scale(0.98); }

/* Wichtig: nested UL darf NICHT wie ein Drilldown-UL behandelt werden */
.award-item{
            flex: 0 0 auto;
            width: clamp(56px, 16vw, 84px);
            height: clamp(56px, 16vw, 84px);
            background-color: var(--surface);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            overflow: hidden;
            box-shadow: var(--shadow-sm);
            transition: transform 0.3s ease;
            cursor: pointer;
            user-select: none;
            -webkit-user-drag: none;
        }

.award-item:hover{ transform: scale(1.05); }

.award-item img{ width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.social-links {
            display: flex; justify-content: center; gap: 1.5rem;
            padding: 0.5rem 2rem 1rem;
            opacity: 0; transform: translateY(20px);
            transition: opacity 0.4s ease 0.35s, transform 0.4s ease 0.35s;
        }

.social-links a { color: var(--muted); transition: color 0.2s; }

.social-links a:hover { color: var(--ink); }

.social-links svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; }

.page-footer {
        margin-top: 4rem;
        padding-top: 2rem;
        border-top: 1px solid var(--border-color);
        color: var(--muted);
        font-size: 0.8rem;
    }

/* BÜHNEN-UI */
.ui-button {
            pointer-events: all; background: var(--overlay-bg);
            border: 1px solid var(--border-color); border-radius: 50%;
            width: 44px; height: 44px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            box-shadow: var(--shadow-sm); transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
        }

.ui-button:hover, .ui-button:focus-visible { background: var(--surface); box-shadow: var(--shadow-md); transform: scale(1.05); }

.ui-button:active { transform: scale(0.98); }

.ui-button svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 2; }

.cta-button { background-color: var(--cta-bg-color); border-color: transparent; }

.cta-button svg { stroke: #fff; }

.cta-button:hover, .cta-button:focus-visible {
            background-color: color-mix(in srgb, var(--cta-bg-color) 90%, #fff); transform: scale(1.05);
        }

.main-footer { display: none; }

.stage-nav {
            position: fixed; z-index: 5; top: 50%; left: 2rem; right: 2rem;
            display: flex; justify-content: space-between; transform: translateY(-50%); 
            pointer-events: none; opacity: 1; transition: opacity 0.5s ease;
        }

body.split-view-active .stage-nav, body.is-ui-hidden .stage-nav { opacity: 0; pointer-events: none; }

body.split-view-active .stage-nav { transform: translateY(-50%) translateX(-100vw); }

.bottom-right-controls { 
            position: fixed; bottom: var(--bottom-safe-area); right: max(2rem, var(--safe-right)); 
            z-index: 6; display: flex; align-items: center; gap: 0.75rem; transition: opacity 0.5s ease;
        }

body.split-view-active .bottom-right-controls { opacity: 0; pointer-events: none; }

/* INFO-OVERLAY & PANEL */
.info-overlay {
            position: fixed; bottom: var(--bottom-safe-area); left: 2rem; z-index: 5;
            background: var(--overlay-bg); border: 1px solid var(--border-color);
            padding: var(--info-padding); border-radius: 8px; max-width: 320px; 
            box-shadow: var(--shadow-md); opacity: 1; visibility: visible; 
            height: auto; 
            transition: padding-bottom 0.5s ease, opacity 0.5s, transform 0.5s, visibility 0.5s;
        }

.info-overlay.is-hidden { opacity: 0; visibility: hidden; transform: translateY(10px); pointer-events: none; }

.info-overlay.is-minimized { cursor: pointer; padding-bottom: var(--info-padding); }

.info-collapsible-rows {
            display: grid; grid-template-rows: 1fr;
            transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

.info-overlay.is-minimized .info-collapsible-rows { grid-template-rows: 0fr; }

.info-inner { overflow: hidden; opacity: 1; transition: opacity 0.3s ease 0.1s; }

.info-overlay.is-minimized .info-inner { opacity: 0; transition: opacity 0.2s ease; }

.info-overlay.is-minimized #info-minimize-btn { transform: rotate(45deg); }

/* Mobile Portrait: Infobox oberhalb der unteren Button-Reihe platzieren */
@media (max-width: 600px) and (orientation: portrait) {
.info-overlay {
                left: 1rem;
                right: 1rem;
                max-width: none;
                bottom: calc(var(--bottom-safe-area) + var(--mobile-controls-offset));
            }

}

.info-overlay h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; margin-top: 0; }

.info-overlay .meta { font-size: 0.85rem; color: var(--muted); margin-bottom: var(--info-padding); margin-top: 0; }

.info-overlay .breadcrumb {
            font-size: 0.75rem; color: var(--muted); margin-bottom: 0.75rem;
            padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-color); 
            position: relative; display: flex; justify-content: space-between; align-items: center;
        }

.info-overlay.is-minimized .breadcrumb { transition: border-color 0.5s; }

.info-overlay .breadcrumb a { color: var(--muted); text-decoration: none; }

.info-overlay .breadcrumb a:hover { color: var(--ink); }

.info-overlay .breadcrumb .breadcrumb-links span:not(:last-child)::after { content: '·'; margin: 0 0.5em; opacity: 0.5; }



/* Breadcrumb bleibt Flex (wie bisher), Close-Button wird nicht gestaucht */
.info-overlay .breadcrumb{
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Textbereich: Ellipsis links (Anfang), damit der Projektname rechts sichtbar bleibt */
.info-overlay .breadcrumb .breadcrumb-links{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  direction: rtl;   /* Ellipsis links */
  text-align: left; /* optisch linksbündig lassen */
  display: block;   /* stabil im Flex */
}

/* Inhalt wieder normal LTR, damit Reihenfolge/Links korrekt bleiben */
.info-overlay .breadcrumb .breadcrumb-links-inner{
  direction: ltr;
  unicode-bidi: isolate;
}

/* X fixieren, nie schrumpfen */
.info-overlay .breadcrumb .info-close-btn{
  flex: 0 0 auto;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
}






.info-overlay .short-text {
            font-size: 0.9rem; line-height: 1.5; margin-bottom: 0; padding-bottom: 1rem;
            border-bottom: 1px solid var(--border-color);
        }

.info-overlay .read-more {
            font-size: 0.75rem; font-weight: 500; color: var(--accent);
            text-decoration: none; background: none; border: none; padding: 0; cursor: pointer;
        }

.info-overlay .read-more:hover { text-decoration: underline; color: var(--ink); }

.slide-counter {
            font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; pointer-events: none;
        }

.info-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 1rem; }

.info-close-btn {
            z-index: 6; padding: 0; cursor: pointer; background: var(--overlay-bg);
            border: 1px solid var(--border-color); border-radius: 50%;
            width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
            transition: transform 0.3s ease; margin-left: 0.5rem; 
        }

.info-close-btn svg { width: 14px; height: 14px; stroke: var(--muted); stroke-width: 2; }

.info-close-btn:hover { transform: scale(1.1); }

.info-close-btn:hover svg { stroke: var(--ink); }

/* PANEL CONTENT STYLING (IMPROVED) */
.project-tags { margin-bottom: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.project-tags .tag {
            font-size: 0.75rem; background-color: rgba(128,128,128,0.1);
            color: var(--muted); padding: 0.2rem 0.6rem; border-radius: 99px;
            border: 1px solid transparent; text-decoration: none; display: inline-block;
        }

.project-tags .tag:hover { border-color: var(--accent); color: var(--ink); }

/* --- New/Adapted Styles for Panel Content (based on static.html) --- */
/* OPTIMIZED FLUID TYPOGRAPHY (CLAMP) */
.lead-text {
            font-size: clamp(1.1rem, 2vw, 1.25rem); /* Responsive Lead */
            line-height: 1.6;
            color: var(--ink);
            margin-bottom: 2rem;
            font-weight: 400;
        }

/* Facts List (1:1 from static.html) */
.facts-list {
            list-style: none; padding: 0; margin: 3rem 0;
            border-top: 1px solid var(--border-color);
        }

.facts-list li {
            padding: 1rem 0;
            border-bottom: 1px solid var(--border-color);
            display: flex; justify-content: space-between;
        }

.fact-label { 
            font-weight: 600; font-size: 0.85rem; 
            text-transform: uppercase; letter-spacing: 0.08em; /* REFINED TYPO */
        }

.fact-value { color: var(--muted); text-align: right; }

.quote-box {
            border-left: 3px solid var(--cta-bg-color);
            padding-left: 1.5rem;
            margin: 2.5rem 0;
            font-style: italic;
            font-family: Georgia, 'Times New Roman', Times, serif; /* SERIF FOR QUOTE */
            color: var(--muted);
            font-size: 1.1rem;
        }

#panel-container, #contact-panel-container {
            position: fixed; top: 0; right: 0; width: 50vw; height: 100dvh; z-index: 20;
            transform: translateX(100%); transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
        }

body.project-panel-active #panel-container, 
        body.contact-panel-active #contact-panel-container { transform: translateX(0); }

.panel-content {
            background: var(--surface); width: 100%; height: 100%;
            padding: 6rem 4rem 4rem; overflow-y: auto; cursor: default;
        }

/* NEU: Content-Begrenzung für große Bildschirme (verhindert "Stretching") */
.content-constraint {
            width: 100%;
            max-width: 680px; /* Lesefreundliche Maximalbreite */
            margin-right: auto; /* Links ausgerichtet lassen */
        }

/* ANIMATIONS FOR PANEL CONTENT */
.content-constraint > * {
            opacity: 0; transform: translateY(15px);
            transition: opacity 0.6s ease-out, transform 0.6s ease-out;
        }

body.project-panel-active .content-constraint > *,
        body.contact-panel-active #contact-panel-container .content-constraint > * {
            opacity: 1; transform: translateY(0);
        }

/* Stagger delays manually for the first few elements for a cascading effect */
body.project-panel-active .content-constraint > *:nth-child(1) { transition-delay: 0.1s; }

/* Breadcrumb */
body.project-panel-active .content-constraint > *:nth-child(2) { transition-delay: 0.15s; }

/* Title */
body.project-panel-active .content-constraint > *:nth-child(3) { transition-delay: 0.2s; }

/* Tags */
body.project-panel-active .content-constraint > *:nth-child(4) { transition-delay: 0.25s; }

/* Lead */
body.project-panel-active .content-constraint > *:nth-child(5) { transition-delay: 0.3s; }

/* Facts */
body.project-panel-active .content-constraint > *:nth-child(6) { transition-delay: 0.35s; }

/* P1 */
body.project-panel-active .content-constraint > *:nth-child(7) { transition-delay: 0.4s; }

/* Gallery */
body.project-panel-active .content-constraint > *:nth-child(n+8) { transition-delay: 0.45s; }

/* Rest */
/* DROP CAP STYLE - REFINED & RESPONSIVE */
.drop-cap::first-letter {
            float: left; 
            font-size: clamp(3rem, 5vw, 3.5rem); /* FLUID SIZE */
            line-height: 0.8;
            margin-right: 0.15em; margin-top: 0em;
            font-family: Georgia, 'Times New Roman', Times, serif; /* SERIF DROP CAP */
            font-weight: 400; color: var(--ink);
        }

.panel-close-btn {
            position: absolute; top: 7rem; left: 0; transform: translateX(-50%);
            z-index: 21; opacity: 0; pointer-events: none; transition: opacity 0.5s ease, transform 0.2s ease;
        }

body.split-view-active #panel-container > #panel-close-btn, 
        body.contact-panel-active #contact-panel-container > #contact-panel-close-btn { opacity: 1; pointer-events: all; }

.panel-close-btn:hover { transform: translateX(-50%) scale(1.05); }

.panel-content .breadcrumb { 
            font-size: 0.75rem; color: var(--muted); margin-bottom: 0.75rem;
            padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-color);
        }

.panel-content .breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }

.panel-content .breadcrumb a:hover { color: var(--ink); }

.panel-content .breadcrumb span:not(:last-child)::after { content: '·'; margin: 0 0.5em; opacity: 0.5; }

/* FLUID TITLE */
.panel-content h1, .panel-content .contact-title { 
            font-size: clamp(2rem, 4vw, 3rem); /* FLUID TYPOGRAPHY */
            margin: 0 0 1.5rem 0; font-weight: 300; 
            line-height: 1.1; letter-spacing: -0.03em; /* TIGHTER TRACKING */
        }

.panel-content p { margin: 0 0 1.5rem 0; color: var(--muted); }

/* THUMBNAIL BAR */
.thumbnail-bar {
            position: fixed; bottom: 0; left: 0; width: 100%; z-index: 7;
            background: var(--overlay-bg); border-top: 1px solid var(--border-color);
            box-shadow: var(--shadow-lg); transform: translateY(100%);
            transition: transform 0.3s ease-in-out;
            display: flex; align-items: center; justify-content: center; gap: 1rem; 
            padding: 1rem; height: auto; 
        }

.thumbnail-bar.no-background {
            background: transparent; border-top-color: transparent; box-shadow: none;
            padding: 0.5rem 1rem calc(var(--bottom-safe-area) + 0.5rem);
        }

.thumbnail-bar.is-visible { transform: translateY(0); }

.carousel-container {
            perspective: 1000px; width: 100%; max-width: 6.5rem; height: 78px; margin: 0; 
        }

@media (min-width: 640px) {
.carousel-container { max-width: 8rem; height: 96px; }

}

.carousel {
            position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
            user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: grab;
        }

.carousel:active { cursor: grabbing; }

.carousel-item {
            position: absolute; top: 0; left: 0; width: 100%; height: 100%;
            transition: all 0.5s ease-in-out; backface-visibility: hidden;
            background-color: var(--surface); border: 1px solid var(--border-color);
            border-radius: 0.75rem; box-shadow: var(--shadow-lg); cursor: pointer; overflow: hidden;
        }

.carousel-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

.carousel-nav-btn {
            pointer-events: all; background: var(--overlay-bg); border: 1px solid var(--border-color); 
            border-radius: 50%; width: 44px; height: 44px; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            box-shadow: var(--shadow-sm); transition: background-color 0.2s, transform 0.2s;
            z-index: 2; flex-shrink: 0; 
        }

.carousel-nav-btn.small { width: 22px; height: 22px; padding: 0; }

.carousel-nav-btn.small svg { width: 14px; height: 14px; }

.carousel-nav-btn:hover { background: var(--surface); transform: scale(1.05); }

.carousel-nav-btn svg { width: 20px; height: 20px; stroke: var(--ink); stroke-width: 2; }

/* INFO-TRIGGER (nur Handy): ersetzt die Infobox als Button unten links */
#info-trigger{
    position: fixed;
    left: 2rem;
    bottom: var(--bottom-safe-area);
    z-index: 6;
    transition: opacity 0.3s ease;
    display: none;
}

#info-trigger.is-hidden{ opacity: 0; pointer-events: none; visibility: hidden; }

#info-trigger .info-trigger-icon{
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    line-height: 1;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", sans-serif;
}

html.is-phone #info-trigger{
    display: block;
    left: max(2rem, var(--safe-left));
    bottom: var(--phone-bottom);
}


#gallery-trigger {
            position: fixed; left: 50%; z-index: 6; 
            transition: opacity 0.3s ease; cursor: pointer; transform: translateX(-50%); 
            bottom: var(--bottom-safe-area); 
        }

/* Handy (nicht iPad): Buttons unten sauber ausrichten */
html.is-phone #gallery-trigger {
            left: 50%;
            right: auto;
            transform: translateX(-50%);
            bottom: var(--phone-bottom);
        }

html.is-phone .bottom-right-controls {
            right: 2rem;
            bottom: var(--phone-bottom);
        }

/* Handy Landscape: Buttons an der gleichen rechten Kante wie Menü (Header) und Pfeil (Stage-Nav) */
@media (max-width: 1024px) and (orientation: landscape) {
/* Rechtskante wie Stage-Nav/Header (2rem) */
html.is-phone .bottom-right-controls {
                            right: max(2rem, var(--safe-right));
                        }

html.is-phone #gallery-trigger {
                            left: 50%;
                            right: auto;
                            transform: translateX(-50%);
                            bottom: var(--phone-bottom);
                        }

.award-item { width: 56px; height: 56px; }

html.is-phone .social-links { padding: 0.25rem 1rem 0.5rem; gap: 1rem; }

}

#gallery-trigger.is-hidden { opacity: 0; pointer-events: none; visibility: hidden; }

/* NEW: STYLES FOR INLINE GALLERY WITH NAV & NEXT PROJECT TYPO FIX */
.inline-gallery-container {
            position: relative; margin: 2rem 0; width: 100%;
        }

.inline-gallery-scroller {
            display: flex; overflow-x: auto; gap: 0; /* Changed from 1rem to 0 for full width logic */
            padding: 0; scroll-snap-type: x mandatory;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
            touch-action: pan-x; cursor: grab;
        }

.inline-gallery-scroller.is-dragging { cursor: grabbing; }

.inline-gallery-scroller::-webkit-scrollbar { display: none; }

.inline-gallery-item {
            flex: 0 0 100%; /* Changed from 85% to 100% for full view */
            max-width: 100%;
            scroll-snap-align: center;
            /* border-radius removed to blend better as full image */
            overflow: hidden;
            background: #eee; aspect-ratio: 4/3;
            position: relative;
        }

.inline-gallery-item img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }

/* NEU: Gallery Counter Style */
.inline-gallery-counter {
            text-align: center; font-size: 0.75rem; color: var(--muted);
            margin-top: 0.5rem; font-variant-numeric: tabular-nums;
        }

/* NEU: Gallery Navigation Arrows (overlay style) */
.gallery-nav-btn {
            position: absolute; top: 50%; transform: translateY(-50%);
            width: 32px; height: 32px; border-radius: 50%;
            background: rgba(255,255,255,0.9); border: 1px solid var(--border-color);
            box-shadow: var(--shadow-sm); cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            z-index: 2; opacity: 0; transition: opacity 0.2s, background-color 0.2s, transform 0.2s;
        }

.inline-gallery-container:hover .gallery-nav-btn { opacity: 1; }

.gallery-nav-btn:hover { background: #fff; transform: translateY(-50%) scale(1.1); }

.gallery-nav-btn svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 2; }

.gallery-nav-btn.prev { left: 1rem; }

.gallery-nav-btn.next { right: 1rem; }

.next-project-teaser {
            margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--border-color);
            display: block; text-decoration: none; color: inherit; group: 'next';
            transition: opacity 0.3s;
        }

.next-project-teaser:hover { opacity: 0.8; }

.next-label { 
            display: block; font-size: 0.75rem; 
            text-transform: uppercase; letter-spacing: 0.08em; /* REFINED TYPO */
            color: var(--muted); margin-bottom: 0.5rem; 
        }

.next-project-image {
            width: 100%; height: 200px; background: #eee; border-radius: 4px; overflow: hidden; margin-bottom: 1rem;
        }

.next-project-image img { 
            width: 100%; height: 100%; object-fit: cover; 
            transition: transform 0.5s ease; /* ADDED */
        }

.next-project-teaser:hover .next-project-image img {
            transform: scale(1.03); /* ADDED */
        }

/* NEU: Optimierte Typo für Next Project Title */
.next-project-title { 
            font-size: 1.1rem; /* Kleiner als vorher (war 1.25rem) */
            font-weight: 500; /* Etwas leichter (war 600) */
            display: flex; align-items: center; gap: 0.5rem; 
            color: var(--ink);
        }

.next-project-title svg { transition: transform 0.2s; width: 18px; height: 18px; stroke-width: 1.5; }

.next-project-teaser:hover .next-project-title svg { transform: translateX(5px); }

/* Responsive für Panel */
@media (max-width: 1024px) {
.panel-content { padding: 6rem 3rem 4rem; }

}

/* Responsive Split Screen Adjustments (Mobile Full Width) */
@media (max-width: 900px) {
/* Panel füllt den ganzen Screen */
#panel-container, #contact-panel-container {
                width: 100vw;
                z-index: 70; /* Überlagert Header und Nav */
            }

/* Schließen-Button positionieren (oben rechts) */
.panel-close-btn {
                left: auto;
                right: 1.5rem;
                top: 1.5rem;
                transform: none;
                background: var(--surface); /* Sicherstellen, dass er sichtbar ist */
            }

.panel-close-btn:hover { transform: scale(1.1); }

/* Stage Reset - kein Shrink-Effekt auf Mobile */
body.split-view-active #stage,
            body.split-view-active #stage.full-bleed {
                width: 100vw;
                left: 0;
                margin-left: 0;
            }

/* Padding im Panel anpassen */
.panel-content {
                padding: 5rem 2rem 4rem; /* Oben Platz lassen für Header-Feeling, auch wenn überdeckt */
            }

/* Breadcrumb und Titel etwas kompakter */
/* .panel-content h1 { font-size: 2rem; } - Removed, handled by Clamp */
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.stage-nav button:focus-visible, .info-toggle:focus-visible { border-radius: 50%; }


.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}




/* Handy Portrait: Infobox (wenn geöffnet) oberhalb der unteren Button-Reihe (phone-bottom) platzieren */
@media (max-width: 600px) and (orientation: portrait) {
  html.is-phone .info-overlay{
    bottom: calc(var(--phone-bottom) + var(--mobile-controls-offset));
  }
}

/* -------------------------------------------------------------------------- */
/* MOBILE: UI-BUTTONS KOMPAKTER (Portrait + Landscape)                         */
/* -------------------------------------------------------------------------- */
/* Ziel: etwas weniger "wuchtig" auf kleinen Screens, ohne Funktionen zu ändern */

html.is-phone .stage-nav .ui-button,
html.is-phone #info-trigger .ui-button,
html.is-phone #gallery-trigger .ui-button,
html.is-phone .bottom-right-controls .ui-button,
html.is-phone .carousel-nav-btn:not(.small) {
  width: 34px;
  height: 34px;
}

html.is-phone .stage-nav .ui-button svg,
html.is-phone #info-trigger .ui-button svg,
html.is-phone #gallery-trigger .ui-button svg,
html.is-phone .bottom-right-controls .ui-button svg,
html.is-phone .carousel-nav-btn:not(.small) svg {
  width: 16px;
  height: 16px;
}

html.is-phone #info-trigger .info-trigger-icon { font-size: 14px; }

/* Handy Landscape: noch etwas kompakter */
@media (max-width: 1024px) and (orientation: landscape) {
  html.is-phone .stage-nav .ui-button,
  html.is-phone #info-trigger .ui-button,
  html.is-phone #gallery-trigger .ui-button,
  html.is-phone .bottom-right-controls .ui-button,
  html.is-phone .carousel-nav-btn:not(.small) {
    width: 32px;
    height: 32px;
  }

  html.is-phone .stage-nav .ui-button svg,
  html.is-phone #info-trigger .ui-button svg,
  html.is-phone #gallery-trigger .ui-button svg,
  html.is-phone .bottom-right-controls .ui-button svg,
  html.is-phone .carousel-nav-btn:not(.small) svg {
    width: 15px;
    height: 15px;
  }

  html.is-phone #info-trigger .info-trigger-icon { font-size: 13px; }
  html.is-phone .bottom-right-controls { gap: 0.5rem; }
}


/* MOBILE: Galerie-Button unten ausblenden */
html.is-phone #gallery-trigger{
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}




/* iPhone Landscape: Pfeile exakt wie Info/Kontakt ausrichten */
@media (max-width: 1024px) and (orientation: landscape){
  html.is-phone .stage-nav{
    left:  max(2rem, var(--safe-left));
    right: max(2rem, var(--safe-right));
  }
}

/* Mobile Landscape: Lesebreite reduzieren (iPhone 11/Max) */
@media (max-width: 900px) and (orientation: landscape){
  #panel-container .content-constraint,
  #contact-panel-container .content-constraint{
    max-width: 520px;      /* angenehme Zeilenlänge */
    margin-left: auto;
    margin-right: auto;    /* zentrieren statt "bis zum Rand" */
  }
}