/* The How it works page (plan.md, "How it works"). #hero: the headline centered on the cream, under it one wide rounded
   frame of the planner filling up (the kit's rotate), wyw's notices in glass over its dark left side. #route: o-route
   in its panel on the designed ground. #yours: the bike shop full-bleed, the owner's three steps in glass over its left
   two thirds (goal and scan, then the plan under them), "Then you say yes" toward her; under 1200 px the steps in a
   row that scrolls sideways over the photo's foot. #ours: three tall photos, each with its step's scene in glass at
   its foot (hanging from it under 1200 px, a sideways row under 1024). #plan: plan-builder in glass over the photo's
   window side, reaching out onto the cream. #team: the owner's dashboard on the laptop's screen. #faq. #close: the
   cafe owner opening for the day. Tokens only. */

/* ---------- #hero ---------- */
.hwh { padding-top: clamp(1.75rem, 3.5vw, 3rem); }
.hwh__head { max-width: 52rem; margin: 0 auto clamp(1.75rem, 3vw, 2.5rem); text-align: center; }
.hwh__title { margin: 0 0 1rem; font-size: clamp(2.5rem, 1.2rem + 2.9vw, 3.9rem); line-height: 1.05; }
.hwh__line { margin: 0 auto 1.6rem; }
.hwh__cta { display: grid; justify-items: center; }
.hwh__stage { position: relative; height: clamp(440px, 39vw, 560px); }
.hwh__frame { position: absolute; inset: 0; isolation: isolate; overflow: hidden; border-radius: var(--radius-l); background: var(--c-ink); box-shadow: var(--shadow-l); }
/* one still grade over the clip: its left side a little deeper under the notices */
.hwh__frame::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 34%, transparent), transparent 52%); }

/* the kit's rotate, as kit.md gives it */
[data-kit-scene="rotate"] [data-kit-slide] { position: absolute; inset: 0; margin: 0; visibility: hidden; overflow: hidden; }
[data-kit-scene="rotate"] [data-kit-slide][data-kit-on] { visibility: visible; z-index: 2; opacity: var(--kit-move, 1); transform: translateX(var(--kit-glide, calc((1 - var(--kit-move, 1)) * 4%))); }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-prev])) [data-kit-slide][data-kit-on] { transform: none; opacity: 1; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { visibility: visible; z-index: 1; }
[data-kit-scene="rotate"] [data-kit-slide] video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pos, 50% 50%); }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-kit-on])) [data-kit-slide]:not([data-kit-slide] ~ [data-kit-slide]) { visibility: visible; }
[data-kit-scene="rotate"] [data-kit-slide] video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; clip-path: inset(2px); }
[data-kit-scene="rotate"] [data-kit-slide] video[data-kit-shown] { clip-path: none; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { opacity: clamp(0, (1 - var(--kit-move, 0)) * 1000, 1); }
@media (scripting: none) { [data-kit-scene="rotate"] [data-kit-slide] video { display: none; } }
/* the furniture maker at his bench at the frame's right, his face and his hands on the drill in view; the window and
   the bench at its left, under the notices (round 3) */
.hwh__slide--1 { --pos: 50% 24%; }

/* wyw over the desk: its tag at the top, the notices at its box's foot (they hang 30 px below it); the box ends high
   enough that the notices stand on the first screen, and is 480 px wide or more, where all four show */
.scene.hwh__wyw { position: absolute; z-index: 4; top: 1.25rem; left: 1.25rem; width: min(520px, 46%); height: min(370px, calc(100% - 30px - 2.5rem)); }
.hwh__stop { top: 1rem; right: 1rem; }
@media (max-width: 1199px) {
  .scene.hwh__wyw { width: min(440px, 52%); }
}
@media (max-width: 759px) {
  .hwh__stage { height: 500px; }
  .hwh__slide--1 { --pos: 56% 40%; }
  .hwh__frame::after { background: linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 40%, transparent), transparent 55%); }
  .scene.hwh__wyw { top: .75rem; bottom: calc(30px + .75rem); left: .75rem; right: .75rem; width: auto; height: auto; }
}

