/* ═══════════════════════════════════════════════
   PROJEKTE 3D – PAGE STYLES
   ═══════════════════════════════════════════════ */


/* ──────────────────────────────────────
   BODY OVERRIDE for dark mode
   ────────────────────────────────────── */

.projekte-3d-body {
    background: #06060e !important;
    color: #e8e6f0;
    min-height: 100vh;
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

/* Ensure cevio-bg class doesn't override with light color */
.projekte-3d-body.cevio-bg {
    background: #06060e !important;
    background-color: #06060e !important;
}

/* Kill any pseudo-element backgrounds from cevio-bg */
.projekte-3d-body.cevio-bg::before {
    background: #06060e !important;
}

/* Smooth dark-to-light transition above footer */
.projekte-3d-body #footer::before {
    content: '';
    display: block;
    height: 80px;
    background: linear-gradient(to bottom, #06060e, transparent);
    pointer-events: none;
}

/* Remove header bottom line/border on this page */
.projekte-3d-body .site-header,
.projekte-3d-body .mobile-header,
.projekte-3d-body #header .site-header,
.projekte-3d-body header {
    border-bottom: none !important;
    box-shadow: none !important;
}

.projekte-3d-body .site-header::after,
.projekte-3d-body .mobile-header::after,
.projekte-3d-body header::after {
    display: none !important;
}

.projekte-3d-body .site-header::before,
.projekte-3d-body .mobile-header::before,
.projekte-3d-body header::before {
    display: none !important;
}

/* Override site grid bg for dark */
.projekte-3d-body .site-grid-bg {
    background-color: transparent !important;
    background-image:
        linear-gradient(rgba(79,70,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,70,255,0.03) 1px, transparent 1px) !important;
    background-size: 80px 80px !important;
    mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 70%);
}

/* Noise overlay */
.projekte-3d-body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
}

/* ──────────────────────────────────────
   BACK BUTTON
   ────────────────────────────────────── */

.p3d-back-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 200;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(79,70,255,0.12);
    border: 1px solid rgba(79,70,255,0.25);
    color: #a5a3ff;
    font-size: 1.2rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(79,70,255,0.15);
}

.p3d-back-btn.visible {
    opacity: 1;
    pointer-events: all;
}

.p3d-back-btn:hover {
    background: rgba(79,70,255,0.25);
    border-color: rgba(79,70,255,0.4);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(79,70,255,0.3);
}


/* ──────────────────────────────────────
   PROJECT NAV DOTS (right side)
   ────────────────────────────────────── */

.p3d-project-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.p3d-project-nav.visible {
    opacity: 1;
    pointer-events: all;
}

.p3d-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.p3d-nav-dot.active {
    background: #4f46ff;
    border-color: #4f46ff;
    box-shadow: 0 0 12px rgba(79,70,255,0.4);
    transform: scale(1.3);
}

.p3d-nav-dot::after {
    content: attr(data-name);
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    color: #6b6b8d;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.p3d-nav-dot:hover::after {
    opacity: 1;
}


/* ══════════════════════════════════════════
   GATE – Category Selection Portal
   ══════════════════════════════════════════ */

.p3d-gate {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 10em 6vw 6em;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    overflow: hidden;
}

/* Ambient glows – contained to prevent iOS overflow/zoom */
.p3d-gate-ambient {
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    pointer-events: none;
    max-width: 100vw;
}
.p3d-gate-ambient.a1 { background: #4f46ff; top: -200px; left: -200px; right: auto; }
.p3d-gate-ambient.a2 { background: #c026ff; bottom: -200px; right: -200px; left: auto; }

/* Kicker */
.p3d-gate-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #4f46ff;
    margin-bottom: 1.8rem;
    opacity: 0;
}

/* Title */
.p3d-gate-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    text-align: center;
    margin-bottom: 0.4em;
    opacity: 0;
}

