/*
  What we help with (solutions.html), on the site's Main Street look.

  Start from the problem, in the owner's own words: six cards dealt out from
  one deck. Pick one and the answer opens beneath as a four-leg relay (what
  comes in, what AI takes on, where you decide, what we'd measure), with the
  street's shops as doors into each business's workflow.

  The page's content is all in the HTML; js/solutions.js adds the deal, the
  picking and the relay. Without it, every answer shows in turn.
*/

/* The motion curves, the green kicker and the press feedback are the site's own (css/styles.css). */
.ms-page {
  --rule: rgba(34, 50, 44, 0.22); --dots: 2px dotted rgba(34, 50, 44, 0.3);
  --ease: var(--ease-out);
  display: block;
}

/* ---------- Type and small parts ---------- */

.ms-page .page-hero .lead { margin-top: 22px; color: var(--ink-soft); }
.ms-label { font-family: var(--sans); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.3; text-transform: uppercase; color: var(--ink-soft); }

/* What AI could take on: green ticks. Where you stay in charge: brick squares. */
.ms-ai li, .ms-you li { position: relative; padding-left: 26px; line-height: 1.45; }
.ms-ai li + li, .ms-you li + li { margin-top: 7px; }
.ms-ai li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 16px; height: 16px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5 L7 11.5 L12 5' fill='none' stroke='%23fffbf1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.ms-you li::before { content: ""; position: absolute; left: 2px; top: 0.32em; width: 12px; height: 12px; border-radius: 3px; background: var(--brick); border: 2px solid var(--ink); }

/* "We'd measure": a mustard rule, as on the site. */
.ms-measure { padding: 2px 0 2px 14px; border-left: 4px solid var(--mustard); line-height: 1.5; }
.ms-measure b { font-weight: 700; }

/* ---------- Motion: each part rises in once ---------- */

html.ms-motion .ms-page [data-reveal],
html.ms-motion .ms-page [data-once] { transition: opacity 0.38s var(--ease-out), transform 0.38s var(--ease-out); transition-delay: var(--d, 0ms); }
html.ms-motion .ms-page [data-reveal]:not(.is-in),
html.ms-motion .ms-page [data-once]:not(.is-in) { opacity: 0; transform: translateY(12px); }
/* A missing script must never leave the page unreadable. */
html.ms-motion:not(.ms-live) .ms-page :is([data-reveal], [data-once]) { animation: ms-failsafe 0s 2.5s forwards; }
@keyframes ms-failsafe { to { opacity: 1; transform: none; } }

