/* ==========================================================================
   aarecom AG – Animationen v2
   Glasfaser-Hero, Marquee, Reveals
   ========================================================================== */

/* ---------- Schweiz-Karte: Punktraster ---------- */
.sm-dots circle { opacity: .5; }
.sm-dots .sm-tw { animation: smTwinkle 7s ease-in-out infinite; }
@keyframes smTwinkle {
  0%, 100% { opacity: .3; }
  50%      { opacity: .95; }
}

/* Karten-Labels einblenden */
.sm-label {
  opacity: 0;
  animation: smFade .8s ease-out forwards;
  animation-delay: 1.4s;
}
@keyframes smFade { to { opacity: 1; } }

/* ---------- Glasfaser-Verbindungen (Karte) ---------- */
.sm-links path {
  stroke-width: 1.4;
  opacity: 0;
  stroke-linecap: round;
  animation: smLinkIn 1.2s ease-out forwards;
  animation-delay: .9s;
}
@keyframes smLinkIn { to { opacity: .38; } }

.sm-pulse {
  opacity: 0;
  animation: smPulseIn .5s ease-out forwards;
  animation-delay: 1.6s;
}
@keyframes smPulseIn { to { opacity: 1; } }

/* ---------- Stadt-Knoten ---------- */
.sm-node .sm-core { fill: #2563EB; }
.sm-node .sm-ring {
  fill: none;
  stroke: #2563EB;
  stroke-width: 1.5;
  opacity: .65;
  transform-box: fill-box;
  transform-origin: center;
  animation: smPing 3.2s cubic-bezier(0, 0, .35, 1) infinite;
}
.sm-node-hq .sm-core { fill: #7C3AED; }
.sm-node-hq .sm-ring { stroke: #7C3AED; animation-duration: 2.4s; }
@keyframes smPing {
  0%   { transform: scale(.6); opacity: .75; }
  70%  { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* ---------- Hero-Entrance: EINE Choreografie ----------
   0,0s Lichtraum steht → 0,2s Headline zeilenweise → 0,5s Subline/CTAs/Trust
   → 0,9s Logo zündet (Finale, --sig-t0) → danach Stille (nur Atmen + Hover) */
.hero-veil { animation: veilIn 1.2s ease-out forwards; }
@keyframes veilIn { to { opacity: 1; } }

/* Solange das Preloader-Intro läuft, wartet die Hero-Choreografie –
   sonst spielt sie unsichtbar hinter dem Overlay ab (Preloader-Logo ist NICHT in .hero) */
html.intro-lock .hero-copy > *,
html.intro-lock .hero .ht-w,
html.intro-lock .hero-veil,
html.intro-lock .hero .sig-dot,
html.intro-lock .hero .sig-word { animation-play-state: paused !important; }

.hero-map {
  opacity: 0;
  transform: translateY(14px) scale(.985);
  animation: heroRise .9s cubic-bezier(.2, .65, .3, 1) forwards;
  animation-delay: .25s;
}
.hero-copy > * {
  opacity: 0;
  transform: translateY(18px);
  animation: heroRise .8s cubic-bezier(.2, .65, .3, 1) forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: .1s; }
.hero-copy > *:nth-child(2) { animation-delay: .18s; }
.hero-copy > *:nth-child(3) { animation-delay: .48s; }
.hero-copy > *:nth-child(4) { animation-delay: .58s; }
.hero-copy > *:nth-child(5) { animation-delay: .7s; }
@keyframes heroRise {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Scroll-Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s cubic-bezier(.2, .65, .3, 1), transform .7s cubic-bezier(.2, .65, .3, 1);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s cubic-bezier(.2, .65, .3, 1), transform .6s cubic-bezier(.2, .65, .3, 1);
}
.reveal-stagger.in-view > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: .03s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: .09s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: .15s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: .21s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: .27s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: .33s; }
.reveal-stagger.in-view > *:nth-child(7) { transition-delay: .39s; }
.reveal-stagger.in-view > *:nth-child(8) { transition-delay: .45s; }

/* ---------- Live-Punkt ---------- */
.dot-live { animation: liveBlink 1.8s ease-in-out infinite; }
@keyframes liveBlink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
  50%      { opacity: .6; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0); }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy > *, .hero-map { animation: none; opacity: 1; transform: none; }
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
  .sm-dots .sm-tw, .sm-node .sm-ring, .dot-live { animation: none; }
  .sm-links path { animation: none; opacity: .38; }
  .sm-label { animation: none; opacity: 1; }
  .sm-pulses { display: none; }
  .hero-veil { animation: none; opacity: 1; }
  .feldband-track { animation: none; }
  .feldband-mask { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .hero-glow { display: none; }
  .service-card:hover, .btn:hover, .team-tile:hover img { transform: none; }
}

/* ==========================================================================
   Hero «Die Signatur» – Logo entsteht aus Licht (includes/logo-hero.php)
   ========================================================================== */
.sig-stage { position: relative; z-index: 2; min-width: 0; perspective: 900px; }
.sig-stage-mark { display: none; }
.sig-logo {
  width: 100%;
  height: auto;
  overflow: visible;
  --sig-t0: .9s; /* Zündung als Finale der Hero-Choreografie */
  will-change: transform;
}

.sig-dot {
  opacity: 0;
  transform: scale(.2);
  transform-box: fill-box;
  transform-origin: center;
  /* 1. Entstehen (einmalig) → 2. sanftes Atmen (endlos, Welle in Zündungsrichtung) */
  animation:
    sigDot .5s cubic-bezier(.2, .65, .3, 1) forwards,
    sigBreathe 4.6s ease-in-out infinite;
}
@keyframes sigDot {
  55%  { opacity: 1; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes sigBreathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.16); }
}

.sig-word {
  opacity: 0;
  transform: translateY(12px);
  transform-box: view-box;
  animation: sigWord .9s cubic-bezier(.2, .65, .3, 1) forwards;
  animation-delay: calc(var(--sig-t0) + 1.05s);
}
@keyframes sigWord {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sig-dot, .sig-word { animation: none !important; opacity: 1; transform: none; }
}





/* ---------- Danke-Seite: Check zeichnet sich ---------- */
.ck-ring {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ckDraw .9s cubic-bezier(.3, 0, .2, 1) forwards;
  animation-delay: .15s;
}
.ck-mark {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ckDraw .5s cubic-bezier(.3, 0, .2, 1) forwards;
  animation-delay: .9s;
}
@keyframes ckDraw { to { stroke-dashoffset: 0; } }
@keyframes ckPulse {
  0%   { transform: scale(1); opacity: .8; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ck-ring, .ck-mark { animation: none; stroke-dashoffset: 0; }
  .ck-pulse { animation: none; opacity: 0; }
}

/* ---------- Partner-Marquee (nur Mobile aktiv via responsive.css) ---------- */
@keyframes partnerMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - var(--s-3))); }
}
@media (prefers-reduced-motion: reduce) {
  .partner-track { animation: none; }
}


