/* ==========================================
   SAKI HSK – MOTION LAYER
   Zusätzliche, ruhige Premium-Animationen.
   Grundsatz: Inhalt ist ohne JS/ohne Bewegung vollständig sichtbar;
   Bewegung ist Verfeinerung, nie Voraussetzung.
   ========================================== */

:root {
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------
   1. Lese-Fortschritt (dünne Gold-Linie oben)
   ------------------------------------------ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1200; /* über sticky Header (Header nutzt niedrigeren z-index) */
    background: transparent;
    pointer-events: none;
}

.scroll-progress-bar {
    height: 100%;
    width: 100%;
    transform: scaleX(0);
    transform-origin: left center;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
    box-shadow: 0 0 8px rgba(240, 180, 41, 0.45);
    will-change: transform;
}

/* ------------------------------------------
   2. Hero – Ken-Burns-Zoom auf den Motiven
   ------------------------------------------ */
.hero-bg .hero-slide .hero-image {
    transform-origin: 60% 40%;
    animation: kenBurns 15s ease-in-out infinite alternate;
}
.hero-bg .hero-slide-2 .hero-image { animation-delay: -5s; }
.hero-bg .hero-slide-3 .hero-image { animation-delay: -10s; }

@keyframes kenBurns {
    from { transform: scale(1.04) translate(0, 0); }
    to   { transform: scale(1.20) translate(-1.8%, -1.2%); }
}

/* ------------------------------------------
   3. Hero – Gold-Unterstrich zeichnet sich
   unter dem Akzentwort "wartet auf dich"
   ------------------------------------------ */
.hero-accent {
    position: relative;
    width: fit-content;
    padding-bottom: 6px;
}
.hero-accent::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: var(--radius-sm);
    transform: scaleX(0);
    transform-origin: left center;
    animation: underlineLoop 8s ease-in-out 0.95s infinite;
}
/* Auf zentrierten Layouts (Tablet/Mobil) den Strich mittig setzen */
@media (max-width: 1024px) {
    .hero-accent { margin-left: auto; margin-right: auto; }
    .hero-accent::after { transform-origin: center; }
}

@keyframes underlineLoop {
    0%   { transform: scaleX(0); transform-origin: left center; }
    18%  { transform: scaleX(1); transform-origin: left center; }   /* gezeichnet */
    70%  { transform: scaleX(1); transform-origin: right center; }  /* halten (Origin-Wechsel unsichtbar) */
    90%  { transform: scaleX(0); transform-origin: right center; }  /* nach rechts wegwischen */
    100% { transform: scaleX(0); transform-origin: right center; }
}

/* ------------------------------------------
   4. Ablauf – gezeichnete Gold-Linie + Schritt-Puls
   ------------------------------------------ */
.process-steps::after {
    content: '';
    position: absolute;
    top: 24px;
    left: 5%;
    right: 5%;
    height: 2px;
    z-index: 0;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
    transform: scaleX(0);
    transform-origin: left center;
}
.process-steps.in-view::after {
    animation: drawLine 1.3s var(--ease-out-quint) forwards;
}

