/* Startseite, interaktive Abschnitte (30.09.2026):
   1. "So findet man Sie" – Frage, Liste, KI-Antwort, beim Scrollen erzaehlt
   2. Ladezeit-Rennen vorher/heute mit echten Messwerten
   3. Ablauf als Band mit Stationen, Fortschritt folgt dem Scrollen
   Ohne JS und bei "Bewegung reduzieren" steht alles vollstaendig und ruhig da. */

/* ---------- 1. So findet man Sie ---------- */
.x-find__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-xl); align-items: start; }
.x-find__steps { list-style: none; margin: var(--gap-lg) 0 0; padding: 0; counter-reset: schritt; }
.x-find__step { position: relative; padding: var(--gap-md) 0 var(--gap-md) 3.25rem; min-height: 38vh; opacity: .75; transition: opacity var(--ease); }
.x-find__step.is-active, .x-find--still .x-find__step { opacity: 1; }
.x-find__step::before { counter-increment: schritt; content: counter(schritt); position: absolute; left: 0; top: var(--gap-md);
  width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  border: 2px solid var(--line-strong); color: var(--text-muted); transition: all var(--ease); }
.x-find--still .x-find__step::before, .x-find__step.is-active::before { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.x-find__step h3 { margin: 0 0 .4rem; font-size: 1.25rem; color: var(--text-strong); }
.x-find__step p { margin: 0; color: var(--text-body); }
.x-find__note { margin-top: var(--gap-sm); font-size: .85rem; color: var(--text-muted); text-align: center; }

.x-find__stage { position: sticky; top: 110px; }
.x-phone { margin: var(--gap-lg) auto 0; max-width: 380px; border-radius: 34px; padding: 14px; background: var(--surface-sunken);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lifted); }
.x-phone__screen { border-radius: 24px; background: var(--surface-raised); min-height: 440px; padding: 18px 16px; overflow: hidden; position: relative; display: flex; flex-direction: column; }
.x-phone__buehne { position: relative; flex: 1; margin-top: 1rem; min-height: 250px; }
.x-phone__search { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: var(--radius-pill);
  background: var(--surface-overlay); color: var(--text-strong); font-size: .95rem; min-height: 2.9rem; }
.x-phone__search svg { flex: none; opacity: .7; }
.x-phone__cursor { display: inline-block; width: 2px; height: 1.1em; background: var(--accent); vertical-align: -2px; margin-left: 1px;
  animation: x-blink 1s steps(1) infinite; }
@keyframes x-blink { 50% { opacity: 0; } }

.x-phone__panel { position: absolute; left: 0; right: 0; top: 0; transition: opacity .45s ease, transform .45s ease; }
.x-find[data-step="1"] .x-phone__panel, .x-find[data-step="1"] .x-phone__why { opacity: 0; transform: translateY(12px); pointer-events: none; }
.x-find[data-step="2"] .x-phone__panel--ki, .x-find[data-step="2"] .x-phone__why { opacity: 0; transform: translateY(12px); pointer-events: none; }
.x-find[data-step="3"] .x-phone__panel--liste, .x-find[data-step="4"] .x-phone__panel--liste { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.x-find[data-step="3"] .x-phone__why { opacity: 0; transform: translateY(12px); pointer-events: none; }

.x-serp { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.x-serp li { display: grid; gap: .3rem; }
.x-serp i { display: block; height: .55rem; border-radius: 4px; background: var(--line-strong); }
.x-serp i:first-child { width: 55%; height: .7rem; background: color-mix(in srgb, var(--accent) 35%, var(--line-strong)); }
.x-serp i:nth-child(2) { width: 92%; } .x-serp i:nth-child(3) { width: 70%; }
.x-serp__seite { margin-top: .4rem; font-size: .8rem; color: var(--text-muted); text-align: center; }

.x-ki { display: grid; gap: .7rem; font-size: .92rem; line-height: 1.5; color: var(--text-body); }
.x-ki__kopf { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text-muted); }
.x-ki__kopf b { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-deep)); }
.x-ki p { margin: 0; }
.x-ki mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text-strong); padding: 0 .2em; border-radius: 4px; font-weight: 600; }
.x-ki__quelle { justify-self: start; display: inline-flex; gap: .4rem; align-items: center; font-size: .78rem; padding: .3rem .65rem;
  border-radius: var(--radius-pill); border: 1px solid var(--accent); color: var(--accent-text); text-decoration: none; }
