/* Services. The company from straight above, the five steps as one stage with five states, the documents you
   keep, one table for eight teams, and the dark sheet where you choose how far to go.
   Everything shared comes from site.css. This file lays the page out and adds four parts the kit lacks:
   the step list that turns into a chip rail, the step camera, the room photograph, and the stop marker.
   "Wide" below is the kit's own split: not a phone and not an upright tablet. */

/* ---------- the step list ---------- */
/* A .k-chips row of links. Wide, it reads as the kit's step list. Tall, it stays a rail of chips. */
.sv-index small { display: none; }
@media (min-width: 700px) and (min-aspect-ratio: 41/50) {
  .sv-index { display: grid; gap: 0; width: 100%; border-bottom: 1px solid var(--rule); }
  .sv-index > a { --sq-fill: transparent; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline; min-height: 0; padding: 9px 0; border-top-color: var(--rule); font-size: clamp(18px, 1.45vw, 24px); font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; white-space: normal; transition: color 0.3s, font-size 0.4s var(--out); }
  .sv-index > a > .k-chip { align-self: center; transition: scale 0.4s var(--bounce); }
  .sv-index > a:hover > .k-chip { scale: 1.35; }
  .sv-index small { display: block; font: 400 12px/1 var(--mono); letter-spacing: 0; color: var(--label); }
  .sv-stage .sv-index > a { color: var(--dim); }
  .sv-stage .sv-index > a:hover { color: var(--ink); }
  .sv-stage .sv-index > a[aria-selected="true"] { --sq-fill: transparent; color: var(--ink); font-size: clamp(24px, 2.3vw, 38px); font-weight: 500; letter-spacing: -0.03em; }
}

/* ---------- the plan ---------- */
/* A light is a white square holding a step's chip. It sits on each thing in the picture that step has touched
   and shows while that step is current or under the pointer. page-services.js places them. */