/* Reduced motion: fewer and gentler, not none. Fades and colour changes stay; movement goes. */
@media (prefers-reduced-motion: reduce) {
  .ms-page *, .ms-page *::before, .ms-page *::after { transition-property: opacity, color, background-color, border-color !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ---------- See one of these at work: its own green panel, a doorway to the street ---------- */
/* The panel frames itself, so it doesn't need a full section's worth of space above it too. */
.ms-try { padding-top: clamp(8px, 2vw, 24px); }
/*
  The worked example: the walk down Main Street, standing still. The walk's
  sky, city and sidewalk run behind the whole card; the words sit on the
  left and the five shops stand on the sidewalk on the right. js/street.js
  draws the shops (and steps through their doors); js/street-still.js sets
  --u (pixels per drawing unit) and lays the walk's own skyline, clouds and
  paving around them. css/walk.css styles those, as on the walk.
*/
.ms-try-card {
  --u: 0.56;
  --ground-h: calc(var(--u) * 92px);
  --city: 2.7;
  --shop-gap: 8;
  --shop-pad: 4;
  --far-1: rgb(207, 225, 216); --far-2: rgb(173, 201, 189); --far-win: rgb(196, 218, 208); --far-lights: 0;
  position: relative; border: var(--line) solid var(--ink); border-radius: var(--r-lg); overflow: clip; box-shadow: 0 8px 0 var(--ink); background: rgb(237, 241, 225); color: var(--ink);
}
.ms-try-view { overflow: hidden; padding-bottom: 0; }
.ms-try-cam { position: relative; display: grid; grid-template-columns: minmax(0, 0.72fr) minmax(0, 1fr); align-items: end; column-gap: clamp(16px, 2.4vw, 36px); background: linear-gradient(rgb(175, 209, 200), rgb(237, 241, 225) 80%); }

/* Still: no twinkling windows here. Hover and the door crossing still answer. */
.ms-try-card .tw { animation: none !important; }

/* ---------- The sky: the sun and the walk's clouds ---------- */
.ms-try-sky { position: absolute; inset: 0; pointer-events: none; }
.ms-try-sun { position: absolute; right: 6%; top: clamp(24px, 3.4vw, 42px); width: clamp(48px, 5.2vw, 72px); aspect-ratio: 1; border-radius: 50%; background: var(--mustard); border: var(--line) solid var(--ink); box-shadow: 0 0 0 10px rgba(227, 167, 47, 0.18), 0 0 0 22px rgba(227, 167, 47, 0.08); }
.ms-try-clouds { position: absolute; inset: 0; }
/* The walk's clouds (css/walk.css draws them), placed in this sky at this scale. */
.ms-try-clouds .walk-cloud-band { will-change: auto; }
.ms-try-clouds .walk-cloud { width: calc(var(--u) * 140px * var(--cloud-size)); }

/* ---------- The city and the sidewalk, right across the card ---------- */
/* The city at 2.7x the street's scale: real skyscrapers, the same height right across the card. */
.ms-try-far { position: absolute; left: 0; right: 0; bottom: var(--ground-h); height: calc(var(--u) * var(--city) * 200px); overflow: hidden; pointer-events: none; }
.ms-try-far-layer { position: absolute; left: 0; bottom: 0; height: 100%; display: flex; }
.ms-try-far-layer svg { display: block; height: 100%; width: auto; max-width: none; flex: none; }
.ms-try-ground { position: absolute; left: 0; right: 0; bottom: 0; height: var(--ground-h); overflow: hidden; background: var(--paper-2); border-top: max(1.5px, calc(var(--u) * 2.5px)) solid var(--ink); pointer-events: none; }
/* The walk's paving (css/walk.css styles it). Drawn 10 units deeper than the sidewalk so its kerb
   falls below the card: the flags run right to the card's edge. */
.ms-try-ground .ms-try-paving { right: 0; height: calc(100% + var(--u) * 10px); will-change: auto; }
/* The drains sit against the kerb, so they go with it. */
.ms-try-ground .pave-drain { display: none; }

/* ---------- The words, on the left ---------- */
.ms-try-text { position: relative; z-index: 2; padding: clamp(28px, 4vw, 52px) 0 calc(var(--ground-h) + var(--text-gap, 66px)) clamp(24px, 4vw, 52px); }
.ms-try h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.05; }
.ms-try-lead { margin-top: 14px; max-width: 30em; font-size: 1.08rem; line-height: 1.55; color: var(--ink-soft); }
.ms-try-btn { margin-top: 22px; }
.ms-try-arrow { width: 9px; height: 9px; margin-left: 2px; border-top: 2.5px solid currentColor; border-right: 2.5px solid currentColor; transform: rotate(45deg); transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .ms-try-btn:hover .ms-try-arrow { transform: translateX(3px) rotate(45deg); }
}

/* ---------- The shops, on the right, standing on the sidewalk ---------- */
.ms-try-scroll { position: relative; z-index: 1; overflow: visible; padding-right: clamp(12px, 2vw, 28px); }
.ms-try-scroll::before { display: none; }
.ms-try-world { position: relative; padding: calc(var(--u) * 24px) 0 var(--ground-h); }
/* As on the walk, the row stands 8 units into the sidewalk: each shop's plinth is drawn to sit in it. */
.ms-try-world .street-row { display: flex; align-items: flex-end; min-width: 0; max-width: none; margin: 0 0 calc(var(--u) * -8px); padding: 0 calc(var(--u) * var(--shop-pad) * 1px); }
/* Only the five shops: the walk's scenery and the office stay on the walk. */
.ms-try-world .street-prop, .ms-try-world .street-ws { display: none; }
.ms-try-world .street-b { flex: none; width: calc(var(--w) * var(--u) * 1px); margin-right: calc(var(--u) * var(--shop-gap) * 1px); position: relative; overflow: visible; border-radius: 0; }
.ms-try-world .street-b:last-of-type { margin-right: 0; }
.ms-try-world .street-b:focus-visible { outline-offset: 4px; }
/* A shop's name shows on the sidewalk when you point at it or tab to it, as the stop's sign does on the walk. */
.ms-try-world .street-label { position: absolute; left: 50%; top: calc(100% + var(--u) * 22px); z-index: 3; height: auto; padding: 0; background: none; border: 0; transform: translateX(-50%); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms ease; }
.ms-try-world .street-kind { display: none; }
.ms-try-world .street-name { font-size: 0.86rem; background: var(--white); border-color: var(--ink); }
.ms-try-world .street-b:hover .street-label, .ms-try-world .street-b:focus-visible .street-label { opacity: 1; }
.ms-try-world .street-b:focus-visible .street-name { background: var(--mustard); }

/*
  Stepping through a door. On the homepage the street fills the screen, so
  the walk's crossing only has to cover the street. Here the street is a card
  on a page, so the page around it goes to paper too:
  going in, the paper and the card's frame fade while the door opens, the
  camera pushes through over plain paper and the doorway dissolves into it,
  as on the walk; coming back, the paper holds while the camera pulls out
  of the door, then gives way to the page once the street has settled.
*/
.ms-try-surround { position: fixed; inset: 0; z-index: 70; background: var(--paper); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 280ms ease, visibility 0s linear 280ms; }
.ms-try-card:is(.is-zooming, .is-door-exiting) { z-index: 71; }
.ms-try-card { transition: border-color 280ms ease, box-shadow 280ms ease; }
.ms-try-text { transition: opacity 280ms ease; }
/* Going in: the words clear while the door opens, before the camera moves (as the walk's card does). */
.ms-try-card.is-zooming:not(.is-door-exiting) + .ms-try-surround { opacity: 1; visibility: visible; transition: opacity 220ms ease; }
.ms-try-card.is-zooming:not(.is-door-exiting) { border-color: transparent; box-shadow: 0 8px 0 transparent; transition: border-color 220ms ease, box-shadow 220ms ease; }
.ms-try-card.is-zooming:not(.is-door-exiting) .ms-try-text { opacity: 0; transition: opacity 90ms var(--ease-snap); }
/* Coming back: everything around the street starts as paper and stays so until the camera settles. */
.ms-try-card.is-door-exiting + .ms-try-surround { opacity: 1; visibility: visible; transition: none; }
.ms-try-card.is-door-exiting { border-color: transparent; box-shadow: 0 8px 0 transparent; transition: none; }
.ms-try-card.is-door-exiting .ms-try-text { opacity: 0; transition: none; }
.ms-try-card .inside { display: none; }

/* Narrow screens: the words above, the shops across the full width below. */
@media (max-width: 860px) {
  .ms-try-cam { grid-template-columns: minmax(0, 1fr); }
  .ms-try-text { padding: clamp(28px, 5vw, 44px) clamp(24px, 5vw, 44px) 8px; }
  .ms-try-scroll { padding: 0 clamp(12px, 3vw, 28px); }
  .ms-try-world { padding-top: 0; }
  .ms-try-clouds { display: none; }
}
@media (max-width: 560px) {
  .ms-try h2 { padding-right: 64px; }
  .ms-try-sun { right: 18px; top: 22px; width: 44px; box-shadow: 0 0 0 7px rgba(227, 167, 47, 0.18), 0 0 0 14px rgba(227, 167, 47, 0.08); }
}

/* ---------- The page ---------- */

.wc-hero h1 { max-width: 13em; }
.wc-hero .lead { max-width: 40em; }
.wc-pick { padding-top: clamp(8px, 2vw, 24px); }
.wc-pick-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.8rem); }