.x-ki__kontakt { font-size: .82rem; color: var(--text-muted); }
.x-ki__kontakt a { color: var(--accent-text); }
.x-ki__quelle:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.x-phone__why { margin-top: var(--gap-sm); display: flex; flex-wrap: wrap; gap: .4rem; transition: opacity .45s ease .1s, transform .45s ease .1s; }
.x-phone__why span { font-size: .75rem; padding: .3rem .6rem; border-radius: var(--radius-pill); background: var(--surface-overlay); color: var(--text-strong); }
.x-phone__why span::before { content: "✓ "; color: var(--good); font-weight: 700; }

/* Ruhig: alles auf einmal sichtbar, KI-Antwort statt Liste */
.x-find--still .x-find__step { min-height: 0; }
.x-find--still .x-find__stage { position: static; }
.x-find--still .x-phone__panel--liste { display: none; }
.x-find--still .x-phone__panel { position: static; }
.x-find--still .x-phone__buehne, .x-find--still .x-phone__screen { min-height: 0; }
.x-find--still .x-phone__panel, .x-find--still .x-phone__why { opacity: 1 !important; transform: none !important; }
.x-find--still .x-phone__cursor { display: none; }

@media (max-width: 900px) {
  .x-find__grid { grid-template-columns: 1fr; gap: 0; }
  .x-phone { max-width: 300px; transform-origin: top center; }
  .x-phone__screen { min-height: 360px; }
  .x-phone__buehne { min-height: 190px; }
  .x-find--still .x-find__step { min-height: 0; }
}

/* ---------- 2. Ladezeit-Rennen ---------- */
.x-race { margin-top: var(--gap-lg); padding: var(--gap-md); border-radius: var(--radius-lg); background: var(--surface-raised); border: 1px solid var(--line); }
.x-race__kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--gap-sm); }
.x-race__kopf h3 { margin: 0; color: var(--text-strong); font-size: 1.2rem; }
.x-race__kopf p { margin: .25rem 0 0; color: var(--text-muted); font-size: .9rem; }
.x-race__bahnen { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-md); margin-top: var(--gap-md); }
.x-race__bahn { display: grid; gap: .6rem; }
.x-race__label { display: flex; justify-content: space-between; font-size: .9rem; color: var(--text-body); }
.x-race__label b { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.x-race__bild { position: relative; aspect-ratio: 16 / 9; max-height: 280px; border-radius: var(--radius); overflow: hidden; background: var(--surface-sunken); border: 1px solid var(--line); }
.x-race__bild img { width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .35s ease; display: block; }
.x-race__bild.is-da img { opacity: 1; }
.x-race__bild::after { content: ""; position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: x-drehen .8s linear infinite; }
.x-race__bild.is-da::after, .x-race:not(.is-laeuft) .x-race__bild:not(.is-da)::after { display: none; }
@keyframes x-drehen { to { transform: rotate(360deg); } }
.x-race__balken { height: 8px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.x-race__balken i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(1); background: var(--text-muted); }
.x-race__bahn--heute .x-race__balken i { background: var(--good); }
.x-page .x-race__nochmal { background: transparent; color: var(--text-strong); }
.x-page .x-race__nochmal[hidden] { display: none; }
@media (max-width: 640px) { .x-race__bahnen { gap: var(--gap-sm); } .x-race { padding: var(--gap-sm); } }

/* ---------- 3. Ablauf ---------- */
.x-flow { --p: 1; margin-top: var(--gap-lg); }
.x-flow__band { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap-xs); list-style: none; margin: 0; padding: 0; }
.x-flow__band::before, .x-flow__band::after { content: ""; position: absolute; top: 27px; left: 8%; right: 8%; height: 4px; border-radius: 4px; background: var(--line-strong); }
.x-flow__band::after { background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright)); transform-origin: left; transform: scaleX(var(--p)); }
.x-flow__station { position: relative; z-index: 1; text-align: center; }
.x-flow__station button { all: unset; cursor: pointer; display: grid; justify-items: center; gap: .55rem; width: 100%; border-radius: var(--radius); padding-bottom: .4rem; }
.x-flow__station button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.x-flow__punkt { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
  background: var(--surface-raised); border: 3px solid var(--line-strong); color: var(--text-muted); transition: all .35s ease; }
