/* ============================================================================
   HERO POLISH — Surgical refinements on top of viz.css + mobile-premium.css
   Scope: ONLY the homepage hero section (.hero-stage--polished).
   Loaded AFTER mobile-premium.css to ensure overrides win cascade ties.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1) Vertical breathing + background depth
   --------------------------------------------------------------------------- */
.hero-stage--polished {
  /* a touch more breathing room at the bottom for the scroll indicator */
  padding-bottom: clamp(80px, 9vw, 140px);
  /* Slightly warmer cream finish to feel "Swiss premium" rather than blue-grey */
  background:
    radial-gradient(circle at 10% 6%, rgba(220, 0, 24, 0.07), transparent 38%),
    radial-gradient(circle at 92% 14%, rgba(15, 23, 42, 0.045), transparent 30%),
    radial-gradient(circle at 50% 102%, rgba(220, 0, 24, 0.085), transparent 44%),
    linear-gradient(180deg, #fdfdfd 0%, #f5f6f8 100%);
}

/* ---------------------------------------------------------------------------
   2) Pill — slightly more refined, with separator dot
   --------------------------------------------------------------------------- */
.hero-stage--polished .hero-stage__pill {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(220, 0, 24, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 6px 18px rgba(15, 23, 42, 0.06);
}
.hero-stage--polished .hero-stage__pill-sep {
  opacity: 0.45;
  margin: 0 2px;
}

/* ---------------------------------------------------------------------------
   3) Headline rhythm — tighter kerning, balanced wrap, line-by-line reveal
   --------------------------------------------------------------------------- */
.hero-stage--polished .hero-stage__title {
  letter-spacing: -0.048em;
  line-height: 0.92;
  text-wrap: balance;
  /* keep desktop power but trim the very top size a hair for refinement */
  font-size: clamp(38px, 5.4vw, 72px);
}
.hero-stage--polished .hero-stage__title-line {
  display: block;
}
/* The accent line gets a touch more visual weight from a soft underglow */
.hero-stage--polished .hero-stage__title .accent {
  position: relative;
  padding-bottom: 0.04em;
}
.hero-stage--polished .hero-stage__title .accent::after {
  content: '';
  position: absolute;
  left: 0;
  right: 22%;
  bottom: 0.06em;
  height: 2px;
  background: linear-gradient(90deg, rgba(220, 0, 24, 0.55), rgba(220, 0, 24, 0));
  border-radius: 999px;
  transform-origin: left center;
  transform: scaleX(0);
  animation: heroAccentDraw 1.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards;
}
@keyframes heroAccentDraw {
  to { transform: scaleX(1); }
}

/* ---------------------------------------------------------------------------
   4) Lead — slightly larger weight, restrained colour, max-width tuned
   --------------------------------------------------------------------------- */
.hero-stage--polished .hero-stage__lead {
  margin-top: 22px;
  max-width: 40rem;
  color: var(--viz-text-2);
  font-weight: 500;
  line-height: 1.62;
}
.hero-stage--polished .hero-stage__lead strong {
  font-weight: 700;
  color: var(--viz-text);
  /* subtle red underline on key words to anchor the eye */
  background-image: linear-gradient(transparent 92%, rgba(220, 0, 24, 0.22) 92%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0 1px;
}

/* ---------------------------------------------------------------------------
   5) Stat cards — qualitative variant (no invented numbers)
   --------------------------------------------------------------------------- */
.hero-stat--qual {
  /* Refined glass: slightly brighter, sharper border */
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 14px 36px rgba(15, 23, 42, 0.07);
  transition: transform 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.35s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.hero-stat--qual:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 22px 50px rgba(15, 23, 42, 0.1);
}
.hero-stat__qual-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.hero-stat__qual-value {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--viz-text);
}
.hero-stat__qual-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(220, 0, 24, 0.08);
  color: var(--viz-red);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   6) CTAs — clearer hierarchy, two-row layout when needed
   --------------------------------------------------------------------------- */
.hero-stage--polished .hero-stage__ctas {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  margin-top: 36px;
}
.hero-stage--polished .hero-stage__ctas-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.hero-stage--polished .btn-pill--primary {
  /* a hair taller, more presence */
  min-height: 54px;
  padding: 15px 30px;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  box-shadow:
    0 14px 30px rgba(220, 0, 24, 0.28),
    0 2px 0 rgba(255, 255, 255, 0.25) inset;
}
.hero-stage--polished .btn-pill__arrow {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  transition: transform 0.3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.hero-stage--polished .btn-pill--primary:hover .btn-pill__arrow {
  transform: translateX(4px);
}

/* Secondary AI button — quieter glass pill in this context */
.sm-chat-trigger--hero {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 18px 12px 14px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  min-height: 48px;
}
.sm-chat-trigger--hero:hover {
  background: rgba(15, 23, 42, 0.96);
  color: white;
  border-color: rgba(15, 23, 42, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
}

/* ---------------------------------------------------------------------------
   7) Trust block — refined brand dots + cleaner type
   --------------------------------------------------------------------------- */
.hero-stage--polished .hero-stage__trust {
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.trust-avatars--brand > * {
  width: 32px;
  height: 32px;
  font-size: 9.5px;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
.trust-avatars--brand > * + * { margin-left: -8px; }
.hero-stage--polished .trust-text strong {
  font-size: 12.5px;
  letter-spacing: -0.005em;
  color: var(--viz-text);
}
.hero-stage--polished .trust-text span {
  font-size: 11px;
  color: var(--viz-text-3);
  letter-spacing: 0.04em;
}
.trust-text__sep {
  opacity: 0.45;
  margin: 0 1px;
}

/* ---------------------------------------------------------------------------
   8) 3D scene — desktop refinement (more breathing space for floats)
   --------------------------------------------------------------------------- */
@media (min-width: 1101px) {
  .hero-stage--polished .scene3d {
    /* Pull cards slightly tighter so they don't clip outside the column */
    max-width: 580px;
  }
  .hero-stage--polished .scene3d__float--tl { top: 4%; left: -2%; }
  .hero-stage--polished .scene3d__float--tr { top: 10%; right: -3%; }
  .hero-stage--polished .scene3d__float--bl { bottom: 12%; left: -3%; }
  .hero-stage--polished .scene3d__float--br { bottom: 2%; right: 4%; }
}

/* ---------------------------------------------------------------------------
   9) Mobile (≤640px) — additional safeguards on top of mobile-premium.css
       mobile-premium.css already converts to a 2×2 bento. We:
        - hide TWO of the four cards (--tr + --br) to keep just 2 tiles
        - widen the remaining two so they read as primary trust signals
   --------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Keep visual scene snug to the headline area */
  .hero-stage--polished .scene3d {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-stage--polished .scene3d__canvas {
    grid-column: 1;
    grid-row: 1;
    max-width: 260px;
  }
  /* MOBILE: drastisch entrümpelt — nur EIN Indikator-Float-Card (Live 24/7).
     Alle anderen Floats inkl. die "Pipeline In Bewegung"-Karte sind redundant
     auf Mobile (Overload). */
  .hero-stage--polished .scene3d__float--bl,
  .hero-stage--polished .scene3d__float--br,
  .hero-stage--polished .scene3d__float--tl {
    display: none !important;
  }
  /* Nur LIVE 24/7 als Indikator behalten — full-width pill */
  .hero-stage--polished .scene3d__float--tr {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }
  /* Trust-Strip mit SM/CR/AI Avatars + CRM·Funnel-Chips ist auf Mobile
     visueller Lärm — auf Desktop bleibt's sichtbar. */
  .hero-stage--polished .hero-stage__trust {
    display: none !important;
  }

  /* CTAs on mobile: primary full-width, secondary trust below */
  .hero-stage--polished .hero-stage__ctas {
    gap: 16px;
    margin-top: 28px;
  }
  .hero-stage--polished .hero-stage__ctas-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .hero-stage--polished .hero-stage__ctas-row .btn-pill,
  .hero-stage--polished .hero-stage__ctas-row .sm-chat-trigger--hero {
    width: 100%;
    justify-content: center;
  }
  .hero-stage--polished .hero-stage__trust {
    width: 100%;
    justify-content: flex-start;
    padding: 10px 14px 10px 10px;
  }

  /* Headline — single accent line, no underline animation on tiny phones */
  .hero-stage--polished .hero-stage__title .accent::after { display: none; }

  /* Stat cards on mobile: stack and tighten */
  .hero-stage--polished .hero-stage__stats {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .hero-stat__qual-value { font-size: 19px; }
  .hero-stat__qual-icon  { width: 28px; height: 28px; }
}

/* Very small phones — single column stat cards so values never crunch */
@media (max-width: 380px) {
  .hero-stage--polished .hero-stage__stats {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------------------
   10) Section transition — subtle scroll indicator + red glow seam
   --------------------------------------------------------------------------- */
.hero-stage--polished .hero-stage__seam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 160px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(220, 0, 24, 0.10), transparent 60%),
    linear-gradient(180deg,
      transparent 0%,
      rgba(251, 251, 253, 0.4) 55%,
      rgba(251, 251, 253, 0.95) 100%);
  z-index: 1;
}

.hero-stage--polished .hero-stage__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 3vw, 32px);
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: var(--viz-text);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 0.3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
              box-shadow 0.3s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.hero-stage--polished .hero-stage__scroll:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}
.hero-stage--polished .hero-stage__scroll-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--viz-red);
  color: white;
  animation: heroScrollBounce 2.4s ease-in-out infinite;
}
@keyframes heroScrollBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

/* Hide scroll indicator on tiny phones where vertical space matters */
@media (max-width: 380px) {
  .hero-stage--polished .hero-stage__scroll-label { display: none; }
  .hero-stage--polished .hero-stage__scroll {
    padding: 9px;
  }
}

/* ---------------------------------------------------------------------------
   11) Reduced motion — disable all decorative animation
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .hero-stage--polished .hero-stage__title .accent::after,
  .hero-stage--polished .hero-stage__scroll-chevron {
    animation: none;
  }
  .hero-stage--polished .hero-stage__title .accent::after {
    transform: scaleX(1);
  }
}

/* ---------------------------------------------------------------------------
   12) MOBILE Hero → Section 2 Übergang Polish (≤640px)
   Sorgt für sanften, premium-fühligen Übergang zwischen Hero und nächstem Block.
   --------------------------------------------------------------------------- */
@media (max-width: 640px) {
  /* Hero unten weniger Abstand — auf Mobile zählt jeder Pixel */
  .hero-stage--polished {
    padding-bottom: 0 !important;
    position: relative;
  }
  /* Seam wird größer + stärker auf Mobile, blendet bis full opaque white */
  .hero-stage--polished .hero-stage__seam {
    height: 220px;
    background:
      radial-gradient(ellipse 120% 60% at 50% 110%, rgba(220, 0, 24, 0.08), transparent 60%),
      linear-gradient(180deg,
        transparent 0%,
        rgba(251, 251, 253, 0.3) 30%,
        rgba(251, 251, 253, 0.7) 60%,
        rgba(251, 251, 253, 1) 100%);
  }

  /* Scroll-Pill: schmaler, näher an unterer Section, sitzt auf dem Seam */
  .hero-stage--polished .hero-stage__scroll {
    bottom: 28px;
    padding: 8px 12px 8px 14px;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    z-index: 6;
    box-shadow:
      0 8px 22px rgba(15, 23, 42, 0.08),
      0 0 0 1px rgba(255, 255, 255, 0.7);
  }
  .hero-stage--polished .hero-stage__scroll-chevron {
    width: 20px;
    height: 20px;
  }

  /* Die nächste Section direkt unter Hero: weniger top-padding,
     damit der "Empty-Space"-Effekt verschwindet. */
  .hero-stage--polished + section.scene-section,
  .hero-stage--polished + .stage {
    padding-top: clamp(28px, 6vw, 56px);
    position: relative;
  }

  /* Optional: kleine "Spike" am Anfang der nächsten Section — bringt visuellen
     Anker, der den Übergang als bewusst designed erscheinen lässt. */
  .hero-stage--polished + section.scene-section::before,
  .hero-stage--polished + .stage::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    width: 48px; height: 48px;
    border-radius: 50%;
    background:
      radial-gradient(circle at 30% 30%, #ff4d6d, var(--viz-red, #DC0018) 65%, #8a000f);
    box-shadow:
      0 0 0 8px rgba(255, 255, 255, 1),
      0 8px 22px rgba(220, 0, 24, 0.32),
      0 0 32px rgba(220, 0, 24, 0.18);
    z-index: 5;
    animation: heroSpikePulse 3.2s ease-in-out infinite;
  }
  @keyframes heroSpikePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50%      { transform: translate(-50%, -50%) scale(1.08); }
  }

  /* Bottom-Pills im Hero (LIVE 24/7, Pipeline-Status) sollen NICHT
     direkt am Übergangs-Rand kleben. */
  .hero-stage--polished .scene3d {
    padding-bottom: 70px;
  }

  /* Reduce-Motion: spike statisch */
  @media (prefers-reduced-motion: reduce) {
    .hero-stage--polished + section.scene-section::before,
    .hero-stage--polished + .stage::before { animation: none; }
  }
}

/* Sehr kleine Geräte: spike noch kleiner */
@media (max-width: 380px) {
  .hero-stage--polished + section.scene-section::before,
  .hero-stage--polished + .stage::before {
    width: 40px; height: 40px;
  }
  .hero-stage--polished .hero-stage__seam {
    height: 180px;
  }
}
