/* ==================================================================
   Pitlane product stories: reusable consumer storytelling blocks.

   Used on the home page; written so a future landing page can reuse
   any single story by copying its <section class="ps-story"> block.
   Needs: the .pl wrapper (brand tokens: --pl-accent, --pl-surface,
   --pl-text, --pl-muted, --pl-line, --pl-display, --pl-body) and
   /assets/stories.js for CTAs, illustrative dates and the to-do check.

   Class prefixes:
     ps-   layout and copy for a story
     pv-   product visuals (mock app UI, receipts, people)
     pt-   the "What's on your car's to-do list?" check
     pc-   the closing call to action
   ================================================================== */

/* ---------- intro ---------- */
.ps-intro { text-align: center; max-width: 40em; margin: 0 auto; padding: 8px 0 26px; }
.ps-intro h2 { font-family: var(--pl-display); font-weight: 800; font-size: clamp(30px, 4.6vw, 48px); line-height: 1.06; letter-spacing: -.015em; }
.ps-intro h2 .b { color: var(--pl-accent-l); }
.ps-intro p { color: var(--pl-muted); font-size: 18px; margin-top: 14px; }

/* ---------- a story: copy + visual ---------- */
.ps-story { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; padding: 54px 0; }
.ps-story.ps-flip .ps-copy { order: 2; }
.ps-kicker { display: inline-block; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--pl-accent-l); }
.ps-copy h3 { font-family: var(--pl-display); font-weight: 800; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.08; letter-spacing: -.01em; margin-top: 10px; }
.ps-copy p { color: var(--pl-muted); font-size: 17px; margin-top: 14px; max-width: 28em; }
.ps-copy p.ps-aside { color: var(--pl-text); font-weight: 500; }
.ps-visual { position: relative; display: flex; justify-content: center; }

/* The To Sort story gets the most room: a soft band behind the whole story. */
.ps-feature { position: relative; padding: 60px 48px; margin: 26px 0; border-radius: 28px;
  background: linear-gradient(160deg, rgba(47,125,244,.16), rgba(47,125,244,.03) 55%, rgba(255,255,255,.02));
  border: 1px solid rgba(91,157,255,.22); }
.ps-feature .ps-copy h3 { font-size: clamp(30px, 4vw, 46px); }

/* Two smaller stories side by side */
.ps-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 40px 0 54px; }
.ps-card { background: rgba(255,255,255,.025); border: 1px solid var(--pl-line); border-radius: 24px; padding: 34px 32px 32px; display: flex; flex-direction: column; }
.ps-card .ps-copy h3 { font-size: clamp(24px, 2.8vw, 32px); }
.ps-card .ps-visual { margin-top: 28px; flex: 1; align-items: center; }

