/* ==========================================================================
   ReachNova: Interaktion und Bewegung für die neuen Section-Layouts
   Hover und Press nur bei echtem Zeiger, Bewegung nur ohne Reduced Motion.
   Hover nutzt "translate" statt "transform", damit es nicht mit der
   Reveal-Animation (transform) kollidiert.
   ========================================================================== */

:root { --rn-ease-out: cubic-bezier(0.16, 1, 0.3, 1); }

/* ---------- Gemeinsame Karten-Rückmeldung (Hover, Fokus, Press) ---------- */
.rn-alert, .rn-stack-card, .rn-file, .rn-pic-card, .rn-tl-body, .rn-chain, .rn-store,
.rn-hub-node, .rn-sst-todo, .rn-frame, .rn-a11y-card, .rn-report, .rn-adsband {
  transition: translate 0.35s var(--rn-ease-out), box-shadow 0.35s var(--rn-ease-out), border-color 0.25s ease, background-color 0.25s ease;
}
.rn-alert, .rn-stack-card, .rn-file, .rn-pic-card, .rn-tl-body { position: relative; }

/* Verlaufslinie oben, wie bei .rn-card */
.rn-alert::before, .rn-stack-card::before, .rn-pic-card::before, .rn-tl-body::before {
  content: ""; position: absolute; inset-block-start: 0; inset-inline: 28px; block-size: 2px; z-index: 1;
  background: linear-gradient(90deg, var(--rn-primary), rgba(26,190,245,0));
  border-radius: 0 0 2px 2px; opacity: 0; transition: opacity 0.3s ease;
}

