/* ============================================================
   AWHI — Experience Layer (nur Startseite)
   Signatur: die Linie der Genesung — ein Koru, der sich beim
   Scrollen entrollt. CI unverändert: Terracotta/Cream, Inter/DM Sans.
   Alle Bewegung wird per JS gesetzt (kein Inhalt ist ohne JS
   versteckt); dieser Layer liefert Layout + Zustände.
   ============================================================ */

/* ---------- Lenis (smooth scroll) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Preloader ---------- */
.xp-loader {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--cream);
  display: grid;
  place-items: center;
  /* Sicherheitsnetz: blendet sich auch ohne JS nach 2,4s aus */
  animation: xpLoaderSafety 0.6s ease 2.4s forwards;
}
.no-js .xp-loader { display: none; }
@media (prefers-reduced-motion: reduce) { .xp-loader { display: none; } }
.xp-loader svg { width: 84px; height: 84px; color: var(--terracotta); overflow: visible; }
.xp-loader-path {
  stroke: currentColor;
  stroke-width: 9;
  fill: none;
  stroke-linecap: round;
}
@keyframes xpLoaderSafety { to { opacity: 0; visibility: hidden; } }

/* ---------- Header: sanftes Verstecken beim Runterscrollen ---------- */
.site-header { transition: transform 0.5s var(--ease-out), background-color 0.3s ease, box-shadow 0.3s ease; }
.site-header.nav-hidden { transform: translateY(-110%); }

/* ---------- Custom Cursor (nur Desktop, dezent) ---------- */
.xp-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--terracotta-deep);
  border-radius: 50%;
  pointer-events: none;
  z-index: 500;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.3s ease, border-color 0.25s ease;
}
.xp-cursor.is-visible { opacity: 0.4; }
.xp-cursor.is-hover { width: 54px; height: 54px; opacity: 0.75; }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .xp-cursor { display: none; }
}

/* ---------- Die Linie der Genesung ---------- */
.xp-line { position: absolute; pointer-events: none; color: var(--terracotta); }
.xp-line-path {
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  opacity: 0.55;
}

/* ============================================================
   HERO
   ============================================================ */
.xp-hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-block: 0;
}
.xp-hero-container { position: relative; z-index: 2; }
.xp-hero-inner { max-width: 62rem; padding-block: 7rem 5rem; }

.xp-hero-eyebrow { margin-bottom: var(--space-md); }

