/* ============================================================
   FördeLab – Projekte-Seite (/projekte.php)
   Gestapelte 3-Device-Mockups: Desktop + Tablet + Phone
   ============================================================ */

.body-projekte { background: var(--bg); }

.nav-links a.nav-active {
    color: var(--accent-bright) !important;
    position: relative;
}
.nav-links a.nav-active::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    bottom: -4px;
    height: 2px;
    background: var(--gradient-highlight);
    border-radius: 1px;
}

.projekte-page {
    background: var(--bg);
    color: var(--text);
    padding-top: 88px; /* unter Navbar */
    min-height: 100vh;
    /* horizontalen Scroll zuverlaessig clippen (iOS Safari ignoriert
       body overflow-x manchmal; overflow: clip ist robuster) */
    overflow-x: clip;
    max-width: 100vw;
}
html, body.body-projekte {
    overflow-x: clip;
    max-width: 100%;
}

/* ---------- Hero ---------- */
.projekte-hero {
    position: relative;
    padding: clamp(5rem, 10vw, 8rem) 1.5rem clamp(6rem, 12vw, 10rem);
    text-align: center;
    overflow: visible; /* glow darf in die Grid-Section bluten */
    isolation: isolate;
    margin-bottom: -4rem; /* Sections ueberlappen leicht → kein harter Schnitt */
}
.projekte-hero-inner {
    max-width: 880px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.projekte-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}
.projekte-hero-sub {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto;
}

/* Hero-Glow: jetzt breiter + groesser + weicher, laeuft weit nach unten aus.
   Wichtig: KEIN vw > 100 mehr, sonst horizontaler Scroll auf Mobile. */
.projekte-hero-glow {
    position: absolute;
    top: -30%;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    height: 180vh;
    background:
        radial-gradient(ellipse 70% 45% at 50% 30%,
            rgba(79, 195, 224, 0.20) 0%,
            rgba(31, 111, 165, 0.10) 30%,
            rgba(18, 62, 99, 0.04) 55%,
            transparent 75%);
    filter: blur(40px);
    z-index: 1;
    pointer-events: none;
}

/* Zusaetzliche Ambient-Aura unter dem Hero → weicht in Grid-Section aus */
.projekte-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -30vh;
    height: 60vh;
    background: radial-gradient(ellipse 70% 50% at 50% 0%,
                rgba(79, 195, 224, 0.08) 0%,
                rgba(31, 111, 165, 0.04) 30%,
                transparent 65%);
    filter: blur(20px);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Grid ---------- */
.projekte-grid-section {
    position: relative;
    padding: 0 1.5rem 6rem;
    isolation: isolate;
}
/* Soft transition-band oberhalb der Karten → loest die Kante komplett auf */
.projekte-grid-section::before {
    content: '';
    position: absolute;
    top: -15vh;
    left: 0;
    right: 0;
    height: 30vh;
    background: linear-gradient(to bottom,
                transparent 0%,
                rgba(15, 42, 68, 0.35) 45%,
                transparent 100%);
    filter: blur(30px);
    pointer-events: none;
    z-index: -1;
}
.section-container {
    max-width: 1280px;
    margin: 0 auto;
}
.projekte-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(3rem, 6vw, 6rem);
}
@media (min-width: 960px) {
    .projekte-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- Filter-Bar ---------- */
.projekte-filter {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    gap: 4px;
    padding: 4px;
    margin: 0 auto clamp(2rem, 4vw, 3rem);
    background: rgba(18, 26, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 999px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.projekte-filter::-webkit-scrollbar { display: none; }

/* Wrap the filter in a flex container so it can center */
.projekte-grid-section .section-container {
    text-align: center;
}
.projekte-grid-section .section-container .projekte-grid {
    text-align: left;
}

.projekte-filter-btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: transparent;
    border: 0;
    border-radius: 999px;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.25s ease;
}
.projekte-filter-btn:hover { color: var(--text); }
.projekte-filter-btn.is-active { color: var(--deep-navy); }
.projekte-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    padding: 0 0.4rem;
    height: 20px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    transition: background 0.25s ease, color 0.25s ease;
}
.projekte-filter-btn.is-active .projekte-filter-count {
    background: rgba(15, 42, 68, 0.2);
    color: var(--deep-navy);
}
/* Der gleitende Pill-Hintergrund.
   top/left: 0 — Position wird komplett ueber transform im JS gesetzt
   (getBoundingClientRect enthaelt schon die 4px Padding). */
.projekte-filter-pill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-radius: 999px;
    background: var(--gradient-highlight);
    box-shadow: 0 4px 18px -2px rgba(79, 195, 224, 0.45);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1;
    pointer-events: none;
    will-change: transform, width, height;
}