.sv-light { --sq-r: 6px; --sq-fill: #fff; --sq-shadow: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28)); position: absolute; left: var(--x); top: var(--y); display: grid; place-items: center; width: 20px; height: 20px; translate: -50% -50%; scale: calc(var(--lit, 0) / var(--z, 1)); opacity: var(--lit, 0); pointer-events: none; transition: scale 0.45s var(--bounce) calc(var(--i, 0) * 40ms), opacity 0.2s calc(var(--i, 0) * 40ms); }
.sv-light > .k-chip { width: 10px; height: 10px; }
/* In the stage the machine carries its own marker. */
.sv-stage .sv-light[data-step="build"] { display: none; }
/* page-services.js writes the step on the first screen as data-lit and on the stage as data-at. An attribute is
   used, not :has(:hover), because WebKit did not restyle lights added after load when the hover changed. */
.sv-hero[data-lit="assess"] .sv-light[data-step="assess"], .sv-stage[data-at="assess"] .sv-light[data-step="assess"],
.sv-hero[data-lit="setup"] .sv-light[data-step="setup"], .sv-stage[data-at="setup"] .sv-light[data-step="setup"],
.sv-hero[data-lit="train"] .sv-light[data-step="train"], .sv-stage[data-at="train"] .sv-light[data-step="train"],
.sv-hero[data-lit="build"] .sv-light[data-step="build"], .sv-stage[data-at="build"] .sv-light[data-step="build"],
.sv-hero[data-lit="run"] .sv-light[data-step="run"], .sv-stage[data-at="run"] .sv-light[data-step="run"] { --lit: 1; }

/* ---------- first screen ---------- */
/* The scene fills the band. Without these two it keeps its own 16 by 9. */
.sv-hero .k-scene { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; --fx: 0.46; }
.sv-hero .k-band-over > .sv-hero-top { max-width: clamp(220px, 17vw, 300px); }
.sv-hero .k-band-over > h1 { max-width: 15em; }
.sv-hero-deck { color: var(--ink); }
.sv-hero-go { justify-items: end; text-align: right; }
/* A room is one link the size of the room. Its square shows under the pointer or the keyboard. */
.sv-hero .k-mark { width: var(--rw); height: var(--rh); }
.sv-hero .k-mark > i { opacity: 0; transition: opacity 0.2s, scale 0.4s var(--bounce); }
.sv-hero .k-mark:is(:hover, :focus-visible) > i { opacity: 1; }
.sv-hero .k-mark > b { top: calc(50% + 20px); }
.sv-hero .k-mark:focus-visible { outline-offset: -3px; }

/* ---------- the five steps ---------- */
.sv-steps { position: relative; background: var(--paper); font-size: 17px; line-height: 1.4; color: var(--ink); }
.sv-stage { position: relative; }
.sv-stage > .k-chips { margin-bottom: 0; }
.sv-say { --gap: 16px; }
.sv-say > .k-link { margin-top: 4px; }
/* The list already names the step in large type. With script off there is no current step, so each one carries its name. */
.js .sv-step-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sv-step-name > .k-chip { vertical-align: 0.12em; }
html:not(.js) .sv-stage > .k-panel { padding-bottom: 44px; }
.sv-hint { max-width: 26em; }
/* A rail in a stack would take the width of all its chips. Stretched, it scrolls inside the column. */
.sv-rooms { justify-self: stretch; }
.sv-view { position: relative; }
.sv-view > .k-scene { --sq-r: clamp(18px, 1.6vw, 26px); }
/* Rooms can be opened while Assess is the step. The machine is there for Build. */
.sv-stage .k-mark { transition: opacity 0.3s, visibility 0s; }
.js .sv-stage:not([data-at="assess"]) .k-mark[data-team],
.sv-stage:not([data-at="build"]) .sv-machine,
html:not(.js) .sv-stage .k-mark { opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0s 0.3s; }
.sv-machine > b { left: auto; right: 50%; translate: 20px -4px; }
.sv-machine:is(:hover, :focus-visible) > b { translate: 20px 0; }

/* The step camera. Each step names the point of the picture it touches and how far in to go. The point lands at
   --ax, --ay of the frame, and the clamps keep the picture over the whole frame. While a room's card is pinned the
   kit's own zoom, an inline transform, takes over, so there is one camera at a time. */
.sv-stage[data-at="setup"] .k-cam { --px: 0.644; --py: 0.537; --zz: 1.45; }
.sv-stage[data-at="train"] .k-cam { --px: 0.492; --py: 0.36; --zz: 1.45; }
.sv-stage[data-at="build"] .k-cam { --px: 0.88; --py: 0.56; --zz: 1.65; }
.sv-stage[data-at="run"] .k-cam { --px: 0.655; --py: 0.3; --zz: 1.45; }
.sv-stage:is([data-at="setup"], [data-at="train"], [data-at="build"], [data-at="run"]) .k-cam {
  --cl: calc((100cqw - var(--w)) * var(--fx, 0.5));
  --ct: calc((100cqh - var(--h)) * var(--fy, 0.5));
  --z: var(--zz);
  transform: translate(
    clamp(100cqw - var(--cl) - var(--w) * var(--zz), var(--ax, 50cqw) - var(--cl) - var(--px) * var(--w) * var(--zz), 0px - var(--cl)),
    clamp(100cqh - var(--ct) - var(--h) * var(--zz), var(--ay, 50cqh) - var(--ct) - var(--py) * var(--h) * var(--zz), 0px - var(--ct))
  ) scale(var(--zz));
}

/* The photograph of a team, which grows out of its room. --ox and --oy are the room's place in the frame. */
.sv-photo { position: absolute; z-index: 3; overflow: hidden; background: var(--table); clip-path: inset(calc(var(--oy, 50%) - 4%) calc(96% - var(--ox, 50%)) calc(96% - var(--oy, 50%)) calc(var(--ox, 50%) - 4%)); transition: clip-path 0.7s var(--out); }
.sv-photo[hidden] { display: none; }
.sv-photo.is-open { clip-path: inset(0); }
.sv-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--at, 50% 50%); }
.sv-photo > figcaption { position: absolute; left: clamp(14px, 2vw, 32px); bottom: clamp(14px, 2vw, 32px); width: min(340px, calc(100% - 28px)); gap: 8px; justify-items: start; }
.sv-photo .btn { margin-top: 6px; }
/* A room's card names the team and says what the line is, on one line. */
.sv-room-card { width: min(384px, 86vw); }
.sv-room-card header em { white-space: nowrap; }

