/* Pilot payback simulator.
   Block names are .payback / .pb-* so nothing collides with operator.css's .sim.
   The timeline spans the pilot itself: 6 months / 26 weeks. */

/* The site ships only .sr-only-focusable — this is the non-focusable twin. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---- pilot page head ---- */
/* h1 is sized to the h2 step: the sentence is long, and at full h1 scale it
   runs to four lines and swamps the card underneath. */
.pilot-head {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 44px;
}
.pilot-head h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
}
.pilot-head .lede {
  margin: 24px 0 0;
  color: var(--c-text-70);
  font-size: clamp(19px, 2.1vw, 26px);
  line-height: 1.34;
}

/* The cue belongs to the card, not the heading block, so it sits close to it. */
.pilot-cue {
  text-align: center;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-copper);
  margin: 0 0 20px;
}

/* ---- card ---- */
.payback {
  max-width: 860px;
  margin: 0 auto;
  background: var(--c-bg-light);
  border: 1px solid var(--c-text-15);
  border-radius: var(--r-lg);
  padding: 40px 44px 34px;
}

.payback__head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-text-15);
  margin-bottom: 28px;
}
.payback__title {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 18px;
  letter-spacing: -0.005em;
}

/* ---- the answer ---- */
.payback__lede {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.32;
  letter-spacing: -0.005em;
  color: var(--c-text-70);
  margin: 0 0 8px;
}

/* Headline and verdict share one grid cell, so the block never resizes
   when a scenario drops out. */
.payback__stack { display: grid; }
.payback__stack > * { grid-area: 1 / 1; align-self: center; }
/* visibility, not display: the inactive state keeps its space so the cell is
   always the height of the tallest state and the card never jumps. It is
   still removed from the accessibility tree. */
.payback__stack > .is-off { visibility: hidden; }

.payback__weeks {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(56px, 9.5vw, 108px);
  line-height: 0.94;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.payback__unit {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 400;
  font-size: 0.26em;
  letter-spacing: -0.005em;
  color: var(--c-text-55);
}
.payback__verdict-lead {
  font-family: var(--f-display);
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin: 0;
}
.payback__verdict-sub {
  font-family: var(--f-sans);
  font-size: 14px;
  color: var(--c-text-70);
  margin: 10px 0 0;
  max-width: 46ch;
}

/* ---- the pilot timeline, with each outcome sitting on its own point ---- */
.payback__year {
  position: relative;
  height: 150px;
  margin: 30px 0 4px;
}

/* the rail itself is decorative; the numbers live in the flags below it */
.payback__rail { position: absolute; inset: 0; }
.payback__rail::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--c-copper) 4%, var(--c-copper) 96%, transparent 100%);
  opacity: 0.28;
}
.payback__band {
  position: absolute;
  top: 24px;
  transform: translateY(-50%);
  height: 4px;
  border-radius: 99px;
  background: var(--c-copper);
  left: var(--x-strong, 0%);
  width: calc(var(--x-quiet, 0%) - var(--x-strong, 0%));
}
.payback__band.is-open {
  border-radius: 99px 0 0 99px;
  -webkit-mask-image: linear-gradient(90deg, #000 76%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 76%, transparent 100%);
}
.payback__clear {
  position: absolute;
  top: 24px;
  transform: translateY(-50%);
  height: 2px;
  border-radius: 99px;
  background: var(--c-accent);
  left: var(--x-quiet, 100%);
  right: 0;
}
/* one tick per month of the pilot */
.payback__tick {
  position: absolute;
  left: var(--x);
  top: 29px;
  width: 1px;
  height: 6px;
  background: var(--c-text-15);
}
.payback__month {
  position: absolute;
  left: var(--x);
  top: 38px;
  transform: translateX(-50%);
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--c-text-30);
}
.pb-mark {
  position: absolute;
  left: var(--x, 0%);
  top: 24px;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--c-bg-light);
  border: 2px solid var(--c-copper);
  z-index: 2;
}
.pb-mark--typical {
  background: var(--c-copper);
  transform: translate(-50%, -50%) scale(1.3);
  z-index: 3;
}
/* Past the end of the pilot: a chevron pinned at the terminus, not a dot
   pretending to sit on a week it never reaches. */
.pb-mark.is-over {
  --x: 100%;
  width: 9px;
  height: 9px;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  transform: translate(-50%, -50%) rotate(45deg);
}
.pb-mark--typical.is-over { transform: translate(-50%, -50%) rotate(45deg) scale(1.15); }