/* Gefilterte Karten ausblenden (mit smooth transition) */
.projekt-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.projekt-card.is-filtered-out {
    display: none;
}

@media (max-width: 540px) {
    .projekte-filter { font-size: 0.8rem; }
    .projekte-filter-btn { padding: 0.55rem 0.9rem; font-size: 0.8rem; }
    .projekte-filter-count { font-size: 0.65rem; min-width: 20px; height: 18px; }
}

.projekte-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}
.projekte-empty h2 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* ---------- Projekt Card ---------- */
.projekt-card {
    position: relative;
    background: linear-gradient(160deg, rgba(18, 62, 99, 0.55) 0%, rgba(15, 22, 36, 0.9) 60%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 2.5vw, 2.5rem);
    overflow: hidden;
    isolation: isolate;
    /* Kein opacity/translate-Hiding mehr: Karten sind sofort sichtbar,
       damit schnelles Scrollen nicht in leere Luft laeuft. Einzelne Bilder
       faden ueber .device-screen img (siehe unten) weich ein wenn geladen. */
}
.projekt-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 75% 10%, rgba(79, 195, 224, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
.projekt-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(160deg, rgba(79, 195, 224, 0.35), rgba(31, 111, 165, 0) 60%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

.projekt-meta {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-bright);
    margin-bottom: 0.6rem;
}
.projekt-meta .projekt-city {
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    text-transform: none;
}
.projekt-meta .projekt-city::before {
    content: '·';
    margin-right: 0.75rem;
    color: var(--text-muted);
}

.projekt-title {
    position: relative;
    z-index: 2;
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 0.5rem;
}
.projekt-subtitle {
    position: relative;
    z-index: 2;
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 46ch;
}

/* ---------- Mockup Stage (der "stacked" Look) ---------- */
.projekt-mockup-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    aspect-ratio: 16 / 10;
    margin: 2rem 0 1.5rem;
    perspective: 1400px;
    transform-style: preserve-3d;
    transition: transform 0.4s ease;
}

/* Device Base */
.device {
    position: absolute;
    border-radius: 12px;
    background: #0B1220;
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.8),
        0 12px 28px -10px rgba(31, 111, 165, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}