/* ---------- Six cards: what owners tell us ---------- */
.wc-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.wc-card { position: relative; display: flex; flex-direction: column; gap: 14px; width: 100%; height: 100%; min-height: 190px; padding: 20px 22px 18px; border: var(--line) solid var(--ink); border-radius: var(--r-lg); background: var(--white); box-shadow: 0 6px 0 var(--ink); font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: transform 160ms var(--ease-out), background-color 200ms ease, box-shadow 200ms var(--ease-out), opacity 200ms ease; }
.wc-card-ico svg { width: 44px; height: auto; display: block; }
/* A speech mark: these are things people say. */
.wc-says { position: relative; flex: 1; font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: clamp(1.15rem, 1.6vw, 1.35rem); line-height: 1.32; }
.wc-says::before { content: "“"; position: absolute; left: -0.5em; top: -0.05em; color: var(--brick); }
.wc-card-foot { display: inline-flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.wc-card-foot::after { content: ""; width: 7px; height: 7px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 200ms var(--ease-out); }
.wc-card--none { background: var(--paper-2); border-style: dashed; box-shadow: none; }
.wc-card--none .wc-says::before { content: none; }

@media (hover: hover) and (pointer: fine) {
  .wc-card:hover { background: var(--mustard-wash); }
  .wc-card--none:hover { background: var(--white); }
}
.wc-card:active { transform: scale(0.97); }
/* Once one is picked, it stands out and the rest step back. */
.wc-card.is-on { background: var(--mustard); }
.wc-card.is-on .wc-card-foot { color: var(--ink); }
.wc-card.is-on .wc-card-foot::after { transform: rotate(225deg) translateY(-2px); }
.wc-cards.has-pick .wc-card:not(.is-on) { opacity: 0.62; }
@media (hover: hover) and (pointer: fine) { .wc-cards.has-pick .wc-card:not(.is-on):hover { opacity: 1; } }

/*
  First view: the cards sit in one deck, then are dealt out to their places.
  Moving across the screen, so ease-in-out; the JS staggers each card 80ms.
*/
.wc-cards > li { position: relative; }
.wc-cards.is-piled > li { transition: none; }
.wc-cards.is-piled .wc-card { pointer-events: none; } /* a tap on the deck deals it; once dealing, the cards are live */
.wc-cards.is-piled { cursor: pointer; }
.wc-cards.is-dealing > li { transition: transform 620ms var(--ease-in-out); }

/* ---------- The answer, beneath the cards ---------- */
.wc-answer { margin-top: 26px; scroll-margin-top: 20px; }
.wc-ans { padding: clamp(22px, 3vw, 34px); border: var(--line) solid var(--ink); border-radius: var(--r-lg); background: var(--white); box-shadow: 6px 7px 0 var(--sky); }

.wc-ans-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px; align-items: start; }
.wc-ans--none .wc-ans-head { grid-template-columns: minmax(0, 1fr); }
.wc-ans-ico svg { width: 64px; height: auto; display: block; }
.wc-ans h3 { margin-top: 6px; font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.1; }
.wc-help { margin-top: 10px; max-width: 44em; color: var(--ink-soft); }
.wc-ans--none .wc-help { margin-top: 14px; font-size: 1.08rem; }