/* ── Gradient text – robust WebKit compositing fix ── */
.p3d-gate-title span {
    display: inline-block;
    background: linear-gradient(135deg, #fff 0%, #a5a3ff 50%, #c026ff 100%);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

/* Subtitle */
.p3d-gate-sub {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 1.1rem;
    color: #6b6b8d;
    text-align: center;
    max-width: 36em;
    line-height: 1.7;
    margin-bottom: 3.5rem;
    opacity: 0;
}

/* Portal Cards container */
.p3d-gate-choices {
    display: flex;
    gap: 2rem;
    perspective: 1200px;
    opacity: 0;
}

/* Individual Portal Card */
.p3d-portal {
    position: relative;
    width: 280px;
    height: 360px;
    border-radius: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 0.5s cubic-bezier(.22,1,.36,1), box-shadow 0.5s ease, border-color 0.3s;
    transform-style: preserve-3d;
    background: #111128;
}

.p3d-portal::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Rotating glow border */
.p3d-portal-glow {
    position: absolute;
    inset: -2px;
    border-radius: 1.6rem;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.4s;
}
.p3d-portal:hover .p3d-portal-glow { opacity: 1; }

.portal-web .p3d-portal-glow {
    background: conic-gradient(from 0deg, #4f46ff, #c026ff, #4f46ff);
    filter: blur(4px);
}
.portal-bot .p3d-portal-glow {
    background: conic-gradient(from 0deg, #5865f2, #06b6d4, #5865f2);
    filter: blur(4px);
}

/* Hover states */
.p3d-portal:hover {
    transform: translateZ(30px) scale(1.04);
    border-color: rgba(255,255,255,0.12);
}
.portal-web:hover {
    box-shadow: 0 20px 60px rgba(79,70,255,0.3), 0 0 100px rgba(79,70,255,0.15);
}
.portal-bot:hover {
    box-shadow: 0 20px 60px rgba(88,101,242,0.3), 0 0 100px rgba(88,101,242,0.15);
}

/* Visual background */
.p3d-portal-visual {
    position: absolute;
    inset: 1px;
    border-radius: 1.5rem;
    z-index: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.portal-web .p3d-portal-visual { background: linear-gradient(135deg, #0f0f2e, #1a1045); }
.portal-bot .p3d-portal-visual { background: linear-gradient(135deg, #0f0f2e, #0f1a3d); }

/* Floating icons */
.p3d-portal-icon {
    font-size: 5rem;
    opacity: 0.08;
    position: absolute;
    transition: opacity 0.4s, transform 0.6s cubic-bezier(.22,1,.36,1);
}
.p3d-portal-icon.i1 { top: 15%; left: 15%; transform: rotate(-12deg); }
.p3d-portal-icon.i2 { top: 40%; right: 10%; transform: rotate(8deg); }
.p3d-portal-icon.i3 { bottom: 25%; left: 20%; transform: rotate(-5deg); }
.p3d-portal:hover .p3d-portal-icon { opacity: 0.15; transform: rotate(0deg) scale(1.1); }

/* Portal content overlay */
.p3d-portal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 3;
}

.p3d-portal-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4f46ff;
    margin-bottom: 0.5rem;
}
.portal-bot .p3d-portal-label { color: #7289da; }

.p3d-portal-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: #e8e6f0;
}

.p3d-portal-count {
    font-size: 0.8rem;
    color: #6b6b8d;
}

/* Portal arrow */
.p3d-portal-arrow {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 3;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    transition: all 0.3s cubic-bezier(.22,1,.36,1);
}
.portal-web .p3d-portal-arrow { background: rgba(79,70,255,0.15); color: #4f46ff; }
.portal-bot .p3d-portal-arrow { background: rgba(88,101,242,0.15); color: #7289da; }
.p3d-portal:hover .p3d-portal-arrow { transform: translateX(4px); background: rgba(255,255,255,0.1); color: #fff; }

/* Scroll hint */
.p3d-gate-hint {
    position: absolute;
    bottom: 2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #6b6b8d;
    opacity: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: p3d-floatHint 2s ease-in-out infinite;
}

@keyframes p3d-floatHint {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}


/* ══════════════════════════════════════════
   CATEGORY HEADER
   ══════════════════════════════════════════ */

.p3d-cat-header {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

.p3d-cat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #4f46ff;
    margin-bottom: 1rem;
    opacity: 0;
}

.p3d-cat-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    opacity: 0;
    background: linear-gradient(135deg, #fff, rgba(255,255,255,0.5));
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.p3d-cat-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: #6b6b8d;
    margin-top: 0.8rem;
    opacity: 0;
}


/* ══════════════════════════════════════════
   TUNNEL – Core 3D Scroll System
   ══════════════════════════════════════════ */

.p3d-tunnel-container {
    position: relative;
    z-index: 5;
}

.p3d-tunnel-section {
    position: relative;
    height: 400vh;
    overflow: visible;
}

.p3d-tunnel-viewport {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    perspective: 1200px;
    perspective-origin: 50% 50%;
}

.p3d-tunnel-track {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.p3d-tunnel-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s;
}


/* ══════════════════════════════════════════
   3D CARDS
   ══════════════════════════════════════════ */

.p3d-card {
    position: absolute;
    transform-style: preserve-3d;
    will-change: transform, opacity;
}

.p3d-card-inner {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    background: #111128;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 80px rgba(79,70,255,0.05);
    transform-style: preserve-3d;
    transition: box-shadow 0.4s ease;
    cursor: pointer;
}

.p3d-card-inner:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.6), 0 0 120px rgba(79,70,255,0.12);
}

.p3d-card-inner img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}

.p3d-card-bar {
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.p3d-card-name {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: -0.01em;
    color: #e8e6f0;
}

.p3d-card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.3em 0.7em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    color: #6b6b8d;
}


/* ══════════════════════════════════════════
   DETAIL PANEL
   ══════════════════════════════════════════ */

.p3d-detail {
    position: absolute;
    left: 5vw;
    top: 50%;
    transform: translateY(-50%);
    max-width: 380px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
}

.p3d-detail-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #4f46ff;
    margin-bottom: 0.8rem;
}

.p3d-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: #16a34a;
    margin-bottom: 1rem;
}

.p3d-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 8px rgba(22,163,74,0.6);
    animation: p3d-statusPulse 2s ease-in-out infinite;
}

@keyframes p3d-statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.p3d-detail-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #e8e6f0;
}

/* ── Gradient detail titles – robust WebKit fix ── */
.p3d-detail-title.holo-orange {
    background: linear-gradient(135deg, #ffb45a, #ff6a00);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.p3d-detail-title.holo-blurple {
    background: linear-gradient(135deg, #5865f2, #7289da);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.p3d-detail-title.holo-cyan {
    background: linear-gradient(135deg, #06b6d4, #a855f7);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.p3d-detail-title.holo-purple {
    background: linear-gradient(135deg, #8b5cf6, #c026d3);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.p3d-detail-desc {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.88rem;
    line-height: 1.75;
    color: #6b6b8d;
    margin-bottom: 1.4rem;
}

.p3d-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.p3d-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    padding: 0.35em 0.75em;
    border-radius: 999px;
    border: 1px solid rgba(79,70,255,0.2);
    color: rgba(79,70,255,0.7);
    background: rgba(79,70,255,0.04);
}

.p3d-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: rgba(79,70,255,0.1);
    border: 1px solid rgba(79,70,255,0.2);
    color: #4f46ff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.p3d-detail-link:hover {
    background: rgba(79,70,255,0.2);
    border-color: rgba(79,70,255,0.4);
    color: #fff;
}


/* ══════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════ */

.p3d-divider {
    height: 30vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.p3d-divider-line {
    width: 1px;
    height: 60%;
    background: linear-gradient(to bottom, transparent, #4f46ff, transparent);
    opacity: 0.2;
}


/* ══════════════════════════════════════════
   CTA
   ══════════════════════════════════════════ */

.p3d-cta {
    position: relative;
    z-index: 10;
    padding: 6rem 6vw 8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.p3d-cta-inner {
    max-width: 600px;
}

.p3d-cta-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff, #4f46ff);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    isolation: isolate;
}

.p3d-cta-text {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 1rem;
    color: #6b6b8d;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.p3d-cta-actions {
    display: inline-flex;
    gap: 0.9em;
    flex-wrap: wrap;
    justify-content: center;
}

/* Override btn-secondary for dark mode CTA */
.p3d-cta .btn-secondary {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.15);
    color: #c4c2d8;
}

.p3d-cta .btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    color: #fff;
}


/* ══════════════════════════════════════════
   LIGHTBOX – Dark theme override
   ══════════════════════════════════════════ */

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 4, 20, 0.96);
    backdrop-filter: blur(24px) saturate(0.8);
    -webkit-backdrop-filter: blur(24px) saturate(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(.22,1,.36,1);
}

.image-lightbox::before {
    content: "";
    position: absolute;
    inset: 10%;
    background: radial-gradient(ellipse at 50% 50%, rgba(79, 70, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: p3d-lb-glow 4s ease-in-out infinite alternate;
}

@keyframes p3d-lb-glow {
    from { opacity: 0.5; transform: scale(0.9); }
    to   { opacity: 1;   transform: scale(1.1); }
}

.image-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.image-lightbox.active .lightbox-img-wrap {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.lightbox-img-wrap {
    position: relative;
    z-index: 2;
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(.22,1,.36,1), opacity 0.45s ease;
}

.image-lightbox img {
    max-width: 84vw;
    max-height: 82vh;
    border-radius: 1em;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 4em 10em rgba(0,0,0,0.7), 0 0 80px rgba(79,70,255,0.2);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 1.4em;
    right: 1.8em;
    width: 2.6em;
    height: 2.6em;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 1.4em;
    font-weight: 300;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    line-height: 1;
    user-select: none;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255,255,255,0.2);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 50%;
    width: 3.2em;
    height: 3.2em;
    display: grid;
    place-items: center;
    color: rgba(255,255,255,0.55);
    font-size: 1.6em;
    cursor: pointer;
    transition: all 0.25s ease;
    z-index: 10;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.lightbox-nav:hover {
    background: rgba(79,70,255,0.25);
    border-color: rgba(79,70,255,0.4);
    color: #fff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 0 24px rgba(79,70,255,0.3);
}

.lightbox-prev { left: 1.8em; }
.lightbox-next { right: 1.8em; }

.lightbox-counter {
    position: absolute;
    bottom: 1.8em;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.78em;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.04);
    padding: 0.4em 1.2em;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.06);
    z-index: 10;
}


/* ══════════════════════════════════════════
   RESPONSIVE – All Breakpoints
   ══════════════════════════════════════════ */

/* ─── LARGE SCREENS (1920px+) ─── */
@media (min-width: 1920px) {
    .p3d-gate-title {
        font-size: 6rem;
    }

    .p3d-gate-sub {
        font-size: 1.25rem;
    }

    .p3d-portal {
        width: 320px;
        height: 400px;
    }

    .p3d-gate-choices {
        gap: 3rem;
    }

    .p3d-card {
        width: auto;
    }

    .p3d-detail {
        max-width: 440px;
    }

    .p3d-cat-title {
        font-size: 7rem;
    }

    .p3d-tunnel-viewport {
        perspective: 1400px;
    }
}

/* ─── MACBOOK / LAPTOP (1200–1440px) ─── */
@media (max-width: 1440px) {
    .p3d-card {
        width: 380px !important;
    }

    .p3d-detail {
        max-width: 340px;
    }
}

@media (max-width: 1200px) {
    .p3d-card {
        width: 340px !important;
    }

    .p3d-detail {
        max-width: 300px;
        left: 4vw;
    }

    .p3d-detail-title {
        font-size: 1.6rem;
    }

    .p3d-detail-desc {
        font-size: 0.82rem;
    }
}

/* ─── iPAD LANDSCAPE / SMALL LAPTOP (900–1024px) ─── */
@media (max-width: 1024px) {
    .p3d-card {
        width: 300px !important;
    }

    .p3d-detail {
        max-width: 260px;
        left: 3vw;
    }

    .p3d-detail-title {
        font-size: 1.4rem;
    }

    .p3d-detail-desc {
        font-size: 0.78rem;
        line-height: 1.65;
    }

    .p3d-detail-link {
        font-size: 0.6rem;
        padding: 0.5rem 1rem;
    }

    .p3d-tunnel-viewport {
        perspective: 1000px;
    }

    .p3d-project-nav {
        right: 1rem;
    }
}

/* ─── iPAD PORTRAIT (768–900px) ─── */
@media (max-width: 900px) {
    .p3d-gate {
        padding: 8em 5vw 5em;
    }

    .p3d-gate-title {
        font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    }

    .p3d-gate-sub {
        font-size: 1rem;
        margin-bottom: 2.5rem;
    }

    .p3d-gate-choices {
        gap: 1.5rem;
    }

    .p3d-portal {
        width: 240px;
        height: 310px;
    }

    .p3d-portal-content {
        padding: 1.5rem;
    }

    .p3d-portal-title {
        font-size: 1.3rem;
    }

    .p3d-portal-arrow {
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .p3d-card {
        width: 280px !important;
    }

    .p3d-tunnel-section {
        height: 350vh;
    }

    .p3d-detail {
        max-width: 230px;
        left: 3vw;
    }

    .p3d-detail .p3d-detail-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 4;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .p3d-cat-title {
        font-size: clamp(2.5rem, 6vw, 4rem);
    }

    .p3d-project-nav {
        right: 0.8rem;
    }

    .p3d-cta {
        padding: 5rem 5vw 6rem;
    }
}

/* ─── TABLET / SMALL TABLET (600–768px) ─── */
@media (max-width: 768px) {
    .p3d-gate {
        padding: 7em 5vw 4em;
        min-height: auto;
    }

    .p3d-gate-title {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .p3d-gate-sub {
        font-size: 0.92rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .p3d-gate-choices {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
    }

    .p3d-portal {
        width: 85vw;
        max-width: 340px;
        height: 180px;
    }

    .p3d-portal-icon {
        font-size: 3rem;
    }

    .p3d-portal-content {
        padding: 1.2rem 1.5rem;
    }

    .p3d-portal-title {
        font-size: 1.2rem;
    }

    .p3d-portal-arrow {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
        bottom: 1.2rem;
        right: 1.5rem;
    }

    .p3d-gate-hint {
        bottom: 1.5rem;
    }

    /* Tunnel */
    .p3d-tunnel-section {
        height: 300vh;
    }

    .p3d-tunnel-viewport {
        perspective: 800px;
    }

    .p3d-card {
        width: 240px !important;
    }

    /* Detail: move to bottom overlay */
    .p3d-detail {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        max-width: 100%;
        padding: 1.5rem 5vw 2rem;
        background: linear-gradient(to top, rgba(6,6,14,0.95) 60%, transparent);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .p3d-detail .p3d-detail-desc {
        display: none;
    }

    .p3d-detail-title {
        font-size: 1.3rem;
    }

    .p3d-detail-tags {
        gap: 0.3rem;
    }

    .p3d-detail-link {
        margin-top: 0.8rem;
        font-size: 0.58rem;
    }

    /* Nav dots hidden on tablet */
    .p3d-project-nav {
        display: none;
    }

    /* Category header */
    .p3d-cat-header {
        height: 50vh;
    }

    .p3d-cat-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .p3d-cat-count {
        font-size: 0.65rem;
    }

    /* CTA */
    .p3d-cta {
        padding: 4rem 5vw 5rem;
    }

    .p3d-cta-title {
        font-size: clamp(1.5rem, 5vw, 2rem);
    }

    .p3d-cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .p3d-cta-actions .btn-primary,
    .p3d-cta-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }

    /* Back button adjust - top on mobile */
    .p3d-back-btn {
        top: 6.5rem;
        bottom: auto;
        left: 1.5rem;
        width: 2.8rem;
        height: 2.8rem;
    }

    /* Lightbox */
    .lightbox-nav {
        display: none;
    }

    .image-lightbox img {
        max-width: 94vw;
        max-height: 75vh;
        border-radius: 0.6em;
    }
}

/* ─── MOBILE (375–600px) ─── */
@media (max-width: 600px) {
    .p3d-gate {
        padding: 6em 4vw 3em;
        min-height: auto;
    }

    .p3d-gate-kicker {
        font-size: 0.6rem;
        margin-bottom: 1.2rem;
    }

    .p3d-gate-title {
        font-size: clamp(1.8rem, 8vw, 2.6rem);
    }

    .p3d-gate-sub {
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 1.8rem;
        padding: 0;
    }

    .p3d-portal {
        width: 90vw;
        max-width: 320px;
        height: 160px;
    }

    .p3d-portal-icon {
        font-size: 2.5rem;
    }

    .p3d-portal-content {
        padding: 1rem 1.2rem;
    }

    .p3d-portal-label {
        font-size: 0.5rem;
    }

    .p3d-portal-title {
        font-size: 1.1rem;
    }

    .p3d-portal-count {
        font-size: 0.7rem;
    }

    /* Tunnel */
    .p3d-tunnel-section {
        height: 280vh;
    }

    .p3d-tunnel-viewport {
        perspective: 600px;
    }

    .p3d-card {
        width: 200px !important;
    }

    .p3d-card-bar {
        padding: 0.5rem 0.8rem;
    }

    .p3d-card-name {
        font-size: 0.7rem;
    }

    .p3d-card-tag {
        font-size: 0.42rem;
        padding: 0.2em 0.5em;
    }

    /* Detail bottom overlay */
    .p3d-detail {
        padding: 1.2rem 4vw 1.5rem;
    }

    .p3d-detail-label {
        font-size: 0.5rem;
        margin-bottom: 0.4rem;
    }

    .p3d-detail-status {
        font-size: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .p3d-detail-title {
        font-size: 1.1rem;
    }

    .p3d-detail-tags {
        gap: 0.25rem;
    }

    .p3d-tag {
        font-size: 0.48rem;
        padding: 0.25em 0.6em;
    }

    .p3d-detail .p3d-detail-link {
        display: none;
    }

    /* Category header */
    .p3d-cat-header {
        height: 40vh;
    }

    .p3d-cat-label {
        font-size: 0.55rem;
    }

    .p3d-cat-title {
        font-size: clamp(1.8rem, 10vw, 3rem);
    }

    .p3d-cat-count {
        font-size: 0.6rem;
    }

    /* Divider */
    .p3d-divider {
        height: 15vh;
    }

    /* CTA */
    .p3d-cta {
        padding: 3em 4vw 4em;
    }

    .p3d-cta-text {
        font-size: 0.88rem;
    }

    /* Back button */
    .p3d-back-btn {
        top: 6rem;
        bottom: auto;
        left: 1.2rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    /* Footer gradient shorter */
    .projekte-3d-body #footer::before {
        height: 50px;
    }
}

/* ─── SMALL MOBILE (below 375px) ─── */
@media (max-width: 375px) {
    .p3d-gate {
        padding: 5.5em 3vw 2.5em;
        min-height: auto;
    }

    .p3d-gate-title {
        font-size: 1.7rem;
    }

    .p3d-gate-sub {
        font-size: 0.8rem;
    }

    .p3d-portal {
        width: 92vw;
        height: 145px;
    }

    .p3d-portal-title {
        font-size: 1rem;
    }

    .p3d-portal-icon {
        font-size: 2rem;
    }

    .p3d-tunnel-section {
        height: 250vh;
    }

    .p3d-tunnel-viewport {
        perspective: 500px;
    }

    .p3d-card {
        width: 170px !important;
    }

    .p3d-card-bar {
        padding: 0.4rem 0.6rem;
    }

    .p3d-card-name {
        font-size: 0.6rem;
    }

    .p3d-card-tag {
        display: none;
    }

    .p3d-detail {
        padding: 1rem 3vw 1.2rem;
    }

    .p3d-detail-title {
        font-size: 1rem;
    }

    .p3d-detail .p3d-detail-tags {
        display: none;
    }

    .p3d-cat-header {
        height: 35vh;
    }

    .p3d-cat-title {
        font-size: 2rem;
    }
}

/* ─── TOUCH DEVICE OVERRIDES ─── */
@media (hover: none) and (pointer: coarse) {
    .p3d-portal:hover {
        transform: none;
    }

    .p3d-portal:hover .p3d-portal-glow {
        opacity: 0;
    }

    .p3d-portal:active {
        transform: scale(0.97);
        transition: transform 0.15s ease;
    }

    .p3d-portal:active .p3d-portal-glow {
        opacity: 1;
    }

    .p3d-card-inner:hover {
        box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 80px rgba(79,70,255,0.05);
    }

    /* Ensure cards are tappable on touch devices */
    .p3d-card {
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent;
    }

    .p3d-card-inner {
        pointer-events: auto !important;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .p3d-card-inner:active {
        opacity: 0.85;
        transition: opacity 0.1s ease;
    }
}

/* ─── LANDSCAPE MOBILE ─── */
@media (max-height: 500px) and (orientation: landscape) {
    .p3d-gate {
        padding: 5em 5vw 2em;
        min-height: auto;
    }

    .p3d-gate-title {
        font-size: 2rem;
    }

    .p3d-gate-sub {
        display: none;
    }

    .p3d-gate-choices {
        flex-direction: row;
        gap: 1rem;
    }

    .p3d-portal {
        width: 200px;
        height: 160px;
    }

    .p3d-portal-icon {
        font-size: 2rem;
    }

    .p3d-gate-hint {
        display: none;
    }

    .p3d-cat-header {
        height: 50vh;
    }

    .p3d-tunnel-section {
        height: 350vh;
    }

    .p3d-detail {
        padding: 0.8rem 3vw 1rem;
    }
}