/* =============================================================
   RT Holding – Galerie Platzhalter
   CI: Dunkles Polygon, Verlauf Grün → Rot → Orange, weiße Linien
   ============================================================= */

:root {
    --bg-0: #141414;
    --bg-1: #1f1f1f;
    --bg-2: #2a2a2a;
    --line: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.65);
    --dim: rgba(255, 255, 255, 0.35);

    --ci-green: #1f8a3a;
    --ci-red: #c8272b;
    --ci-orange: #e85a19;

    --ci-gradient: linear-gradient(
        90deg,
        var(--ci-green) 0%,
        #7b4d28 35%,
        var(--ci-red) 60%,
        var(--ci-orange) 100%
    );

    --radius: 6px;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html,
body {
    height: 100%;
    min-height: 100vh;
}

body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto,
        sans-serif;
    color: #fff;
    background-color: var(--bg-0);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* -------------------------------------------------------------
   Hintergrundebenen
   ------------------------------------------------------------- */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(
            ellipse at 20% 30%,
            #262626 0%,
            #161616 60%,
            #0d0d0d 100%
        ),
        var(--bg-0);
}

.polygons {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.85;
    animation: slowPan 40s ease-in-out infinite alternate;
}

@keyframes slowPan {
    0% {
        transform: scale(1.02) translate(0, 0);
    }
    100% {
        transform: scale(1.06) translate(-1.5%, -1%);
    }
}

/* Farbige Schimmer im Hintergrund */
.glow {
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    mix-blend-mode: screen;
    animation: drift 18s ease-in-out infinite alternate;
}

.glow-green {
    background: var(--ci-green);
    top: -20vmax;
    left: -15vmax;
    animation-delay: 0s;
}

.glow-red {
    background: var(--ci-red);
    bottom: -25vmax;
    right: -10vmax;
    animation-delay: -6s;
}

.glow-orange {
    background: var(--ci-orange);
    top: 30%;
    right: -20vmax;
    opacity: 0.12;
    animation-delay: -12s;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(4%, -3%) scale(1.08);
    }
}

/* -------------------------------------------------------------
   Layout
   ------------------------------------------------------------- */
.stage {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: clamp(20px, 3vw, 40px) clamp(20px, 5vw, 72px);
    gap: clamp(24px, 4vw, 48px);
}

/* Während des Ladens alles verbergen, damit es kein Flackern gibt */
.stage[data-state='loading'] #view-placeholder,
.stage[data-state='loading'] #view-gallery,
.stage[data-state='loading'] .bottom-bar {
    visibility: hidden;
}

/* Topbar ------------------------------------------------------ */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    opacity: 0;
    animation: fadeDown 0.9s var(--ease-out) 0.1s forwards;
}

.brand {
    display: flex;
    align-items: center;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    border-radius: 4px;
}

.brand-link:hover,
.brand-link:focus-visible {
    opacity: 0.82;
    transform: translateY(-1px);
}

.brand-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 6px;
}

.logo {
    width: clamp(90px, 10vw, 140px);
    height: auto;
    display: block;
    filter: invert(1) brightness(1.05);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(6px);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ci-orange);
    box-shadow: 0 0 0 0 rgba(232, 90, 25, 0.6);
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(232, 90, 25, 0.55);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(232, 90, 25, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(232, 90, 25, 0);
    }
}

/* Hero -------------------------------------------------------- */
.hero {
    align-self: center;
    max-width: 880px;
    margin: 0 auto;
    text-align: center;
    padding: clamp(12px, 3vw, 24px) 0;
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    margin-bottom: clamp(18px, 3vw, 28px);
    opacity: 0;
    animation: fadeUp 0.8s var(--ease-out) 0.35s forwards;
}

.headline {
    font-size: clamp(54px, 10vw, 132px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.95;
    text-transform: uppercase;
    margin-bottom: clamp(18px, 3vw, 28px);
}

.headline .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    animation: wordIn 0.9s var(--ease-out) forwards;
}

.headline .word:nth-child(1) {
    animation-delay: 0.45s;
}
.headline .word:nth-child(2) {
    animation-delay: 0.65s;
    margin-left: 0.18em;
}