.xp-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 9.2vw, 6.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin: 0 0 var(--space-lg);
  color: var(--ink);
}
.xp-mask { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.xp-maskline { display: inline-block; will-change: transform; }

/* Startseiten-Hero: "Recover together." mit rotierendem Wort bleibt immer in einer
   Zeile — ein Umbruch würde die Wort-Rotation (Breiten-Animation in main.js) zerreißen.
   Schriftgröße folgt daher primär der Viewport-Breite, nicht der generischen Untergrenze. */
.xp-hero:not(.xp-hero--partner) .xp-maskline { white-space: nowrap; }
@media (max-width: 640px) {
  .xp-hero:not(.xp-hero--partner) .xp-title { font-size: clamp(1.65rem, 8.6vw, 2.75rem); letter-spacing: -0.02em; }
}
@media (max-width: 360px) {
  .xp-hero:not(.xp-hero--partner) .xp-title { font-size: 7.9vw; }
}

.xp-hero-lead {
  font-size: clamp(1.1rem, 1.7vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 46ch;
  margin: 0 0 var(--space-xl);
}
.xp-hero-lead .w { display: inline-block; will-change: transform, opacity; }

.xp-hero-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.xp-hero-actions .btn { will-change: transform; }
.xp-hero-textlink { margin-left: var(--space-xs); }

.xp-hero-arc {
  position: absolute;
  top: -18vh;
  right: -14vw;
  width: min(56vw, 720px);
  aspect-ratio: 1;
  color: var(--terracotta-tint);
  z-index: 1;
}
.xp-hero-arc svg { width: 100%; height: 100%; }

.xp-hero-scroll { position: absolute; left: 50%; transform: translateX(-50%); bottom: 2rem; z-index: 2; }
@media (max-width: 760px) {
  .xp-hero-scroll { display: none; }
  .xp-hero-inner { padding-block: 6.5rem 3.5rem; }
}

/* ---------- Partner-Hero (kompaktere Bühne, gleiche Sprache) ---------- */
.xp-hero--partner { min-height: 86svh; }
.xp-title--partner {
  font-size: clamp(2.5rem, 6.2vw, 4.8rem);
  max-width: 18ch;
  line-height: 1.05;
}
.xp-hero--partner .xp-hero-inner { padding-block: 8rem 4rem; }
@media (max-width: 640px) {
  .xp-title--partner { font-size: clamp(1.85rem, 8.2vw, 2.75rem); max-width: 15ch; }
}
/* Sicherheitsnetz: lange, ungetrennte Wörter (z.B. "Behandlungserfolg") dürfen die
   überlaufversteckte Maske nie rechts abschneiden — nötigenfalls sauber trennen. */
.xp-title { overflow-wrap: break-word; hyphens: auto; }

/* Partner: Ausgangslage-Lead mit Wort-Emphase */
.xp-partner-lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.25rem, 2.3vw, 1.7rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
  max-width: 40ch;
}

/* Partner: Statistiken mit mehr Gewicht */
.page-partner .stat-num {
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

/* ============================================================
   MISSION
   ============================================================ */
.xp-mission {
  padding-block: clamp(6rem, 15vh, 11rem);
  position: relative;
}
.xp-line-mission {
  left: max(1.5rem, calc((100vw - var(--container)) / 2 - 3.5rem));
  top: 4rem;
  height: min(72%, 560px);
  width: 80px;
  display: none;
}
@media (min-width: 1180px) { .xp-line-mission { display: block; } }

.xp-mission-head { max-width: 60rem; }
.xp-mission-h {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 22ch;
  margin-bottom: 0;
}
.xp-mission-lead {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.7vw, 2.05rem);
  line-height: 1.42;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 36ch;
  margin: var(--space-xl) 0 0;
}
.xp-mission-lead .w { display: inline-block; }

.xp-founder {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-top: clamp(4rem, 9vh, 7rem);
}
.xp-founder-photo {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  will-change: clip-path;
}
.xp-founder-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  display: block;
  will-change: transform;
}
.xp-founder-photo .founder-tag { position: absolute; left: 12px; bottom: 12px; }
.xp-founder-note { position: relative; max-width: 46ch; }
.xp-founder-koru {
  width: 34px;
  height: 34px;
  color: var(--terracotta);
  margin-bottom: var(--space-sm);
  display: block;
}
.xp-founder-note p {
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0;
}
@media (max-width: 760px) {
  .xp-founder { grid-template-columns: 1fr; }
  .xp-founder-photo { max-width: 240px; }
}

/* ============================================================
   PHASEN-REISE
   ============================================================ */
.xp-journey-sec { padding-block: clamp(5rem, 12vh, 9rem) 0; background: var(--cream-alt); }
.xp-journey-head { padding-bottom: clamp(2.5rem, 6vh, 4.5rem); }
.xp-journey-head h2 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); letter-spacing: -0.025em; }
.xp-journey-lead { max-width: 44ch; }

.xp-journey { position: relative; overflow: hidden; }

/* Rail (Fortschritts-Navigation) */
.xp-rail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}
.xp-rail-inner {
  position: relative;
  display: flex;
  gap: clamp(1.2rem, 3.5vw, 3rem);
  padding-block: 0.4rem 1rem;
}
.xp-rail-item {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  cursor: pointer;
  font-family: var(--font-display);
  color: var(--ink-faint);
  transition: color 0.35s ease;
}
.xp-rail-num { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; }
.xp-rail-title { font-size: 0.92rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.xp-rail-item.is-active { color: var(--ink); }
.xp-rail-item.is-active .xp-rail-num { color: var(--terracotta-deep); }
.xp-rail-bar {
  position: absolute;
  left: var(--space-md);
  right: var(--space-md);
  bottom: 0;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.xp-rail-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--terracotta-deep);
  border-radius: 2px;
}

