/* =========================================================================
   Sektion „Erst sprechen. Dann entscheiden.“ – AutomaNext im Apple-Design
   Nutzt die globalen Tokens der Seite, wenn vorhanden, sonst eigene Fallbacks.
   Alle Klassen sind mit „es-“ präfixiert und kollidieren nicht mit der Seite.
   ========================================================================= */

erst-sprechen {
  --es-blue: var(--blue, #1735ff);
  --es-blue-hover: var(--blue-hover, #2b47ff);
  --es-blue-active: var(--blue-active, #102bdb);
  --es-violet: #7b5cff;
  --es-green: #30d158;
  --es-text: var(--text, #1d1d1f);
  --es-text-secondary: var(--text-secondary, #6e6e73);
  --es-chip-bg: var(--bg-light, #f5f5f7);
  --es-font-display: var(--font-display, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif);
  --es-font-text: var(--font-text, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif);
  --es-ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  display: block;
}

erst-sprechen *,
erst-sprechen *::before,
erst-sprechen *::after {
  box-sizing: border-box;
}

.es {
  position: relative;
  overflow: hidden;
  padding: 140px 40px 150px;
  background: #fff;
  font-family: var(--es-font-text);
  color: var(--es-text);
  -webkit-font-smoothing: antialiased;
}

/* Dezenter Lichtschein in Markenfarbe hinter dem Foto */
.es::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 45% 60% at 78% 50%, rgba(23, 53, 255, 0.07), rgba(23, 53, 255, 0) 70%);
  pointer-events: none;
}

.es-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(56px, 7vw, 96px);
  max-width: 1180px;
  margin: 0 auto;
}

/* ---------- Typografie ---------- */

.es-eyebrow {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.23536;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--es-blue);
}

.es-headline {
  margin: 0;
  font-family: var(--es-font-display);
  font-size: clamp(46px, 4.8vw, 64px);
  line-height: 1.0625;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.es-line {
  display: block;
  width: fit-content;
}

.es-line--accent {
  padding-bottom: 0.06em;
  background-image: linear-gradient(90deg, var(--es-blue) 0%, var(--es-violet) 50%, var(--es-blue) 100%);
  background-size: 200% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.es.is-visible .es-line--accent {
  animation: es-sweep 2.4s var(--es-ease) 0.45s both;
}

@keyframes es-sweep {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: 0 0;
  }
}

.es-text {
  max-width: 520px;
  margin: 24px 0 0;
  font-size: 21px;
  line-height: 1.381;
  letter-spacing: 0.011em;
  color: var(--es-text-secondary);
  text-wrap: pretty;
}

/* ---------- Button ---------- */

.es-actions {
  margin-top: 36px;
}

.es-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 980px;
  background: var(--es-blue);
  font-size: 17px;
  line-height: 1.17648;
  letter-spacing: -0.022em;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.2s linear, transform 0.2s var(--es-ease);
}

.es-cta:hover {
  background: var(--es-blue-hover);
  text-decoration: none;
}

.es-cta:active {
  background: var(--es-blue-active);
  transform: scale(0.98);
}

.es-cta:focus-visible {
  outline: 3px solid rgba(23, 53, 255, 0.45);
  outline-offset: 3px;
}

.es-cta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s var(--es-ease);
}

.es-cta:hover svg {
  transform: translateX(3px);
}

/* ---------- Vorteile ---------- */

.es-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.es-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border-radius: 980px;
  background: var(--es-chip-bg);
  font-size: 14px;
  line-height: 1.28577;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--es-text);
}

.es-check svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.es-check svg circle {
  fill: var(--es-blue);
}

.es-check svg path {
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Foto ---------- */

.es-media {
  position: relative;
}

.es-photo {
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 32px;
  background: #e8e8ed;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.35);
  /* Hält die runden Ecken beim Zoomen des Bildes in Safari stabil */
  isolation: isolate;
}

.es-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 72%;
  transform: scale(1.08);
  transition: transform 1.8s var(--es-ease);
}

.es.is-visible .es-photo img {
  transform: scale(1);
}

/* ---------- Gesprächskarte ---------- */

.es-call {
  position: absolute;
  left: -56px;
  bottom: 44px;
  width: 300px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: opacity 0.9s var(--es-ease) 0.7s, transform 0.9s var(--es-ease) 0.7s;
}

.es-call-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.es-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--es-blue), var(--es-violet));
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

.es-call-person {
  flex: 1 1 auto;
  min-width: 0;
}