/* ---------- #route: o-route in its panel; the panel's height follows the scene's layout, which follows its width ---------- */
.hwr__in { container-type: inline-size; }
.hwr__panel { height: 600px; }
.scene.hwr__scene { position: absolute; inset: 0; border-radius: inherit; }
.hwr__stop { top: 1rem; right: 1rem; }
@container (max-width: 859px) { .hwr__panel { height: 710px; } }
@container (max-width: 639px) {
  .hwr__panel { height: 920px; }
  .hwr__stop { right: auto; left: 1rem; }   /* the arrow's head stands at the panel's upper right */
}

/* ---------- #yours: the owner's three steps over her shop ---------- */
.hwy { padding-bottom: 0; }
.hwy__head { max-width: 46rem; margin: 0 auto var(--space-4); text-align: center; }
.hwy__head .lede { margin-inline: auto; margin-bottom: 0; }
.hwy__frame { position: relative; isolation: isolate; display: grid; align-items: end; min-height: clamp(720px, 54vw, 800px); padding-block: 3rem; }
.hwy__pic { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--c-ink); }
.hwy__pic img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 42%; }
.hwy__steps { display: grid; grid-template-columns: 19rem 23.5rem; grid-template-areas: "goal scan" "plan plan"; gap: 1rem; width: max-content; margin: 0 0 0 max(var(--gutter), calc((100% - var(--max-w)) / 2)); padding: 0; list-style: none; }
.hwy__item { position: relative; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.hwy__item--goal { grid-area: goal; min-height: 21rem; }
.hwy__item--scan { grid-area: scan; }
.hwy__item--plan { grid-area: plan; width: 35rem; }
.scene.hwy__scene { width: 100%; margin-top: auto; }
.hwy__item--goal .scene.hwy__scene { margin-top: 0; }   /* the chat grows down from under its name, into its item's room */
.hwy__item--plan .scene.hwy__scene { padding: 0; }
.hwy__stop { top: 1.25rem; right: 1.25rem; }
.hwy__tour { display: none; }
/* a step's name with its number (also on #ours' photos): a glass pill */
.hw-step { display: inline-flex; align-self: flex-start; align-items: center; gap: .55rem; margin: 0; padding: .35rem .95rem .35rem .35rem; border-radius: 999px; background: color-mix(in srgb, var(--c-paper) 86%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); box-shadow: var(--shadow-s), inset 0 0 0 1px color-mix(in srgb, var(--c-paper) 70%, transparent); color: var(--c-ink); font: 800 .9375rem/1.2 var(--font-ui); }
.hw-step__n { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--c-brand-dark); color: var(--c-paper); font-size: .875rem; }
/* the hand-over: after the plan, toward her at the counter */
.hwy__yes { position: absolute; z-index: 2; bottom: 4.25rem; left: calc(max(var(--gutter), calc((100% - var(--max-w)) / 2)) + 36.25rem); display: flex; align-items: center; gap: .7rem; margin: 0; padding: .7rem 1.1rem .7rem .7rem; border-radius: var(--radius-s); background: color-mix(in srgb, var(--c-paper) 88%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); box-shadow: var(--shadow-m), inset 0 0 0 1px color-mix(in srgb, var(--c-paper) 70%, transparent); color: var(--c-ink); }
.hwy__yes-icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--c-accent-text); color: var(--c-paper); font-size: 1.15rem; }
.hwy__yes b { display: block; font: 800 1rem/1.25 var(--font-ui); }
.hwy__yes small { display: block; color: var(--c-ink-soft); font: 600 .8125rem/1.3 var(--font-ui); }
/* under 1200 px: the photo on top, her at its right; the kit's tour turns through the three steps over its foot, one
   at a time (a row of three would leave two of them off the photo), with its own stop icon */