@keyframes drawLine {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Mobil stapeln die Schritte vertikal – die horizontale Linie entfällt
   (wie die graue Spur in styles.css) */
@media (max-width: 1024px) {
    .process-steps::after { display: none; }
}

/* Schritt-Nummern: kurzer Gold-Ring-Puls, der mit der Linie mitwandert */
.process-steps.in-view .step-number {
    animation: stepPop 0.85s var(--ease-out-quint) both;
}
.process-steps.in-view .process-step:nth-child(1) .step-number { animation-delay: 0.15s; }
.process-steps.in-view .process-step:nth-child(2) .step-number { animation-delay: 0.38s; }
.process-steps.in-view .process-step:nth-child(3) .step-number { animation-delay: 0.61s; }
.process-steps.in-view .process-step:nth-child(4) .step-number { animation-delay: 0.84s; }
.process-steps.in-view .process-step:nth-child(5) .step-number { animation-delay: 1.07s; }

@keyframes stepPop {
    0%   { transform: scale(0.82); box-shadow: 0 0 0 0 rgba(240, 180, 41, 0.5); }
    60%  { transform: scale(1.06); }
    100% { transform: scale(1);    box-shadow: 0 0 0 16px rgba(240, 180, 41, 0); }
}

/* Schritt-Nummern: beim Hovern/Fokus zieht ein diagonaler
   Lichtstreif (Swoosh) wiederholt über den Kreis */
.step-number {
    position: relative;
    overflow: hidden;
}
.step-number::after {
    content: '';
    position: absolute;
    top: -30%;
    bottom: -30%;
    left: 0;
    width: 45%;
    background: linear-gradient(105deg,
        transparent 0%,
        rgba(255, 250, 235, 0.55) 50%,
        transparent 100%);
    transform: translateX(-180%) skewX(-18deg);
    pointer-events: none;
}
.process-step:hover .step-number::after,
.process-step:focus-within .step-number::after {
    animation: stepSwoosh 1.8s ease-in-out infinite;
}

@keyframes stepSwoosh {
    0%   { transform: translateX(-180%) skewX(-18deg); }
    55%  { transform: translateX(420%) skewX(-18deg); }
    100% { transform: translateX(420%) skewX(-18deg); }
}

/* ------------------------------------------
   4b. Zuverlässigkeits-Box – Schild zeichnet sich,
   Haken setzt sich, Texte folgen gestaffelt
   (nur mit JS aktiv, ohne JS bleibt alles sichtbar)
   ------------------------------------------ */
.js-motion .reliability-icon svg [pathLength] {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.reliability-box.in-view .reliability-icon svg path:nth-child(1) {
    animation: iconDraw 0.8s var(--ease-out-quint) forwards;
}
.reliability-box.in-view .reliability-icon svg path:nth-child(2) {
    animation: iconDraw 0.45s var(--ease-out-quint) 0.75s forwards;
}
.reliability-box.in-view .reliability-icon {
    animation: shieldPulse 0.5s var(--ease-out-quint) 1.2s;
}

.js-motion .reliability-eyebrow,
.js-motion .reliability-text strong,
.js-motion .reliability-sub {
    opacity: 0;
    transform: translateY(10px);
}
.reliability-box.in-view .reliability-eyebrow {
    animation: statIn 0.6s var(--ease-out-quint) 0.3s forwards;
}
.reliability-box.in-view .reliability-text strong {
    animation: statIn 0.6s var(--ease-out-quint) 0.5s forwards;
}
.reliability-box.in-view .reliability-sub {
    animation: statIn 0.6s var(--ease-out-quint) 0.7s forwards;
}

@keyframes shieldPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ------------------------------------------
   4c. Wert-Sektion – lebendige Mini-Icons
   (ruhige Loops, nur auf der aktiven Karte)
   ------------------------------------------ */

/* Icon 1: Stern pulsiert sanft und dreht leicht, Zwinkler blitzen versetzt */
.value-item .ico-star,
.value-item .ico-tw {
    transform-box: fill-box;
    transform-origin: center;
}
.value-item.active .ico-star {
    animation: icoStar 3.2s ease-in-out infinite;
}
.value-item.active .ico-tw1 { animation: icoTwinkle 3.2s ease-in-out infinite; }
.value-item.active .ico-tw2 { animation: icoTwinkle 3.2s ease-in-out 1.1s infinite; }

@keyframes icoStar {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.14) rotate(12deg); }
}
@keyframes icoTwinkle {
    0%, 100% { opacity: 0.35; transform: scale(0.8); }
    40%      { opacity: 1; transform: scale(1.15); }
    70%      { opacity: 0.5; }
}

/* Icon 2: Hotelfenster leuchten zeilenweise durch */
.value-item.active .ico-win { animation: icoWin 2.8s ease-in-out infinite; }
.value-item.active .ico-win1 { animation-delay: 0s; }
.value-item.active .ico-win2 { animation-delay: 0.45s; }
.value-item.active .ico-win3 { animation-delay: 0.9s; }

@keyframes icoWin {
    0%, 100% { opacity: 0.4; }
    30%, 60% { opacity: 1; }
}

/* Icon 3: Haken zeichnet sich, hält, setzt neu an */
.value-item .ico-check {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}
.value-item.active .ico-check {
    animation: icoCheck 3s ease-in-out infinite;
}