.device-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0A0F1A;
}
.device-screen img,
.device-screen iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    display: block;
}
/* Bilder smooth einblenden sobald sie geladen sind */
.device-screen img {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.device-screen img.is-loaded,
.device-screen img[data-loaded="true"] {
    opacity: 1;
}
.device-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.85rem;
    background: repeating-linear-gradient(45deg,
                #0E1828 0, #0E1828 10px,
                #0B1220 10px, #0B1220 20px);
}

/* ----- Desktop (Browser-Chrome) ----- */
.device-desktop {
    left: 0;
    top: 8%;
    width: 72%;
    height: 78%;
    border-radius: 10px 10px 14px 14px;
    transform: translate3d(var(--tx, 0), var(--ty, 0), 0)
               rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
}
.device-desktop .device-bar {
    position: relative;
    height: 26px;
    background: linear-gradient(180deg, #14253B 0%, #0E1B2E 100%);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 6px;
}
.device-desktop .device-bar .dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #344;
}
.device-desktop .device-bar .dot-r { background: #ff5f57; }
.device-desktop .device-bar .dot-y { background: #febc2e; }
.device-desktop .device-bar .dot-g { background: #28c840; }
.device-desktop .device-bar .device-url {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', monospace;
    font-size: 0.65rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.03);
    padding: 2px 10px;
    border-radius: 4px;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.device-desktop .device-screen {
    height: calc(100% - 26px);
}

/* ----- Tablet ----- */
.device-tablet {
    right: 2%;
    top: 0;
    width: 36%;
    height: 62%;
    border-radius: 16px;
    transform: translate3d(calc(var(--tx, 0) * -0.6), calc(var(--ty, 0) * -0.6), 60px)
               rotate(-3deg);
    z-index: 3;
    box-shadow:
        0 40px 70px -20px rgba(0, 0, 0, 0.85),
        0 20px 40px -15px rgba(79, 195, 224, 0.35),
        inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}
.device-tablet-pro {
    left: 0;
    top: 4%;
    width: 70%;
    height: 90%;
    border-radius: 18px;
    box-shadow:
        0 40px 80px -20px rgba(0, 0, 0, 0.85),
        0 20px 40px -15px rgba(79, 195, 224, 0.4),
        inset 0 0 0 2px rgba(255, 255, 255, 0.06);
}

/* ----- Phone ----- */
.device-phone {
    right: 10%;
    bottom: 0;
    width: 20%;
    height: 58%;
    border-radius: 22px;
    background: #0A0F1A;
    padding: 4px;
    transform: translate3d(calc(var(--tx, 0) * -0.3), calc(var(--ty, 0) * -0.3), 80px)
               rotate(5deg);
    z-index: 4;
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.85),
        0 15px 30px -10px rgba(31, 111, 165, 0.5),
        inset 0 0 0 1.5px rgba(255, 255, 255, 0.08);
}
.device-phone .device-screen {
    border-radius: 18px;
}
.device-phone::before {
    /* Notch */
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 32%;
    height: 14px;
    background: #000;
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
}
.device-phone--tour {
    right: 4%;
    bottom: 4%;
    width: 24%;
    height: 70%;
}

/* ----- Hover-Effekt (Desktop mit Maus + Mobile via .is-hovered / Scroll) ----- */
.projekt-card:hover .device-desktop,
.projekt-card.is-hovered .device-desktop {
    transform: translate3d(calc(var(--tx, 0) - 6px), calc(var(--ty, 0) - 4px), 0)
               rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
}
.projekt-card:hover .device-tablet,
.projekt-card.is-hovered .device-tablet {
    transform: translate3d(calc(var(--tx, 0) * -0.6 + 8px), calc(var(--ty, 0) * -0.6 - 6px), 80px)
               rotate(-5deg);
}
.projekt-card:hover .device-phone,
.projekt-card.is-hovered .device-phone {
    transform: translate3d(calc(var(--tx, 0) * -0.3 + 12px), calc(var(--ty, 0) * -0.3 + 2px), 100px)
               rotate(7deg);
}

/* ----- 360° Tour Preview (Static Placeholder + Play-Overlay) ----- */
.tour-preview {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: #0B1220;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
    text-align: left;
}
.tour-preview-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: radial-gradient(ellipse at 30% 20%,
                rgba(31, 111, 165, 0.5) 0%,
                rgba(18, 62, 99, 0.9) 40%,
                #0A0F1A 85%);
}
.tour-preview-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(1.1);
}
/* Live Matterport-Fallback wenn kein Screenshot vorhanden ist.
   pointer-events:none → Klick wandert an den <button.tour-preview> fuer Fullscreen. */
.tour-iframe-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    pointer-events: none;
    background: #0A0F1A;
}
.tour-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0F2A44;
    background: var(--gradient-highlight);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 12px 40px -8px rgba(79, 195, 224, 0.6),
        0 0 0 8px rgba(79, 195, 224, 0.12),
        0 0 0 16px rgba(79, 195, 224, 0.06);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}
