/* The Basis page's out-of-the-workbook block, stop 09: the window, the rail under it, the act panels, and the two
   phone renderings. Tokens only (site.css and v3.css names); lengths in rem, hairlines in px. assets/oow/stage.js says how the window
   plays, assets/oow/phones.js how the phones do (both set a pane's 1440 by 900 or 390 by 844 layout size on the frame they create).
   The window and the rail follow the home hero's (assets/hero2/hero2.css). */

/* one grid for the block: the row that holds the window and the phones gives its two children to it, so the act's words sit right under
   the window at every width (as measured: with the row kept as its own grid, an empty band of about
   389 pixels opened under the window from 1280 wide, and from 1024 to 1279 wide the words came about 1,100 pixels under it, after
   both phones).
   At every width: the window across the block's full row, its act's words, then the phones (at 1440 the window is drawn 1280 px wide, 0.889 of the screen, where beside the phones it was 960 px, 0.667, and its card's
   text drew at about 8 px). */
.pg-basis .oow-block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; min-width: 0; }
.pg-basis .oow-row { display: contents; }
.pg-basis .oow-fig { order: 1; }
.pg-basis .oow-acts { order: 2; }
.pg-basis .oow-phones { order: 3; }

/* the window: the still inside the site's window frame; the stage lies over it at the same size and never takes a click */
.pg-basis .oow-fig { position: relative; margin: 0; min-width: 0; }
.pg-basis .oow-fig .ph-win { display: block; position: relative; overflow: hidden; border-radius: var(--v3-r-win); background: var(--cell);
  box-shadow: var(--shadow-window); transition: box-shadow var(--t-hover) var(--ease); }
.pg-basis .oow-fig .ph-win:hover { box-shadow: var(--shadow-window-hover); }
.pg-basis .oow-fig .ph-win:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pg-basis .oow-fig .ph-win img { display: block; width: 100%; height: auto; aspect-ratio: 1440 / 900; object-fit: cover; object-position: top left; }
.pg-basis .oow-fig .oow-stage { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1440 / 900; z-index: 1; overflow: hidden;
  border-radius: var(--v3-r-win); pointer-events: none; visibility: hidden; opacity: 0; contain: layout paint; background: var(--bg); }
.pg-basis .oow-fig.oow-on .oow-stage { visibility: visible; }
.pg-basis .oow-fig.oow-narrow .oow-stage { display: none; }
/* each pane kept on its own layer: as measured, without it the window's rounded corners came out up to 10 pixels
   different when the same time was reached by two different seeks; with it, 0 in 11 of 12 checks (the twelfth, the first shot after
   the page loaded, 9 corner pixels) */
.pg-basis .oow-fig .oow-pane { position: absolute; inset: 0; visibility: hidden; opacity: 0; will-change: opacity; }
.pg-basis .oow-fig .oow-pane iframe { position: absolute; left: 0; top: 0; display: block; border: 0; margin: 0; padding: 0;
  transform-origin: 0 0; background: transparent; pointer-events: none; }

/* at phone width (under 640 px, where the rail goes two by two) the window keeps one readable size: the act's whole still, never a
   close-up, drawn 1.76 times the screen's width (and never wider than 48rem), its top left corner on the page's content edge, running
   off the screen's right edge; one size and one place for all four acts; the window never zooms. The figure reaches both edges of the screen and cuts the window at the right one, so the page
   never scrolls sideways; the rail and the caption keep the content column. Over the window lies a layer in the colour of the ground
   the window stands on: clear across the first seven tenths of the screen, then rising evenly to eight tenths of the ground at the
   right edge, so the window reads as running on and never as cut by accident. No fade at the foot: the window ends with its own ring
   and corners. The layer is half a rem taller than the window above and below, the reach of the window's outer rings
   (--shadow-window), so they fade with the picture, and it takes no press: the picture under it still opens the act's whole still.
   The eight tenths is the layer's own opacity over a gradient that ends in the ground's colour: no colour is mixed, so the fade draws
   wherever a gradient does.
   --oow-ground names that ground (the page's --bg; the home page's first screen names its own in home.css). --oow-run is the window's
   width; the home page's lower Basis picture takes the same (pages.css).
   From 640 px the whole still fits its column, as it does from 768 px: there less than a fifth of the window would run off, and the
   layer would dim the right third of a window that is nearly all on screen. */
.pg-home, .pg-basis { --oow-run: min(176vw, 48rem); }
@media (max-width: 39.99em) {
  .pg-basis .oow-fig { margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); overflow-x: hidden; overflow-x: clip; }
  .pg-basis .oow-fig .ph-win { width: var(--oow-run); }
  .pg-basis .oow-fig::after { content: ""; position: absolute; left: 0; top: -0.5rem; width: 100%; height: calc(var(--oow-run) * 900 / 1440 + 1rem);
    pointer-events: none; opacity: 0.8; background: linear-gradient(90deg, transparent 70%, var(--oow-ground, var(--bg))); }
}

/* the rail: four items under the window, a pause and play button at its right end; shown at every width (in the still it swaps the
   acts' stills); two by two under 1210 px, so the fourth label never wraps alone, its two rows of one height, so a label that wraps to two lines in one row leaves the rows
   even (at 390 act 3's label wraps and its row stood 16 px taller than act 1's) */