/* hairline dropping from each point to its label */
.pb-stem {
  position: absolute;
  left: var(--x, 0%);
  top: 24px;
  width: 1px;
  height: var(--h, 24px);
  background: var(--c-text-15);
}
.pb-stem.is-none,
.pb-stem.is-detached { display: none; }

/* end-of-pilot marker */
.payback__cap {
  position: absolute;
  top: 0;
  right: 0;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-55);
}
.payback__end {
  position: absolute;
  right: 0;
  top: 17px;
  width: 1px;
  height: 14px;
  background: var(--c-text-30);
}

/* ---- the outcome flags ---- */
.pb-flags { margin: 0; }
/* The value lands exactly on its point and the label leads into it from the
   left. Because every flag ends at its own point and the tiers run
   strong -> typical -> low (ascending x), a stem dropping from a lower tier is
   always to the right of the tiers above it and can never cross their text. */
.pb-flag {
  position: absolute;
  left: clamp(0px, calc(var(--x, 0%) - var(--fw, 0px)), calc(100% - var(--fw, 0px)));
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}
/* three tiers, so labels can never overlap however close the points get */
.pb-flag--strong  { top: 60px; }
.pb-flag--typical { top: 94px; }
.pb-flag--quiet   { top: 128px; }

.pb-flag__label {
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-55);
}
.pb-flag__val {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 24px;
  letter-spacing: -0.012em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin: 0;
  color: var(--c-text);
}
.pb-flag__val.is-none { color: var(--c-text-30); }
/* marks which line the headline quotes — a pointer, not emphasis */
.pb-flag--typical .pb-flag__label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-copper);
  margin-right: 8px;
  vertical-align: middle;
}

@media (prefers-reduced-motion: no-preference) {
  .payback__band,
  .payback__clear,
  .pb-mark,
  .pb-stem,
  .pb-flag {
    transition: left 0.36s cubic-bezier(.2,.6,.2,1),
                width 0.36s cubic-bezier(.2,.6,.2,1);
  }
  /* While dragging, track the thumb instead of rubber-banding behind it. */
  .payback.is-scrubbing .payback__band,
  .payback.is-scrubbing .payback__clear,
  .payback.is-scrubbing .pb-mark,
  .payback.is-scrubbing .pb-stem,
  .payback.is-scrubbing .pb-flag { transition-duration: 0.1s; }
}

/* ---- controls ---- */
.payback__controls {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--c-text-15);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px 40px;
}
.pb-ctrl__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.pb-ctrl__label {
  font-family: var(--f-sans);
  font-size: 13px;
  color: var(--c-text-70);
}
.pb-ctrl__val {
  font-family: var(--f-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 20px;
  letter-spacing: -0.006em;
  font-variant-numeric: tabular-nums;
  color: var(--c-text);
}

/* Range inputs are built from zero — the site has no form styling at all.
   Each vendor pseudo needs its own rule block: grouping them voids the lot. */
.pb-ctrl__input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  margin: 0;
  cursor: pointer;
  display: block;
}
.pb-ctrl__input::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: var(--c-text-08);
}
.pb-ctrl__input::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: var(--c-text-08);
}
.pb-ctrl__input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-bg-light);
  border: 2px solid var(--c-copper);
  box-shadow: 0 2px 6px rgba(32, 14, 3, 0.18);
  margin-top: -7px; /* WebKit only: centres against the 4px runnable track */
}
.pb-ctrl__input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--c-bg-light);
  border: 2px solid var(--c-copper);
  box-shadow: 0 2px 6px rgba(32, 14, 3, 0.18);
  box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
  .pb-ctrl__input::-webkit-slider-thumb {
    transition: transform 0.22s cubic-bezier(.2,.6,.2,1), background 0.18s ease;
  }
  .pb-ctrl__input::-moz-range-thumb {
    transition: transform 0.22s cubic-bezier(.2,.6,.2,1), background 0.18s ease;
  }
}
.pb-ctrl__input:hover::-webkit-slider-thumb,
.pb-ctrl__input:active::-webkit-slider-thumb {
  background: var(--c-copper);
  transform: scale(1.15);
}
.pb-ctrl__input:hover::-moz-range-thumb,
.pb-ctrl__input:active::-moz-range-thumb {
  background: var(--c-copper);
  transform: scale(1.15);
}
/* Ring on the input, not the thumb pseudo — thumb outlines are unreliable
   across engines and this must be keyboard-operable. */