@media (max-width: 1199px) {
  .hwy__frame { display: block; min-height: 0; padding: 0; }
  .hwy__pic { position: relative; inset: auto; height: 600px; }
  .hwy__pic img { object-position: 74% 40%; }
  .hwy__steps, .hwy__stop { display: none; }
  /* the tour starts 17rem above the photo's foot, below her face (its upper half) */
  .hwy__tour { position: relative; z-index: 1; display: grid; gap: .75rem; width: min(26rem, calc(100% - 2 * var(--gutter))); margin: -17rem 0 0 var(--gutter); }
  .hwy__tabs { display: flex; gap: .5rem; }
  .hwy__tabs [role="tab"] { position: relative; flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-width: 0; padding: .45rem .6rem; overflow: hidden; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--c-paper) 82%, transparent); -webkit-backdrop-filter: blur(12px) saturate(1.3); backdrop-filter: blur(12px) saturate(1.3); box-shadow: var(--shadow-s); color: var(--c-ink); font: 800 .875rem/1.2 var(--font-ui); white-space: nowrap; cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), translate var(--dur-fast) var(--ease-out), scale var(--dur-fast) var(--ease-out); }
  .hwy__tabs [role="tab"] .hw-step__n { flex: none; width: 1.5rem; height: 1.5rem; font-size: .8125rem; }
  .hwy__tabs [role="tab"]:hover { background: color-mix(in srgb, var(--c-paper) 94%, transparent); }
  .hwy__tabs [role="tab"][aria-selected="true"] { background: var(--c-paper); box-shadow: var(--shadow-m), inset 0 0 0 2px var(--c-brand-dark); }
  .hwy__tabs [role="tab"]:focus-visible { outline: 2px solid var(--c-paper); outline-offset: 2px; }
  .hwy__time { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--c-brand); transform-origin: 0 50%; scale: var(--kit-fill, 0) 1; }
  .hwy__panels { min-height: 20rem; }
  .hwy__panels .scene[data-scene="leadbars"] { padding: 0; }
  .hwy__tstop { position: absolute; top: -3.25rem; left: 0; right: auto; }
  /* the tour's own stop icon (the kit's, not the runtime's [data-stop]): one glyph at a time */
  .hwy__tstop .stop__play, .hwy__tstop[aria-pressed="true"] .stop__pause { display: none; }
  .hwy__tstop[aria-pressed="true"] .stop__play { display: inline; }
  .hwy__yes { position: static; width: max-content; margin: 1rem auto 0; }
}
/* under 390 px the three tabs' whole names (a row that does not wrap) set the tour's width, 22 px past a 360 px screen:
   the tour takes the screen less .75rem a side, its one column never wider than that, and the tabs draw a little
   tighter, so every name stays whole */
@media (max-width: 389px) {
  .hwy__tour { grid-template-columns: minmax(0, 1fr); width: calc(100% - 1.5rem); margin-left: .75rem; }
  .hwy__tabs { gap: .375rem; }
  .hwy__tabs [role="tab"] { gap: .35rem; padding: .45rem .5rem; font-size: .8125rem; }
  .hwy__tabs [role="tab"] .hw-step__n { width: 1.375rem; height: 1.375rem; }
}

/* ---------- #ours: the team's three steps, each on a photo of its own ---------- */
.hwo__head { max-width: 46rem; margin: 0 auto var(--space-4); text-align: center; }
.hwo__head .lede { margin-inline: auto; margin-bottom: 0; }
.hwo__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); margin: 0; padding: 0; list-style: none; }
.hwo__item { display: grid; gap: .9rem; align-content: start; min-width: 0; }
.hwo__media { position: relative; isolation: isolate; height: 600px; }
.hwo__pic { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: var(--radius-m); background: var(--c-ink); box-shadow: var(--shadow-m); }
.hwo__pic img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }
.hwo__item--launch { --pos: 46% 50%; }
.hwo__item--leads { --pos: 50% 50%; }
.hwo__item--tune { --pos: 20% 50%; }
.hwo__n { position: absolute; top: .9rem; left: .9rem; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--c-paper); box-shadow: var(--shadow-m); color: var(--c-brand-text); font: 800 1.15rem/1 var(--font-ui); }
.scene.hwo__scene { position: absolute; left: .75rem; right: .75rem; bottom: .75rem; }
.hwo__stop { top: .9rem; right: .9rem; }
.hwo__stop--item { display: none; }
.hwo__item h3 { margin: 0; }
.hwo__item p { margin: -.4rem 0 0; color: var(--c-ink-soft); font-size: var(--fs-small); }
/* under 1200 px: each scene hangs from its photo's foot, more than half of it on the photo, clear of the faces */
@media (max-width: 1199px) {
  .hwo__media { height: auto; padding-top: 440px; }
  .hwo__pic { bottom: auto; height: 440px; }
  .scene.hwo__scene { position: relative; inset: auto; margin: -12rem .75rem 0; }
}
/* under 1024 px: a row that scrolls sideways, each photo with its own stop icon */
@media (max-width: 1023px) {
  .hwo__row { display: flex; gap: .85rem; margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) .75rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); }
  .hwo__item { flex: 0 0 min(92%, 22rem); scroll-snap-align: start; }
  .hwo__stop:not(.hwo__stop--item) { display: none; }
  .hwo__stop--item { display: grid; }
}
/* on the phone each scene takes its photo's whole width: leads' tilted board needs the room */
@media (max-width: 759px) { .scene.hwo__scene { margin: -12rem .25rem 0; } }
/* under 1200 px a lead's source rides its card's top right corner, so its line ("Asked a quote") keeps whole beside
   the avatar instead of ending in "…" */