/* The relay, as in the handover draft: four legs joined by a line that draws through them. */
.wc-relay-wrap { position: relative; margin-top: 28px; }
.wc-track { position: absolute; left: 22px; right: 22px; top: 21px; height: 3px; border-radius: 3px; background: rgba(34, 50, 44, 0.15); }
.wc-track-fill { position: absolute; inset: 0; border-radius: 3px; background: var(--green); transform-origin: left; transform: scaleX(0); }
.wc-relay { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.wc-leg { display: flex; flex-direction: column; gap: 10px; padding: 0 0 4px; }
.wc-dot { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(34, 50, 44, 0.3); background: var(--paper); transition: background-color 200ms ease, border-color 200ms ease; }
.wc-dot::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: rgba(34, 50, 44, 0.2); transition: background-color 200ms ease, transform 260ms var(--ease-out); }
.wc-leg .ms-label { transition: color 200ms ease; }
.wc-leg > :not(.wc-dot):not(.ms-label) { flex: 1; padding: 14px 16px; border-radius: var(--r-md); border: 2px solid rgba(34, 50, 44, 0.16); background: var(--white); transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease; }
.wc-problem { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-size: 1.12rem; line-height: 1.4; }
.wc-measure { font-weight: 600; line-height: 1.5; }
.wc-leg .ms-ai li, .wc-leg .ms-you li { font-size: 0.95rem; }