/* ==========================================================================
   Preloader: Logo-Intro in Fullscreen (nur Home, 1× pro Besuch)
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  background:
    radial-gradient(560px 400px at 82% 12%, rgba(14, 165, 233, .07), transparent 70%),
    radial-gradient(520px 380px at 10% 88%, rgba(124, 58, 237, .06), transparent 70%),
    linear-gradient(180deg, #FFFFFF 0%, #FBFCFE 100%);
  transition: opacity .65s ease, transform .65s cubic-bezier(.45, 0, .2, 1), visibility 0s .65s;
}
.preloader-logo {
  position: relative;
  width: min(88vw, 720px);
  animation: plZoom 2.6s cubic-bezier(.2, .65, .3, 1) forwards;
}
/* Licht-Bloom hinter dem Mark, wenn die Punkte zünden */
.preloader-logo::before {
  content: '';
  position: absolute;
  left: 12%;
  top: 43%;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.5);
  background: radial-gradient(circle,
    rgba(124, 58, 237, .22) 0%,
    rgba(37, 99, 235, .14) 42%,
    rgba(14, 165, 233, .08) 60%,
    transparent 72%);
  opacity: 0;
  animation: plBloom 1.9s ease-out forwards;
  animation-delay: .5s;
  pointer-events: none;
}
.preloader-logo .sig-logo {
  position: relative;
  --sig-t0: .35s; /* Intro startet flotter als im Hero */
}
@keyframes plZoom {
  from { transform: scale(.9); }
  to   { transform: scale(1); }
}
@keyframes plBloom {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55); }
}
.preloader--done {
  opacity: 0;
  transform: scale(1.035);
  visibility: hidden;
  pointer-events: none;
}
html.intro-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .preloader { display: none; }
}









/* ---------- Hero: Headline steigt zeilenweise aus der Maske ---------- */
.ht-w {
  /* 120%, damit das Wort auch unter der Unterlängen-Reserve der Maske startet */
  transform: translateY(120%);
  animation: htWord .75s cubic-bezier(.2, .65, .3, 1) forwards;
}
.ht-line:nth-child(1) .ht-w:nth-child(1) { animation-delay: .2s; }
.ht-line:nth-child(1) .ht-w:nth-child(2) { animation-delay: .28s; }
.ht-line:nth-child(2) .ht-w:nth-child(1) { animation-delay: .42s; }
.ht-line:nth-child(2) .ht-w:nth-child(2) { animation-delay: .5s; }
@keyframes htWord { to { transform: translateY(0); } }

.hero-cue span { animation: cueDot 1.8s cubic-bezier(.4, 0, .4, 1) infinite; }
@keyframes cueDot {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ht-w { animation: none; transform: none; }
  .hero-cue span { animation: none; }
}


