/* ============================================================
   HERO — Headline, CTAs, echte OSM-Karte (Leaflet) mit animierten
   Routen Phase 1 (chaos) → Phase 2 (clean).
   ============================================================ */

.hero {
  position: relative; overflow: hidden;
  padding: 48px 0 64px;
  background: var(--surface);
}
.hero__glow {
  position: absolute; top: -200px; right: -120px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(79,114,227,.10), transparent 70%);
  pointer-events: none;
}
.hero__inner {
  position: relative;
  max-width: 1200px; margin-inline: auto;
  padding-inline: 20px;
  display: grid; grid-template-columns: 1fr; gap: 40px;
  align-items: center;
}
.hero__copy .display {
  margin: 18px 0;
  font-size: clamp(30px, 6vw, 50px);
}
/* Canonical category line — sits between marketing lead and CTAs.
   Same wording across DE/EN/NL, so LLMs treat it as a stable
   category signal when summarizing what Trailo is. */
.hero__categories {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, .08);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text2);
  letter-spacing: .01em;
}
.hero__categories b {
  color: var(--text);
  font-weight: 700;
}

.hero__ctas {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 28px; margin-bottom: 12px;
}
.hero__friction {
  font-size: 13px; color: var(--text3); margin-bottom: 20px;
}

/* ─── Map / Animations-Container ──────────────────────────── */
.hero__viz { margin: 0; }
.map {
  position: relative;
  width: 100%; max-width: 640px;
  margin-inline: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--r3);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--sh-lg);
  overflow: hidden;
  display: flex;
  isolation: isolate;          /* Stacking-Context: Leaflet-Panes & Chips bleiben unter sticky Navbar */
}
.map__svg, .map__leaflet {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.map__leaflet { background: #f3f5f8; }
/* Leaflet-Standard-Attribution dezenter darstellen */
.map__leaflet .leaflet-control-attribution {
  font-size: 9px;
  background: rgba(255,255,255,.85);
  padding: 1px 6px;
}
.map__leaflet .leaflet-control-attribution a { color: var(--text3); }

/* Custom Marker (DivIcon) für Depots & Stopps */
.hm-depot { background: transparent !important; border: 0 !important; }
.hm-depot span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 22px;
  background: #1e293b; color: #fff;
  font: 700 10px/1 var(--font);
  border-radius: 4px;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.3);
}
.hm-stop { background: transparent !important; border: 0 !important; }
.hm-stop span {
  display: block; width: 10px; height: 10px;
  background: #1e293b; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.35);
}
.map__city {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  padding: 4px 10px; border-radius: 6px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  font-size: 10px; font-weight: 600; color: var(--text2);
  letter-spacing: .05em; text-transform: uppercase;
}
.map__phase {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  font-size: 11px; font-weight: 600;
  box-shadow: var(--sh-sm);
  transition: opacity .4s var(--ease);
}
.map__phase--chaos { color: var(--red); }
.map__phase--ai { color: var(--accent); opacity: 0; }

.map__stat {
  position: absolute; bottom: 12px; right: 12px; z-index: 5;
  padding: 8px 14px; border-radius: 10px;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--border);
  font-size: 12px; color: var(--text2);
  box-shadow: var(--sh-sm);
  display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  pointer-events: none;
}
.map__stat strong { color: var(--green); font-size: 18px; font-weight: 800; }

.map__panel { display: none; }

/* ─── Route-Animation: Phase 1 chaos → Phase 2 clean. Loop ~10s ─
   Pfadlänge wird per JS in CSS-Variable --len gesetzt (getTotalLength).
   Fallback 2000 falls JS noch nicht gelaufen ist. */
.route {
  stroke-dasharray: var(--len, 2000);
  stroke-dashoffset: var(--len, 2000);
  fill: none;
}
.route--chaos { animation: drawChaos 10s var(--ease) infinite; }
.route--clean { animation: drawClean 10s var(--ease) infinite; opacity: 0; }
.route--c1 { animation-delay: 0s; }
.route--c2 { animation-delay: .2s; }
.route--c3 { animation-delay: .4s; }
.route--c4 { animation-delay: .6s; }
.route--o1 { animation-delay: 4.6s; }
.route--o2 { animation-delay: 4.8s; }
.route--o3 { animation-delay: 5.0s; }
.route--o4 { animation-delay: 5.2s; }

