/* =====================================================================
   Für wen – calculator as a sentence with −/+ capsules, then the plans.
   Sliders: hairline track, black fill up to the thumb (--fill set by JS).
   ===================================================================== */
/* same faint vertical hairlines as the dark horizon stage on the start page (dark.css .dk__stage),
   inverted for the light page; sits between the frame rails, behind the content */
.fw-main { position: relative; isolation: isolate; }
.fw-main::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--rail); right: var(--rail); z-index: -1;
  background: repeating-linear-gradient(90deg, rgba(28, 28, 26, 0.045) 0 1px, transparent 1px 7px);
  pointer-events: none;
}

/* flows straight out of the hero: same centred axis, sentence in the hero's type family */
.fw-hero { padding-top: clamp(48px, 6vw, 96px); padding-bottom: clamp(28px, 3.4vw, 48px); }
.fw-calc {
  margin: 0 var(--rail); padding: 0 var(--pad) clamp(56px, 7vw, 96px);
  text-align: center;
}
.fw-calc__sentence {
  margin: 0 auto; max-width: 23em;
  font-size: clamp(20px, 2.15vw, 31px); line-height: 1.6; font-weight: 500; letter-spacing: -0.02em;
  color: var(--text-2); text-wrap: balance;
}
.fw-calc__result {
  margin: clamp(14px, 1.6vw, 22px) 0 0;
  font-size: clamp(40px, 4.8vw, 72px); line-height: 1.02; font-weight: 600; letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.fw-calc__note { margin: 22px auto 0; max-width: 34em; font-size: 14px; line-height: 1.55; color: var(--muted); text-wrap: balance; }

/* value capsule: − value + */
.fw-pill {
  display: inline-flex; align-items: center; vertical-align: 0.08em;
  height: max(44px, 1.45em); padding: 0 5px; margin: 0 2px;
  border-radius: 999px; background: #121212; color: #f4f2ee;
  font-size: 0.86em; line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
}
.fw-pill__val { min-width: 2.4em; padding: 0 0.42em; text-align: center; font-variant-numeric: tabular-nums; }
.fw-pill__btn {
  display: grid; place-items: center; flex: none;
  width: max(34px, 1.05em); height: max(34px, 1.05em); padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); color: #fff; cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out;
}
.fw-pill__btn svg { width: 50%; height: 50%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.fw-pill__btn:hover { background: rgba(255, 255, 255, 0.3); }
.fw-pill__btn:active { transform: scale(0.92); }
.fw-pill__btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.fw-pill__btn:disabled { opacity: 0.35; cursor: default; background: rgba(255, 255, 255, 0.08); }

/* hint above the sentence */
.fw-calc__hint {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 clamp(14px, 1.6vw, 20px);
  font-size: 14px; color: var(--muted);
}
.fw-calc__hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* entrance: continues the hero's fade-up (pages.css pg-in), one line after another */
@media (prefers-reduced-motion: no-preference) {
  .fw-calc > * { animation: fw-in 700ms cubic-bezier(0.2, 0, 0, 1) backwards; }
  @keyframes fw-in { from { opacity: 0; translate: 0 12px; } }
  .fw-calc > :nth-child(1) { animation-delay: 260ms; }
  .fw-calc > :nth-child(2) { animation-delay: 340ms; }
  .fw-calc > :nth-child(3) { animation-delay: 420ms; }
  .fw-calc > :nth-child(4) { animation-delay: 500ms; }
}

/* one-time nudge after load: each + lights up once, left to right */
@media (prefers-reduced-motion: no-preference) {
  .fw-calc.is-nudge .fw-pill__btn[data-step="1"] { animation: fw-nudge 900ms ease-out both; }
  .fw-calc.is-nudge .fw-pill[data-key="hours"] .fw-pill__btn[data-step="1"] { animation-delay: 220ms; }
  .fw-calc.is-nudge .fw-pill[data-key="rate"] .fw-pill__btn[data-step="1"] { animation-delay: 440ms; }
  @keyframes fw-nudge {
    0%, 100% { background: rgba(255, 255, 255, 0.16); transform: none; }
    35% { background: #fff; color: #121212; transform: scale(1.12); }
  }
}

@media (max-width: 560px) {
  .fw-calc { text-align: left; }
  .fw-calc__sentence, .fw-calc__note { margin-left: 0; }
  .fw-calc__sentence { line-height: 2.25; }
  .fw-pill { font-size: 0.82em; }
}

/* =====================================================================
   Für wen – plans + scroll scene.
   Static (default): calculator, then the plans below it.
   Scene (.is-scene, set by fuer-wen.js where it fits): the stage pins
   below the header for a stretch of scroll; JS drives --p 0 → 1:
   sentence and note fade up, the sum moves to --sum-y, the plans fade in
   at their final place. Final composition is centred on the stage.
   ===================================================================== */
/* plan + billing styles live in plans.css (shared with preise.html) */

/* ---------- scene ---------- */
.fw-scene.is-scene { height: var(--scene-h); margin: 0 var(--rail); }
.fw-scene.is-scene .fw-stage {
  position: sticky; top: var(--stage-top); height: var(--stage-h); overflow: hidden;
}
.fw-scene.is-scene .fw-calc { margin: 0; padding-bottom: 0; }
.fw-scene.is-scene .fw-plans {
  position: absolute; left: 0; right: 0; top: var(--plans-y); padding: 0 var(--pad);
  opacity: var(--p-in, 0); transform: translateY(calc((1 - var(--p-in, 0)) * 40px));
}
.fw-scene.is-scene .fw-calc__hint,
.fw-scene.is-scene .fw-calc__sentence { opacity: var(--p-out, 1); transform: translateY(calc((1 - var(--p-out, 1)) * -24px)); }
.fw-scene.is-scene .fw-calc__note { opacity: var(--p-out, 1); }
.fw-scene.is-scene .fw-calc__result { transform: translateY(calc(var(--p, 0) * var(--sum-dy))); }
/* inputs are not clickable once they have faded */
.fw-scene.is-scene.is-late .fw-calc__sentence { pointer-events: none; }
.fw-scene.is-scene:not(.is-late) .fw-plans { pointer-events: none; }

/* short screens: the same composition, a little tighter, so sum + plans still fit on one screen */
.fw-scene.is-tight .fw-plans__title { margin-bottom: 10px; }
.fw-scene.is-tight .fw-plan { padding-top: 14px; padding-bottom: 14px; }
.fw-scene.is-tight .fw-plan__price { margin-top: 10px; font-size: 30px; }
.fw-scene.is-tight .fw-plan__list { margin-top: 10px; padding-top: 10px; gap: 3px; font-size: 13px; }
.fw-scene.is-tight .fw-plans__btn { margin-top: 16px; height: 44px; }

/* Q&A below the scene: own surface so it reads as a new section after the plans */
.fw-faq { border-top: 1px solid var(--border); background: var(--bg); position: relative; }
.fw-faq__group { margin: 28px 0 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.fw-faq .pg-block__head + .fw-faq__group { margin-top: 0; }