@media (hover: hover) and (pointer: fine) {
  .rn-alert:hover, .rn-stack-card:hover, .rn-file:hover, .rn-pic-card:hover, .rn-tl-step:hover .rn-tl-body {
    border-color: rgba(26,190,245,0.35); box-shadow: var(--rn-shadow-hover);
  }
  .rn-alert:hover::before, .rn-stack-card:hover::before, .rn-pic-card:hover::before, .rn-tl-step:hover .rn-tl-body::before { opacity: 1; }
  .rn-file:hover { box-shadow: inset 0 0 0 1px rgba(26,190,245,0.45), var(--rn-shadow-hover); }

  /* Zeilen in Listen: Fläche tönt sich ein, Icon reagiert */
  .rn-wrapper .rn-report-list .rn-report-row, .rn-wrapper .rn-frame-list .rn-frame-row,
  .rn-wrapper .rn-trio .rn-trio-item, .rn-cmp-table tbody tr > * { transition: background-color 0.25s ease; }
  .rn-wrapper .rn-report-list .rn-report-row:hover, .rn-wrapper .rn-frame-list .rn-frame-row:hover { background: var(--rn-surface-alt); }
  .rn-wrapper .rn-trio .rn-trio-item:hover { background: var(--rn-surface-alt); }
  .rn-cmp-table tbody tr:hover > th, .rn-cmp-table tbody tr:hover > .rn-cmp-bad { background: var(--rn-surface-alt); }
  .rn-cmp-table tbody tr:hover > .rn-cmp-good { background: #e0f4fd; }

  .rn-report-row:hover .rn-report-icon, .rn-frame-row:hover .rn-frame-icon,
  .rn-direct-item:hover .rn-direct-icon, .rn-trio-item:hover .rn-trio-icon,
  .rn-num-col:hover .rn-num-icon, .rn-file:hover .rn-file-icon, .rn-route-step:hover .rn-route-dot,
  .rn-tl-step:hover .rn-tl-dot, .rn-stack-layer:hover .rn-stack-num, .rn-pipe-step:hover .rn-pipe-icon {
    scale: 1.08;
  }
  .rn-direct-item:hover .rn-direct-icon, .rn-report-row:hover .rn-report-icon, .rn-frame-row:hover .rn-frame-icon {
    background: var(--rn-primary); color: var(--rn-text-main); border-color: var(--rn-primary);
  }
  .rn-route-step:hover .rn-route-dot, .rn-tl-step:hover .rn-tl-dot { background: var(--rn-primary); color: var(--rn-text-main); border-color: var(--rn-primary); }
  .rn-stack-layer:hover .rn-stack-num { background: var(--rn-primary); color: var(--rn-text-main); border-color: var(--rn-primary); }

  /* Vorher → Nachher: Pfeil schiebt nach rechts, Ergebnis hebt sich */
  .rn-pair:hover .rn-pair-arrow svg { translate: 4px 0; }
  .rn-pair:hover .rn-pair-to { border-color: var(--rn-primary); }

  /* Spalten mit Linie oben: Linie wird zur Markenfarbe */
  .rn-wrapper .rn-num-cols .rn-num-col:hover { border-top-color: var(--rn-primary); }

  /* Chevron-Ablauf */
  .rn-chev-step:hover .rn-chev-head { filter: brightness(0.97); }

  /* Schaubild Direkter Draht */
  .rn-chain:hover .rn-chain-me { scale: 1.03; }

  /* Shopify: Problem in der Liste markiert den passenden Punkt im Shop */
  .rn-anno:has(.rn-anno-item:nth-child(1):hover) [data-pin="1"],
  .rn-anno:has(.rn-anno-item:nth-child(2):hover) [data-pin="2"],
  .rn-anno:has(.rn-anno-item:nth-child(3):hover) [data-pin="3"] { scale: 1.25; box-shadow: 0 0 0 8px rgba(240,68,56,0.22); }
  .rn-anno:has(.rn-anno-item:nth-child(1):hover) .rn-store-url,
  .rn-anno:has(.rn-anno-item:nth-child(2):hover) .rn-store-apps,
  .rn-anno:has(.rn-anno-item:nth-child(3):hover) .rn-store-hero { outline: 2px solid #f04438; outline-offset: 2px; }
  .rn-anno-item { transition: opacity 0.25s ease; }
  .rn-anno-list:has(.rn-anno-item:hover) .rn-anno-item:not(:hover) { opacity: 0.55; }

  /* Hub-Links und Info-Karten */
  .rn-hub-node:has(a):hover { border-color: rgba(26,190,245,0.55); }
  .rn-sst-todo:hover, .rn-a11y-card:hover { box-shadow: var(--rn-shadow-md); }
}

/* Icon- und Punkt-Übergänge */
.rn-report-icon, .rn-frame-icon, .rn-direct-icon, .rn-trio-icon, .rn-num-icon, .rn-file-icon,
.rn-route-dot, .rn-tl-dot, .rn-stack-num, .rn-pipe-icon, .rn-chain-me, .rn-anno-pin, .rn-pair-arrow svg {
  transition: scale 0.3s var(--rn-ease-out), translate 0.3s var(--rn-ease-out), background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease;
}
.rn-chev-head { transition: filter 0.25s ease; }
.rn-store-url, .rn-store-apps, .rn-store-hero { transition: outline-color 0.2s ease; outline: 2px solid transparent; outline-offset: 2px; }
.rn-wrapper .rn-num-cols .rn-num-col { transition: border-top-color 0.3s ease; }

/* Hover-Lift nur mit Bewegung */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .rn-alert:hover, .rn-stack-card:hover, .rn-file:hover, .rn-pic-card:hover, .rn-tl-step:hover .rn-tl-body,
  .rn-hub-node:has(a):hover { translate: 0 -4px; }
  .rn-pic-card:hover .rn-ill-load b { scale: 2.4 1; }
  .rn-pic-card:hover .rn-ill-badge { rotate: -12deg; }
  .rn-pic-card:hover .rn-ill-phone { rotate: -6deg; }
}
.rn-ill-load b { transform-origin: left center; transition: scale 0.9s var(--rn-ease-out); }
.rn-ill-badge, .rn-ill-phone { transition: rotate 0.4s var(--rn-ease-out); }

/* Press-Rückmeldung auf allem, was klickbar ist */
.rn-hub-node a, .rn-hub-btn, .rn-cmp-cta .rn-btn, .rn-pairs-cta .rn-btn, .rn-adsband-cta .rn-btn,
.rn-consult-facts .rn-btn, .rn-svc-card { transition: scale 0.15s ease-out, background-color 0.2s ease, box-shadow 0.2s ease; }
.rn-hub-node a:active, .rn-hub-btn:active, .rn-cmp-cta .rn-btn:active, .rn-pairs-cta .rn-btn:active,
.rn-adsband-cta .rn-btn:active, .rn-consult-facts .rn-btn:active, .rn-svc-card:active { scale: 0.97; }
.rn-hub-node a:focus-visible, .rn-hub-btn:focus-visible { outline: 3px solid var(--rn-primary); outline-offset: 3px; }

/* ---------- Bewegung beim Scrollen (nur ohne Reduced Motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes rn-m-rise { from { opacity: 0; translate: 0 18px; } }
    @keyframes rn-m-grow-y { from { scale: 1 0; } }
    @keyframes rn-m-grow-x { from { scale: 0 1; } }
    @keyframes rn-m-pop { from { opacity: 0; scale: 0.6; } }

    /* Nur echte Abläufe erscheinen Schritt für Schritt, damit die Reihenfolge sichtbar wird */
    .rn-route-step, .rn-tl-step, .rn-prog-step, .rn-chev-step, .rn-pipe-step {
      animation: rn-m-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 60%;
    }

    /* Balken wachsen aus der Grundlinie */
    .rn-stack-spark span { transform-origin: bottom; animation: rn-m-grow-y linear both; animation-timeline: view(); animation-range: entry 30% cover 45%; }
    .rn-stack-spark span:nth-child(2) { animation-range: entry 34% cover 47%; }
    .rn-stack-spark span:nth-child(3) { animation-range: entry 38% cover 49%; }
    .rn-stack-spark span:nth-child(4) { animation-range: entry 42% cover 51%; }
    .rn-stack-spark span:nth-child(5) { animation-range: entry 46% cover 53%; }
    .rn-stack-spark span:nth-child(6) { animation-range: entry 50% cover 55%; }
    .rn-stack-spark span:nth-child(7) { animation-range: entry 54% cover 57%; }
    .rn-stack-spark span:nth-child(8) { animation-range: entry 58% cover 59%; }

    /* Fortschrittsbalken der Tracking-Schritte füllen sich */
    .rn-prog-bar::after { animation: rn-m-grow-x linear both; animation-timeline: view(); animation-range: entry 40% cover 50%; }

    /* Verbindungslinien zeichnen sich mit dem Scrollen */
    .rn-tl, .rn-stack, .rn-route { view-timeline: --rn-line block; }
    .rn-tl::before, .rn-stack::before { transform-origin: top; animation: rn-m-grow-y linear both; animation-timeline: --rn-line; animation-range: entry 40% cover 65%; }
    .rn-route::before { transform-origin: top left; animation: rn-m-grow-y linear both; animation-timeline: --rn-line; animation-range: entry 30% cover 55%; }
    @media (min-width: 900px) { .rn-route::before { animation-name: rn-m-grow-x; animation-range: entry 60% cover 45%; } }

    /* Webdesign + SEO: die beiden Kreise schieben sich zur Schnittmenge zusammen */
    @keyframes rn-m-from-left { from { translate: -40px 0; } }
    @keyframes rn-m-from-right { from { translate: 40px 0; } }
    .rn-venn-c--a { animation: rn-m-from-left linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    .rn-venn-c--b { animation: rn-m-from-right linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    .rn-venn-mid { animation: rn-m-pop linear both; animation-timeline: view(); animation-range: entry 60% cover 50%; }

    /* Punkte und Markierungen springen auf */
    .rn-anno-pin--on, .rn-alert-dot { animation: rn-m-pop linear both; animation-timeline: view(); animation-range: entry 30% entry 90%; }
  }

  /* Warnpunkt pulsiert kurz, endet nach drei Durchläufen */
  @keyframes rn-m-ping { 0% { box-shadow: 0 0 0 0 rgba(249,115,22,0.45); } 70%, 100% { box-shadow: 0 0 0 9px rgba(249,115,22,0); } }
  .rn-alert:hover .rn-alert-dot { animation: rn-m-ping 1.2s ease-out 3; }

  /* Hub: Tracking-Knoten pulsiert dreimal beim Hover über das Schaubild */
  @keyframes rn-m-ring { 0% { box-shadow: 0 0 0 0 rgba(26,190,245,0.45); } 100% { box-shadow: 0 0 0 18px rgba(26,190,245,0); } }
  .rn-hub:hover .rn-hub-node--core { animation: rn-m-ring 1.4s ease-out 3; }
}