@keyframes drawChaos {
  0%   { stroke-dashoffset: var(--len, 2000); opacity: .95; }
  18%  { stroke-dashoffset: 0;                opacity: .95; }
  40%  { stroke-dashoffset: 0;                opacity: .95; }
  46%  { stroke-dashoffset: 0;                opacity: 0; }
  100% { stroke-dashoffset: 0;                opacity: 0; }
}
@keyframes drawClean {
  0%   { stroke-dashoffset: var(--len, 2000); opacity: 0; }
  46%  { stroke-dashoffset: var(--len, 2000); opacity: 0; }
  47%  { opacity: .95; }
  65%  { stroke-dashoffset: 0;                opacity: .95; }
  92%  { stroke-dashoffset: 0;                opacity: .95; }
  100% { stroke-dashoffset: 0;                opacity: 0; }
}
.map__phase--chaos { animation: phaseChaos 10s linear infinite; }
.map__phase--ai     { animation: phaseAI 10s linear infinite; }
.map__stat          { animation: statShow 10s linear infinite; }
@keyframes phaseChaos {
  0%, 44% { opacity: 1; }
  46%, 100% { opacity: 0; }
}
@keyframes phaseAI {
  0%, 46% { opacity: 0; }
  48%, 95% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes statShow {
  0%, 60% { opacity: 0; transform: translateY(6px); }
  62%, 95% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(6px); }
}

/* Reduced-motion: stop in optimised state, no looping draw */
@media (prefers-reduced-motion: reduce) {
  .route--chaos { display: none; }
  .route--clean {
    stroke-dashoffset: 0;
    opacity: .95;
    animation: none;
  }
  .map__phase--chaos { display: none; }
  .map__phase--ai { opacity: 1; animation: none; }
  .map__stat { opacity: 1; transform: none; animation: none; }
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (min-width: 640px) {
  .hero { padding: 56px 0 72px; }
  .hero__inner { padding-inline: 24px; }
}
@media (min-width: 768px) {
  .hero { padding: 72px 0 88px; }
  .hero__copy .display { margin: 20px 0; }
}
@media (min-width: 1024px) {
  .hero { padding: 96px 0 112px; }
  .hero__inner { grid-template-columns: 1fr 1fr; gap: 56px; }
  .map__panel {
    display: flex; flex-direction: column; gap: 8px;
    flex: 0 0 35%;
    margin-left: auto;     /* an Main-Axis-Ende drücken, sonst overlap mit absolute Leaflet */
    position: relative;    /* eigener Stacking-Context, über Leaflet */
    z-index: 1;
    background: #fff;
    border-left: 1px solid var(--border);
    padding: 14px;
    min-width: 0;
  }
  .map__svg, .map__leaflet { width: 65%; right: auto; }
  /* Chips/Stat dürfen nicht über das Panel rutschen — innerhalb 65%-Map-Bereich halten */
  .map__city { right: calc(35% + 12px); }
  .map__stat { right: calc(35% + 12px); }
  .map__panel-h { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; }
  .map__panel ul { display: flex; flex-direction: column; gap: 6px; }
  .map__panel ul li {
    padding: 6px 8px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
  }
  .map__panel ul li > div { line-height: 1.35; }
  .map__panel ul li > span:first-child {
    width: 5px; height: 30px; border-radius: 3px; flex-shrink: 0;
  }
  .map__panel ul li b { font-size: 11px; font-weight: 600; color: var(--text); display: block; }
  .map__panel ul li em { font-size: 10px; color: var(--text3); font-style: normal; display: block; }
  .map__panel-foot {
    margin-top: auto;
    padding: 8px 10px; border-radius: 8px;
    background: var(--accent-tint-2);
    border: 1px solid rgba(79,114,227,.2);
    font-size: 11px; color: var(--accent); font-weight: 600;
  }
}