/* ---------- shared visual pieces (match the app's own UI) ---------- */
.pv-app { width: 100%; max-width: 400px; background: #0a1424; border: 1px solid rgba(255,255,255,.08); border-radius: 22px; padding: 18px; box-shadow: 0 40px 80px -36px rgba(0,0,0,.9); font-size: 13px; line-height: 1.35; }
.pv-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #8193ad; font-weight: 700; }
.pv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.pv-title { font-family: var(--pl-display); font-weight: 700; font-size: 17px; color: #fff; }
.pv-sub { color: #8193ad; font-size: 12px; }
.pv-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.pv-dot.red { background: #ff5a5a; } .pv-dot.amber { background: #f5a623; } .pv-dot.green { background: #34c759; } .pv-dot.blue { background: var(--pl-accent); }
.pv-red { color: #ff6b6b; } .pv-amber { color: #f5a623; } .pv-green { color: #34c759; } .pv-blue { color: var(--pl-accent-l); }
.pv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--pl-accent); color: #fff; font-weight: 700; font-size: 13px; border-radius: 12px; padding: 10px 14px; }
.pv-ghost { display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(255,255,255,.16); color: #dce4ef; font-weight: 600; font-size: 12.5px; border-radius: 10px; padding: 7px 11px; }
.pv-note { color: #8193ad; font-size: 11.5px; margin-top: 10px; }
.pv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 1. reminders: Next Up + odometer, with a notification ---------- */
.pv-remind { position: relative; width: 100%; max-width: 400px; padding-top: 46px; }
.pv-toast { position: absolute; top: 0; right: -14px; left: 34px; z-index: 2; display: flex; gap: 11px; align-items: flex-start;
  background: rgba(244,247,252,.97); color: #0c1322; border-radius: 16px; padding: 11px 13px; box-shadow: 0 24px 40px -18px rgba(0,0,0,.75); }
.pv-toast img, .pv-toast .pv-appicon { width: 30px; height: 30px; border-radius: 8px; flex: none; background: #0a1424; display: grid; place-items: center; }
.pv-toast b { display: block; font-size: 12.5px; }
.pv-toast span { display: block; font-size: 12.5px; color: #3b475c; }
.pv-toast small { margin-left: auto; color: #6b7588; font-size: 11px; white-space: nowrap; }
.pv-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.06); }
.pv-row:first-of-type { border-top: 0; }
.pv-row .n { color: #fff; font-weight: 700; width: 72px; flex: none; }
.pv-row .d { font-weight: 700; }
.pv-row .w { margin-left: auto; color: #8193ad; font-size: 12px; text-align: right; }
.pv-odo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 13px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.06); }
.pv-odo .km { font-family: var(--pl-display); font-weight: 800; font-size: 19px; color: #fff; }

/* ---------- 2. to sort: the checklist ---------- */
.pv-todo { max-width: 440px; }
.pv-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.06); }
.pv-item:first-of-type { border-top: 0; }
.pv-check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.28); flex: none; margin-top: 1px; display: grid; place-items: center; }
.pv-item.done .pv-check { background: var(--pl-accent); border-color: var(--pl-accent); }
.pv-item .t { color: #fff; font-size: 15px; font-weight: 500; }
.pv-item.done .t { color: #6f8099; text-decoration: line-through; }
.pv-item .m { font-size: 12.5px; margin-top: 3px; color: #8193ad; }
.pv-item .m b { color: #b8c5d8; font-weight: 700; }
.pv-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; border-radius: 100px; padding: 2px 8px; margin-left: 6px; vertical-align: 1px; color: #9ec2ff; background: rgba(47,125,244,.16); border: 1px solid rgba(91,157,255,.3); }
.pv-types { display: flex; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed rgba(255,255,255,.1); }
.pv-types span { font-size: 11.5px; font-weight: 600; border-radius: 100px; padding: 5px 11px; border: 1px solid rgba(255,255,255,.14); color: #9fb2cc; }
.pv-types span.on { background: var(--pl-accent); border-color: var(--pl-accent); color: #fff; }

/* ---------- 3. service history: receipt -> records ---------- */
.pv-hist { display: grid; grid-template-columns: 170px 40px 1fr; align-items: center; width: 100%; max-width: 520px; }
.pv-receipt { position: relative; background: #f7f4ec; color: #2b2a26; border-radius: 4px; padding: 16px 14px 20px; transform: rotate(-4deg);
  font: 500 10.5px/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; box-shadow: 0 26px 40px -22px rgba(0,0,0,.8);
  -webkit-mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0 / 12px 100% repeat-x; mask: radial-gradient(circle 5px at 50% 100%, transparent 98%, #000) 0 0 / 12px 100% repeat-x; }
.pv-receipt .h { font-weight: 800; letter-spacing: .06em; text-align: center; font-size: 11px; }
.pv-receipt .s { text-align: center; color: #77736a; margin-bottom: 8px; }
.pv-receipt .l { display: flex; justify-content: space-between; gap: 8px; }
.pv-receipt hr { border: 0; border-top: 1px dashed #b9b3a5; margin: 7px 0; }
.pv-receipt .tot { font-weight: 800; }
.pv-arrow { display: grid; place-items: center; color: var(--pl-accent-l); }
.pv-records { padding: 16px; }
.pv-rec { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.06); }
.pv-rec:first-of-type { border-top: 0; }
.pv-rec .t { color: #fff; font-weight: 600; font-size: 13px; }
.pv-rec .m { color: #8193ad; font-size: 11.5px; margin-top: 1px; }
.pv-rec .c { margin-left: auto; color: #fff; font-weight: 700; font-size: 13px; }
.pv-rec .pv-dot { margin-top: 4px; }
.pv-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(47,125,244,.12); border: 1px solid rgba(91,157,255,.25); }
.pv-total span { color: #b8c5d8; font-size: 12px; }
.pv-total b { font-family: var(--pl-display); font-size: 17px; color: #fff; }
.pv-scan { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #9ec2ff; margin-bottom: 8px; }

/* ---------- 4. sharing: two people, one vehicle ---------- */
.pv-share { width: 100%; max-width: 380px; text-align: center; }
.pv-people { display: flex; align-items: center; justify-content: center; }
.pv-person { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px; }
.pv-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-family: var(--pl-display); font-weight: 800; font-size: 20px; color: #fff; }
.pv-avatar.a { background: linear-gradient(160deg, #5b9dff, #2f7df4); }
.pv-avatar.b { background: linear-gradient(160deg, #46d08a, #23a565); }
.pv-person span { font-size: 12px; color: #b8c5d8; font-weight: 600; }
.pv-link { flex: 1; max-width: 120px; height: 2px; margin-bottom: 22px; background: repeating-linear-gradient(90deg, rgba(91,157,255,.7) 0 6px, transparent 6px 11px); position: relative; }
.pv-link::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); border-radius: 50%; background: #0d1a2e; border: 1px solid rgba(91,157,255,.45);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b9dff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11l1.5-4.5A2 2 0 0 1 8.4 5h7.2a2 2 0 0 1 1.9 1.5L19 11'/%3E%3Crect x='3' y='11' width='18' height='6' rx='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; }
.pv-share .pv-app { margin-top: 18px; text-align: left; padding: 14px 16px; }
.pv-shared-row { display: flex; align-items: center; gap: 10px; }
.pv-shared-row + .pv-shared-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.pv-shared-row .t { color: #fff; font-weight: 600; }
.pv-shared-row .m { color: #8193ad; font-size: 12px; }
.pv-shared-row .r { margin-left: auto; font-size: 12px; font-weight: 700; }

/* ---------- 5. providers ---------- */
.pv-prov { max-width: 400px; width: 100%; }
.pv-p { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid rgba(255,255,255,.06); }
.pv-p:first-of-type { border-top: 0; }
.pv-p .ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; background: rgba(47,125,244,.14); color: var(--pl-accent-l); }
.pv-p .t { color: #fff; font-weight: 600; }
.pv-p .m { color: #8193ad; font-size: 12px; }
.pv-p .acts { margin-left: auto; display: flex; gap: 6px; }
.pv-p .acts span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.14); color: #b8c5d8; }
.pv-prov .pv-btn { width: 100%; margin-top: 12px; }
.ps-choice { font-family: var(--pl-display); font-weight: 700; color: var(--pl-text) !important; }

/* ---------- the to-do check ---------- */
.pt { margin: 30px 0 20px; padding: 44px 40px; border-radius: 28px; background: rgba(255,255,255,.025); border: 1px solid var(--pl-line);
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.pt h2 { font-family: var(--pl-display); font-weight: 800; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; letter-spacing: -.01em; }
.pt > div > p { color: var(--pl-muted); margin-top: 10px; font-size: 16.5px; }
.pt-list { list-style: none; margin-top: 20px; display: grid; gap: 9px; }
.pt-opt { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: rgba(255,255,255,.03); border: 1px solid var(--pl-line); color: var(--pl-text); border-radius: 14px; padding: 13px 15px;
  font: 500 15.5px/1.3 var(--pl-body); transition: border-color .15s, background .15s; }
.pt-opt:hover { border-color: rgba(91,157,255,.5); }
.pt-opt .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid rgba(255,255,255,.3); flex: none; display: grid; place-items: center; transition: background .15s, border-color .15s; }
.pt-opt .box svg { opacity: 0; transition: opacity .15s; }
.pt-opt[aria-pressed="true"] { background: rgba(47,125,244,.14); border-color: rgba(91,157,255,.55); }
.pt-opt[aria-pressed="true"] .box { background: var(--pl-accent); border-color: var(--pl-accent); }
.pt-opt[aria-pressed="true"] .box svg { opacity: 1; }
.pt-opt:focus-visible { outline: 2px solid var(--pl-accent-l); outline-offset: 2px; }
.pt-result { text-align: center; padding: 30px 24px; border-radius: 22px; background: linear-gradient(180deg, var(--pl-surface), #0b1626); border: 1px solid var(--pl-line); }
.pt-num { font-family: var(--pl-display); font-weight: 800; font-size: 64px; line-height: 1; color: var(--pl-accent-l); }
.pt-head { font-family: var(--pl-display); font-weight: 700; font-size: 20px; margin-top: 8px; }
.pt-sub { color: var(--pl-muted); font-size: 15px; margin-top: 6px; min-height: 2.6em; }

/* ---------- buttons (shared by the to-do check and the closing CTA) ---------- */
.ps-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; text-decoration: none; color: #fff; cursor: pointer; border: 0;
  background: linear-gradient(180deg, var(--pl-accent-l), var(--pl-accent)); font-family: var(--pl-display); font-weight: 700; font-size: 16px;
  padding: 15px 26px; border-radius: 11px; box-shadow: 0 12px 26px -8px rgba(47,125,244,.6); transition: transform .12s, filter .18s; }
.ps-cta:hover { filter: brightness(1.07); transform: translateY(-1px); }
.ps-cta:focus-visible { outline: 2px solid var(--pl-accent-l); outline-offset: 3px; }
.ps-cta.block { width: 100%; }

/* ---------- closing ---------- */
.pc { text-align: center; padding: 74px 0 70px; }
.pc h2 { font-family: var(--pl-display); font-weight: 800; font-size: clamp(32px, 5vw, 54px); line-height: 1.04; letter-spacing: -.02em; max-width: 14em; margin: 0 auto; }
.pc h2 .accent { background: linear-gradient(100deg, var(--pl-accent-l), var(--pl-accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.pc > p { color: var(--pl-muted); font-size: 18px; max-width: 30em; margin: 16px auto 0; }
.pc .ps-cta { margin-top: 28px; padding: 16px 32px; font-size: 17px; }
.pc .pc-fine { font-size: 14px; color: var(--pl-muted); margin-top: 14px; }
.pc-trust { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin-top: 34px; }
.pc-trust li { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--pl-text); }
.pc-trust svg { color: var(--pl-accent-l); flex: none; }

/* ---------- gentle reveal (progressive enhancement; content is visible without JS) ---------- */
.ps-anim .ps-reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.ps-anim .ps-reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .ps-story { gap: 36px; }
  .ps-pair { grid-template-columns: 1fr; }
  .pt { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 880px) {
  .ps-story { grid-template-columns: 1fr; gap: 30px; padding: 40px 0; }
  .ps-story.ps-flip .ps-copy { order: 0; }
  .ps-copy { text-align: center; }
  .ps-copy p { margin-left: auto; margin-right: auto; }
  .ps-feature { padding: 40px 22px; }
}
@media (max-width: 560px) {
  .ps-intro p, .pc > p { font-size: 16.5px; }
  .ps-card { padding: 28px 20px 24px; }
  .pt { padding: 30px 18px; }
  .pv-hist { grid-template-columns: 1fr; justify-items: center; gap: 8px; }
  .pv-receipt { width: 190px; }
  .pv-arrow { transform: rotate(90deg); }
  .pv-hist .pv-app { max-width: 400px; }
  .pv-toast { right: 0; left: 14px; }
  .pv-row .n { width: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .ps-anim .ps-reveal { opacity: 1; transform: none; transition: none; }
  .pt-opt, .pt-opt .box, .ps-cta { transition: none; }
}