@keyframes icoCheck {
    0%       { stroke-dashoffset: 1; }
    28%      { stroke-dashoffset: 0; }
    78%      { stroke-dashoffset: 0; opacity: 1; }
    88%      { opacity: 0; }
    92%      { stroke-dashoffset: 1; opacity: 0; }
    100%     { stroke-dashoffset: 1; opacity: 1; }
}

/* ------------------------------------------
   5. Vorteile – Icon zeichnet sich beim Erscheinen
   (nur mit JS aktiv, damit Icons ohne JS sichtbar bleiben)
   ------------------------------------------ */
.js-motion .benefit-card .benefit-icon svg [pathLength] {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.js-motion .benefit-card.icon-drawn .benefit-icon svg [pathLength] {
    animation: iconDraw 0.9s var(--ease-out-quint) forwards;
}
/* leichte Staffelung der Striche innerhalb eines Icons */
.js-motion .benefit-card.icon-drawn .benefit-icon svg :nth-child(2) { animation-delay: 0.12s; }
.js-motion .benefit-card.icon-drawn .benefit-icon svg :nth-child(3) { animation-delay: 0.24s; }
.js-motion .benefit-card.icon-drawn .benefit-icon svg :nth-child(4) { animation-delay: 0.36s; }

/* Icon-Chip atmet beim Erscheinen kurz auf */
.js-motion .benefit-card .benefit-icon { transform: scale(0.86); opacity: 0; }
.js-motion .benefit-card.icon-drawn .benefit-icon {
    animation: chipIn 0.6s var(--ease-out-quint) forwards;
}

@keyframes iconDraw {
    to { stroke-dashoffset: 0; }
}
@keyframes chipIn {
    from { transform: scale(0.86); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ------------------------------------------
   6. Vertrauen – Stat-Reihen gestaffelt herein,
   Gold-Icon-Kreis ploppt
   ------------------------------------------ */
.js-motion .trust-stats .trust-stat { opacity: 0; transform: translateY(14px); }
.trust-stats.in-view .trust-stat {
    animation: statIn 0.6s var(--ease-out-quint) forwards;
}
.trust-stats.in-view .trust-stat:nth-child(1) { animation-delay: 0.05s; }
.trust-stats.in-view .trust-stat:nth-child(2) { animation-delay: 0.17s; }
.trust-stats.in-view .trust-stat:nth-child(3) { animation-delay: 0.29s; }
.trust-stats.in-view .trust-stat:nth-child(4) { animation-delay: 0.41s; }

.trust-stats.in-view .trust-stat-icon {
    animation: statIconPop 0.55s var(--ease-out-quint) both;
}
.trust-stats.in-view .trust-stat:nth-child(1) .trust-stat-icon { animation-delay: 0.18s; }
.trust-stats.in-view .trust-stat:nth-child(2) .trust-stat-icon { animation-delay: 0.30s; }
.trust-stats.in-view .trust-stat:nth-child(3) .trust-stat-icon { animation-delay: 0.42s; }
.trust-stats.in-view .trust-stat:nth-child(4) .trust-stat-icon { animation-delay: 0.54s; }

@keyframes statIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes statIconPop {
    0%   { transform: scale(0.6);  box-shadow: 0 0 0 0 rgba(240, 180, 41, 0.45); }
    60%  { transform: scale(1.08); }
    100% { transform: scale(1);    box-shadow: 0 0 0 12px rgba(240, 180, 41, 0); }
}

/* ------------------------------------------
   7. Reduced Motion – alles ruhig & sichtbar
   ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .scroll-progress { display: none; }

    .hero-bg .hero-slide .hero-image { animation: none; transform: none; }

    .hero-accent::after {
        animation: none;
        transform: scaleX(1);
    }

    .process-steps::after { animation: none; transform: scaleX(1); }
    .process-steps.in-view .step-number { animation: none; }
    .step-number::before, .step-number::after { animation: none !important; }

    .js-motion .reliability-icon svg [pathLength] {
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        animation: none;
    }

    .js-motion .trust-stats .trust-stat { opacity: 1; transform: none; }
    .trust-stats.in-view .trust-stat,
    .trust-stats.in-view .trust-stat-icon { animation: none; }
}