.word-accent {
    background: var(--ci-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% 100%;
    animation: wordIn 0.9s var(--ease-out) 0.65s forwards,
        gradientShift 8s ease-in-out infinite alternate;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

@keyframes wordIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lead {
    color: var(--muted);
    font-size: clamp(15px, 1.6vw, 19px);
    max-width: 58ch;
    margin: 0 auto;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 0.9s forwards;
}

.lead strong {
    color: #fff;
    font-weight: 600;
    position: relative;
    padding: 0 4px;
    white-space: nowrap;
}

.lead strong::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 3px;
    background: var(--ci-gradient);
    background-size: 200% 100%;
    border-radius: 2px;
    box-shadow: 0 0 14px rgba(232, 90, 25, 0.35);
    animation: gradientShift 8s ease-in-out infinite alternate;
}

.nowrap {
    white-space: nowrap;
}

/* Bottombar --------------------------------------------------- */
.bottom-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 0.9s var(--ease-out) 1.5s forwards;
}

.copyright {
    color: var(--dim);
    text-decoration: none;
    transition: color 0.25s var(--ease-out);
    padding: 4px 6px;
    border-radius: 4px;
}

.copyright:hover,
.copyright:focus-visible {
    color: #fff;
}

.copyright:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 4px;
}

/* -------------------------------------------------------------
   Galerie
   ------------------------------------------------------------- */
.gallery {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-top: clamp(8px, 2vw, 16px);
    align-self: start;
}

.gallery-intro {
    text-align: center;
    max-width: 780px;
    margin: 0 auto clamp(28px, 4vw, 48px);
}

.gallery-headline {
    font-size: clamp(40px, 7vw, 88px);
    margin-bottom: clamp(14px, 2vw, 20px);
}

.gallery-lead {
    margin-top: 4px;
}

.image-count {
    display: inline-block;
    margin-left: 6px;
    color: var(--dim);
    font-variant-numeric: tabular-nums;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: clamp(10px, 1.6vw, 18px);
}

.tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: #1a1a1a;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.4s var(--ease-out),
        box-shadow 0.4s var(--ease-out),
        border-color 0.3s var(--ease-out);
    opacity: 0;
    transform: translateY(14px);
    animation: tileIn 0.7s var(--ease-out) forwards;
    animation-delay: var(--d, 0s);
    outline: none;
}

.tile:hover,
.tile:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px -20px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.tile:focus-visible {
    box-shadow: 0 22px 40px -20px rgba(0, 0, 0, 0.65),
        0 0 0 2px rgba(232, 90, 25, 0.6);
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s var(--ease-out), filter 0.4s var(--ease-out);
    filter: brightness(0.95);
}

.tile:hover img,
.tile:focus-visible img {
    transform: scale(1.06);
    filter: brightness(1.02);
}

.tile::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 45%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
    opacity: 0;
    transition: opacity 0.3s var(--ease-out);
    pointer-events: none;
}

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

@keyframes tileIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 8, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: clamp(16px, 4vw, 40px);
    animation: lbIn 0.3s var(--ease-out);
}

.lightbox[hidden] {
    display: none;
}

@keyframes lbIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lb-stage {
    position: relative;
    max-width: min(1200px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.lb-stage img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8);
    animation: imgIn 0.4s var(--ease-out);
}

@keyframes imgIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lb-caption {
    color: var(--dim);
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-variant-numeric: tabular-nums;
}

.lb-btn {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s var(--ease-out),
        border-color 0.2s var(--ease-out),
        transform 0.2s var(--ease-out);
}

.lb-btn:hover,
.lb-btn:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
}

.lb-btn:active {
    transform: scale(0.94);
}

.lb-close {
    top: clamp(12px, 2vw, 24px);
    right: clamp(12px, 2vw, 24px);
}

.lb-prev {
    left: clamp(12px, 2vw, 24px);
    top: 50%;
    transform: translateY(-50%);
}

.lb-next {
    right: clamp(12px, 2vw, 24px);
    top: 50%;
    transform: translateY(-50%);
}

.lb-prev:active {
    transform: translateY(-50%) scale(0.94);
}

.lb-next:active {
    transform: translateY(-50%) scale(0.94);
}

/* -------------------------------------------------------------
   Animationen
   ------------------------------------------------------------- */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------------------------------------------------
   Responsiv
   ------------------------------------------------------------- */
@media (max-width: 640px) {
    .top-bar {
        flex-wrap: wrap;
    }

    .status {
        font-size: 10px;
        padding: 6px 10px;
    }

    .bottom-bar {
        flex-direction: column;
        gap: 4px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
    }

    .lb-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 420px) {
    .headline {
        font-size: 48px;
    }

    .gallery-headline {
        font-size: 36px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Motion Reduction respektieren */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
