/* #how: How it works (30 Oct 2026; the review fixes of 31 Oct 2026), theme light. A scroll film of one SmartStack desk:
   the top lifts off, parts into its plies, the alternate plies take colours (the frame follows) and press back
   together, ending on the stripe in the edge (assets/how-film-b, made by _source/how-film). The old sticky notched
   card with three steps is in _source/Replaced sections (29 Oct 2026)/Before how film (30 Oct 2026)/.

   Static layout (reduced motion, no GSAP, no JS, windows under 340px tall and portrait windows under 520px tall): the
   label, heading and the two lines in the left columns, the still beside them in a rounded floating frame (stacked
   on phones), then the caption. The still is the top parted into its plies over the navy frame, Howick High School
   edition (film frame 186; 124, green plies, until 31 Oct 2026). Portrait phones get the phone camera's frame in a 2:3
   box (the 1600x900 still cropped to 4:3 cut the frame's legs); phones held sideways get the whole 16:9 still.

   Film layout (#how.how--film, added by js/sections/how.js): .how__pin is one screen, pinned for 3 screens (2.5 on
   phones). The film is frameless: every frame is the page's own paper (#f5f2ed) wherever it shows no desk, so how.js
   places the frame's rectangle (.how__film) on the screen with no edge to see. The rectangle is anchored to the
   screen's bottom right, because the legs run off the frame's bottom edge and the last close-up off its right edge;
   its top and left edges are paper in every frame. A paper fade over the screen's bottom edge (.how__fade, as tall
   as how.js sets --how-fade) lets the legs and the close-up fade out, so no straight cut shows once the pin lets go.
   how.js sets data-how-layout:
   - side (screens at least 768px wide and 1.15:1 or wider): the words in a column on the left, at the page's text
     edge, vertically centred; the frame as large as fits with its clear left third (nothing of the desk comes
     nearer the frame's left edge than 0.344 of its width) behind the column, never under the nav.
   - beside (screens under 440px tall and at least 1.5:1: phones held sideways, short laptop windows): the same, with
     the words in a narrower column and smaller type.
   - stack (portrait and narrow screens): the words in a band at the top, the film under them; the phone frames
     (600x900) the full width of the screen when the desk keeps clear of the words, otherwise the desktop frames
     cropped from the left (short phones, portrait tablets).
   Over the film two tracking boxes (the hero's and the foot's ink brackets with yellow corner squares) name the top
   and the frame with the hero's labels; they lock on as the film comes up (before the pin), the top's box rides up
   with it and stays round the plies until they have pressed back together. Each label has one place for the whole
   film (planned by how.js for the screen), shows only while that place is clear and fades in and out with the film
   (never cut in one frame); a place inside the box gets a paper backing, as it can sit over a tube. While the frame
   takes the two named colourways a mono label (the hero's: chip dots and the colour section's chip name) takes the
   top label's place. */

#how {
  --how-fade: 56px;                 /* the bottom fade's height (how.js sets it from the frame's size) */
  --how-gap: 24px;                  /* between the words' column and the clear edge of the film */
}


/* ------------------------------------------------------------------ static layout */
#how .how__frame {
  width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start;
}
#how .how__copy { grid-column: 1 / span 5; display: grid; justify-items: start; gap: 28px; }
#how .how__title { max-width: 8em; }
#how .how__beats { display: grid; gap: 30px; width: 100%; }
#how .how__beat { display: grid; justify-items: start; gap: 10px; }
#how .how__beat-label { color: var(--muted); }
#how .how__beat-text { color: color-mix(in srgb, var(--fg) 82%, transparent); max-width: 34ch; }

#how .how__media { grid-column: 6 / span 7; margin: 0; position: sticky; top: calc(var(--nav-clear) + 24px); }
#how .how__screen {
  position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 9;
  border-radius: var(--r-media); background: var(--paper); box-shadow: var(--shadow-float);
}
#how .how__still {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 100% 50%;
  user-select: none; -webkit-user-select: none; -webkit-user-drag: none;
}
#how .how__film, #how .how__fade, #how .how__svg, #how .how__tag { display: none; }
#how .how__caption { margin-top: 14px; }