@media (max-width: 1199px) {
  .scene.hwo__scene .ld-row { grid-template-columns: 32px minmax(0, 1fr); }
  .scene.hwo__scene .ld-src { position: absolute; top: 7px; right: 8px; padding: 4px 8px; }
}

/* ---------- #plan: plan-builder over the photo's window side, reaching out onto the cream ---------- */
.hwp__head { max-width: 46rem; margin-bottom: var(--space-4); }
.hwp__head .lede { margin-bottom: 0; }
.hwp__stage { position: relative; height: 620px; }
.hwp__pic { position: absolute; top: 0; bottom: 0; left: 0; width: 80%; overflow: hidden; border-radius: var(--radius-l); background: var(--c-ink); box-shadow: var(--shadow-l); }
.hwp__pic img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 100% 40%; }
.scene.hwp__scene { position: absolute; top: 30px; right: 0; width: 600px; height: 560px; }
.hwp__stop { top: 1rem; left: 1rem; }
/* under 1200 px: the photo on top, the plan under it, more than half of it on the photo, below his face */
@media (max-width: 1199px) {
  .hwp__stage { height: auto; padding-top: 600px; }
  .hwp__pic { right: 0; bottom: auto; width: auto; height: 600px; }
  .hwp__pic img { object-position: 55% 30%; }
  .scene.hwp__scene { position: relative; inset: auto; width: min(600px, calc(100% - 2rem)); margin: -19.25rem auto 0; }
  .hwp__stop { top: calc(600px - 19.25rem - 3.25rem); left: auto; right: 1rem; }   /* just above the plan, clear of his face */
}
@media (max-width: 759px) {
  .hwp__stage { padding-top: 680px; }
  .hwp__pic { height: 680px; }
  .hwp__pic img { object-position: 46% 30%; }
  .scene.hwp__scene { width: auto; height: 700px; margin: -22.75rem .5rem 0; }
  /* inside the plan's top corner, beside its title: the plan is nearly a phone screen tall, so the icon above it
     would not fit in one view with it */
  .hwp__stop { z-index: 6; top: calc(680px - 22.75rem + .6rem); right: 1.1rem; }
}

/* ---------- #team: the owner's dashboard on the laptop ---------- */
.hwt__in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.hwt__words { max-width: 28rem; }
.hwt__words .lede { margin-bottom: 0; }
.hwt__frame { position: relative; height: clamp(440px, 38vw, 540px); margin: 0; overflow: hidden; border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-l); }
.hwt__photo { position: absolute; inset: 0; margin: 0; }
.hwt__photo > img { width: 100%; height: 100%; object-fit: cover; object-position: 52% 50%; }
.hwt__stop { top: 1rem; right: 1rem; }
@media (max-width: 1023px) {
  .hwt__in { grid-template-columns: minmax(0, 1fr); }
  .hwt__words { max-width: 40rem; }
  .hwt__frame { height: 480px; }
}
/* on the phone the screen fills most of the frame's width, so its words stay readable */
@media (max-width: 759px) {
  .hwt__frame { height: 445px; }
  .hwt__photo > img { object-position: 55% 50%; }
}