.pg-basis .oow-rail { display: flex; align-items: flex-start; gap: 1.5rem; margin-top: 1.25rem; }
.pg-basis .oow-rail ol { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 1.5rem; margin: 0; padding: 0; list-style: none; }
@media (max-width: 75.62em) {
  .pg-basis .oow-rail ol { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 0.25rem 1rem; }
}
.pg-basis .oow-fig.oow-live .oow-rail li:not([data-has]) { visibility: hidden; }
.pg-basis .oow-rail li button { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0.625rem; width: 100%;
  min-height: 2.75rem; margin: 0; padding: 0 0 0.5rem; border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink-3);
  font: 500 0.8125rem/1.25rem var(--font-sans); transition: color 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.pg-basis .oow-rail li button:hover, .pg-basis .oow-rail li.on button { color: var(--ink); }
.pg-basis .oow-rail li button:focus-visible, .pg-basis .oow-rail .oow-pp:focus-visible, .pg-basis .oow-ph-sw button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* the loop's wrap is a cut: for that one frame the labels change without their colour ease */
.pg-basis .oow-rail.oow-cut li button { transition: none; }
.pg-basis .oow-bar { display: block; height: 2px; overflow: hidden; border-radius: 1px; background: color-mix(in oklab, var(--ink) 12%, transparent); }
.pg-basis .oow-bar i { display: block; height: 100%; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; }
.pg-basis .oow-fig.oow-still .oow-rail li.on .oow-bar i, .pg-basis .oow-fig.oow-narrow .oow-rail li.on .oow-bar i { transform: scaleX(1); }
.pg-basis .oow-l { display: block; text-wrap: pretty; }
/* pause and play: 44 px to tap; the icon drawn with the text colour; gone in the still */
.pg-basis .oow-rail .oow-pp { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; margin: -0.875rem -0.75rem 0 0;
  padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer;
  transition: color 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.pg-basis .oow-rail .oow-pp:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 6%, transparent); }
.pg-basis .oow-rail .oow-ic { position: relative; display: block; width: 0.75rem; height: 0.75rem; }
.pg-basis .oow-rail .oow-ic::before, .pg-basis .oow-rail .oow-ic::after { content: ""; position: absolute; top: 0; bottom: 0; width: 0.25rem; border-radius: 1px; background: currentColor; }
.pg-basis .oow-rail .oow-ic::before { left: 0.0625rem; }
.pg-basis .oow-rail .oow-ic::after { right: 0.0625rem; }
.pg-basis .oow-fig.oow-paused .oow-rail .oow-ic::before { left: 0.125rem; width: 0.625rem; border-radius: 0; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.pg-basis .oow-fig.oow-paused .oow-rail .oow-ic::after { display: none; }
.pg-basis .oow-fig.oow-still .oow-rail .oow-pp, .pg-basis .oow-fig.oow-narrow .oow-rail .oow-pp { display: none; }

/* the act panels: with no script all four show, one under another; with it, the act on screen */
.pg-basis .oow-acts { display: grid; gap: 1.5rem; min-width: 0; }
.pg-basis .oow-block.oow-js .oow-act:not(.on) { display: none; }

/* the phones: under the window and its words, side by side at every width from 640 px, stacked at phone width; both always show, so
   nothing swaps and the page under them never moves */
.pg-basis .oow-phones { display: grid; grid-template-columns: repeat(2, minmax(0, 18rem)); justify-content: center; gap: 2rem; min-width: 0; }
@media (max-width: 39.99em) {
  .pg-basis .oow-phones { grid-template-columns: minmax(0, 18rem); }
}
.pg-basis .oow-ph { margin: 0; min-width: 0; }
/* the phone, drawn: a rounded body, a thin bezel, a camera island, one side button; no brand */
.pg-basis .oow-ph-body { position: relative; padding: 0.5rem; border-radius: 2.75rem; background: var(--n0);
  box-shadow: 0 0 0 1px var(--n5), var(--edge-hi), 0 1.5rem 3rem -1rem var(--sunk); }
.pg-basis .oow-ph-body::before { content: ""; position: absolute; right: -0.1875rem; top: 22%; width: 0.1875rem; height: 11%; border-radius: 0 2px 2px 0; background: var(--n5); }
.pg-basis .oow-ph-scr { position: relative; overflow: hidden; aspect-ratio: 390 / 844; border-radius: 2.25rem; background: var(--cell); isolation: isolate; }
/* no notch is drawn over the screen: the phone screens run to the top edge, and a notch covered their first line and its Designed mark */
.pg-basis .oow-ph-scr img { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.pg-basis .oow-ph-scr .oow-ph-live { position: absolute; z-index: 2; left: 0; top: 0; border: 0; margin: 0; padding: 0;
  transform-origin: 0 0; opacity: 0; pointer-events: none; background: transparent; }
.pg-basis .oow-ph-scr .oow-ph-live.on { opacity: 1; }
.pg-basis .oow-ph figcaption { margin-top: 0.875rem; }
.pg-basis .oow-ph figcaption:empty { display: none; }
/* the switch between the two phones: kept in the page's markup, not shown, since both phones show at every width */
.pg-basis .oow-ph-sw { display: none; }
.pg-basis .oow-ph-sw button { display: flex; flex-direction: column; align-items: stretch; gap: 0.625rem; min-height: 2.75rem; margin: 0; padding: 0 0 0.5rem;
  border: 0; background: none; text-align: left; cursor: pointer; color: var(--ink-3); font: 500 0.8125rem/1.25rem var(--font-sans);
  transition: color 0.1s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.pg-basis .oow-ph-sw button:hover, .pg-basis .oow-ph-sw button[aria-pressed="true"] { color: var(--ink); }
.pg-basis .oow-ph-sw button[aria-pressed="true"] .oow-bar i { transform: scaleX(1); }