@media (max-width: 767.98px) {
  #how .how__frame { grid-template-columns: minmax(0, 1fr); row-gap: 36px; }
  #how .how__copy, #how .how__media { grid-column: 1 / -1; }
  #how .how__media { position: static; }
}
/* portrait phones: the phone camera's still (600x900, the <picture> source), whole, legs and all */
@media (max-width: 767.98px) and (orientation: portrait) {
  #how .how__screen { aspect-ratio: 2 / 3; }
  #how .how__still { object-position: 50% 50%; }
}


/* ------------------------------------------------------------------ film layout: shared */
#how.how--film {
  /* the rooms leave their own air above; below, at least the theme edge, so the film's paper never meets the fade
     into the next section (the pilot since 31 Oct 2026, on the same paper; before that the colour section's paper-2) */
  padding-block: clamp(24px, 4vh, 48px) var(--section-pad);
}
#how.how--film .how__pin { height: 100vh; height: 100svh; }
#how.how--film .how__frame {
  position: relative; height: 100%; max-width: none; margin: 0; padding: 0;
  display: block; container-type: size;
  /* the words' column: at the page's text edge (the .wrap's, so the rooms, How it works and the sections after it
     line up on wide screens) */
  --how-left: max(var(--gutter), calc((100cqw - var(--max)) / 2 + var(--gutter)));
  --how-col: min(30cqw, 520px);
}
#how.how--film .how__media { position: absolute; inset: 0; margin: 0; }
#how.how--film .how__screen {
  position: absolute; inset: 0; aspect-ratio: auto; overflow: hidden;
  border-radius: 0; background: none; box-shadow: none;
}
#how.how--film .how__still { display: none; }
/* the frame's own rectangle (how.js sets left, top, width and height) */
#how.how--film .how__film { display: block; position: absolute; left: 0; top: 0; width: 0; height: 0; }
#how.how--film .how__zoom { position: absolute; inset: 0; transform-origin: 66% 56%; }
#how.how--film .how__zoom.is-live { will-change: transform; }
#how.how--film .how__poster,
#how.how--film .how__canvas {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: fill;
}
#how.how--film .how__fade {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; height: var(--how-fade); pointer-events: none;
  background: linear-gradient(to bottom, rgb(245 242 237 / 0), rgb(245 242 237 / .72) 55%, var(--paper));
}

/* the tracking boxes: 1px ink brackets and yellow corner squares, as the hero's and the foot's */
#how.how--film .how__svg { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
#how.how--film .how__box { opacity: 0; }
#how.how--film .how__brackets { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linecap: square; }
#how.how--film .how__squares rect { fill: var(--yellow); stroke: var(--ink); stroke-width: 1; }
/* the box labels: the hero's part labels, mono, over the box's corner (how.js places them) */
#how.how--film .how__tag {
  display: block; position: absolute; left: 0; top: 0; margin: 0; white-space: nowrap; color: var(--ink);
  opacity: 0; visibility: hidden; will-change: transform;
}
/* a label before its first frame is drawn */
#how.how--film :is(.how__tag, .how__way).is-off { opacity: 0 !important; visibility: hidden !important; }
/* a label placed inside its box can sit over a tube or a ply: a paper backing keeps it legible */
#how.how--film :is(.how__tag, .how__way).is-in {
  background: rgb(245 242 237 / .86); padding: 2px 6px; margin: -2px -6px; border-radius: 3px;
}
/* the colourway label: the hero's (chip dots and the chip name), the names sharing one masked grid cell (how.js
   scrubs each one in and out from the frame drawn) */
#how.how--film .how__way {
  display: block; position: absolute; left: 0; top: 0; margin: 0; white-space: nowrap; color: var(--ink);
  opacity: 0; visibility: hidden; will-change: transform;
}
#how .how__way { display: none; }
#how .how__way-mask { display: grid; overflow: clip; padding-block: 3px; margin-block: -3px; }
#how .how__way-item { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 10px; }
#how .how__way .chip__dot { width: 10px; height: 10px; }
#how .how__way .chip__dot + .chip__dot { margin-left: -3px; }

/* the words: the heading stays; the two lines take turns in one place under it (how.js) */
#how.how--film .how__copy { position: absolute; z-index: 3; display: block; color: var(--ink); }
#how.how--film .how__eyebrow { margin-bottom: 20px; }
#how.how--film .how__title { max-width: none; }
#how.how--film .how__beats { display: grid; gap: 0; margin-top: clamp(20px, 3.2vh, 34px); }
/* stretch, not start: each line block takes the column's width, so SplitText splits it again when the column changes
   (a tablet turned to landscape and back kept the landscape column's line breaks; the review of 31 Oct 2026) */
