@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400&display=swap');

:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --yellow-color: #ffff00;
    --string-default: rgba(255, 255, 255, 0.3);
    --string-active: #ff0000;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh; /* Fallback für sehr alte Browser */
    height: 100dvh; /* HIER NEU: Zwingt Safari, die echte sichtbare Höhe zu nutzen */
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Clash Display', sans-serif;
    overflow: hidden; /* Deaktiviert natives Scrollen komplett, um die Mac-Sperre zu brechen */
}

/* Ersetze den alten Weichzeichner-Bereich in archive.css durch das hier: */

/* Der Body selbst bleibt jetzt immer voll sichtbar (opacity: 1), 
   damit die UI-Elemente wie SORTIMENT nicht verschwinden! */
body.fade-in {
    opacity: 1;
}

/* Wir blenden STATTDESSEN nur den interaktiven Inhalt aus */
body.fade-in .viewport-wrapper,
body.fade-in .center-archive-label {
    opacity: 1;
    transition: opacity 1s ease;
}

body.fade-out .viewport-wrapper,
body.fade-out .center-archive-label {
    opacity: 0 !important;
    transition: opacity 0.6s ease;
}

/* Die UI-Elemente werden explizit von jeglichem Fade ausgeschlossen */
.vertical-title,
.info-btn,
.home-btn {
    opacity: 1 !important;
    transition: color 0.3s ease, transform 0.3s ease !important;
}
/* --- Virtueller Viewport --- */
.viewport-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    cursor: move;
    z-index: 5;
}

.viewport-wrapper:active {
    cursor: grabbing;
}

/* Das unendliche Canvas-Feld */
.canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 3000px;
    height: 3000px;
    will-change: transform;
}

#network-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.photo-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* --- Archiv-Bilder & Hover --- */
.archive-photo {
    position: absolute;
    width: 180px;
    height: auto;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    z-index: 10;
}

.archive-photo:hover {
    transform: scale(1.12);
    box-shadow: 0 0 35px 5px rgba(255, 0, 0, 0.3);
    z-index: 999;
}

/* --- UI-Elemente (Fixiert über dem Geschehen) --- */
.vertical-title {
    position: fixed;
    top: 0;
    left: 0;                    /* Tweak this (e.g., 10px) if you need to slide it right, away from the screen edge */
    margin: 0;
    padding: 0;
    
    /* ── NEW SIZE CONTROLS FOR PNG ── */
    width: 100vh;                /* Adjust this value to control how far up the screen the logo climbs */
    height: auto;               /* Keeps your logo perfectly proportioned without stretching it */
    
    mix-blend-mode: difference; /* Keeps your difference blending effect intact */
    z-index: 101;
    pointer-events: none;
    transform-origin: top left;
    transform: translateY(100vh) rotate(-90deg);
}

.center-archive-label {
    position: fixed;
    left: 38%;
    top: 56%;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #ffffff;
    mix-blend-mode: difference;
    z-index: 90;
    pointer-events: none;
}

.info-btn {
    position: fixed;
    top: 40px;
    right: 40px;
    background: none;
    border: none;
    color: #ffffff;
    font-family: 'Clash Display', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin: 0;
    mix-blend-mode: difference;
    z-index: 101;
    transition: color 0.3s ease;
}

.info-btn:hover {
    color: var(--yellow-color) !important;
}

.home-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    text-decoration: none;
    font-size: 3rem;
    font-weight: 600;
    color: var(--yellow-color);
    text-transform: lowercase;
    z-index: 101;
    transition: transform 0.3s ease;
}

.home-btn:hover {
    transform: scale(1.08);
}

/* --- Overlay --- */
.overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    background: #111;
    font-size: 10px;
    padding: 50px;
    border: none;
    position: relative;
    max-width: 800px;
    width: 90%;
}

.close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    color: white; font-size: 1.5rem;
    cursor: pointer;
}
.close-btn:hover {
    color: var(--yellow-color);
}

/* Grundzustand der Bilder im CSS um einen sanften Übergang erweitern */
.archive-photo {
    transition: filter 0.4s ease, opacity 0.4s ease;
    will-change: filter, opacity; /* Optimiert die Browser-Performance */
}

/* Zustand für alle Bilder aus anderen Gruppen, während ein Bild fokussiert ist */
.archive-photo.is-dimmed {
    filter: grayscale(100%) brightness(0.5);
    opacity: 0.75; /* Macht die inaktiven Bilder zusätzlich leicht transparent */
}

/* =========================================================
   NEU: CUSTOM CURSOR LABEL
   ========================================================= */
.cursor-label {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    color: var(--yellow-color);
    mix-blend-mode: difference;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s ease;
    transform: translate(20px, 20px);
}
.cursor-label.visible { opacity: 1; }