.es-call-person strong,
.es-call-person small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.es-call-person strong {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.es-call-person small {
  margin-top: 1px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--es-text-secondary);
}

.es-call-phone {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--es-green);
}

.es-call-phone svg {
  width: 17px;
  height: 17px;
  fill: #fff;
}

.es-call-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.es-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.es-wave i {
  width: 3px;
  height: calc(var(--h) * 20px);
  border-radius: 2px;
  background: var(--es-blue);
  opacity: 0.85;
  transform-origin: center;
}

.es.is-visible .es-wave i {
  animation: es-wave 1.2s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.13s);
}

@keyframes es-wave {
  from {
    transform: scaleY(0.35);
  }

  to {
    transform: scaleY(1);
  }
}

.es-call-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.33337;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--es-text-secondary);
  white-space: nowrap;
}

.es-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--es-green);
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.2);
}

/* ---------- Sprechblase ---------- */

.es-bubble {
  position: absolute;
  top: 44px;
  right: -28px;
  display: flex;
  gap: 6px;
  padding: 16px 20px;
  border-radius: 22px 22px 22px 6px;
  background: linear-gradient(135deg, var(--es-blue), var(--es-violet));
  box-shadow: 0 20px 40px -18px rgba(23, 53, 255, 0.55);
  transition: opacity 0.9s var(--es-ease) 0.95s, transform 0.9s var(--es-ease) 0.95s;
}

.es-bubble i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.45;
}

.es.is-visible .es-bubble i {
  animation: es-typing 1.4s ease-in-out infinite;
}

.es.is-visible .es-bubble i:nth-child(2) {
  animation-delay: 0.18s;
}

.es.is-visible .es-bubble i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes es-typing {
  0%,
  60%,
  100% {
    opacity: 0.45;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.es:not(.is-visible) .es-call,
.es:not(.is-visible) .es-bubble {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
}

/* ---------- Einblenden beim Scrollen ---------- */

.es-reveal {
  transition: opacity 0.9s var(--es-ease), transform 0.9s var(--es-ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}

.es:not(.is-visible) .es-reveal {
  opacity: 0;
  transform: translateY(28px);
}

/* ---------- Responsive ---------- */

@media (max-width: 1068px) {
  .es {
    padding: 110px 40px 120px;
  }

  .es-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 64px;
    max-width: 640px;
    text-align: center;
  }

  .es-line {
    margin: 0 auto;
  }

  .es-headline {
    font-size: 56px;
    line-height: 1.07143;
    letter-spacing: -0.005em;
  }

  .es-text {
    margin-inline: auto;
  }

  .es-checks {
    justify-content: center;
  }

  .es-media {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
  }

  .es-call {
    left: -40px;
    text-align: left;
  }

  .es-bubble {
    right: -24px;
  }
}

@media (max-width: 734px) {
  .es {
    padding: 88px 22px 96px;
  }

  .es-inner {
    gap: 48px;
  }

  .es-eyebrow {
    margin-bottom: 10px;
    font-size: 15px;
  }

  .es-headline {
    font-size: clamp(32px, 9.6vw, 40px);
    line-height: 1.1;
    letter-spacing: 0;
  }

  .es-text {
    margin-top: 18px;
    font-size: 17px;
    line-height: 1.47059;
    letter-spacing: -0.022em;
  }

  .es-actions {
    margin-top: 28px;
  }

  .es-cta {
    padding: 12px 22px;
    font-size: 15px;
  }

  .es-checks {
    margin-top: 24px;
  }

  .es-photo {
    border-radius: 24px;
  }

  /* Karten bleiben auf schmalen Displays innerhalb des Fotos */
  .es-call {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    padding: 12px 12px 10px;
    border-radius: 18px;
  }

  .es-bubble {
    top: 16px;
    right: 16px;
    padding: 13px 16px;
  }
}

/* ---------- Reduzierte Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  .es-reveal,
  .es-call,
  .es-bubble,
  .es-photo img,
  .es-cta,
  .es-cta svg {
    transition: none;
  }

  .es:not(.is-visible) .es-reveal,
  .es:not(.is-visible) .es-call,
  .es:not(.is-visible) .es-bubble {
    opacity: 1;
    transform: none;
  }

  .es-photo img {
    transform: none;
  }

  .es.is-visible .es-bubble i,
  .es.is-visible .es-wave i,
  .es.is-visible .es-line--accent {
    animation: none;
  }

  .es-line--accent {
    background-position: 0 0;
  }
}