#how.how--film .how__beat { grid-area: 1 / 1; align-content: start; gap: 12px; justify-items: stretch; }
#how.how--film .how__beat-text { max-width: 34ch; }
/* masked lines (SplitText, from how.js): each line moves inside its own padded mask (.ss-line-mask, base.css) */
#how .how__line { display: block; position: relative; }
/* until how.js has split them into masked lines, the words wait */
#how.how--film .how__copy:not([data-split]) :is(.how__title, .how__beat) { visibility: hidden; }
#how.how--film .how__copy:not([data-split]) .how__eyebrow { opacity: 0; }

#how.how--film .how__caption { position: absolute; z-index: 3; margin: 0; left: var(--how-left); bottom: clamp(14px, 2.6vh, 28px); }


/* ------------------------------------------------------------------ film layout: side (words in the left column) */
#how.how--film[data-how-layout="side"] .how__copy {
  left: var(--how-left); width: var(--how-col);
  top: var(--nav-clear); bottom: clamp(56px, 9vh, 96px);
  display: flex; flex-direction: column; justify-content: center;
}
/* sized so "It's in your" keeps to one line of the column (it is about 4.2em wide in Geist) */
#how.how--film[data-how-layout="side"] .how__title { font-size: min(var(--fs-l), calc(var(--how-col) * .22)); }


/* ------------------------------------------------------------------ film layout: beside (phones held sideways) */
#how.how--film[data-how-layout="beside"] .how__frame { --how-col: calc(40cqw - var(--how-left)); --how-gap: 16px; }
#how.how--film[data-how-layout="beside"] .how__copy {
  left: var(--how-left); width: var(--how-col);
  /* ends above the caption (bottom 8px, 12px type), so the last line never reads as a line of the caption: the gap was
     5px at 740x360 and 640x360 (the review of 31 Oct 2026) */
  top: var(--nav-clear); bottom: 36px;
  display: flex; flex-direction: column; justify-content: center;
}
#how.how--film[data-how-layout="beside"] .how__eyebrow { margin-bottom: 12px; }
#how.how--film[data-how-layout="beside"] .how__title { font-size: clamp(24px, 8vh, 32px); }
#how.how--film[data-how-layout="beside"] .how__beats { margin-top: 12px; }
#how.how--film[data-how-layout="beside"] .how__beat { gap: 7px; }
#how.how--film[data-how-layout="beside"] .how__beat-text { font-size: 14px; line-height: 1.45; max-width: none; }
#how.how--film[data-how-layout="beside"] .how__caption { bottom: 8px; font-size: 12px; }


/* ------------------------------------------------------------------ film layout: stack (words on top, film below) */
#how.how--film[data-how-layout="stack"] .how__copy {
  left: 0; top: 0; width: 100%; max-width: calc(660px + 2 * var(--gutter));
  padding: calc(var(--nav-clear) + clamp(4px, 1.2vh, 16px)) var(--gutter) 0;
}
#how.how--film[data-how-layout="stack"] .how__title { font-size: min(var(--fs-l), 8.6cqw); }
/* over the film, on a light glass pill as the rooms' caption, so it reads at full contrast over a leg or the close-up */
#how.how--film[data-how-layout="stack"] .how__caption {
  left: auto; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  color: rgba(11, 11, 13, .74); white-space: nowrap;
  background: rgba(245, 242, 237, .8); border: 1px solid rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%);
}

@media (max-width: 767.98px) {
  #how.how--film .how__eyebrow { margin-bottom: 14px; }
  #how.how--film[data-how-layout="stack"] .how__title { font-size: clamp(28px, 8.4cqw, 40px); }
  #how.how--film[data-how-layout="stack"] .how__beats { margin-top: 14px; }
  #how.how--film[data-how-layout="stack"] .how__beat { gap: 8px; }
  #how.how--film[data-how-layout="stack"] .how__beat-text { font-size: 16px; line-height: 1.5; max-width: none; }
  #how.how--film .how__caption { font-size: 12px; }
}
