/* DECAMP 01.12.2026: Bereich „Unter der Lupe“ (Startseite)
   CROSS X5 groß im Bild, Schritt für Schritt werden Bauteile gezeigt.
   Desktop: Abschnitt bleibt stehen, Scrollen schaltet die Schritte.
   Handy/iPad: kein Festhalten, Schritte per Tippen (läuft auch von selbst weiter). */

.lupe-wrapper {
    height: calc(100vh + var(--lupe-steps, 4) * 65vh) !important;
}

.lupe-section .lupe-text { position: relative; }

.lupe-section .parallax-title { line-height: 1.05; }

.lupe-lead {
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    max-width: 34em;
}

/* ---------- Schritt-Liste links ---------- */
.lupe-steps {
    margin: 0;
    padding: 0;
    position: relative;
    counter-reset: none;
}
.lupe-steps::before { /* senkrechte Führungslinie */
    content: "";
    position: absolute;
    left: 17px;
    top: 18px;
    bottom: 18px;
    width: 2px;
    background: #e3e0d8;
}
.lupe-step { position: relative; margin: 0; }
.lupe-step-head {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 7px 0;
    cursor: pointer;
    color: #6c757d;
    font-weight: 700;
    font-size: 1.05rem;
    transition: color .3s ease;
}
.lupe-step-head:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; border-radius: 6px; }
.lupe-num {
    position: relative;
    z-index: 1;
    flex: 0 0 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .9rem;
    background: #fff;
    border: 2px solid #d9d5cc;
    color: #8a8f94;
    transition: background .35s ease, border-color .35s ease, color .35s ease, transform .35s ease;
}
.lupe-step.is-done .lupe-num {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.lupe-step.is-active .lupe-step-head { color: #212529; }
.lupe-step.is-active .lupe-num {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent-color) 35%, transparent);
}
.lupe-step-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .45s cubic-bezier(.25, 1, .5, 1), opacity .35s ease;
    opacity: 0;
    padding-left: 50px;
}
.lupe-step-body > p {
    overflow: hidden;
    margin: 0;
    color: #555;
    font-size: .95rem;
    line-height: 1.6;
}
.lupe-step.is-active .lupe-step-body {
    grid-template-rows: 1fr;
    opacity: 1;
}
.lupe-step.is-active .lupe-step-body > p { padding: 2px 0 10px; }

/* ---------- Bild-Bühne rechts ---------- */
.lupe-stage {
    --intro: 1;
    position: relative;
    aspect-ratio: 4 / 3;
    max-height: calc(100vh - 170px);
    margin: 0 auto;
    border-radius: 22px;
    background: #2a2d30;
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .35);
    opacity: calc(.15 + var(--intro) * .85);
}
.lupe-photo {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    clip-path: inset(0 calc((1 - var(--intro)) * 18%) 0 0 round 22px);
}
.lupe-scene { /* Foto + Punkte bewegen sich gemeinsam (Kamera-Fahrt) */
    position: absolute;
    inset: 0;
    transform-origin: var(--fx, 50%) var(--fy, 50%);
    transform: translateX(calc((1 - var(--intro)) * 6%)) scale(calc(var(--zoom, 1.04) + (1 - var(--intro)) * .12));
    transition: transform 1.1s cubic-bezier(.25, 1, .5, 1), transform-origin 1.1s cubic-bezier(.25, 1, .5, 1);
    will-change: transform;
}
.lupe-scene img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.lupe-scene::after { /* leichte Abdunklung, damit Punkte gut sichtbar sind */
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.25));
    pointer-events: none;
}


/* Punkte im Bild */
.lupe-spot {
    all: unset;
    position: absolute;
    z-index: 3;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: grid;
    place-items: center;
    cursor: pointer;
    opacity: calc(var(--intro) * 1);
}
.lupe-spot-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, .85);
    border: 2px solid rgba(0, 0, 0, .15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    transition: all .4s cubic-bezier(.25, 1, .5, 1);
}
.lupe-spot.is-active .lupe-spot-dot {
    width: 34px;
    height: 34px;
    font-size: .95rem;
    background: var(--accent-color);
    border: 3px solid #fff;
}
.lupe-spot.is-active::before { /* pulsierender Ring */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: lupePulse 1.8s ease-out infinite;
}
.lupe-spot:focus-visible .lupe-spot-dot { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes lupePulse {
    0% { transform: scale(.6); opacity: .9; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* Lupe (vergrößerter Ausschnitt) */
.lupe-glass {
    position: absolute;
    z-index: 4;
    right: -4%;
    bottom: -7%;
    width: 36%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: #f4f1ea;
    border: 6px solid #fff;
    box-shadow: 0 18px 40px -8px rgba(0, 0, 0, .45);
    transform: scale(calc(.4 + var(--intro) * .6));
    opacity: var(--intro);
    transform-origin: 80% 80%;
}
.lupe-glass::after { /* Glas-Spiegelung */
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), rgba(255,255,255,0) 45%);
    pointer-events: none;
}
.lupe-view {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.15);
    transition: opacity .5s ease, transform .8s cubic-bezier(.25, 1, .5, 1);
}
.lupe-view.is-active { opacity: 1; transform: scale(1); }
.lupe-zoom {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
}
.lupe-svg { width: 100%; height: 100%; display: block; }

/* Fortschritt */
.lupe-progress {
    position: absolute;
    z-index: 3;
    left: 22px;
    right: 42%;
    bottom: 18px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden;
}
.lupe-progress span {
    display: block;
    height: 100%;
    width: calc(var(--p, 0) * 100%);
    background: #fff;
    border-radius: inherit;
    transition: width .2s linear;
}

/* ---------- Handy & iPad: kein Festhalten ---------- */
@media (max-width: 991px), (prefers-reduced-motion: reduce) {
    .lupe-wrapper { height: auto !important; }
    .lupe-wrapper .sticky-section.lupe-section {
        position: relative !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 40px 0 70px !important;
        overflow: visible;
    }
    .lupe-stage { max-height: none; }
    .lupe-progress { right: 22px; }
}
@media (max-width: 991px) {
    .lupe-section .parallax-title { font-size: 1.9rem !important; }
    .lupe-lead { font-size: .95rem; line-height: 1.55; }
    .lupe-glass { width: 40%; right: -2%; bottom: -10%; border-width: 4px; }
    .lupe-section .scroll-indicator { display: none !important; }
    .lupe-section .col-lg-7 { margin-bottom: 20px; }
}
@media (min-width: 992px) and (max-height: 820px) {
    .lupe-lead { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .lupe-scene, .lupe-view, .lupe-step-body, .lupe-spot-dot { transition: none !important; }
    .lupe-spot.is-active::before { animation: none; }
}