.pb-ctrl__input:focus { outline: none; }
.pb-ctrl__input:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 4px;
  border-radius: var(--r-md);
}

/* ---- foot ---- */
.payback__foot {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--c-text-15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 36px;
}
/* the cash-flow point — a teal rule marks it as load-bearing, not a footnote */
.payback__key {
  font-family: var(--f-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--c-text-70);
  margin: 0;
  max-width: 52ch;
  border-left: 2px solid var(--c-accent);
  padding-left: 16px;
}
.payback__cta { flex: none; }

/* ---- entrance, keyed off the site's .is-revealed ancestor hook ---- */
@media (prefers-reduced-motion: no-preference) {
  .payback__band {
    transform: translateY(-50%) scaleX(0);
    transform-origin: left;
  }
  .payback.is-revealed .payback__band {
    transform: translateY(-50%) scaleX(1);
    transition: transform 1.4s cubic-bezier(.2,.6,.2,1),
                left 0.36s cubic-bezier(.2,.6,.2,1),
                width 0.36s cubic-bezier(.2,.6,.2,1);
  }
  .pb-mark { transform: translate(-50%, -50%) scale(0); }
  .pb-mark--typical { transform: translate(-50%, -50%) scale(0); }
  .payback.is-revealed .pb-mark {
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.5s cubic-bezier(.2,.6,.2,1),
                left 0.36s cubic-bezier(.2,.6,.2,1);
  }
  .payback.is-revealed .pb-mark--typical { transform: translate(-50%, -50%) scale(1.3); }
  .payback.is-revealed .pb-mark--strong { transition-delay: 0s, 0s; }
  .payback.is-revealed .pb-mark--typical { transition-delay: 0.12s, 0s; }
  .payback.is-revealed .pb-mark--quiet { transition-delay: 0.24s, 0s; }
  .payback.is-revealed .pb-mark.is-over,
  .payback.is-revealed .pb-mark--typical.is-over {
    transform: translate(-50%, -50%) rotate(45deg);
  }
  /* The teal arrives last, after the copper band has drawn. */
  .payback__clear { opacity: 0; }
  .payback.is-revealed .payback__clear {
    opacity: 1;
    transition: opacity 0.4s ease 1.2s, left 0.36s cubic-bezier(.2,.6,.2,1);
  }
  .payback.is-scrubbing .payback__clear { transition: opacity 0.4s ease, left 0.1s cubic-bezier(.2,.6,.2,1); }
}

/* ---- responsive: the site's two real breakpoints ---- */
@media (max-width: 980px) {
  .payback { padding: 32px 30px 28px; }
  .payback__controls { gap: 24px 30px; }
  .payback__foot { flex-direction: column; align-items: stretch; gap: 24px; }
  .payback__cta { align-self: flex-start; }
}

@media (max-width: 600px) {
  .payback { padding: 22px; }
  .payback__year { height: 146px; }
  .pb-flag { gap: 8px; }
  .pb-flag__val { font-size: 21px; }
  .pb-flag--strong  { top: 56px; }
  .pb-flag--typical { top: 86px; }
  .pb-flag--quiet   { top: 116px; }
  .payback__controls { grid-template-columns: 1fr; gap: 22px; }
  .pb-ctrl__input { height: 34px; }
  .pb-ctrl__input::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
  .pb-ctrl__input::-moz-range-thumb { width: 22px; height: 22px; }
  .payback__cta { width: 100%; justify-content: center; }
}

@media (max-width: 400px) {
  .pb-flag__label { font-size: 10px; letter-spacing: 0.1em; }
  .payback__cap { font-size: 10px; }
  .payback__month { display: none; }
}

/* ============================================================
   Pilot page — one screen, no scrolling.
   The page is a full-height column: nav, a centred main that takes the
   slack, and a one-line footer. Everything inside is sized off the
   viewport height so it compresses on short windows instead of
   overflowing. Falls back to normal document flow below 900px wide,
   where fitting a slider panel on one screen is not realistic.
   ============================================================ */
.pilot-page { display: flex; flex-direction: column; min-height: 100vh; }
.pilot-page main { flex: 1 1 auto; display: flex; align-items: center; min-height: 0; }
.pilot-page .section { padding: clamp(6px, 1.2vh, 30px) 0; width: 100%; }