.cursor-title {
    font-size: 1.2rem;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
}
.cursor-subtitle {
    font-size: 0.85rem;
    font-weight: 300;
    white-space: nowrap;
}

/* =========================================================
   NEU: GALERIE OVERLAY
   ========================================================= */
.gallery-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.4s ease;
    display: flex;
    flex-direction: column;
}
.gallery-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.gallery-close-btn {
    position: absolute;
    top: 40px; right: 40px;
    background: none; border: none;
    color: #fff; font-size: 1.5rem;
    cursor: pointer; z-index: 2010;
    font-family: inherit;
}
.gallery-close-btn:hover { color: var(--yellow-color); }

.gallery-scroller {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 0 5vw;
    height: 65vh;
    margin-top: 15vh;
    overflow-x: auto;
    overflow-y: hidden;
}
.gallery-scroller::-webkit-scrollbar { display: none; }
.gallery-scroller img {
    height: 100%;
    max-width: 80vw;
    object-fit: contain;
    flex-shrink: 0;
}

.gallery-info {
    position: absolute;
    bottom: 50px;
    left: 5vw;
    right: 5vw;
    color: white;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.6;
    max-width: 800px;
}

/* --- Loading Screen --- */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 101; /* Ensure it stays above everything */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease;
}

.loading-bar-container {
    width: 150px; /* Small, minimalist bar like sub.global */
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2); /* Grey background */
    position: relative;
    overflow: hidden;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background-color: #ffffff; /* White filling */
    transition: width 0.1s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Archive Tags --- */
.archive-tags {
    position: fixed;
    top: 100px; /* Positioned just below the info-btn */
    right: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0px;
    z-index: 1000;
}

.archive-tag {
    font-size: 1.0rem;
    color: white;
    text-decoration: none;
    mix-blend-mode: difference;
    font-family: inherit;
    transition: opacity 0.3s ease;
}

.archive-tag:hover {
    opacity: 0.5;
}

/* =========================================================
   MOBILE INTERACTION & OVERLAY FIXES
   ========================================================= */

/* Deaktiviert den Custom-Mauszeiger komplett auf Touch-Geräten (Smartphones & Tablets) */
@media (pointer: coarse) {
    .cursor-label {
        display: none !important;
    }
}

/* Versteckt den Custom-Mauszeiger auf Desktops, sobald ein Overlay oder die Galerie aktiv ist */
body:has(.gallery-overlay:not(.hidden)) .cursor-label,
body:has(.overlay:not(.hidden)) .cursor-label {
    display: none !important;
}

/* =========================================================
   MOBILE & SAFARI OPTIMIZATION
   ========================================================= */

/* Schaltet nativen Browser-Zoom/Pan auf dem Canvas-Container strikt ab */
#viewport-wrapper {
    touch-action: none !important; 
}

@media (max-width: 768px) {
    /* 1. Archive-Label in der Mitte stark verkleinern */
    .center-archive-label {
        font-size: 1.0rem !important; 
    }

    /* 2. Galerie sicher vor dem Abschneiden schützen */
    .gallery-overlay {
        height: 100dvh !important;
        /* Schützt den Inhalt vor der weißen iOS Home-Bar */
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px) !important;
        box-sizing: border-box;
    }
    
    .gallery-info {
        padding-bottom: 20px !important; /* Puffer für den Text */
    }

    /* 3. Info- & Home-Button verkleinern */
    .info-btn {
      	right: 25px;
      	top: 25px;
        font-size: 1.5rem !important;
    }

    .archive-tags {
        top: 55px;
        right: 25px;
    }
    .archive-tag {
        font-size: 0.5rem;
    }

    .overlay-content {
    font-size: 6px;
    padding: 10px;
    }
  
    .home-btn {
      	right: 25px;
        font-size: 1.5rem !important;
    }

    /* 4. Home-Button sicher anheben */
    .home-btn {
        bottom: calc(env(safe-area-inset-bottom, 20px) + 25px) !important; 
    }

    /* 5. Sortiment-Tag unten links reparieren */
    .vertical-title {
    width: 85vh !important; /* Adjust this to make the logo longer/shorter */
    height: auto !important;
    
    /* 1. Reset top and pin to the bottom left */
    top: auto !important;
    bottom: calc(env(safe-area-inset-bottom, 20px) + 20px) !important;
    left: 0px !important;
    
    /* 2. Geometrically perfect rotation */
    transform-origin: 0% 100% !important; /* Pivot exactly from the bottom-left corner */
    transform: rotate(-90deg) translateY(100%) !important; /* Swings it up, then pushes it right by its own height */
	}
}