/* the dashboard (designed at 420 x 262) */
.dash { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; background: var(--c-paper); color: var(--c-ink); font-family: var(--font-ui); }
.dash__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 12px 14px; border-bottom: 1px solid var(--c-line); }
.dash__brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
.dash__mark { flex: none; width: 22px; height: 22px; fill: var(--c-brand); }
.dash__human { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--c-action); color: var(--c-on-action); font-size: 16px; font-weight: 800; white-space: nowrap; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-action) 22%, transparent); }
.dash__human .icon { width: 18px; height: 18px; }
.dash__chat { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 14px; list-style: none; background: color-mix(in srgb, var(--c-paper-alt) 55%, var(--c-paper)); }
.dash__msg { max-width: 84%; padding: 9px 13px; border-radius: 16px; font-size: 18px; font-weight: 600; line-height: 1.3; }
.dash__msg--me { align-self: flex-end; border-bottom-right-radius: 5px; background: var(--c-brand-dark); color: var(--c-paper); }
.dash__msg--team { display: flex; align-items: flex-start; gap: 9px; align-self: flex-start; max-width: 92%; padding: 0; background: none; }
.dash__msg--team > span:last-child { padding: 9px 13px; border-radius: 16px; border-bottom-left-radius: 5px; background: var(--c-paper); box-shadow: var(--shadow-s), inset 0 0 0 1px var(--c-line); }
.dash__av { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--c-paper); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c-brand) 45%, var(--c-paper)); }
.dash__avmark { width: 20px; height: 20px; fill: var(--c-brand); }
.dash__typing { display: flex; align-items: center; gap: 9px; align-self: flex-start; }
.dash__dots { display: flex; gap: 5px; padding: 13px 14px; border-radius: 16px; background: var(--c-paper); box-shadow: inset 0 0 0 1px var(--c-line); }
.dash__dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-ink-soft); opacity: .55; }
/* the dots give way to the answer */
.dash__chat:has(> .dash__msg--team[data-kit-on]) .dash__typing { display: none; }
.dash__chat [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 10px)); }
@media (scripting: enabled) {
  .dash__chat [data-kit-at]:not(:first-child) { opacity: var(--kit-in, 0); transform: translateY(calc((1 - var(--kit-in, 0)) * 10px)); }
}

/* ---------- #close: the cafe owner opening for the day, the panel at her left ---------- */
.hwclose { --close-pos: 62% 30%; --close-pos-m: 64% 25%; }
.hwclose .close__stop { right: auto; left: 1rem; }
.hwclose__seq { top: 1.5rem; right: clamp(1.25rem, 2.5vw, 2rem); width: min(15rem, 22%); }
/* under 1200 px: her video on top, fading into the navy, the panel on the navy under it */
@media (max-width: 1199px) {
  .hwclose { align-items: end; justify-items: center; padding: 24rem 1.5rem 1.5rem; }
  .hwclose::after { display: none; }
  .hwclose .close__media { bottom: auto; height: 27rem; -webkit-mask-image: linear-gradient(180deg, var(--c-ink) 74%, transparent); mask-image: linear-gradient(180deg, var(--c-ink) 74%, transparent); }
  .hwclose .close__media video { object-position: 64% 30%; }
  .hwclose .close__stop { left: auto; right: 1rem; }
  .hwclose__seq { top: 1.25rem; left: 1.25rem; right: auto; width: min(15rem, 32%); }   /* over the grinders, clear of her face */
}
/* on the phone she stands in the middle of the narrow frame: no card there (her video shows the moment), the panel under her */
@media (max-width: 759px) {
  .hwclose { padding: 19rem .75rem .75rem; justify-items: stretch; }
  .hwclose .close__media { height: 21rem; }
  .hwclose .close__media video { object-position: var(--close-pos-m); }
  .hwclose .close__stop { right: .75rem; }
  .hwclose__seq { display: none; }
}