.x-flow__station.is-erreicht .x-flow__punkt { border-color: var(--accent); color: var(--text-strong); }
.x-flow__station[aria-current="step"] .x-flow__punkt, .x-flow__station button[aria-expanded="true"] .x-flow__punkt {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent); box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 18%, transparent); }
.x-flow__name { font-weight: 700; color: var(--text-strong); font-size: .98rem; }
.x-flow__detail { margin-top: var(--gap-md); padding: var(--gap-md); border-radius: var(--radius-lg); background: var(--surface-raised); border: 1px solid var(--line); min-height: 7.5rem; }
.x-flow__detail h3 { margin: 0 0 .4rem; color: var(--text-strong); font-size: 1.2rem; }
.x-flow__detail p { margin: 0; color: var(--text-body); }
.x-flow__detail [hidden] { display: none; }
/* Ohne JS: alle Texte untereinander */
.x-flow:not(.is-bereit) .x-flow__detail > div { display: block !important; margin-bottom: var(--gap-sm); }
@media (max-width: 760px) {
  .x-flow__band { grid-template-columns: 1fr; gap: var(--gap-sm); }
  .x-flow__band::before, .x-flow__band::after { top: 8%; bottom: 8%; left: 27px; right: auto; width: 4px; height: auto; transform-origin: top; transform: scaleY(var(--p)); }
  .x-flow__band::before { transform: none; }
  .x-flow__station { text-align: left; }
  .x-flow__station button { grid-template-columns: 58px 1fr; justify-items: start; align-items: center; gap: var(--gap-sm); }
}
@media (prefers-reduced-motion: reduce) {
  .x-find__step, .x-phone__panel, .x-phone__why, .x-flow__punkt, .x-race__bild img { transition: none; }
}

/* ---------- Messwerte als Kundenkarten (01.10.2026) ----------
   Stefan: die Pfeil-Liste "sieht mehr gewollt als gekonnt aus". Jetzt: Bildschirmfoto der Kundenseite,
   Tacho mit grosser Zahl, Ladezeit und Datenmenge als Balken vorher/heute in echter Laenge. */
.x-page .x-proof { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
.x-case { display: flex; flex-direction: column; gap: var(--gap-md); padding: var(--gap-sm) var(--gap-sm) var(--gap-md); border-radius: var(--radius-lg);
  background: var(--surface-raised); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.x-page .x-case__bild { position: relative; inset: auto; width: 100%; max-width: none; transform: none; border-radius: var(--radius); box-shadow: none; }
.x-page .x-case__bild img { aspect-ratio: 16 / 8; }
.x-case__kopf { display: flex; align-items: center; gap: var(--gap-md); padding: 0 var(--gap-xs); }
.x-page .x-case__kopf .x-gauge { width: 96px; height: 96px; }
.x-case__kopf h3 { margin: 0; }
.x-case__score { margin: .35rem 0 0; color: var(--text-muted); font-size: .9rem; }
.x-case__score b { color: var(--good); font-size: 1.05rem; margin: 0 .3rem; }
.x-case__score span { white-space: nowrap; opacity: .85; }
.x-case__balken { display: grid; gap: .35rem; padding: 0 var(--gap-xs); }
.x-case__zeile { display: flex; justify-content: space-between; align-items: baseline; font-size: .9rem; color: var(--text-muted); }
.x-case__zeile b { color: var(--text-strong); font-size: 1.15rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x-bar { position: relative; height: 10px; border-radius: var(--radius-pill); background: var(--line); }
.x-bar i { display: block; height: 100%; border-radius: inherit; }
.x-bar--vorher { height: 18px; background: none; }
.x-bar--vorher i { background: color-mix(in srgb, var(--text-muted) 30%, transparent); }
.x-bar--vorher em { position: absolute; left: .6rem; top: 50%; transform: translateY(-50%); font-style: normal;
  font-size: .72rem; color: var(--text-muted); white-space: nowrap; }
.x-bar--heute { background: transparent; }
.x-bar--heute i { background: linear-gradient(90deg, var(--good), color-mix(in srgb, var(--good) 70%, #fff)); }
@media (prefers-reduced-motion: no-preference) {
  .x-reveal:not(.is-waiting) .x-bar--heute i { animation: x-balken 1.2s cubic-bezier(.2,.8,.2,1) .3s backwards; }
}
@keyframes x-balken { from { width: 100%; } }

/* ---------- Partner verlinkt (01.10.2026, Stefan: "alle partner links muessen zu den partnern verlinken") ---------- */
.x-page a.x-frame, .x-ref-link { display: block; color: inherit; text-decoration: none; }
.x-ref-link figcaption { color: inherit; }
.x-page .x-refs a.x-ref-link .x-frame, .x-page a.x-case__bild { transition: transform var(--ease), box-shadow var(--ease); }
.x-page .x-refs a.x-ref-link:hover .x-frame, .x-page a.x-case__bild:hover { transform: translateY(-4px); box-shadow: var(--shadow-lifted); }
.x-page a.x-frame:focus-visible, .x-ref-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.x-case h3 a { color: inherit; text-decoration: none; }
.x-case h3 a:hover { color: var(--accent-text); }
.x-page .x-quote footer span a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .2em; }
.x-page .x-quote footer span a:hover { color: var(--accent-text); }