/* Wide: the list and the words on the left, the plan on the right, running off the edge of the screen. */
@media (min-width: 700px) and (min-aspect-ratio: 41/50) {
  .sv-stage { display: grid; grid-template-columns: minmax(250px, 27fr) minmax(0, 73fr); column-gap: clamp(24px, 3.4vw, 60px); padding-left: max(var(--m), (100% - var(--k-max)) / 2); overflow: clip; }
  .sv-stage > .sv-index { grid-column: 1; margin-top: var(--k-top); align-self: start; }
  .sv-stage > .k-panel { grid-column: 1; }
  .sv-say { padding-block: clamp(18px, 2.4vh, 30px); }
  .sv-view { grid-column: 2; grid-row: 1 / span 6; --ax: 40cqw; --ay: 60cqh; }
  .sv-view > .k-scene, .sv-photo { position: absolute; inset: 0 -2vw -2vw 0; aspect-ratio: auto; --fx: 0.69; }
  .sv-photo { --sq-r: clamp(18px, 1.6vw, 26px); }
  .sv-photo > figcaption { bottom: calc(2vw + clamp(14px, 2vw, 32px)); }
  .sv-rooms { display: none; }
  .sv-card { margin-top: 22px; max-width: 30em; }

  /* With script off the five steps read down the left while the plan stays in view. */
  html:not(.js) .sv-view { position: sticky; top: 96px; align-self: start; height: calc(100svh - 120px); }
  html:not(.js) .sv-steps { padding-bottom: var(--k-gap); }
}
/* Wide and tall enough: the stage holds still for the length of the five steps and scrolling changes its state. */
@media (min-width: 700px) and (min-aspect-ratio: 41/50) and (min-height: 600px) {
  .js .sv-run { --len: 80svh; height: calc(100svh + 4 * var(--len)); }
  .js .sv-stage { position: sticky; top: 0; height: 100svh; grid-template-rows: auto minmax(0, 1fr); }
  .js .sv-stage > .k-panel { grid-row: 2; }
  .js .sv-view { grid-row: 1 / span 2; margin-top: clamp(86px, 6.6vw, 104px); }
  .js .sv-card { position: absolute; z-index: 2; right: clamp(28px, 5.4vw, 96px); top: clamp(150px, 22svh, 230px); width: min(400px, 30vw); margin: 0; }
}
/* Wide but short, a phone on its side: the same two columns without the hold. */
@media (min-width: 700px) and (min-aspect-ratio: 41/50) and (max-height: 599px) {
  .js .sv-view { position: sticky; top: 76px; align-self: start; height: calc(100svh - 92px); margin-top: var(--k-top); }
  .js .sv-stage { padding-bottom: 32px; }
}

/* Tall: the plan is a band that stays at the top, the steps are a rail under it, the words under that. */
@media (max-width: 699px), (max-aspect-ratio: 41/50) {
  .sv-stage { display: flex; flex-direction: column; }
  .sv-view { order: -2; height: 46svh; z-index: 5; }
  .sv-view > .k-scene, .sv-photo { position: absolute; inset: 0; aspect-ratio: auto; --fx: 0.6; -webkit-mask-image: none; mask-image: none; }
  .sv-stage > .sv-index { order: -1; z-index: 5; margin: 0; padding: 10px var(--m); background: var(--paper); }
  /* The space is on what a panel holds. A panel that is hidden but still findable keeps its own box. */
  .sv-say { padding: 8px var(--m) 0; }
  .sv-card { margin: 26px var(--m) 0; }
  .sv-stage > .k-panel > :last-child { margin-bottom: 40px; }
  .sv-rooms { margin-top: 4px; }
  .sv-photo > figcaption { --sq-fill: #fff; --sq-shadow: var(--lift); padding: 14px 16px; }

  .sv-hero .k-scene { --fx: 0.62; }
  .sv-hero .k-band-over > .sv-hero-top { display: contents; }
  .sv-hero .k-band-over > h1 { order: -1; }
  .sv-hero-go { order: 1; justify-items: stretch; text-align: left; }
  .sv-hero .sv-index { order: 2; }
  .sv-hero .k-mark > i { display: none; }
  .sv-hero .k-mark { min-width: 44px; min-height: 44px; }
  /* The kit makes a tag 44px tall on a phone. An upright tablet is touched too. */
  .sv-far a.k-tag, .sv-ref a.k-tag { min-height: 44px; padding-inline: 14px; }
}
@media (max-width: 699px) and (min-height: 600px), (max-aspect-ratio: 41/50) and (min-height: 600px) {
  .js .sv-view { position: sticky; top: 0; }
  .js .sv-stage > .sv-index { position: sticky; top: 46svh; }
}
/* A wrapped rail on an upright tablet needs no bleed. On a phone the kit's rail already runs edge to edge. */
@media (max-width: 699px) {
  .sv-stage > .sv-index.is-rail { margin-inline: 0; }
}

/* A step's words and its sheet arrive when the step does. */
@keyframes sv-rise { from { opacity: 0; translate: 0 18px; } }
@keyframes sv-sheet { from { opacity: 0; translate: 0 36px; rotate: 0deg; } }
.js .sv-stage.is-ready > .k-panel:not([hidden]) .sv-say > * { animation: sv-rise 0.7s var(--out) both; }
.js .sv-stage.is-ready > .k-panel:not([hidden]) .sv-say > :nth-child(2) { animation-delay: 80ms; }
.js .sv-stage.is-ready > .k-panel:not([hidden]) .sv-say > :nth-child(3) { animation-delay: 160ms; }
.js .sv-stage.is-ready > .k-panel:not([hidden]) .sv-say > :nth-child(n + 4) { animation-delay: 240ms; }
.js .sv-stage.is-ready > .k-panel:not([hidden]) .sv-card { animation: sv-sheet 0.7s var(--out) 120ms both; }

/* ---------- what you keep ---------- */
.sv-keep-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 4vw, 72px); align-items: start; }
.sv-keep-say { position: sticky; top: 110px; }
.sv-keep-say > button.k-link[aria-expanded="true"] > i { rotate: 90deg; }
.sv-sheets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; padding-bottom: 12px; }
.sv-sheet { cursor: default; transition: translate 0.5s var(--out), opacity 0.7s, rotate 0.5s var(--out); }
.sv-sheet.is-roadmap { grid-column: 1 / span 7; grid-row: 1 / span 2; z-index: 1; }
.sv-sheet.is-policy { grid-column: 8 / span 5; grid-row: 1; z-index: 2; margin: 34px 0 0 22px; }
.sv-sheet.is-register { grid-column: 7 / span 6; grid-row: 2; z-index: 3; margin: 30px 0 0 -18px; }
.sv-sheet:is(:hover, :focus-within) { z-index: 4; }
.sv-sheet.is-front { z-index: 5; }
.sv-sheet.is-policy:has(.sv-policy-six:not([hidden])) { z-index: 6; }
.sv-sheet .k-doc-rows > li { transition: color 0.2s; }
.sv-sheet .k-doc-rows > li:hover, .sv-sheet .k-doc-rows > li:hover b { color: var(--ink); }
.sv-sheet .k-doc-rows a { text-decoration: none; }
.sv-sheet .k-doc-rows a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.sv-policy-short { --cols: minmax(0, 1fr); }
.sv-policy-six { margin-top: 0; }
.sv-sheet.is-policy:has(.sv-policy-six:not([hidden])) .sv-policy-short { display: none; }
.k-doc-foot a { text-decoration-color: var(--faint); text-underline-offset: 0.2em; }
/* Sheets slide up one after another once the script is running and the section comes into view. */
.sv-on [data-rise]:not(.is-in) { opacity: 0; translate: 0 44px; rotate: 0deg; }
.sv-on [data-rise] { transition: translate 0.7s var(--out) calc(var(--d, 0) * 1ms), opacity 0.5s calc(var(--d, 0) * 1ms), rotate 0.7s var(--out) calc(var(--d, 0) * 1ms); }

