/* /os "Not locked into one AI model" (WEB-142 P3v3): the heading, then three cards, Start, Recommended and Power users,
   side by side on wide screens and one per row below. Each card has a title, a line and a stage: a small circuit round
   the closed Foundational OS cube with six slots and the same routes on every card. The slots the card's stack uses
   show at full strength with an ink line along each one's route; every other slot and route is faded
   (os-not-locked.js).
   The page's own type rules carry ID weight and !important, so the three type rules here carry more. */

.page .wrap.nolock-sec {
  padding-inline: var(--nolock-gutter);
}

.nolock-sec > .nolock-copy {
  grid-column: 1 / -1;
  min-width: 0;
}

html:not(#_n1) body:not(#_n2):not(#_n3):not(#_n4):not(#_n5):not(#_n6) [data-page=os] .nolock-sec .nolock-h {
  font-size: var(--nolock-fs-head) !important;
  line-height: var(--nolock-tl-head) !important;
  margin: 0 !important;
  padding: 0 !important;
  text-wrap: balance;
}

/* Two lines, the second grey, as on the origin heading (WEB-154). */
.nolock-h > span {
  display: block;
}

.nolock-h > span + span {
  color: var(--text);
}

/* The page's type block gives every element the lead weight; the card's line is body copy, so it takes the body's. */
html:not(#_n1) body:not(#_n2):not(#_n3) [data-page=os] .nolock-text > .nolock-line {
  font-weight: var(--b-w) !important;
}

/* The copy shows with its picture instead of on the site's scroll reveal. translate is left to heading-pin.js's hold. */
[data-page=os] .nolock-sec .rv {
  opacity: 1 !important;
  transform: none !important;
}

/* --nolock-u is one pixel of the prototype RF approved, drawn on a 15 px body: the OS body is 15 px at 390 and 1440,
   so the cards' padding, corners and gaps match it there and grow with the body above. */
.nolock-sec > .nolock-cards {
  --nolock-u: calc(var(--os-fs-b) / 15);
  grid-column: 1 / -1;
  display: grid;
  gap: calc(14 * var(--nolock-u));
  min-width: 0;
  margin: calc(var(--line) * 2) 0 0;
  padding: 0;
  list-style: none;
}

/* The stage keeps to the card's foot, so the cubes line up across cards whose copy runs to different lengths. */
.nolock-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  border-radius: calc(20 * var(--nolock-u));
  background: var(--paper);
  box-shadow: inset 0 0 0 var(--stroke) var(--rule);
  overflow: clip;
}

.nolock-card.is-rec {
  box-shadow: inset 0 0 0 calc(2 * var(--stroke)) var(--ink), var(--gui-shadow);
}

.nolock-card > .nolock-text {
  padding: calc(18 * var(--nolock-u)) calc(20 * var(--nolock-u)) 0;
}

.nolock-text > h3,
.nolock-text > .nolock-line {
  margin: 0;
  font-size: var(--os-fs-b);
  line-height: var(--os-tl-b);
  letter-spacing: var(--b-tr);
}

/* The title is a Label on the Label's line rounded to the pixel (--nolock-tl-title: 20 for 19.5 wide and 20.4 on phones).
   Padding splits the rest of the body line it was laid out on above and below, so the card stays put (WEB-135).
   Padding, because the next line's .2em top margin would collapse into a bottom margin. */
html:not(#_n1) body:not(#_n2):not(#_n3):not(#_n4):not(#_n5) [data-page=os] .nolock-text > h3 {
  line-height: var(--nolock-tl-title) !important;
}

.nolock-text > h3 {
  padding-block: calc((var(--os-tl-b) - 1lh) / 2);
  color: var(--ink);
}

.nolock-text > .nolock-line {
  margin-top: .2em;
  color: var(--text);
  text-wrap: balance;
}

/* The stage keeps its shape before the script runs, so nothing below moves when the cube arrives. The script fits the
   picture to whatever shape the stage has, less --nolock-edge each side.
   zoom draws the whole picture (cube, bus, dots, discs, names, line weights) at --nolock-s, centred in the full-width
   card. Lengths are zoomed and percentages are not, so the width's percentage takes the same factor: the script then
   reads the full-size stage in its own zoomed pixels, lays out the full-size circuit, and the browser scales it. */
.nolock-stage {
  --nolock-edge: 10px;
  --nolock-off: 15%;
  --nolock-s: .8;
  position: relative;
  align-self: end;
  justify-self: center;
  zoom: var(--nolock-s);
  aspect-ratio: 342 / 470;
  width: min(calc(100% * var(--nolock-s)), calc(var(--nolock-max-h) * 342 / 470));
  min-width: 0;
}

.nolock-stage > .nolock-circuit,
.nolock-stage > canvas,
.nolock-stage > .nolock-nodes,
.nolock-stage > .nolock-still {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The still of the cube until the canvas is in. Its viewBox is the script's SPAN, so padded by --nolock-edge it scales
   and centres as fit() does, and the cube lands where the canvas draws it. */
.nolock-stage > .nolock-still {
  box-sizing: border-box;
  padding: var(--nolock-edge);
}

.nolock-stage:has(> canvas) > .nolock-still {
  visibility: hidden;
}

/* The script's fade stops carry only an opacity, so the masks read alpha. */
.nolock-circuit mask {
  mask-type: alpha;
}

.nolock-circuit .nolock-wire {
  stroke: var(--ph);
}

.nolock-circuit .nolock-dot {
  fill: var(--story-ring);
}

.nolock-circuit .nolock-route {
  stroke: color-mix(in srgb, var(--ink) var(--nolock-off), var(--paper));
}

.nolock-circuit .nolock-live {
  stroke: var(--ink);
}

.nolock-nodes > .nolock-ai {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--gui-shadow);
  color: var(--story-dot);
  transition: opacity var(--dur-3) var(--ease), color var(--dur-3) var(--ease), transform var(--dur-3) var(--ease);
}

.nolock-nodes > .nolock-ai > svg {
  width: 54%;
  height: 54%;
  fill: currentColor;
}

.nolock-nodes > .nolock-ai.is-on {
  color: var(--ink);
  transform: scale(1.08);
}

.nolock-nodes > .nolock-name {
  position: absolute;
  translate: -50% 0;
  color: var(--ink);
  font-size: var(--os-fs-s);
  line-height: var(--os-tl-s-ui);
  letter-spacing: var(--s-tr);
  white-space: nowrap;
  transition: opacity var(--dur-3) var(--ease);
}

.nolock-nodes > .nolock-name[data-bus=top] {
  translate: -50% -100%;
}

.nolock-nodes > .is-off {
  opacity: var(--nolock-off);
}

/* A narrower card's stage is no shorter than a phone's, so its slots keep the phone's pitch and neighbouring names keep
   their room; below 1024 px a third of the page is too narrow for that, so the cards stay one per row. */
@media (min-width:1024px) {
  .nolock-sec > .nolock-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--gut);
  }

  .nolock-card > .nolock-text {
    padding: calc(22 * var(--nolock-u)) calc(24 * var(--nolock-u)) 0;
  }

  .nolock-text > .nolock-line {
    min-height: calc(var(--os-tl-b) * 2);
  }

  .nolock-stage {
    aspect-ratio: 10 / 12;
    width: calc(100% * var(--nolock-s));
    min-height: calc(470 * var(--nolock-u));
  }
}

@media (prefers-reduced-motion: reduce) {
  .nolock-nodes > .nolock-ai,
  .nolock-nodes > .nolock-name {
    transition: none;
  }
}