/* Lit: the line has reached this leg. Colour, plus a small pop of the dot as it lands. */
.wc-leg.is-lit .wc-dot { border-color: var(--ink); background: var(--white); }
.wc-leg.is-lit .wc-dot::after { animation: wc-pop 260ms var(--ease-out); }
@keyframes wc-pop { from { transform: scale(0.7); opacity: 0.4; } }
.wc-leg--in.is-lit .wc-dot::after { background: var(--sky); }
.wc-leg--ai.is-lit .wc-dot::after { background: var(--green); }
.wc-leg--you.is-lit .wc-dot::after { background: var(--brick); }
.wc-leg--measure.is-lit .wc-dot::after { background: var(--mustard); }
.wc-leg.is-lit .ms-label { color: var(--ink); }
.wc-leg.is-lit > :not(.wc-dot):not(.ms-label) { border-color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.wc-leg--ai.is-lit > .ms-ai { background: var(--green-wash); }
.wc-leg--you.is-lit > .ms-you { background: #fbe9dc; }
.wc-leg--measure.is-lit > .wc-measure { background: var(--mustard-wash); }

/* The street carries the examples. */
.wc-street { margin-top: 26px; padding-top: 16px; border-top: var(--dots); }
.wc-street > .ms-label { margin-bottom: 12px; }
.wc-street ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
/* Each example is a door into that business's workflow. */
.wc-street li { display: flex; }
.wc-case { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; width: calc(100% + 20px); margin: -10px; padding: 10px; border-radius: var(--r-md); color: inherit; text-decoration: none; transition: transform 160ms var(--ease-out), background-color 150ms ease; }
.wc-case:active { transform: scale(0.98); }
.wc-case:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; --door-angle: 62deg; --door-light: 1; }
.wc-case:focus-visible .win { fill: var(--lit) !important; }
.wc-shop { display: block; padding-bottom: 4px; border-bottom: var(--line) solid var(--ink); }
.wc-shop svg { width: 100%; height: auto; display: block; }
.wc-shop .win { transition: fill 200ms ease; }
.wc-case-t { display: grid; gap: 4px; }
.wc-shop-n { font-family: var(--serif); font-variation-settings: "SOFT" 100; font-weight: 600; font-size: 1.02rem; }
.wc-case-p { font-size: 0.93rem; line-height: 1.5; color: var(--ink-soft); }
/* Always shown, so it reads as a way in on touch screens too. */
.wc-step { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; font-weight: 700; font-size: 0.9rem; color: var(--green-deep); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--green); }
.wc-step-arrow { width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform 200ms var(--ease-out); }
/* With a pointer: the shop's lights come on and its door swings open, as on the street. */
@media (hover: hover) and (pointer: fine) {
  .wc-case:hover { background: var(--mustard-wash); }
  .wc-case:hover .win { fill: var(--lit) !important; }
  .wc-case:hover { --door-angle: 62deg; --door-light: 1; }
  .wc-case:hover .wc-step-arrow { transform: translateX(3px) rotate(45deg); }
}
.wc-again { margin-top: 22px; padding-top: 16px; border-top: var(--dots); font-weight: 600; color: var(--ink-soft); }
.wc-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--ink); text-decoration: underline; text-decoration-color: var(--brick); text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; }
.wc-ans--none .btn { margin-top: 18px; }

/*
  The first answer unrolls down from the cards (clip-path, drawer curve).
  Inside it, and on every later pick, the parts settle in 40ms apart.
*/
.wc-answer.is-opening .wc-ans:not([hidden]) { animation: wc-unroll 420ms var(--ease-drawer) backwards; } /* backwards: the clip lets go at the end, so the shadow shows */
@keyframes wc-unroll { from { clip-path: inset(0 0 100% 0 round var(--r-lg)); } to { clip-path: inset(0 0 0 0 round var(--r-lg)); } }
.wc-ans.is-playing .wc-in { animation: wc-in 260ms var(--ease-out) both; animation-delay: calc(60ms + var(--n, 0) * 40ms); }
@keyframes wc-in { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1100px) {
  .wc-relay { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .wc-track { display: none; }
  .wc-street ul { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
  .wc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .wc-cards { grid-template-columns: minmax(0, 1fr); }
  .wc-card { min-height: 0; }
  .wc-ans-head { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .wc-ans-ico svg { width: 48px; }
  .wc-relay { grid-template-columns: minmax(0, 1fr); }
  .wc-leg { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 8px 12px; }
  .wc-leg > :not(.wc-dot):not(.ms-label) { grid-column: 1 / -1; }
  .wc-dot { width: 36px; height: 36px; }
}

/* Pick another needs the script; without it every answer is already showing. */
html:not(.wh-js) .wc-js-only { display: none; }
