/* Hallmark · genre: modern-minimal · macrostructure: scroll world (one pinned 3D view, seven chapters) · redesign: full
 * critique: P5 H4 E4 S5 R4 V4
 * waivers: 40 camera-scale demo text inside real app recordings; 29 one glass layer (sticky nav); pinned view kept under 60rem (Alvis asked for the scroll world on tablet and phone)
 */
.world { position: relative; --top: 64px; --vh: calc(100svh - var(--top)); }
.world-rail { display: none; }
.ch { position: relative; }
.ch .h1, .ch .h2 { text-wrap: balance; }
.ch-text > .sub, .ch-text > .body { margin-top: 20px; max-width: 34rem; text-wrap: balance; }
.ch-text > .btn, .ch-text > .cta-pair { margin-top: 28px; }
.ch-hero .h1, .ch-end .h1 { font-size: clamp(40px, 5.4vw, 76px); line-height: 1.04; letter-spacing: -.035em; }
.one-line { white-space: nowrap; }
.ch-hero .h1 { font-size: clamp(32px, 4.9vw, 72px); }
/* Title chip as glass (Alvis 2026-12-04): a clear pane with a lit top edge, holding a blue glass tile. */
.ch-hero .chip-word { height: .98em; padding: 0 .12em; margin: 0 .06em; border-radius: 14px; top: -.06em;
  background: linear-gradient(160deg, rgb(255 255 255 / .62), rgb(255 255 255 / .26) 55%, rgb(255 255 255 / .4));
  -webkit-backdrop-filter: blur(10px) saturate(1.8); backdrop-filter: blur(10px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), inset 0 -1px 0 rgb(255 255 255 / .35), 0 0 0 1px rgb(255 255 255 / .7),
    0 0 0 2px rgb(30 37 56 / .06), 0 10px 26px -12px rgb(30 37 56 / .45); }
.ch-hero .chip-word .chip-ico { width: .76em; height: .76em; border-radius: 10px;
  background: linear-gradient(165deg, rgb(132 180 255 / .96), rgb(19 110 251 / .9) 52%, rgb(10 78 196 / .96));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .7), inset 0 0 0 1px rgb(255 255 255 / .18), inset 0 -3px 6px rgb(0 28 90 / .28),
    0 6px 12px -6px rgb(19 110 251 / .7); }
.ch-hero .chip-word .chip-ico::before { content: ''; position: absolute; inset: 1px 1px 52% 1px; border-radius: 9px 9px 40% 40% / 9px 9px 18px 18px;
  background: linear-gradient(rgb(255 255 255 / .42), rgb(255 255 255 / .04)); pointer-events: none; }
.ch-hero .chip-word .chip-ico svg { width: .44em; height: .44em; filter: drop-shadow(0 1px 1px rgb(0 28 90 / .35)); }
.ch-hero .proof-line { margin: 28px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 8px 20px; flex-wrap: wrap; }
/* the line sits over the street photo: an opaque pill keeps it readable on any frame (Alvis 2026-12-04) */
.ch-hero .proof-line span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px 7px 10px; border-radius: 999px;
  background: rgb(255 255 255 / .9); box-shadow: 0 0 0 1px rgb(30 37 56 / .08), 0 6px 16px -8px rgb(30 37 56 / .35); }