/* ---------- every role ---------- */
.sv-roles-head { margin-bottom: clamp(24px, 3vw, 44px); }
.sv-roles-grid { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 3fr); gap: clamp(24px, 3.4vw, 60px); align-items: start; }
.sv-teams { font-size: clamp(14px, 1.02vw, 16px); }
/* The padding gives the button a 44px target and the margin takes it back, so the row keeps its height. */
.sv-teams th button { font-weight: 600; padding-block: 13px; margin-block: -13px; white-space: nowrap; }
.sv-teams th button::after { content: '+'; content: '+' / ''; display: inline-block; width: 1em; margin-left: 6px; font-weight: 400; color: var(--label); transition: rotate 0.4s var(--out); }
.sv-teams th button[aria-expanded="true"]::after { rotate: 45deg; }
html:not(.js) .sv-teams th button::after { content: none; }
.sv-teams [data-say="find"] { color: var(--ink); }
.sv-plan { --cols: 9em minmax(0, 1fr); --cols-s: 9em minmax(0, 1fr); margin-top: 12px; font: 400 12px/1.45 var(--mono); color: var(--label); }
.sv-plan > li:last-child { border-bottom: 1px solid var(--fog); }
.sv-follow { position: sticky; top: 104px; display: grid; gap: 10px; }
.sv-follow-pic { margin-bottom: 8px; }
/* The small plan shows one room. --px and --py are that room's place in the picture, from its marker. */
.sv-follow-pic > img { inset: auto; left: 50%; top: 50%; width: auto; height: 250%; max-width: none; translate: calc(clamp(0.17, var(--px, 0.647), 0.83) * -100%) calc(clamp(0.2, var(--py, 0.547), 0.8) * -100%); transition: translate 0.7s var(--out); }
.sv-follow-pic > .k-pin { position: absolute; left: 12px; top: 12px; }
.sv-follow > .k-h3 { min-height: 2.1em; }