.pilot-page .pilot-head { margin: 0 auto clamp(8px, 1.5vh, 24px); max-width: 720px; }
.pilot-page .pilot-head h1 { font-size: clamp(24px, 3.4vh, 42px); }
.pilot-page .pilot-head .lede {
  margin-top: clamp(8px, 1.2vh, 16px);
  font-size: clamp(14px, 1.8vh, 20px);
  line-height: 1.3;
}
.pilot-page .pilot-cue { margin-bottom: clamp(8px, 1.2vh, 16px); font-size: 11px; }

.pilot-page .payback { padding: clamp(12px, 2.1vh, 30px) clamp(20px, 2.6vw, 40px) clamp(10px, 1.7vh, 24px); }
.pilot-page .payback__head { padding-bottom: clamp(6px, 1vh, 14px); margin-bottom: clamp(9px, 1.7vh, 24px); }

.pilot-page .payback__answer { margin-top: 0; padding-top: 0; border-top: 0; }
.pilot-page .payback__lede { font-size: clamp(15px, 1.9vh, 22px); margin-bottom: 2px; }
.pilot-page .payback__weeks { font-size: clamp(40px, 7.4vh, 86px); }
.pilot-page .payback__verdict-lead { font-size: clamp(20px, 3vh, 34px); }
.pilot-page .payback__verdict-sub { font-size: 13px; margin-top: 6px; }

/* the timeline scales with the window: tiers and stems follow --pb-tier */
.pilot-page .payback__year {
  --pb-tier: clamp(23px, 3.2vh, 36px);
  height: calc(24px + var(--pb-tier) * 3 + 16px);
  margin: clamp(6px, 1.3vh, 22px) 0 0;
}
.pilot-page .pb-flag--strong  { top: calc(24px + var(--pb-tier) * 0.6); }
.pilot-page .pb-flag--typical { top: calc(24px + var(--pb-tier) * 1.6); }
.pilot-page .pb-flag--quiet   { top: calc(24px + var(--pb-tier) * 2.6); }
.pilot-page .pb-stem[data-pb="stem-strong"]  { height: calc(var(--pb-tier) * 0.6) !important; }
.pilot-page .pb-stem[data-pb="stem-typical"] { height: calc(var(--pb-tier) * 1.6) !important; }
.pilot-page .pb-stem[data-pb="stem-quiet"]   { height: calc(var(--pb-tier) * 2.6) !important; }
.pilot-page .pb-flag__val { font-size: clamp(17px, 2.4vh, 24px); }

.pilot-page .payback__controls {
  margin-top: clamp(9px, 1.8vh, 26px);
  padding-top: clamp(8px, 1.5vh, 22px);
  gap: clamp(8px, 1.4vh, 20px) clamp(24px, 3vw, 40px);
}
.pilot-page .pb-ctrl__head { margin-bottom: clamp(2px, 0.5vh, 8px); }
.pilot-page .pb-ctrl__label { font-size: clamp(11px, 1.4vh, 13px); }
.pilot-page .pb-ctrl__val { font-size: clamp(15px, 2vh, 20px); }
.pilot-page .pb-ctrl__input { height: clamp(20px, 2.8vh, 28px); }

.pilot-page .payback__foot {
  margin-top: clamp(8px, 1.5vh, 22px);
  padding-top: clamp(8px, 1.3vh, 20px);
  gap: clamp(16px, 2vw, 36px);
}
.pilot-page .payback__key { font-size: clamp(11px, 1.4vh, 14px); line-height: 1.45; }
.pilot-page .payback__cta { padding: clamp(11px, 1.7vh, 18px) clamp(20px, 2vw, 34px); font-size: clamp(13px, 1.6vh, 15px); }

/* one-line footer */
.pilot-foot {
  flex: none;
  border-top: 1px solid var(--c-text-15);
  background: var(--c-bg-light);
  padding: 12px 0;
}
.pilot-foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--f-sans);
  font-size: 12px;
  color: var(--c-text-55);
}
.pilot-foot__links { display: flex; gap: 20px; }
.pilot-foot__links a { color: var(--c-text-55); transition: color 0.18s ease; }
.pilot-foot__links a:hover { color: var(--c-accent); }

/* Below this width the panel needs to stack; a single screen stops being
   achievable, so hand the page back to normal scrolling. */
@media (max-width: 900px) {
  .pilot-page { display: block; min-height: 0; }
  .pilot-page main { display: block; }
  .pilot-page .section { padding: 40px 0 48px; }
  .pilot-page .payback__year { --pb-tier: 34px; }
}