.world-on .ch-hero .proof-line { color: #2a3142; }
.ch-hero .proof-line .icon { color: var(--blue); }
.ch-cover .figs > * { white-space: nowrap; }
.ch-cover .figs { justify-content: flex-start; gap: 16px 36px; margin-top: 32px; }
.ch-cover .figs dd { font-size: 30px; line-height: 36px; }
.ch-cover .makes { max-width: none; margin: 32px 0 0; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ch-cover .fine { margin-top: 16px; max-width: 34rem; }
.still { width: 100%; height: auto; margin-top: 40px; border-radius: 12px; }
.phone { display: none; }

/* glass: a clear sheet over the moving view, with a lit edge. Text on it stays full ink.
 * [EXCEPTION] M1/M2 .ch-text, .panel - Alvis asked for glass on the homepage (2026-12-03); the 3D view behind is the rich medium it needs */
:root { --ground: #f4f4f5; } /* neutral room: the track is the only blue in the view (Alvis) */
.world { --glass: linear-gradient(155deg, rgb(255 255 255 / .8), rgb(255 255 255 / .68) 46%, rgb(255 255 255 / .72)); --glass-edge: inset 0 1px 0 rgb(255 255 255 / .95), inset 1px 0 0 rgb(255 255 255 / .55), inset 0 0 0 1px rgb(255 255 255 / .42), 0 0 0 1px rgb(27 36 64 / .07), 0 2px 4px rgb(27 36 64 / .05), 0 24px 48px -16px rgb(27 36 64 / .24); --glass-blur: blur(18px) saturate(1.8); }

/* panels: the real app, in one frame */
.ch-feature .panel { border-radius: 20px; padding: 12px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.ch-feature .crop { margin: 0; height: min(600px, calc(var(--vh) - 96px)); border: 0; border-radius: 10px; box-shadow: none; }
.ch-ask .tabs { margin: 0 0 16px; }
/* tabs: frosted look without a live blur. Four blurred tabs over the moving 3D view stalled the scroll (jank probe
   2026-12-04: 2-13 frames over 33 ms with blur, 0 without, two runs each). */
.ch-ask .tab[aria-selected="false"] { background: linear-gradient(155deg, rgb(255 255 255 / .9), rgb(255 255 255 / .82)); box-shadow: var(--glass-edge); color: var(--ink); }
.ch-ask .glass { max-width: none; padding: 12px; border: 0; border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.ch-ask .stage-view { border-radius: 10px; }
.ch-ask .stage-fade { display: none; }
/* Still process images (Alvis 2026-12-05): one strip per tab. In the scroll world the scroll glides the strip from step
   to step; without it (reduced motion, no WebGL) the visitor scrolls the strip inside the stage. */
.stage-view.steps { aspect-ratio: 1440 / 760; height: auto; }
#hero-stage { cursor: auto; }
.steps .strip { position: absolute; left: 0; top: 0; width: 100%; display: none; }
.steps .strip.on { display: block; }
.steps .strip img { display: block; width: 100%; height: auto; background: #f4f6f9; }
#ask:not(.by-scroll) .stage-view.steps { overflow-y: auto; overscroll-behavior: contain; }
#ask:not(.by-scroll) .steps .strip { position: static; }
.crop[data-pan] img { display: block; width: 100%; height: auto; }
.ch-feature .crop[data-pan] { height: auto; max-height: min(600px, calc(var(--vh) - 96px)); }
@media (prefers-reduced-motion: reduce) { .crop[data-pan] { overflow-y: auto; overscroll-behavior: contain; } }
.ch-ask.by-scroll .tab .prog i { transform: scaleX(var(--at, 0)); animation: none; }

/* ---------- without the live world (no WebGL, reduced motion, no script): normal sections with a picture ---------- */
html:not(.world-on) .ch { padding-top: 96px; }
html:not(.world-on) .ch-hero { padding-top: 64px; }
html:not(.world-on) .ch-panel { margin-top: 32px; }
html:not(.world-on) .ch-end { padding-bottom: 72px; }
@media (min-width: 60.01rem) {
  html:not(.world-on) .ch-hero > .col, html:not(.world-on) .ch-cover > .col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
  html:not(.world-on) .ch-hero .still, html:not(.world-on) .ch-cover .still { margin: 0; }
  html:not(.world-on) .ch-feature > .col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: auto 1fr; column-gap: 64px; }
  html:not(.world-on) .ch-feature .ch-panel { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  html:not(.world-on) .ch-feature .still { align-self: start; }
  html:not(.world-on) .ch-end .still { max-width: 720px; }
}

/* ---------- live world ---------- */
.world-on .still { display: none; }
.world-on .world-rail { display: block; position: absolute; inset: calc(var(--top) * -1) 0 0; pointer-events: none; }
.world-on .world-view { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.world-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity var(--dur-slow) var(--ease); }
.world-view.is-live canvas { opacity: 1; }
.world-view .poster { position: absolute; max-width: none; height: 100%; width: auto; top: 0; left: 74%; transform: translateX(-50%); transition: opacity var(--dur-slow) var(--ease); }
.world-view.is-live .poster { opacity: 0; }
/* the road runs off the last screen softly instead of being cut by a straight edge */
.world-on .ch { z-index: 1; } /* chapters paint above the fade below, so it softens the road only, never the plan cards */
.world-on .world::after { content: ''; position: absolute; z-index: 0; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(rgb(244 244 245 / 0), var(--ground)); pointer-events: none; }

.world-on .ch-hero { min-height: calc(var(--vh) * 1.7); }
.world-on .ch-cover { min-height: calc(var(--vh) * 2.5); }
.world-on .ch-ask { min-height: calc(var(--vh) * 7.6); } /* words, then about two empty screens to watch the jack, stands and wheel, then five tabs of about 0.85 screen each */
.world-on .ch-feature { min-height: calc(var(--vh) * 2.5); }
.world-on .ch-end { min-height: calc(var(--vh) * 2.6); }
.world-on .ch > .col { position: relative; }
.world-on .ch-hero .ch-copy, .world-on .ch-cover .ch-copy { position: sticky; top: var(--top); height: var(--vh); display: grid; align-items: center; }
.world-on .ch-hero .ch-copy { align-items: start; }
.world-on .ch-hero .ch-text { max-width: none; padding-top: 9vh; }
.world-on .ch-cover .ch-text { max-width: 33rem; }
.world-on .ch-end .ch-copy { position: sticky; top: var(--top); height: var(--vh); display: grid; justify-items: center; align-items: start; padding-top: 9vh; text-align: center; }
.world-on .ch-end .cta-pair { justify-content: center; }

/* the closing words wait until the car has driven out from behind them */
.world-on .ch-end .ch-text { transition: opacity 200ms var(--ease); }
.world-on .world:not(.at-end):has(.world-view.is-live) .ch-end .ch-text { opacity: 0; }

/* words on glass once the room is busy behind them */
.world-on .ch-cover .ch-text, .world-on .ch-ask .ch-text, .world-on .ch-feature .ch-text { padding: 28px 32px 32px; border-radius: 20px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
.world-on .ch-text :is(.body, .sub, .fine, dt, .proof-line) { color: #3c4457; }
@supports not (backdrop-filter: blur(1px)) { .world { --glass: rgb(255 255 255 / .94); } }
/* [EXCEPTION] A6 glass stays with Windows transparency off: Alvis asked for glass and his own PC has it off; text meets 4.5:1 on the glass, and prefers-contrast still turns it solid */
@media (prefers-contrast: more) { .world { --glass: #fff; --glass-blur: none; } }
/* header as one floating bar over the view */
@media (min-width: 60.01rem) {
  .world-on .nav, .world-on .nav.is-stuck { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; }
  .world-on .nav .col { position: relative; }
  .world-on .nav .col::before { content: ''; position: absolute; z-index: -1; inset: 6px -20px; border-radius: 16px; background: linear-gradient(rgb(255 255 255 / .72), rgb(255 255 255 / .56)); -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8); box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), 0 0 0 1px rgb(27 36 64 / .07), 0 12px 28px -14px rgb(27 36 64 / .25); }
}

.world-on .ch-ask, .world-on .ch-feature { padding-bottom: 72px; }

/* Ask: the words and the car on the lift first, then the whole app slides up and holds */
.world-on .ch-ask > .col { display: grid; grid-template-rows: calc(var(--vh) * 3.2) minmax(0, 1fr); min-height: inherit; }
.world-on .ch-ask .ch-text { position: sticky; top: calc(var(--top) + 8vh); max-width: 30rem; }
.world-on .ch-ask .panel { position: sticky; top: calc(var(--top) + 20px); margin: 0 auto; max-width: min(74rem, calc((var(--vh) - 120px) * 1.895)); }

/* Sources, Diagnose, Estimates: words stay on one side, the panel rises on the other and stops beside them */
.world-on .ch-feature > .col { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
.world-on .ch-feature .ch-text { position: sticky; top: calc(var(--top) + 8vh); }
.world-on .ch-feature .ch-panel { padding-top: calc(var(--vh) * 1.02); }
.world-on .ch-feature .panel { position: sticky; top: calc(var(--top) + 40px); }

/* ---------- tablet landscape ---------- */
@media (max-width: 75rem) {
  .world-on .ch-feature > .col { gap: 32px; }
  .world-on .ch-cover .ch-text, .world-on .ch-ask .ch-text, .world-on .ch-feature .ch-text { padding: 24px; }
  .ch-cover .figs { gap: 16px 24px; }
}

/* ---------- tablet portrait and phone: one column, the same live view behind it ---------- */
@media (max-width: 60rem) {
  .world-view .poster { left: 50%; }
  .world-on .ch-hero { min-height: calc(var(--vh) * 1.9); }
  .world-on .ch-hero .ch-copy { align-items: start; }
  .world-on .ch-hero .ch-text { padding: 5vh 0 0; }
  .ch-hero .h1 { font-size: clamp(24px, 7.2vw, 64px); }
  .world-on .ch-cover { min-height: calc(var(--vh) * 2.6); }
  .world-on .ch-cover .ch-copy { position: static; height: auto; display: block; }
  .world-on .ch-cover .ch-text, .world-on .ch-ask .ch-text, .world-on .ch-feature .ch-text { max-width: none; }
  .world-on .ch-ask .ch-text, .world-on .ch-feature .ch-text { top: calc(var(--top) + 16px); }
  .world-on .ch-ask .ch-panel { height: calc(var(--vh) * 4.5) !important; }
  .world-on .ch-feature { min-height: 0; }
  .world-on .ch-ask > .col, .world-on .ch-feature > .col { display: block; min-height: 0; }
  .world-on .ch-ask .ch-copy, .world-on .ch-feature .ch-copy { min-height: calc(var(--vh) * 1.15); }
  /* the raised car and the wheel coming off play out before the five tabs rise over the view (Alvis) */
  .world-on .ch-ask .ch-copy { min-height: calc(var(--vh) * 3.5); }
  .world-on .ch-ask .ch-panel, .world-on .ch-feature .ch-panel { padding-top: 0; height: auto; }
  .world-on .ch-feature .panel { position: static; max-width: none; }
  .world-on .ch-ask .panel { top: calc(var(--top) + 12px); max-width: none; }
  .world-on #estimates { padding-bottom: calc(var(--vh) * .8); }
  .ch-feature .crop { height: min(640px, calc(var(--vh) - 64px)); }
}

/* portrait: the track runs out before it reaches the hero words */
@media (max-width: 60rem), (max-aspect-ratio: 9/10) {
  .world-on .ch-hero .ch-text { position: relative; isolation: isolate; }
  .world-on .ch-hero .ch-text::before { content: ''; position: absolute; z-index: -1; inset: 0 -100vw -26px; background: linear-gradient(var(--ground) calc(100% - 26px), rgb(244 244 245 / 0)); pointer-events: none; }
}
/* the source line reads as one sentence when it has to wrap */
@media (max-width: 24rem) {
  .world .ch-hero .proof-line span { display: inline; line-height: 22px; }
  .world .ch-hero .proof-line .motor-logo { display: inline-block; vertical-align: -1px; margin: 0 2px; }
  .world .ch-hero .proof-line .icon { display: inline-block; vertical-align: -2px; margin-right: 6px; }
}
/* very narrow phones: the three figures wrap */
@media (max-width: 22.5rem) {
  .world .ch-cover .figs { grid-template-columns: auto auto; justify-content: start; gap: 12px 32px; }
}

/* ---------- phone: the phone app, not a shrunken desktop ---------- */
@media (max-width: 40rem) {
  .ch-hero .h1 { font-size: clamp(26px, 8.2vw, 48px); } /* one line without the icon chip */
  .ch-hero .chip-word { display: none; }
  .ch .glass, .ch .crop { display: none; }
  .ch-ask .tabs { justify-content: flex-start; overflow-x: auto; margin: 0 -16px 12px; padding: 1px 16px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 16px; }
  .ch-ask .tab { flex: none; white-space: nowrap; scroll-snap-align: start; }
  .phone { display: block; }
  .world-on .ch-ask .phone { max-width: calc((var(--vh) - 84px) * .541 + 16px); margin-inline: auto; }
  .phone img { display: none; width: 100%; height: auto; border-radius: 12px; }
  .phone img.on { display: block; }
  .ch-ask .phone { border-radius: 20px; padding: 8px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-edge); }
  .ch-feature .panel { padding: 8px; }
  .world-on .ch-cover .ch-text, .world-on .ch-ask .ch-text, .world-on .ch-feature .ch-text { padding: 20px; }
  .ch-text > .sub, .ch-text > .body { margin-top: 12px; }
  .ch-text > .btn, .ch-text > .cta-pair { margin-top: 20px; }
  .ch-hero .proof-line { margin-top: 20px; }
  .ch-cover .figs { display: grid; grid-template-columns: auto auto auto; justify-content: space-between; gap: 12px; margin-top: 24px; }
  .ch-cover .figs dt { white-space: normal; }
  .ch-cover .figs > div { justify-content: flex-end; }
  .world .ch-cover .figs { column-gap: 8px; }
  .world .ch-cover .figs dt { font-size: 13px; }
  .ch-cover .figs dd { font-size: 20px; line-height: 28px; }
  .ch-cover .makes { margin-top: 24px; }
}

/* The ending: an empty stretch where the van drives away (its track starts here), then the plans as the last chapter.
   Wide screens: the cards stay pinned at the top and each one appears once the van has driven past it (world/main.js);
   the van uses the strip under them. Narrow or portrait: the cards stack and appear as they scroll into view. */
html:not(.world-on) .ch-drive { display: none; }
.world-on .ch-drive { min-height: calc(var(--vh) * 2.2); }
.world-on .ch-plans { min-height: calc(var(--vh) * 4.6); } /* about 1.5 screens of scroll with every card shown before the row leaves */
.world-on .ch-plans > .col { min-height: inherit; display: flex; flex-direction: column; }
.world-on .ch-plans .pin { position: sticky; top: calc(var(--top) + 16px); }
.world-on .ch-plans .cells { background: transparent; border-color: transparent; }
.world-on .ch-plans .plan:not(.feat) { box-shadow: 0 0 0 1px #d8dde8; }
/* wide screens: main.js sets --rv (0..1) per card from the van's tail, uncovering the card from its left edge */
.world-on .ch-plans :is(.plan, .pin > .center) { clip-path: inset(-40px calc((1 - var(--rv, 1)) * (100% + 48px) - 24px) -24px -24px); }
/* layouts (main.js stacked()/vert() match these): a phone (w/h < 0.6) stacks the cards and the van drives down past them;
   a small landscape screen or one 600px wide or less stacks them and fades each in; everything else keeps the row of four */
@media (max-width: 60rem) and (min-aspect-ratio: 9/10), (max-width: 37.5rem), (max-aspect-ratio: 599/1000) {
  .world-on .ch-drive { min-height: calc(var(--vh) * 1.4); }
  .world-on .ch-plans { min-height: 0; }
  .world-on .ch-plans > .col { display: block; }
  .world-on .ch-plans .pin { position: static; }
}
@media (min-width: 37.56rem) and (min-aspect-ratio: 600/1000) and (max-aspect-ratio: 899/1000), (min-width: 60.06rem) and (min-aspect-ratio: 600/1000) {
  .world-on .ch-plans .cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 75rem) and (min-width: 37.56rem) and (min-aspect-ratio: 600/1000) {
  .world-on .ch-plans .plan { padding: 20px 14px; }
  .world-on .ch-plans .plan .price { font-size: 30px; }
}
@media (max-width: 60rem) and (min-aspect-ratio: 9/10), (max-width: 37.5rem) and (min-aspect-ratio: 600/1000), (prefers-reduced-motion: reduce) {
  .world-on .ch-plans :is(.plan, .pin > .center) { clip-path: none; }
  .world-on .ch-plans .plan { transition: opacity 400ms var(--ease), transform 400ms var(--ease); }
  .world-on .ch-plans .plan:not(.in) { opacity: 0; transform: translateY(12px); }
}
/* phone: main.js sets --rb (px cut from the bottom) so each part shows only above the van's tail */
@media (max-aspect-ratio: 599/1000) and (prefers-reduced-motion: no-preference) {
  .world-on .ch-plans :is(.head, .plan, .pin > .center) { clip-path: inset(-24px -24px var(--rb, -24px) -24px); }
  .world-on .ch-plans { padding-bottom: 50svh; } /* room for the van to drive off before the next section */
}
@media (prefers-reduced-motion: reduce) {
  .world-on .ch-plans .plan { transform: none !important; transition: opacity 150ms linear; }
}