/* Track & Panels */
.xp-track { display: flex; align-items: stretch; will-change: transform; }
.xp-panel {
  flex: 0 0 100vw;
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.xp-panel-inner { padding-block: 6.5rem 3rem; }
.xp-kicker {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta-deep);
  margin: 0 0 var(--space-md);
}
.xp-panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.xp-panel .phase-panel-text h3 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin-bottom: var(--space-sm);
}
.xp-panel .phase-panel-text > p { color: var(--ink-soft); max-width: 52ch; }
.xp-panel-cta { margin-top: var(--space-md); }
.xp-panel .mini { max-width: 470px; justify-self: center; width: 100%; }
.xp-panel .kiwi-chat { justify-self: center; }

/* Phase 2: Text + Galerie */
.xp-panel-peekgrid .phase-panel-text { max-width: 60ch; margin-bottom: var(--space-lg); }
.xp-panel--peek .peek-gallery { margin-top: 0; }

/* Auf flachen Screens: Galerie kompakter, Captions weg */
@media (min-width: 900px) and (max-height: 860px) {
  .xp-panel-inner { padding-block: 5.5rem 2rem; }
  .xp-panel--peek .peek-cap { display: none; }
  .xp-panel--peek .phase-panel-text { margin-bottom: var(--space-md); }
  .xp-panel--peek .phase-panel-text > p { max-width: 68ch; }
}
@media (min-width: 900px) and (max-height: 740px) {
  .xp-panel--peek .peek-gallery { transform: scale(0.86); transform-origin: top center; }
}

/* Mobile & reduced motion: vertikale Reise */
@media (max-width: 899px) {
  .xp-rail { display: none; }
  .xp-track { display: block; }
  .xp-panel { min-height: 0; display: block; }
  .xp-panel-inner { padding-block: 3.5rem 1rem; }
  .xp-panel-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
  .xp-journey-sec { padding-bottom: clamp(3rem, 8vh, 5rem); }
}
.xp-journey.is-static .xp-track { display: block; transform: none !important; }
.xp-journey.is-static .xp-panel { min-height: 0; display: block; }
.xp-journey.is-static .xp-rail { display: none; }
.xp-journey.is-static .xp-panel-inner { padding-block: 3.5rem 1.5rem; }

/* ============================================================
   NEWSLETTER-FINALE
   ============================================================ */
.xp-finale {
  background: var(--accent-deep);
  padding-block: clamp(6rem, 14vh, 10rem);
  position: relative;
  overflow: hidden;
}
.xp-finale-koru {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: min(48vw, 560px);
  aspect-ratio: 1;
  color: rgba(251, 246, 241, 0.16);
  pointer-events: none;
}
.xp-finale .cta-band {
  background: transparent;
  padding: 0;
  border-radius: 0;
  overflow: visible;
}
.xp-finale-h { font-size: clamp(2.2rem, 4.8vw, 3.6rem); letter-spacing: -0.025em; }
.xp-finale-inner { position: relative; z-index: 2; }
.xp-finale-contact { display: inline-block; margin-top: var(--space-md); }

/* Formular-Fokus: ruhiger, deutlicher Ring */
.xp-finale .signup-form input[type="email"] {
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}
.xp-finale .signup-form input[type="email"]:focus {
  outline: none;
  border-color: var(--cream);
  background: rgba(251, 246, 241, 0.12);
  box-shadow: 0 0 0 4px rgba(251, 246, 241, 0.18);
}

/* ============================================================
   Reduced Motion: alles statisch, alles sichtbar
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .xp-maskline, .xp-hero-lead .w, .xp-mission-lead .w { transform: none !important; opacity: 1 !important; }
  .site-header.nav-hidden { transform: none; }
}
