/* =============================================================
   FEATURE SECTIONS
   Drei Hauptfunktionen untereinander, Handy abwechselnd links und rechts.
   Auf dem Handy steht immer erst der Text, dann das Bild.
   ============================================================= */

.feature {
  background: var(--color-bg, #fff);
  padding: 24px 0;
  overflow-x: hidden;
  overflow-x: clip; /* nur seitlich: Die Partikel duerfen ueber die Section nach oben hinaus */
}

.feature--first {
  padding-top: 72px;
}

.feature--last {
  padding-bottom: 72px;
}

.feature__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}

.feature__visual {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

.feature__media {
  display: block;
  width: 100%;
  height: auto;
}

.feature--reverse .feature__visual {
  order: 2;
}

/* Liegt hinter dem Handy-Bild und reicht darueber hinaus. Lage des Felds: js/feature-particles.js */
.feature__particles {
  position: absolute;
  z-index: -1;
  top: -14%;
  left: -3.2%;
  width: 106.4%;
  height: 90%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 10%);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 10%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

/* Themen-Icons auf der Kante des Handys: Lage und Groesse in Anteilen des Bilds, skalieren also mit.
   Sie liegen in derselben Ebene wie das Display des Mockups. Aus dessen Ecken (composite.py) folgt:
   Die Senkrechten bleiben senkrecht, die Breite ist um 8 % gestaucht (entspricht 23 Grad Drehung),
   und die Waagerechten laufen auf einen Fluchtpunkt rechts bei x = 10,8 Bildbreiten, y = 47 % zu.
   --topic-tilt ist die Neigung dorthin vom jeweiligen Icon aus; wer es verschiebt, rechnet sie neu. */
.feature__topic {
  position: absolute;
  left: var(--topic-x);
  top: var(--topic-y);
  width: var(--topic-size);
  height: auto;
  transform: translate(-50%, -50%) skewY(var(--topic-tilt)) scaleX(0.92);
}

/* Beispielfragen um das Coach-Handy, im Stil der Nutzer-Nachrichten auf dem Bild. Selbe Ebene wie die Icons. */
.feature__question {
  position: absolute;
  left: var(--topic-x);
  top: var(--topic-y);
  width: 38%;
  padding: 0.75em 1em;
  border-radius: 1.3em;
  background: linear-gradient(to bottom, #f0f7ff, #e0eefd);
  /* Wie die Icons der App: heller Schein von innen und helle Oberkante, dazu ein leichter blauer Schatten */
  box-shadow:
    inset 0 2px 6px rgba(255, 255, 255, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(60, 102, 191, 0.1),
    0 6px 14px rgba(60, 102, 191, 0.1),
    0 1px 2px rgba(60, 102, 191, 0.08);
  color: #3c66bf;
  font-size: 13px;
  line-height: 1.35;
  text-wrap: balance;
  transform: translate(-50%, -50%) skewY(var(--topic-tilt)) scaleX(0.92);
}

/* Die Lage folgt dem Chat auf dem Bild: nur auf Flaechen ohne Nachricht, damit kein Text verdeckt wird */
.feature__question--first {
  --topic-x: 9%;
  --topic-y: 21%;
  --topic-tilt: 2.4deg;
  --float-time: 4.7s;
  --float-delay: -1.7s;
}

.feature__question--second {
  --topic-x: 94%;
  --topic-y: 62.5%;
  --topic-tilt: -1.5deg;
  --float-time: 5.5s;
  --float-delay: -4.3s;
}

.feature__question--third {
  --topic-x: 7%;
  --topic-y: 80%;
  --topic-tilt: -3deg;
  --float-time: 4.3s;
  --float-delay: -2.9s;
}

/* Zwei Spalten, aber wenig Rand links: Die linken Fragen ruecken aufs Handy, statt abgeschnitten zu werden */
@media (max-width: 1100px) {
  .feature__question--first {
    --topic-x: 13%;
  }

  .feature__question--third {
    --topic-x: 13.5%;
  }
}

/* Dezent: je 5px hin und her, in eigenem Takt. translate statt transform, das haelt die Perspektive */
@keyframes feature-float {
  from {
    translate: 0 -5px;
  }

  to {
    translate: 0 5px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .feature__topic,
  .feature__question {
    animation: feature-float var(--float-time) ease-in-out var(--float-delay) infinite alternate;
  }
}

@supports (width: 1cqw) {
  .feature__visual {
    container-type: inline-size;
  }

  /* 420cqw: Abstand, bei dem 23 Grad Drehung genau auf den Fluchtpunkt fuehren */
  .feature__topic,
  .feature__question {
    transform: translate(-50%, -50%) skewY(var(--topic-tilt)) perspective(420cqw) rotateY(23deg);
  }

  .feature__question {
    font-size: max(11px, 3.1cqw);
  }
}

.feature__topic--sleep {
  --topic-x: 14%;
  --topic-y: 24%;
  --topic-size: 20%;
  --topic-tilt: 2.1deg;
  --float-time: 4.1s;
  --float-delay: -3.1s;
}

.feature__topic--relaxation {
  --topic-x: 83%;
  --topic-y: 56%;
  --topic-size: 15%;
  --topic-tilt: -0.9deg;
  --float-time: 5.7s;
  --float-delay: -2.2s;
}

.feature__topic--confidence {
  --topic-x: 15%;
  --topic-y: 80%;
  --topic-size: 18%;
  --topic-tilt: -3deg;
  --float-time: 4.6s;
  --float-delay: -4.6s;
}

.feature__copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.feature__headline {
  margin-bottom: 20px;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.feature__body {
  margin-bottom: 28px;
  color: var(--color-text-muted, #6b6b6b);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.feature__body strong {
  color: var(--color-text, #000);
  font-weight: 600;
}

.feature__body mark {
  background: #fbf3c4;
  color: var(--color-text, #000);
  border-radius: 3px;
  padding: 0.05em 0.15em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.feature__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
}

.feature__item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--color-text-muted, #6b6b6b);
  font-size: 1rem;
  line-height: 1.4;
}

.feature__item strong {
  color: var(--color-text, #000);
  font-weight: 600;
}

.feature__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.feature__icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature__icon--violet {
  background: #e9e8ff;
  color: #5b5ce6;
}

.feature__icon--pink {
  background: #ffe6e6;
  color: #e5484d;
}

.feature__icon--green {
  background: #dff5e3;
  color: #2f9e52;
}

.feature__icon--orange {
  background: #ffeadb;
  color: #e8682a;
}

.feature__icon--blue {
  background: #dfeeff;
  color: #1e7fdc;
}

@media (max-width: 800px) {
  .feature {
    padding: 32px 0;
  }

  .feature--first {
    padding-top: 64px;
  }

  .feature--last {
    padding-bottom: 48px;
  }

  .feature__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .feature__copy {
    order: 1;
  }

  /* Das Bild hat viel transparenten Rand: breiter als die Spalte, damit das Handy gross wirkt */
  .feature__visual,
  .feature--reverse .feature__visual {
    order: 2;
    justify-self: center;
    width: min(94%, 390px);
    max-width: none;
    margin-inline: 0; /* mit auto wuerde das breitere Bild links anliegen statt mittig stehen */
  }

  /* Das Handy fuellt hier fast die Breite, daneben ist kein Platz: eine Frage ueber, zwei unter dem Chat */
  .feature__question {
    width: 42%;
  }

  .feature--last .feature__inner {
    gap: 40px; /* Luft zwischen Liste und der oberen Frage */
  }

  .feature__question--first {
    --topic-x: 23%;
    --topic-y: 3.5%;
    --topic-tilt: 4deg;
  }

  .feature__question--second {
    --topic-x: 77%;
    --topic-y: 89%;
    --topic-tilt: -4deg;
  }

  .feature__question--third {
    --topic-x: 23%;
    --topic-y: 90%;
    --topic-tilt: -4deg;
  }
}