/* ---------- how far ---------- */
.sv-track { margin-top: clamp(64px, 7vw, 108px); touch-action: pan-y; }
.sv-track > li { padding-top: 26px; gap: 8px; transition: color 0.3s; }
.sv-track > li::before { transition: background-color 0.3s; }
.sv-track label { cursor: pointer; }
/* The whole column chooses the step. The sample link sits above that. */
.sv-track label::after { content: ''; position: absolute; inset: -22px 0 0 0; }
.sv-track input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.sv-track b { transition: color 0.3s; }
.sv-track b > .k-chip { transition: opacity 0.3s; }
.sv-track li:has(input:focus-visible) b { outline: 2px solid currentColor; outline-offset: 5px; }
.sv-track .k-tag { position: relative; z-index: 1; justify-self: start; margin-top: 8px; }
.sv-track > li:has(input:checked) ~ li, .sv-track > li:has(input:checked) ~ li b { color: var(--dim); }
.sv-track > li:has(input:checked) ~ li::before { background: var(--rule); }
.sv-track > li:has(input:checked) ~ li .k-chip { opacity: 0.45; }
/* The marker is a white label at the end of the last step you keep. It can be dragged along the track. */
.sv-track .k-pin { position: absolute; right: 0; bottom: calc(100% + 12px); opacity: 0; scale: 0.9; transform-origin: 100% 100%; pointer-events: none; cursor: grab; transition: opacity 0.2s, scale 0.4s var(--bounce); }
.sv-track li:has(input:checked) .k-pin { opacity: 1; scale: 1; pointer-events: auto; }
.sv-track.is-dragging, .sv-track.is-dragging label, .sv-track.is-dragging .k-pin { cursor: grabbing; }
.sv-far-note { max-width: 62em; margin-top: clamp(40px, 5vw, 80px); }
.sv-far-end { margin-top: clamp(40px, 6vw, 96px); }
.sv-far-go { justify-items: end; text-align: right; }
.sv-far-go > .k-h3 { max-width: 13em; }

/* A sample document shown in a pop-up keeps the document's type. */
.sv-sample-doc { display: grid; gap: 7px; font: 400 13px/1.45 var(--mono); color: var(--text); }
.sv-sample-doc a { text-decoration-color: var(--faint); text-underline-offset: 0.2em; }

/* ---------- why, tool advice, how we work, reference ---------- */
.sv-why .k-h2 > .k-ref { font-size: 0.3em; letter-spacing: 0; }
.sv-builds-note { flex: 1 1 28em; max-width: 44em; }
/* One piece of client work, set below the two columns on a hairline. */
.sv-story { margin-top: clamp(40px, 5vw, 80px); padding-top: clamp(24px, 3vw, 44px); border-top: 1px solid var(--rule); }
.sv-ref .k-table tbody th { white-space: nowrap; }
.sv-ref .k-table td:nth-child(2) { min-width: 9.5em; }
.sv-ref .k-table tbody th > .k-chip { margin-right: 6px; }

/* ---------- narrower ---------- */
@media (max-width: 1099px) {
  .sv-roles-grid { grid-template-columns: minmax(0, 1fr); }
  .sv-follow { position: static; }
  .sv-follow > :not(.k-text) { display: none; }
}
/* Narrower, the register would lie over the roadmap's words, so it keeps to its own columns. */
@media (max-width: 1279px) {
  .sv-sheet.is-register { grid-column: 8 / span 5; margin-left: 4px; }
}
@media (max-width: 899px) {
  .sv-keep-grid { grid-template-columns: minmax(0, 1fr); }
  .sv-keep-say { position: static; }
  .sv-sheets { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .sv-sheet.is-roadmap, .sv-sheet.is-policy, .sv-sheet.is-register { grid-column: auto; grid-row: auto; margin: 0; }
  .sv-track > li { padding-top: 20px; }
  .sv-track label { display: flex; align-items: center; min-height: 44px; }
  .sv-track .k-pin { bottom: auto; top: 18px; }
  .sv-far-go { justify-items: start; text-align: left; }
}
@media (max-width: 699px) {
  .sv-teams td > .k-more { grid-column: 1 / -1; }
  .sv-plan { --cols-s: 8em minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .sv-light, .sv-photo, .sv-sheet, .sv-follow-pic > img, .sv-track *, .sv-on [data-rise] { transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .js .sv-stage.is-ready > .k-panel .sv-say > *, .js .sv-stage.is-ready > .k-panel .sv-card { animation: none !important; }
}
@media print {
  .js .sv-run { height: auto; }
  .js .sv-stage { position: static; height: auto; }
  .sv-on [data-rise]:not(.is-in) { opacity: 1; translate: none; }
}