.tour-preview:hover .tour-play-badge,
.tour-preview:focus-visible .tour-play-badge,
.projekt-card.is-hovered .tour-play-badge {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow:
        0 16px 52px -6px rgba(79, 195, 224, 0.8),
        0 0 0 10px rgba(79, 195, 224, 0.18),
        0 0 0 22px rgba(79, 195, 224, 0.08);
}
.tour-play-badge svg { margin-left: 4px; }
.tour-play-label {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.8rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(10, 15, 26, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 999px;
    color: var(--text);
    border: 1px solid rgba(79, 195, 224, 0.25);
    white-space: nowrap;
}
.tour-preview-phone .tour-preview-screen {
    background: radial-gradient(ellipse at 60% 40%,
                rgba(79, 195, 224, 0.35) 0%,
                rgba(18, 62, 99, 0.85) 45%,
                #0A0F1A 100%);
}
.tour-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(79, 195, 224, 0.8);
}
.tour-placeholder-icon {
    opacity: 0.85;
    filter: drop-shadow(0 0 18px rgba(79, 195, 224, 0.35));
}
.tour-placeholder-label {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ----- Fullscreen Lightbox fuer 360° Touren ----- */
.tour-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(5, 8, 15, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 2vw, 1.5rem);
}
.tour-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}
body.tour-lightbox-open {
    overflow: hidden;
}
.tour-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 1;
}
.tour-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}
.tour-lightbox-title {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text);
    max-width: calc(100% - 5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tour-lightbox-frame {
    width: 100%;
    max-width: 1400px;
    aspect-ratio: 16 / 10;
    max-height: calc(100vh - 5rem);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
    background: #000;
    transform: scale(0.96);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.tour-lightbox.is-open .tour-lightbox-frame {
    transform: scale(1);
}
.tour-lightbox-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 720px) {
    .tour-play-badge { width: 58px; height: 58px; }
    .tour-play-badge svg { width: 20px; height: 20px; }
    .tour-play-label { font-size: 0.6rem; padding: 0.25rem 0.6rem; bottom: 10px; }
    .tour-lightbox-title { font-size: 1rem; left: 1rem; top: 1rem; }
    .tour-lightbox-frame { aspect-ratio: 9 / 16; max-height: calc(100vh - 4rem); }
}

/* ----- Kartentypen-spezifische Anpassungen ----- */
.projekt-card--tour .projekt-mockup-stage {
    aspect-ratio: 16 / 9;
}

/* ---------- Actions ---------- */
.projekt-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
.projekt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    background: var(--gradient-highlight);
    color: var(--deep-navy);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.projekt-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(79, 195, 224, 0.45);
}
.projekt-link--ghost {
    background: transparent;
    color: var(--accent-bright);
    border: 1px solid rgba(79, 195, 224, 0.35);
}
.projekt-link--ghost:hover {
    background: rgba(79, 195, 224, 0.08);
    border-color: var(--accent-bright);
}

/* ---------- CTA ---------- */
.projekte-cta {
    padding: clamp(3rem, 6vw, 5rem) 1.5rem 6rem;
}
.projekte-cta-inner {
    background: linear-gradient(135deg, rgba(18, 62, 99, 0.55) 0%, rgba(15, 22, 36, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: clamp(2.5rem, 5vw, 4rem) 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.projekte-cta-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center bottom,
                rgba(79, 195, 224, 0.18) 0%, transparent 60%);
    pointer-events: none;
}
.projekte-cta h2 {
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 400;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}
.projekte-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
}
.projekte-cta .btn {
    position: relative;
    z-index: 1;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 720px) {
    .projekt-card {
        padding: 1.25rem;
    }
    .projekt-mockup-stage {
        aspect-ratio: 4 / 3;
        margin-top: 1.25rem;
    }
    /* Devices leicht einziehen, damit sie Platz zum Animieren haben */
    .device-desktop { width: 78%; height: 72%; left: 2%; top: 6%; }
    .device-tablet  { width: 38%; height: 58%; right: 4%; top: 0%; }
    .device-phone   { width: 22%; height: 56%; right: 10%; bottom: 4%; }
    .device-desktop .device-bar .device-url { font-size: 0.55rem; max-width: 50%; }

    /* Tour-Karten: das kleine Phone sieht auf Mobile zerstueckelt aus
       (Notch + Rotation + Mini-Resolution). Wir blenden es aus und geben
       dem Tablet-Pro die volle Buehne. */
    .projekt-card--tour .device-phone--tour {
        display: none;
    }
    .projekt-card--tour .projekt-mockup-stage {
        aspect-ratio: 16 / 11;
    }
    .projekt-card--tour .device-tablet-pro {
        width: 94%;
        height: 92%;
        left: 3%;
        top: 4%;
    }
    /* Hover-Animation fuer die grosse Tablet-Pro auf Mobile anpassen */
    .projekt-card--tour.is-hovered .device-tablet-pro {
        transform: translate3d(-2px, -4px, 0) scale(1.015);
    }
}

/* Mobile / Touch: deutlich ausgepraegterer "is-hovered"-State,
   weil kein Maus-Parallax die Bewegung erzeugt. */
@media (hover: none), (max-width: 820px) {
    .projekt-card.is-hovered .device-desktop {
        transform: translate3d(-10px, -12px, 0) scale(1.01);
    }
    .projekt-card.is-hovered .device-tablet {
        transform: translate3d(14px, -16px, 80px) rotate(-8deg) scale(1.06);
    }
    .projekt-card.is-hovered .device-phone {
        transform: translate3d(-10px, 10px, 110px) rotate(9deg) scale(1.06);
    }
}
