/* easytor-v2 · foundation/base.css · the kit: one visual vocabulary (SPEC 4)
   ==========================================================================
   Reads tokens.css; holds no literal colour. Logical properties only
   (--start / --end where CSS has no logical keyword).
   motion.css is appended to this file at build time and owns everything that
   MOVES between states (scenes, actors, reveals, hits, reduced motion).
   What is here: the resting look of every primitive and every state as a class,
   the hover / press transitions of the kit's own controls and the leader's draw
   (both under html.motion only), and the dim-line's actor keyframes.

   Contents
     1  reset and document          8  containers: card, bento, icon tile, island
     2  type and the .hl grammar    9  frame-browser, stepper, media-toggle, dialog
     3  layout: container, section 10  3D rigs and the phone (.u-phone3d)
     4  overlays (glow, grid …)    11  the chat screen (.chat)
     5  buttons                    12  utilities (.visually-hidden, .skip-link, .cta-dup)
     6  eyebrow, label bar         13  forced colours
     7  sticker, badge, timer pill,
        leader, dim-line, chip
   The cheat sheet for builders is tools/build/KIT.md; the living reference is kit.html.
   ========================================================================== */

/* ==========================================================================
   1  Reset and document
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* anchors land under the floating bar and above the dock; never smooth (SPEC 5.6) */
  scroll-padding-block: var(--anchor-top) calc(var(--stage-bottom) + 16px);
  scroll-behavior: auto;
  background-color: var(--bg);
}

body {
  margin: 0;
  min-block-size: 100vh;
  min-block-size: 100svh;
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: var(--w-regular);
  line-height: var(--lh-body);
  color: var(--fg-2);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-synthesis: none;
}

/* Every world scope re-colours the text that sits in it. */
[data-world],
.theme-app,
.theme-chat { color: var(--fg-2); }

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, fieldset { margin: 0; }
fieldset { padding: 0; border: 0; min-inline-size: 0; }
ul[role="list"], ol[role="list"] { margin: 0; padding: 0; list-style: none; }

img, svg, video, canvas { display: block; max-inline-size: 100%; }
img, video { block-size: auto; }

a { color: inherit; text-decoration-skip-ink: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { margin: 0; }
b, strong { font-weight: var(--w-bold); }

/* [hidden] must beat every display rule of the kit and the sections, without !important */
[hidden]:not(#_) { display: none; }

::selection { background-color: var(--accent); color: var(--on-accent); }

/* Focus: 2px ring, 3px away, in the colour of the world the control sits in. */
:focus { outline: none; }
:focus-visible,
.is-focus {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

/* Controls that float over both worlds (nav, dock, WhatsApp button, skip link):
   2px white inside, 2px navy outside. */
.u-ring-double:focus-visible,
.u-ring-double.is-focus {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--white);
}

/* ==========================================================================
   2  Type
   ========================================================================== */

h1, h2, h3, h4,
.t-h1, .t-display, .t-h2, .t-h3, .t-h4 {
  color: var(--fg);
  font-weight: var(--w-black);
  line-height: var(--lh-head);
  letter-spacing: var(--track-head);
  text-wrap: balance;
}

h1, .t-h1 { font-size: var(--text-h1); }
.t-display { font-size: var(--text-display); }
h2, .t-h2 { font-size: var(--text-h2); }
h3, .t-h3 { font-size: var(--text-h3); }
h4, .t-h4 { font-size: var(--text-h4); font-weight: var(--w-bold); line-height: 1.25; }

p { text-wrap: pretty; }

.t-lede, .lede {
  font-size: var(--text-lede);
  line-height: 1.55;
  color: var(--fg-2);
  max-inline-size: 34rem;
}
.t-body { font-size: var(--text-body); line-height: var(--lh-body); }
.t-small { font-size: var(--text-small); line-height: 1.55; }
.t-caption { font-size: var(--text-caption); line-height: 1.45; color: var(--fg-3); }
.t-muted { color: var(--fg-3); }

/* Digits that must not jump: timers, counters, prices */
.u-tnum { font-variant-numeric: tabular-nums; }

/* An inline link in running text */
.link {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
.link:hover { text-decoration-thickness: 2px; }

/* --- The headline grammar ----------------------------------------------------
   <h2 class="hl">
     <span class="hl__quiet">quiet lead-in, 200 (Extralight)</span>                 (optional)
     <span class="hl__heavy">heavy words&nbsp;<span class="hl__accent">last.</span></span>
   </h2>
   The break between the two lines is authored (block spans); inside a line the
   wrap is balanced; the space before the accent is U+00A0, so the pink word is
   never alone on a line. */

.hl {
  margin: 0;
  color: var(--fg);
  font-weight: var(--w-black);
  line-height: var(--lh-head);
  letter-spacing: var(--track-head);
  text-wrap: balance;
}

/* A word (or the no-break pair before the accent) wider than its line — 200% text on
   a phone — breaks inside the word instead of pushing the page sideways; the cap on
   the box keeps a shrink-to-fit headline (a grid with justify-items: start, a centred
   flex column) inside its container so the break can happen. At normal sizes nothing
   is that wide, so neither ever shows. */
h1, h2, h3, h4, .hl,
.t-h1, .t-display, .t-h2, .t-h3, .t-h4 {
  max-inline-size: 100%;
  overflow-wrap: break-word;
}

.hl__quiet,
.hl__heavy { display: block; }

.hl__quiet {
  font-weight: var(--w-quiet);
  color: var(--fg-2);
}

/* a quiet line of more than three words: .62em. The -he / -en forms apply it to one language only.
   Extralight (--w-quiet) only where the quiet line renders at 24px or more (lead rule, Talent FS,
   2026-11-23): a reduced line (15-35px) is Light (--w-regular), except in an h1, whose quiet line
   is 27px+ at every width. A full-size .hl__quiet (32px+) stays Extralight. */
.hl__quiet--sm,
.hl__quiet--sm-he:lang(he),
.hl__quiet--sm-en:lang(en) {
  font-size: .62em;
  line-height: 1.2;
  padding-block-end: .24em;
}
:is(.hl__quiet--sm, .hl__quiet--sm-he:lang(he), .hl__quiet--sm-en:lang(en)):not(h1 *) { font-weight: var(--w-regular); }

.hl__heavy { font-weight: var(--w-black); }

/* a second heavy line that answers the first (the end card's pink line: .78 in the film) */
.hl__heavy--sm { font-size: .8em; }

.hl__accent { color: var(--accent-display); }

/* ==========================================================================
   3  Layout
   ========================================================================== */

.container {
  inline-size: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* A section paints its own canvas (the contrast sweep reads ancestors only). */
.section {
  position: relative;
  isolation: isolate;                 /* so a .u-layer can sit at z-index -1 */
  padding-block: var(--section-pad);
  background-color: var(--bg);
  color: var(--fg-2);
}

/* The section begins with a sticky stage (SPEC 7.0). While that stage is LIVE
   (html.stages, not cramped) the stage starts at the section's top edge and the
   negative scroll margin cancels html's scroll-padding, so an anchor lands at p = 0
   with the stage filling the viewport. Static (no JS, reduced motion, short
   viewport, cramped) it is an ordinary section: its padding, no scroll margin, and
   an anchor lands under the nav like any other (motion.css resets the margin to 0
   in those states as well, so the two files agree whichever loads last).
   The conditions sit in :where() so the rule weighs (0,2,1): a section whose stage
   is not first at some width restores both with `html.stages .x { … }` (sections.css
   loads after base.css). */
html.stages .section--stage:where(:not(.is-cramped):not(:has(.scene.is-cramped))) {
  padding-block-start: 0;
  scroll-margin-block-start: calc(-1 * var(--anchor-top));
}

/* eyebrow · 16 · headline · 16 · lede · 24 · actions; head -> body: --head-gap */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: var(--space-16);
  margin-block-end: var(--head-gap);
}

.section-head > * { min-inline-size: 0; }

.section-head__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-12) var(--space-24);
  margin-block-start: var(--space-8);
}

/* only where the body is ONE centred object */
.section-head--center {
  justify-items: center;
  text-align: center;
}
.section-head--center .section-head__actions { justify-content: center; }

/* ==========================================================================
   4  Overlays: the day surfaces and the night light (SPEC 3.2)
   Each is a BACKGROUND, so it can sit on the section itself
   (data-surface="glow|grid|lilac"; "plain" paints nothing), on a stage, or on
   an aria-hidden child layer (.u-layer). Day overlays are gone --overlay-fade
   before the top and bottom edges, so no seam shows. Never a mask.
   ========================================================================== */

/* an aria-hidden art layer behind the content of its positioned parent */
.u-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* the world's painted background: night glow, blueprint vignette (day: none) */
.u-bg-art { background-image: var(--bg-art); }

/* the world's radial light. Day: a near-white centre. Night: royal blue with the
   bright core, for behind IMAGERY only (a device), never behind copy. */
.u-glow,
.section[data-surface="glow"] {
  --glow-size: min(100%, 1400px) calc(100% - 2 * var(--overlay-fade));
  --glow-at: 50% 50%;
  background-image: var(--glow);
  background-repeat: no-repeat;
  background-position: var(--glow-at);
  background-size: var(--glow-size);
}

/* the copy-safe light (no bright core): text may sit on it. A section's surface is
   always this one: in day it is the same near-white light, at night it has no core. */
.u-glow--soft,
.section[data-surface="glow"] { background-image: var(--glow-soft); }

/* the lilac bloom: inset, toward the inline-end and the lower half (the film's lower corner) */
.u-lilac,
.section[data-surface="lilac"] {
  --lilac-size: min(78%, 980px) min(76%, 820px);
  --lilac-at: var(--end) 4% bottom var(--overlay-fade);
  background-image: var(--lilac);
  background-repeat: no-repeat;
  background-position: var(--lilac-at);
  background-size: var(--lilac-size);
}

/* the grid: a line every 60px, a stronger one every 240px, one line on the centre
   axis. The top layer is a static fade to the canvas at both edges. */
.u-grid-bg,
.section[data-surface="grid"] {
  background-image:
    linear-gradient(to bottom, var(--bg) 0, transparent var(--overlay-fade), transparent calc(100% - var(--overlay-fade)), var(--bg) 100%),
    linear-gradient(to right, var(--grid-line-2) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-2) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 240px 240px, 240px 240px, 60px 60px, 60px 60px;
  background-position: 0 0, calc(50% + 120px) 0, 0 0, calc(50% + 30px) 0, 0 0;
  background-repeat: no-repeat, repeat, repeat, repeat, repeat;
}

/* edge to edge, no fade: a stage that owns its whole frame (the blueprint floor) */
.u-grid-bg--bleed {
  background-image:
    linear-gradient(to right, var(--grid-line-2) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line-2) 1px, transparent 1px),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 240px 240px, 240px 240px, 60px 60px, 60px 60px;
  background-position: calc(50% + 120px) 0, 0 0, calc(50% + 30px) 0, 0 0;
  background-repeat: repeat;
}

/* ==========================================================================
   5  Buttons
   .is-hover / .is-active / .is-focus mirror the pseudo-classes so kit.html and
   screenshots can show a state at rest. Sections never set them.
   ========================================================================== */

.btn {
  --btn-h: 48px;
  --btn-pad: 22px;
  --btn-size: 1.0625rem;              /* 17px */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-inline-size: 100%;
  min-block-size: var(--btn-h);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-bar);
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: var(--btn-size);
  font-weight: var(--w-medium);
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn--lg { --btn-h: 56px; --btn-pad: 28px; --btn-size: 1.25rem; }
.btn--sm { --btn-h: 40px; --btn-pad: 16px; --btn-size: .9375rem; }

/* 40px is for fine pointers only, and even there the hit area is 44px */
.btn--sm::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block: -2px;
}
@media (pointer: coarse) {
  .btn--sm { --btn-h: 44px; }
}

.btn__label { text-wrap: balance; }

.btn:active,
.btn.is-active { transform: scale(.98); }

.btn:disabled,
.btn[aria-disabled="true"] { cursor: not-allowed; transform: none; }

/* --- .btn--bar: THE primary action, and only ever an action (the glowing pill) --
   <a class="btn btn--bar" href="#contact">
     <span class="btn__label">לתיאום הדגמה</span>
     <span class="btn__cap" aria-hidden="true"><svg class="btn__chev" viewBox="0 0 24 24"><path d="M15.25 5.5 8.75 12l6.5 6.5"/></svg></span>
   </a>
   A pill in a pink -> deeper magenta gradient (toward the inline-end), a white 700 label, a soft
   pink glow, and the cap as a WHITE CIRCLE inset at the inline-END with the chevron in pink.
   The chevron is drawn pointing left and mirrored with --dir, so it points along the reading
   direction. Every pixel under the label lies between --cta-fill-1 and --cta-fill-2 (white on
   both >= 4.5:1); the rims and the shine never sit under the text at rest.
   The pill clips its own shine (overflow: hidden): .btn--sm's 44px hit area is therefore a
   transparent 2px border band (below), not the ::after every other .btn--sm uses. */

.btn--bar {
  --cap-inset: 5px;                              /* the circle's distance from the pill's edge */
  --cap-gap: var(--space-12);                    /* label -> circle */
  --cap-d: calc(var(--btn-h) - 2 * var(--cap-inset));
  align-items: center;
  padding-inline-end: var(--cap-inset);
  border-radius: var(--radius-full);
  background-color: var(--cta-fill-2);
  background-image: linear-gradient(to var(--end), var(--cta-fill-1) 28%, var(--cta-fill-2) 100%);
  background-clip: padding-box;
  color: var(--cta-fg);
  font-weight: var(--w-bold);
  box-shadow: var(--cta-rim), var(--cta-glow);
  overflow: hidden;
}
.btn--bar.btn--lg { --cap-inset: 6px; --cap-gap: 14px; }
.btn--bar.btn--sm {
  --cap-inset: 4px;
  --cap-gap: 10px;
  min-block-size: calc(var(--btn-h) + 4px);
  border-block: 2px solid transparent;           /* the 44px hit area of the 40px pill */
}
.btn--bar.btn--sm::after { content: none; }

.btn--bar .btn__label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-inline-size: 0;
  padding-block: 8px;
  padding-inline: calc(var(--btn-pad) + 2px) var(--cap-gap);
}

/* The cap is a circle as tall as a one-line pill less its inset. When the visitor's text is
   larger (a 24px or 32px default font) the one-line pill grows past --btn-h and so does the
   circle: 1lh + the label's 16px of padding is that pill's height. A label that wraps makes
   the pill taller still; the circle keeps its one-line size and stays centred. */
.btn__cap {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  inline-size: var(--cap-d);
  inline-size: max(var(--cap-d), 1lh + 16px - 2 * var(--cap-inset));
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: var(--cta-knob);
  color: var(--cta-knob-fg);
  box-shadow: var(--cta-knob-shadow);
}

.btn__chev {
  position: relative;
  inline-size: 56%;
  block-size: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scaleX(var(--dir));
}

/* the shine: one light band that crosses the pill along the reading direction, once per hover
   or keyboard focus (an animation that is applied, never looped). Transform only. */
.btn--bar::before {
  content: "";
  position: absolute;
  inset-block: -2px;
  inset-inline-start: 0;
  z-index: 1;
  inline-size: 42%;
  background-image: var(--cta-shine);
  transform: translateX(calc(var(--dir) * 110%)) skewX(calc(var(--dir) * 18deg));
  pointer-events: none;
}

/* the phone-number bar: digits at 700, never broken at the hyphen; the number
   itself is a <bdi dir="ltr"> so it paints left to right in the Hebrew page */
.btn--tel .btn__label { font-weight: var(--w-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (hover: hover) {
  .btn--bar:hover { box-shadow: var(--cta-rim), var(--cta-glow-hover); }
  .btn--bar:hover .btn__cap { transform: translateX(calc(var(--dir) * -3px)); }
  .btn--bar:hover .btn__chev { transform: translateX(calc(var(--dir) * -1.5px)) scaleX(var(--dir)); }
}
.btn--bar.is-hover { box-shadow: var(--cta-rim), var(--cta-glow-hover); }
.btn--bar.is-hover .btn__cap { transform: translateX(calc(var(--dir) * -3px)); }
.btn--bar.is-hover .btn__chev { transform: translateX(calc(var(--dir) * -1.5px)) scaleX(var(--dir)); }

@keyframes btn-shine {
  from { transform: translateX(calc(var(--dir) * 110%)) skewX(calc(var(--dir) * 18deg)); }
  to { transform: translateX(calc(var(--dir) * -290%)) skewX(calc(var(--dir) * 18deg)); }
}
@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) {
    html.motion .btn--bar:hover::before { animation: btn-shine 720ms var(--ease-in-out) 1 both; }
  }
  html.motion .btn--bar:focus-visible::before { animation: btn-shine 720ms var(--ease-in-out) 1 both; }
}

.btn--bar:disabled,
.btn--bar[aria-disabled="true"] {
  --cta-fill-1: var(--surface-2);
  --cta-fill-2: var(--surface-2);
  --cta-fg: var(--fg-3);
  --cta-knob: var(--line-2);
  --cta-knob-fg: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn--bar:disabled::before,
.btn--bar[aria-disabled="true"]::before { content: none; }
.btn--bar:disabled .btn__cap,
.btn--bar[aria-disabled="true"] .btn__cap { transform: none; box-shadow: none; }
.btn--bar:disabled .btn__chev,
.btn--bar[aria-disabled="true"] .btn__chev { transform: scaleX(var(--dir)); }

/* --- .btn--ghost: the one outline secondary (a quiet pill beside the glowing one) */

.btn--ghost {
  gap: var(--space-8);
  padding: 8px var(--btn-pad);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-full);
  color: var(--fg);
}
@media (hover: hover) {
  .btn--ghost:hover { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
}
.btn--ghost.is-hover { border-color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.btn--ghost:disabled,
.btn--ghost[aria-disabled="true"] { color: var(--fg-3); border-color: var(--line); box-shadow: none; }

/* --- .btn--link: text + arrow, for quiet in-line actions ---------------------
   <a class="btn btn--link" href="#dashboard">
     <span class="btn__label">דילוג על הסיור</span>
     <svg class="btn__arrow" viewBox="0 0 24 24" aria-hidden="true"><path d="M19 12H5m6-6-6 6 6 6"/></svg>
   </a> */

.btn--link {
  --btn-h: 44px;
  gap: var(--space-8);
  border-radius: 2px;
  color: var(--accent-ink);
  font-size: var(--text-body);
  text-align: start;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: .28em;
}

.btn__arrow {
  flex: none;
  inline-size: 20px;
  block-size: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scaleX(var(--dir));
}

@media (hover: hover) {
  .btn--link:hover { text-decoration-color: currentColor; }
  .btn--link:hover .btn__arrow { transform: translateX(calc(var(--dir) * -3px)) scaleX(var(--dir)); }
}
.btn--link.is-hover { text-decoration-color: currentColor; }
.btn--link.is-hover .btn__arrow { transform: translateX(calc(var(--dir) * -3px)) scaleX(var(--dir)); }

/* --- .btn--play: "watch the video" -------------------------------------------
   <button class="btn btn--play" type="button" data-video-open>
     <span class="btn__disc" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M9 6.2v11.6L18.5 12z"/></svg></span>
     <span class="btn__label">לצפייה בסרטון (56 שניות)</span>
   </button>
   The play glyph never mirrors. */

.btn--play {
  --btn-h: 44px;
  gap: var(--space-12);
  color: var(--fg);
  text-align: start;
}

.btn__disc {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--accent-glow);
}
.btn__disc svg { inline-size: 20px; block-size: 20px; fill: currentColor; }

@media (hover: hover) {
  .btn--play:hover .btn__disc { transform: scale(1.08); }
  .btn--play:hover .btn__label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em; }
}
.btn--play.is-hover .btn__disc { transform: scale(1.08); }
.btn--play.is-hover .btn__label { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .28em; }

/* the kit's own hover and press transitions: transform only, and only with motion allowed */
html.motion .btn { transition: transform var(--dur-1) var(--ease-out); }
html.motion .btn--bar { transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
html.motion .btn__cap,
html.motion .btn__chev,
html.motion .btn__arrow,
html.motion .btn__disc { transition: transform var(--dur-2) var(--ease-out); }

/* ==========================================================================
   6  Eyebrow and label bar
   ========================================================================== */

/* the eyebrow of every section head: a 10px magenta square + 15px/700 text. Not a bar. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--fg);
  font-size: var(--text-small);
  font-weight: var(--w-bold);
  line-height: 1.3;
  letter-spacing: 0;
}
.eyebrow::before {
  content: "";
  flex: none;
  inline-size: 10px;
  block-size: 10px;
  background-color: var(--accent);
}

/* --- .label-bar: the film's small bar with the pink cap ----------------------
   One place since 2026-11-26: the footer brand block (the dawn lockup has .switch__tag).
   Never an eyebrow, never a control: no hover, no focus, default cursor.
   <p class="label-bar">
     <span class="label-bar__text">מערכת לניהול תורים</span>
     <span class="label-bar__cap" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M15.25 5.5 8.75 12l6.5 6.5"/></svg></span>
   </p> */

.label-bar {
  --label-h: 28px;
  display: inline-flex;
  align-items: stretch;
  min-block-size: var(--label-h);
  margin: 0;
  border-radius: var(--radius-bar);                       /* 4px, as the bar button (SPEC 3.3) */
  background-color: var(--action-bg);
  color: var(--action-fg);
  box-shadow: var(--shadow-action);
  font-size: max(var(--text-caption), calc(var(--label-h) * .5));
  font-weight: var(--w-medium);
  line-height: 1.2;
  cursor: default;
}

.label-bar__text {
  display: flex;
  align-items: center;
  padding: 2px calc(var(--label-h) * .44);
}

.label-bar__cap {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: var(--label-h);
  inline-size: max(var(--label-h), 1lh + 4px);         /* square while the text is one line, as .btn__cap */
  border-start-end-radius: inherit;
  border-end-end-radius: inherit;
  background-color: var(--action-cap);
  color: var(--action-cap-fg);
}
.label-bar__cap svg {
  inline-size: calc(var(--label-h) * .58);
  block-size: calc(var(--label-h) * .58);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: scaleX(var(--dir));
}

/* ==========================================================================
   7  Motifs
   ========================================================================== */

/* --- .sticker ---------------------------------------------------------------
   Attached to an object (a device, a card), never inline in a sentence; at most
   one in view. Raw magenta + the magenta glow, white 800 at >= 20px.
   The tilt uses the `rotate` property, so a transform animation (a pop) composes. */

.sticker {
  --sticker-size: clamp(1.25rem, 1rem + 1.1vw, 2rem);     /* 20 -> 32 */
  position: relative;
  display: inline-block;
  margin: 0;
  padding: .16em .56em .18em;
  border-radius: .27em;                                   /* about .2 of the height */
  background-color: var(--accent);
  color: var(--white);
  box-shadow: var(--accent-glow);
  font-size: var(--sticker-size);
  font-weight: var(--w-extra);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  rotate: calc(var(--dir) * -1.2deg);
}

/* phone stages: 16px/800 on the solid fill; may take two lines; at most 86% of the object it points at */
.sticker--sm {
  --sticker-size: 1rem;
  max-inline-size: 86%;
  padding: .32em .7em .34em;
  border-radius: .5em;
  background-color: var(--accent-fill);
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
  white-space: normal;
}

/* a pointer triangle under the sticker; --sticker-point moves it along the edge */
.sticker--callout {
  --sticker-point: 50%;
  margin-block-end: .5em;
}
.sticker--callout::after {
  content: "";
  position: absolute;
  inset-block-start: calc(100% - 1px);
  inset-inline-start: calc(var(--sticker-point) - .3em);
  inline-size: .6em;
  block-size: .44em;
  background-color: inherit;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* --- .count-badge -----------------------------------------------------------
   <span class="count-badge" aria-hidden="true"><bdi class="count-badge__n" dir="ltr">99+</bdi></span>
   Only for numbers that are literally on a screen marked as illustration or real. */

.count-badge {
  --badge-size: 48px;
  display: inline-grid;
  place-items: center;
  min-inline-size: var(--badge-size);
  min-block-size: var(--badge-size);                       /* a disc that grows with its digits, never clips them */
  padding-inline: calc(var(--badge-size) * .14);
  border: 3px solid var(--bg);
  border-radius: var(--radius-full);
  background-color: var(--accent);
  background-clip: padding-box;
  color: var(--white);
  box-shadow: var(--accent-glow);
  font-size: calc(var(--badge-size) * .42);               /* 20px: white on raw magenta needs >= 19px bold */
  font-weight: var(--w-extra);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* digits under 19px bold sit on the solid fill */
.count-badge--sm {
  --badge-size: 32px;
  border-width: 2px;
  background-color: var(--accent-fill);
  font-size: var(--text-caption);
}

/* --- .timer-pill ------------------------------------------------------------
   Decoration (aria-hidden). White in every world; .is-done is the magenta state.
   <div class="timer-pill" aria-hidden="true">
     <span class="timer-pill__clock"><i class="timer-pill__hand"></i></span>
     <span class="timer-pill__digits" dir="ltr">
       <span class="timer-pill__d">0</span><span class="timer-pill__d">0</span><span class="timer-pill__sep">:</span><span class="timer-pill__d">0</span><span class="timer-pill__d">2</span>
     </span>
   </div>
   An odometer digit: <span class="timer-pill__d"><span class="timer-pill__strip" style="--n:10">0<br>1<br>…9</span></span>;
   --k picks the digit at rest, an actor moves the strip with translateY. */

.timer-pill {
  --pill-h: 44px;
  /* positioned, so a second pill stacked over this one (the done state, KIT.md 7.7) paints above
     the odometer strips, whose transform would otherwise lift them over a non-positioned sibling */
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--pill-h) * .26);
  min-block-size: var(--pill-h);
  padding-inline: calc(var(--pill-h) * .42) calc(var(--pill-h) * .5);
  border-radius: var(--radius-full);
  background-color: var(--pill-bg);
  color: var(--pill-fg);
  box-shadow: var(--shadow-float);
  font-size: calc(var(--pill-h) * .52);                   /* 23px */
  font-weight: var(--w-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.timer-pill__digits { display: inline-flex; align-items: center; }

.timer-pill__d {
  display: inline-block;
  block-size: 1.2em;
  block-size: 1lh;                       /* one line of the strip, whatever line-height the visitor forces */
  overflow: hidden;
  overflow: clip;
  text-align: center;
}
.timer-pill__sep { padding-inline: .04em; transform: translateY(-.06em); }

.timer-pill__strip {
  --n: 10;
  --k: 0;
  display: block;
  transform: translateY(calc(var(--k) / var(--n) * -100%));
}

.timer-pill__clock {
  position: relative;
  flex: none;
  inline-size: calc(var(--pill-h) * .5);
  block-size: calc(var(--pill-h) * .5);
  border: max(2px, calc(var(--pill-h) * .05)) solid currentColor;
  border-radius: 50%;
}

/* the hand is an actor (transform: rotate), never a timed loop; `rotate` sets where it rests */
.timer-pill__hand {
  position: absolute;
  inset-block-end: 50%;
  inset-inline-start: calc(50% - max(1px, var(--pill-h) * .025));
  inline-size: max(2px, calc(var(--pill-h) * .05));
  block-size: 36%;
  border-radius: 1px;
  background-color: currentColor;
  transform-origin: 50% 100%;
  rotate: 42deg;
}

.timer-pill.is-done {
  background-color: var(--accent);
  color: var(--white);
  box-shadow: var(--accent-glow);
}

/* digits under 19px bold: the done state sits on the solid fill */
.timer-pill--sm { --pill-h: 36px; }
.timer-pill--sm.is-done { background-color: var(--accent-fill); }

/* --- .leader ------------------------------------------------------------------
   The film's leader label: a name sitting on a 2px magenta rule, a muted line
   under it, and the rule running on to a dot on the device's edge through a
   right-angle elbow. HTML boxes; each grows from the DEVICE side.
   <div class="leader" style="--leader-stub: 28px; --leader-drop: 40px">
     <div class="leader__label">
       <strong class="leader__name">ניהול עובדים</strong>
       <span class="leader__note">כל הצוות, כל התורים</span>
     </div>
     <span class="leader__path" aria-hidden="true"><i class="leader__rule"></i><i class="leader__run"></i><i class="leader__stub"></i><i class="leader__dot"></i></span>
   </div>
   The device stands on the label's inline-END side (features, both layouts) and the
   dot is ABOVE the rule; .leader--below puts it below the rule. */

/* --leader-stub is declared on the root, not on .leader, so a label COLUMN can set it
   once and pad its inline-end by the same value (the dots then land on its edge):
   .x__labels { --leader-stub: 18px; padding-inline-end: var(--leader-stub); } */
:where(:root) { --leader-stub: 24px; }  /* from the elbow to the dot on the device's edge */

.leader {
  --leader-drop: 32px;                /* from the rule up (or down) to the dot */
  --leader-w: 2px;
  --leader-dot: 9px;
  --leader-joint: 5px;
  --leader-delay: 0ms;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.leader__label { display: contents; }

.leader__name {
  grid-row: 1;
  padding-block-end: 6px;
  color: var(--fg);
  font-size: var(--text-small);
  font-weight: var(--w-bold);
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: break-word;          /* a narrow label column at a large text size */
}

.leader__note {
  grid-row: 3;
  padding-block-start: 6px;
  color: var(--fg-3);
  font-size: var(--text-caption);
  line-height: 1.4;
  overflow-wrap: break-word;
}

.leader__path {
  grid-row: 2;
  position: relative;
  block-size: var(--leader-w);
}

.leader__rule,
.leader__run,
.leader__stub,
.leader__dot {
  position: absolute;
  background-color: var(--accent);
}

.leader__rule {
  inset: 0;
  transform-origin: var(--end) 50%;
}

.leader__run {
  inset-inline-end: 0;
  inset-block-end: 0;
  inline-size: var(--leader-w);
  block-size: var(--leader-drop);
  transform-origin: 50% 0;
}

/* a small dot on each joint of the elbow */
.leader__run::before,
.leader__run::after {
  content: "";
  position: absolute;
  inset-inline-start: calc(50% - var(--leader-joint) / 2);
  inline-size: var(--leader-joint);
  block-size: var(--leader-joint);
  border-radius: 50%;
  background-color: inherit;
}
.leader__run::before { inset-block-start: calc(var(--leader-w) / 2 - var(--leader-joint) / 2); }
.leader__run::after { inset-block-end: calc(var(--leader-w) / 2 - var(--leader-joint) / 2); }

.leader__stub {
  inset-inline-start: calc(100% - var(--leader-w));
  inset-block-end: calc(var(--leader-drop) - var(--leader-w));
  inline-size: calc(var(--leader-stub) + var(--leader-w));
  block-size: var(--leader-w);
  transform-origin: var(--end) 50%;
}

.leader__dot {
  inset-inline-start: calc(100% + var(--leader-stub) - var(--leader-dot) / 2);
  inset-block-end: calc(var(--leader-drop) - var(--leader-w) / 2 - var(--leader-dot) / 2);
  inline-size: var(--leader-dot);
  block-size: var(--leader-dot);
  border-radius: 50%;
}

.leader--below .leader__run { inset-block: 0 auto; transform-origin: 50% 100%; }
.leader--below .leader__stub { inset-block: calc(var(--leader-drop) - var(--leader-w)) auto; }
.leader--below .leader__dot { inset-block: calc(var(--leader-drop) - var(--leader-w) / 2 - var(--leader-dot) / 2) auto; }


/* Opt-in draw (a hit, SPEC 7.7). Inside a LIVE stage a .leader--draw waits undrawn;
   .is-drawn (set by the section's render() at the station's threshold) plays the dot,
   the stub, the run, the rule and then the text, once, from the device outward.
   --leader-delay staggers the leaders of a station (80ms apart). Taking .is-drawn
   away returns it to the waiting state at once (no reverse play). Anywhere else
   (static page, cramped stage, reduced motion) a .leader--draw is simply drawn. */
html.stages .scene:not(.is-cramped) .leader--draw:not(.is-drawn) .leader__dot { transform: scale(0); }
html.stages .scene:not(.is-cramped) .leader--draw:not(.is-drawn) .leader__stub,
html.stages .scene:not(.is-cramped) .leader--draw:not(.is-drawn) .leader__rule { transform: scaleX(0); }
html.stages .scene:not(.is-cramped) .leader--draw:not(.is-drawn) .leader__run { transform: scaleY(0); }
html.stages .scene:not(.is-cramped) .leader--draw:not(.is-drawn) .leader__name,
html.stages .scene:not(.is-cramped) .leader--draw:not(.is-drawn) .leader__note { opacity: 0; }

html.motion .leader--draw.is-drawn .leader__dot { transition: transform 220ms var(--ease-pop) var(--leader-delay); }
html.motion .leader--draw.is-drawn .leader__stub { transition: transform 90ms linear calc(var(--leader-delay) + 100ms); }
html.motion .leader--draw.is-drawn .leader__run { transition: transform 110ms linear calc(var(--leader-delay) + 190ms); }
html.motion .leader--draw.is-drawn .leader__rule { transition: transform 300ms var(--ease-out) calc(var(--leader-delay) + 300ms); }
html.motion .leader--draw.is-drawn .leader__name { transition: opacity 240ms var(--ease-out) calc(var(--leader-delay) + 360ms); }
html.motion .leader--draw.is-drawn .leader__note { transition: opacity 240ms var(--ease-out) calc(var(--leader-delay) + 480ms); }

/* --- .dim-line ----------------------------------------------------------------
   A measuring line: 1.5px shaft, T-caps, solid arrowheads pointing outward, and
   a small chip that interrupts it. Horizontal by default; .dim-line--v is vertical
   and its chip always reads bottom to top. HTML boxes, drawn from one end: the
   left end (horizontal) or the top (vertical), in BOTH languages: a dimension line
   never mirrors. Only its place (which side of the device) follows the page.
   <div class="dim-line dim-line--v" aria-hidden="true">
     <i class="dim-line__line"></i><i class="dim-line__lead"></i>
     <span class="dim-line__chip"><bdi dir="ltr">24/7</bdi></span>
   </div>
   Draw it with two actors over the same slice: .dim-line__line gets
   --act: dim-shaft-x | dim-shaft-y, .dim-line__lead gets --act: dim-lead-x | dim-lead-y. */

.dim-line {
  --dim-color: var(--accent);
  --dim-chip-bg: var(--surface);
  --dim-chip-fg: var(--accent-ink);
  --dim-w: 1.5px;
  --dim-cap: 11px;
  --dim-head: 7px;
  /* Dimension lines never mirror (SPEC 5.1): the same drawing, drawn from the same
     end, in both languages. The line is laid out left to right and its own --dir /
     --start / --end say so, for the kit's keyframes and for a section's actors. */
  --dir: -1;
  --start: left;
  --end: right;
  direction: ltr;
  position: relative;
  display: grid;
  place-items: center;
  inline-size: 100%;
  min-block-size: 24px;
  color: var(--dim-color);
}

/* white linework (the blueprint's 640 and 745) */
.dim-line--ink {
  --dim-color: var(--linework);
  --dim-chip-bg: var(--bg);
  --dim-chip-fg: var(--fg);
}

.dim-line__line {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(50% - var(--dim-w) / 2);
  block-size: var(--dim-w);
  background-color: currentColor;
  transform-origin: var(--start) 50%;
}

.dim-line__lead {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* T-caps: the start one is fixed, the end one rides the lead */
.dim-line::before,
.dim-line__lead::before {
  content: "";
  position: absolute;
  inset-block-start: calc(50% - var(--dim-cap) / 2);
  inline-size: var(--dim-w);
  block-size: var(--dim-cap);
  background-color: currentColor;
}
.dim-line::before { inset-inline-start: 0; }
.dim-line__lead::before { inset-inline-end: 0; }

/* arrowheads: drawn pointing left, mirrored so each points outward */
.dim-line::after,
.dim-line__lead::after {
  content: "";
  position: absolute;
  inset-block-start: calc(50% - var(--dim-head) / 2);
  inline-size: calc(var(--dim-head) * 1.25);
  block-size: var(--dim-head);
  background-color: currentColor;
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
.dim-line::after { inset-inline-start: var(--dim-w); transform: scaleX(calc(var(--dir) * -1)); }
.dim-line__lead::after { inset-inline-end: var(--dim-w); transform: scaleX(var(--dir)); }

.dim-line__chip {
  position: relative;
  padding: 3px 8px;
  background-color: var(--dim-chip-bg);
  color: var(--dim-chip-fg);
  font-size: .875rem;
  font-weight: var(--w-bold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.dim-line--v {
  inline-size: 24px;
  block-size: 100%;
  min-block-size: 0;
}
.dim-line--v .dim-line__line {
  inset-inline: calc(50% - var(--dim-w) / 2) auto;
  inset-block: 0;
  inline-size: var(--dim-w);
  block-size: auto;
  transform-origin: 50% 0;
}
.dim-line--v::before,
.dim-line--v .dim-line__lead::before {
  inset-inline: calc(50% - var(--dim-cap) / 2) auto;
  inline-size: var(--dim-cap);
  block-size: var(--dim-w);
}
.dim-line--v::before { inset-block: 0 auto; }
.dim-line--v .dim-line__lead::before { inset-block: auto 0; }
.dim-line--v::after,
.dim-line--v .dim-line__lead::after {
  inset-inline: calc(50% - var(--dim-head) / 2) auto;
  inline-size: var(--dim-head);
  block-size: calc(var(--dim-head) * 1.25);
  transform: none;
}
.dim-line--v::after { inset-block: var(--dim-w) auto; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.dim-line--v .dim-line__lead::after { inset-block: auto var(--dim-w); clip-path: polygon(0 0, 100% 0, 50% 100%); }

/* reads bottom to top in both directions */
.dim-line--v .dim-line__chip {
  padding: 8px 3px;
  writing-mode: vertical-rl;
  rotate: 180deg;
}

@keyframes dim-shaft-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dim-lead-x { from { transform: translateX(calc(var(--dir) * 100%)); } to { transform: translateX(0); } }
@keyframes dim-shaft-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dim-lead-y { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* --- .chip: the small neutral pill ("המחשה", "מסך אמיתי") --------------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 28px;
  margin: 0;
  padding: 3px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background-color: var(--surface-2);
  color: var(--fg-2);
  font-size: var(--text-caption);
  font-weight: var(--w-medium);
  line-height: 1.3;
}

/* a real screen or recording: a small green light before the text */
.chip--live::before {
  content: "";
  flex: none;
  inline-size: 7px;
  block-size: 7px;
  border-radius: 50%;
  background-color: var(--success);
}

/* --- Icons: one set, 24px grid, 2px stroke, round caps and joins, no fills ---- */

.icon {
  flex: none;
  inline-size: 24px;
  block-size: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--20 { inline-size: 20px; block-size: 20px; }
.icon--32 { inline-size: 32px; block-size: 32px; }
.icon__accent { stroke: var(--accent); }        /* the one accent detail */
.icon--flip { transform: scaleX(var(--dir)); }  /* an icon drawn pointing left that must follow the reading direction */

/* ==========================================================================
   8  Containers
   ========================================================================== */

.card {
  position: relative;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-color: var(--surface);
  color: var(--fg-2);
  box-shadow: var(--shadow-card);
}

/* media inside a card: the card radius minus the card padding, at least 8px */
.card__media {
  inline-size: 100%;
  border-radius: var(--radius-media);
}

/* one column below 900px; a 12-column grid from 900px. A tile sets --col (and --row). */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--grid-gap);
}
.bento > * {
  --col: 4;
  --row: 1;
  min-inline-size: 0;
}
@media (min-width: 900px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .bento > * { grid-column: span var(--col); grid-row: span var(--row); }
}

/* a 32px tile on --surface-2 holding a 20px icon; --lg 48px / 24px; --xl 64px / 32px */
.icon-tile {
  --tile: 32px;
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: var(--tile);
  block-size: var(--tile);
  border-radius: calc(var(--tile) * .25);
  background-color: var(--surface-2);
  color: var(--fg);
}
.icon-tile > .icon { inline-size: 20px; block-size: 20px; }
.icon-tile--lg { --tile: 48px; }
.icon-tile--lg > .icon { inline-size: 24px; block-size: 24px; }
.icon-tile--xl { --tile: 64px; }
.icon-tile--xl > .icon { inline-size: 32px; block-size: 32px; }

/* --- .island: THE night island -------------------------------------------------
   <div class="island" data-world="night"> … </div>
   One definition for the overnight card, the plan card and the voices stage. */

.island {
  position: relative;
  padding: var(--card-pad);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-color: var(--surface);
  background-image: var(--island-art);
  background-repeat: no-repeat;
  color: var(--fg-2);
}

/* a card that sits ON an island is raised (--surface-2): on --surface, the island's own
   fill, it would show as a hairline only (the overnight card's events, the voices frames) */
.island .card { background-color: var(--surface-2); }

/* ==========================================================================
   9  Frame, stepper, media toggle, dialog
   ========================================================================== */

/* --- .frame-browser: navy chrome around a REAL screenshot ---------------------
   <figure class="frame-browser">
     <div class="frame-browser__bar" aria-hidden="true">
       <span class="frame-browser__dots"><i></i><i></i><i></i></span>
       <span class="frame-browser__tab"><img src="assets/img/logo.png" alt="" width="14" height="14">easytor</span>
     </div>
     <div class="frame-browser__view"><img class="frame-browser__shot" src="…" alt="…" width="1797" height="930"></div>
   </figure> */

.frame-browser {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--navy);
  box-shadow: var(--shadow-device), 0 0 0 1px var(--line);
}

.frame-browser__bar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-16);
  min-block-size: 36px;
  padding-inline: 14px;
  direction: ltr;                      /* window chrome never mirrors */
}

.frame-browser__dots {
  display: flex;
  align-self: center;
  gap: 6px;
}
.frame-browser__dots i {
  inline-size: 9px;
  block-size: 9px;
  border-radius: 50%;
  background-color: var(--device-rim);
  box-shadow: inset 0 0 0 1px var(--device-rim);
}

.frame-browser__tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-block-size: 28px;
  padding-inline: 12px 22px;
  border-start-start-radius: 8px;
  border-start-end-radius: 8px;
  background-color: var(--navy-2);
  color: var(--white);
  font-size: var(--text-caption);
  font-weight: var(--w-medium);
  line-height: 1;
}
.frame-browser__tab img { inline-size: 14px; block-size: 14px; }

.frame-browser__view {
  position: relative;
  overflow: hidden;
  background-color: var(--white);
}
.frame-browser__shot { inline-size: 100%; block-size: auto; }

/* --- .stepper: one button per chapter / station of a stage --------------------
   <div class="stepper" role="group" aria-label="…">
     <button class="stepper__btn" type="button" aria-current="step" aria-label="פרק 1 מתוך 4: …"></button>
     <button class="stepper__btn" type="button" aria-label="…"></button>
   </div>
   The hit area is 44px; the drawn mark is a 32 x 4px bar. .stepper--col stacks it. */

.stepper {
  display: inline-flex;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stepper--col { flex-direction: column; }

.stepper__btn {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-bar);
  background: none;
  color: var(--line-2);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.stepper__btn::before {
  content: "";
  inline-size: 32px;
  block-size: 4px;
  border-radius: 2px;
  background-color: currentColor;
}
.stepper--col .stepper__btn::before { inline-size: 4px; block-size: 32px; }

.stepper__btn[aria-current="step"] { color: var(--fg); }
.stepper__btn[aria-current="step"]::before { transform: scaleY(1.5); }
.stepper--col .stepper__btn[aria-current="step"]::before { transform: scaleX(1.5); }
@media (hover: hover) {
  .stepper__btn:hover { color: var(--fg); }
}
.stepper__btn:focus-visible,
.stepper__btn.is-focus { outline-offset: -5px; }
html.motion .stepper__btn::before { transition: transform var(--dur-1) var(--ease-out); }

/* --- .media-toggle: pause / play for anything that moves by itself for > 5 s ---
   <button class="media-toggle" type="button" aria-label="השהיה">
     <svg class="media-toggle__pause" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 5.5v13M16 5.5v13"/></svg>
     <svg class="media-toggle__play" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6.2v11.6L18.5 12z"/></svg>
   </button>
   Paused = the attribute data-paused (or .is-paused). The label swaps; no aria-pressed. */

.media-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background-color: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.media-toggle svg { grid-area: 1 / 1; inline-size: 20px; block-size: 20px; }
.media-toggle__pause { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.media-toggle__play { fill: currentColor; display: none; }
.media-toggle[data-paused] .media-toggle__play,
.media-toggle.is-paused .media-toggle__play { display: block; }
.media-toggle[data-paused] .media-toggle__pause,
.media-toggle.is-paused .media-toggle__pause { display: none; }
.media-toggle:active { transform: scale(.94); }
html.motion .media-toggle { transition: transform var(--dur-1) var(--ease-out); }

/* --- .dialog: native <dialog> --------------------------------------------------
   <dialog class="dialog" data-world="night" aria-labelledby="x-title">
     <div class="dialog__head">
       <h2 class="dialog__title" id="x-title">…</h2>
       <button class="dialog__close" type="button" aria-label="סגירה"><svg class="icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
     </div>
     <div class="dialog__body"> … </div>
   </dialog> */

.dialog {
  --dialog-w: 30rem;                 /* a dialog sets its own width (the video dialog: wider) */
  inline-size: min(100% - 2 * var(--gutter), var(--dialog-w));
  max-inline-size: none;
  max-block-size: calc(100vh - 2 * var(--space-24));
  max-block-size: calc(100dvh - 2 * var(--space-24));
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-color: var(--surface);
  color: var(--fg-2);
  box-shadow: var(--shadow-float);
}
.dialog::backdrop { background-color: var(--scrim); }

.dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding-block: var(--space-12);
  padding-inline: var(--card-pad) var(--space-12);
}

.dialog__title {
  font-size: var(--text-h4);
  font-weight: var(--w-bold);
  line-height: 1.25;
  color: var(--fg);
}

.dialog__close {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: 44px;
  block-size: 44px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: none;
  color: var(--fg);
  cursor: pointer;
}

.dialog__body {
  display: grid;
  gap: var(--space-16);
  padding: 0 var(--card-pad) var(--card-pad);
}

/* ==========================================================================
   10  3D rigs and the phone
   --------------------------------------------------------------------------
   A RIG is the element that carries a 3D pose. Rules (SPEC 4, "3D rigs"):
     · perspective lives on the rig's DIRECT parent: .u-persp (one perspective for the page);
     · the rig is preserve-3d: .u-rig, or the phone itself;
     · neither the rig nor anything between it and its planes has opacity < 1,
       overflow, clip-path, mask, filter, contain: paint or radius clipping.
       Those go on leaf planes, or on a wrapper OUTSIDE .u-persp;
     · a second animation on a rig is a second, nested .u-rig
       (hero: .u-persp > .u-rig turn > .u-rig shake > phone, badge, sticker);
     · planes that must follow a pose are children of the rig that carries it.
   ========================================================================== */

.u-persp {
  perspective: var(--perspective);
  perspective-origin: var(--perspective-origin);
}

.u-rig {
  position: relative;
  display: grid;
  inline-size: fit-content;            /* sized to its content, never inset: 0 */
  transform-style: preserve-3d;
}

/* --- .u-phone3d: the ONE device, everywhere -----------------------------------
   One custom property sizes it: --phone-w, the BODY width. Everything else is a
   fraction of it (SPEC 4 + brief/media.json):
     bezel 3.2% of the body · body corner 14.9% of the body · screen 520 / 1108,
     clipped with 12.5% of the SCREEN width (concentric with the body corner) ·
     camera pill over every screen: centre 50% / 3.37%, 32.5% x 3.9% of the screen ·
     a 1px hairline on the body edge · ten thickness slices (five below 900px) ·
     a front face (screen layers), a back face (the logo), a glare layer.
   The phone IS a rig (preserve-3d): its direct parent carries the perspective
   (.u-persp), and nothing between them clips, fades or filters.

   <div class="u-persp">
     <div class="u-phone3d" style="--phone-w: 300px" aria-hidden="true">
       <i class="u-phone3d__slice" style="--i:0"></i> … ten, --i 0..9; 1, 3, 5, 7, 8 also .u-phone3d__slice--minor
       <div class="u-phone3d__back"><img class="u-phone3d__logo" src="assets/img/logo-light.png" alt="" width="512" height="512"></div>
       <div class="u-phone3d__front">
         <div class="u-phone3d__screen">
           <div class="u-phone3d__layer"><img src="assets/media/tour/booking.jpg" alt="" width="520" height="1108"></div>
           <i class="u-phone3d__glare"></i>
         </div>
       </div>
     </div>
   </div>
   Media-backed screens stay at 320 CSS px or less: --phone-w <= var(--phone-w-media-max). */

.u-phone3d {
  --phone-w: 300px;
  --phone-bezel: calc(var(--phone-w) * .032);
  --phone-radius: calc(var(--phone-w) * .149);
  --phone-screen-w: calc(var(--phone-w) - 2 * var(--phone-bezel));      /* 93.6% of the body */
  --phone-screen-h: calc(var(--phone-screen-w) * 1108 / 520);
  --phone-screen-radius: calc(var(--phone-screen-w) * .125);
  --phone-h: calc(var(--phone-screen-h) + 2 * var(--phone-bezel));
  --phone-depth: clamp(10px, calc(var(--phone-w) * .068), 22px);
  --phone-u: calc(var(--phone-screen-w) / 100);   /* 1% of the screen width: the unit of an HTML screen */
  --phone-glare: 0;                               /* 0 at rest; at most .12, and only while it turns */
  --phone-n: 10;                                  /* slices in the markup */
  position: relative;
  flex: none;
  inline-size: var(--phone-w);
  block-size: var(--phone-h);
  transform-style: preserve-3d;
}

/* the device shadow: a leaf plane just behind the body, in the phone's own world
   (day: a navy drop shadow; night: the royal-blue light, never a dark shadow) */
.u-phone3d::before {
  content: "";
  position: absolute;
  inset: 3% 4%;
  border-radius: var(--phone-radius);
  box-shadow: var(--shadow-device);
  transform: translateZ(calc(var(--phone-depth) / -2 - 1px));
  pointer-events: none;
}

/* Thickness: flat rounded planes stacked through the depth. --s is 0 at the two
   faces and 1 in the middle of the edge, so the middle slices are the widest
   (a rounded edge) and the lightest (where the frame catches the light). */
.u-phone3d__slice {
  --t: calc(var(--i) / (var(--phone-n) - 1));
  --s: sin(var(--t) * 180deg);
  position: absolute;
  inset: 0;
  inset: calc((1 - var(--s)) * 1.5px);
  border-radius: var(--phone-radius);
  background-color: var(--device-edge);
  background-image: linear-gradient(180deg,
    color-mix(in srgb, var(--device-edge-hi) calc(var(--s) * 100%), var(--device-edge)) 0%,
    color-mix(in srgb, var(--device-edge-hi) calc(var(--s) * 55%), var(--device-edge)) 22%,
    color-mix(in srgb, var(--device-edge-hi) calc(var(--s) * 30%), var(--device-edge)) 100%);
  transform: translateZ(calc((var(--t) - .5) * (var(--phone-depth) - 2px)));
}

.u-phone3d__front,
.u-phone3d__back {
  position: absolute;
  inset: 0;
  border-radius: var(--phone-radius);
  background-color: var(--device-body);
  box-shadow: inset 0 0 0 1px var(--device-rim);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.u-phone3d__front {
  transform: translateZ(calc(var(--phone-depth) / 2));
}

/* the back: dark glass with a soft sheen, the light logo */
.u-phone3d__back {
  display: grid;
  place-items: center;
  background-image: linear-gradient(155deg, var(--device-body-hi) 0%, var(--device-body) 38%, var(--device-body) 72%, var(--device-body-hi) 100%);
  transform: translateZ(calc(var(--phone-depth) / -2)) rotateY(180deg);
}

.u-phone3d__logo {
  inline-size: 30%;
  block-size: auto;
}

/* the lit screen: a leaf plane, so it may clip */
.u-phone3d__screen {
  position: absolute;
  inset: var(--phone-bezel);
  overflow: hidden;
  border-radius: var(--phone-screen-radius);
  /* Safari drops the radius clip on <video> inside a 3D context; clip-path keeps it */
  clip-path: inset(0 round var(--phone-screen-radius));
  background-color: var(--device-screen);
}

/* the camera cut-out over every screen, 1px larger than the one inside the crops:
   centre x 50%, centre y 3.37% of the screen height, 32.5% of its width, 3.9% of its height */
.u-phone3d__screen::after {
  content: "";
  position: absolute;
  z-index: 4;
  inset-block-start: 1.42%;                       /* 3.37% - 3.9% / 2 */
  inset-inline-start: 33.75%;                     /* 50% - 32.5% / 2  */
  inline-size: 32.5%;
  block-size: 3.9%;
  border-radius: var(--radius-full);
  background-color: var(--device-screen);
  pointer-events: none;
}

/* Screen layers stack in DOM order (the last is on top) and cross-fade by OPACITY on
   the layer. A layer holds an <img>, a <video> over its poster <img>, or HTML. */
.u-phone3d__layer {
  position: absolute;
  inset: 0;
}

.u-phone3d__layer > img,
.u-phone3d__layer > video,
img.u-phone3d__layer,
video.u-phone3d__layer {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  max-inline-size: none;
  object-fit: cover;
}

/* an HTML screen paints its theme's canvas (.theme-chat, .theme-app) */
.u-phone3d__layer.theme-chat,
.u-phone3d__layer.theme-app {
  background-color: var(--bg);
  color: var(--fg-2);
}

/* the glass: a reflection over everything on the screen, the camera pill included.
   Sections fade it in only while the phone turns (--phone-glare on the phone, or an
   opacity actor on this element), at most .12. */
.u-phone3d__glare {
  position: absolute;
  inset: -25%;
  z-index: 5;
  background-image: linear-gradient(115deg, transparent 36%, var(--device-glare) 50%, transparent 64%);
  opacity: var(--phone-glare);
  pointer-events: none;
}

/* A plane that follows the pose (exploded UI, a callout in depth): a CHILD of the
   phone (the rig) laid over the screen rectangle and lifted off the glass by
   --plane-z. The lift is the `translate` property, so an actor may animate
   `transform` on top of it (e-depth-in with a positive --depth lifts it and settles
   it on the glass). A leaf plane: it may fade, clip and round its corners. */
.u-phone3d__plane {
  --plane-z: 0px;
  position: absolute;
  inset: var(--phone-bezel);
  border-radius: var(--phone-screen-radius);
  translate: 0 0 calc(var(--phone-depth) / 2 + 1px + var(--plane-z));
  pointer-events: none;
}

@media (max-width: 899.98px) {
  .u-phone3d { --phone-depth: clamp(8px, calc(var(--phone-w) * .068), 16px); }
  .u-phone3d__slice--minor { display: none; }
}

/* --- Poses: a plain transform list, so a keyframe can go from one to another
   (motion.css e-turn: --turn-from: var(--pose-a); --turn-to: var(--pose-front)).
   These classes set a pose AT REST on any rig, the phone included. Written by
   intent: .u-pose-a turns the screen toward the inline-start (where the copy is
   when the device stands on the inline-end side); .u-pose-b is the mirror. */
.u-pose-front { transform: var(--pose-front); }
.u-pose-a { transform: var(--pose-a); }
.u-pose-b { transform: var(--pose-b); }

/* ==========================================================================
   11  The chat screen (.chat inside .theme-chat)
   The film's first scene as HTML, shared by the hero phone and the contact
   phone. A prop: its subtree is aria-hidden and holds nothing focusable.
   Every size is in --phone-u (1% of the screen width), so it scales with the phone.

   <div class="u-phone3d__layer theme-chat chat">
     <div class="chat__status" dir="ltr"><span>9:41</span></div>
     <div class="chat__head">
       <span class="chat__avatar"></span>
       <div class="chat__who"><strong class="chat__title">…</strong><span class="chat__sub">…</span></div>
     </div>
     <div class="chat__list">
       <div class="chat__msg" style="--sender: var(--chat-sender-1)"><span class="chat__sender">…</span><span class="chat__text">…</span></div>
       <div class="chat__msg chat__msg--out"><span class="chat__text">…</span></div>
     </div>
     <div class="chat__input">…</div>
   </div>
   ========================================================================== */

.chat {
  display: flex;
  flex-direction: column;
  font-size: calc(var(--phone-u) * 5.4);
  line-height: 1.3;
}

.chat__status {
  display: flex;
  align-items: center;
  flex: none;
  block-size: calc(var(--phone-u) * 13.5);
  padding-inline: calc(var(--phone-u) * 9.5);
  background-color: var(--surface-2);
  color: var(--fg);
  font-size: calc(var(--phone-u) * 4.2);
  font-weight: var(--w-bold);
  font-variant-numeric: tabular-nums;
}

.chat__head {
  display: flex;
  align-items: center;
  flex: none;
  gap: calc(var(--phone-u) * 3.4);
  padding: calc(var(--phone-u) * 1.2) calc(var(--phone-u) * 6) calc(var(--phone-u) * 4.6);
  background-color: var(--surface-2);
}

.chat__avatar {
  display: grid;
  place-items: center;
  flex: none;
  inline-size: calc(var(--phone-u) * 14);
  block-size: calc(var(--phone-u) * 14);
  border-radius: 50%;
  background-color: var(--line);
  font-size: calc(var(--phone-u) * 7);
  line-height: 1;
}

.chat__who {
  display: grid;
  gap: calc(var(--phone-u) * .6);
  min-inline-size: 0;
}
.chat__title {
  color: var(--fg);
  font-size: calc(var(--phone-u) * 5.2);
  font-weight: var(--w-bold);
  line-height: 1.2;
}
.chat__sub {
  color: var(--fg-3);
  font-size: calc(var(--phone-u) * 3.3);
  line-height: 1.2;
}

.chat__list {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: calc(var(--phone-u) * 3.6);
  min-block-size: 0;
  overflow: hidden;
  padding: calc(var(--phone-u) * 4) calc(var(--phone-u) * 4.2);
}

.chat__msg {
  --sender: var(--chat-sender-1);
  display: grid;
  gap: calc(var(--phone-u) * .8);
  flex: none;
  max-inline-size: 84%;
  padding: calc(var(--phone-u) * 3) calc(var(--phone-u) * 4.6) calc(var(--phone-u) * 3.4);
  border-radius: calc(var(--phone-u) * 3.4);
  background-color: var(--surface);
  color: var(--fg);
}
.chat__sender {
  color: var(--sender);
  font-size: calc(var(--phone-u) * 3.7);
  font-weight: var(--w-bold);
  line-height: 1.2;
}
.chat__text { overflow-wrap: anywhere; white-space: pre-line; }

/* the visitor's own message (contact): at the inline-end, no sender line */
.chat__msg--out {
  align-self: flex-end;
  background-color: var(--surface-2);
  border-end-end-radius: calc(var(--phone-u) * 1);
}

.chat__input {
  display: flex;
  align-items: center;
  flex: none;
  min-block-size: calc(var(--phone-u) * 14.5);
  margin: 0 calc(var(--phone-u) * 4) calc(var(--phone-u) * 6);
  padding-inline: calc(var(--phone-u) * 7);
  border-radius: var(--radius-full);
  background-color: var(--chat-input);
  color: var(--fg-3);
  font-size: calc(var(--phone-u) * 3.8);
}

/* ==========================================================================
   12  Utilities
   ========================================================================== */

.visually-hidden {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* a section far from the viewport, parked by the runtime (main.js 7b): the browser skips its contents;
   its block size is kept inline (contain-intrinsic-block-size), so nothing below it moves */
main > section.is-parked { content-visibility: auto; }

/* the first element of <body>; appears on focus */
.skip-link {
  position: fixed;
  inset-block-start: var(--space-8);
  inset-inline-start: var(--space-8);
  z-index: var(--z-skip);
  display: inline-flex;
  align-items: center;
  min-block-size: 44px;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-bar);
  background-color: var(--navy);
  color: var(--white);
  font-weight: var(--w-medium);
  text-decoration: none;
  transform: translateY(calc(-100% - var(--space-16)));
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline: 2px solid var(--navy);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--white);
}

/* a section's own CTA that repeats the dock's label: not rendered where the dock exists
   (scripting on, below 1024px, and not html.short: a probe taller than 480px. A class, not a height query,
   so a keyboard that shrinks the viewport does not bring the duplicate back under the visitor's field) */
@media (max-width: 1023.98px) {
  html.js:not(.short) .cta-dup { display: none; }
}

/* ==========================================================================
   13  Forced colours
   Every filled control gets a 2px solid ButtonText border, selected states a
   Highlight border; lines that are painted as backgrounds stay visible.
   ========================================================================== */

@media (forced-colors: active) {
  .btn--bar,
  .btn--ghost,
  .btn__disc,
  .label-bar,
  .sticker,
  .count-badge,
  .timer-pill,
  .chip,
  .card,
  .island,
  .icon-tile,
  .frame-browser,
  .media-toggle,
  .dialog,
  .dialog__close,
  .skip-link {
    border: 2px solid ButtonText;
  }

  .btn--bar { box-shadow: none; }
  .btn--bar.btn--sm { border: 2px solid ButtonText; }
  .label-bar__cap { border-inline-start: 2px solid ButtonText; }
  .btn__cap { border: 2px solid ButtonText; box-shadow: none; }
  .btn--bar::before { content: none; }

  .timer-pill.is-done,
  .stepper__btn[aria-current="step"] { border: 2px solid Highlight; }

  .stepper__btn::before,
  .leader__rule,
  .leader__run,
  .leader__stub,
  .leader__dot,
  .leader__run::before,
  .leader__run::after,
  .dim-line__line,
  .dim-line::before,
  .dim-line::after,
  .dim-line__lead::before,
  .dim-line__lead::after,
  .eyebrow::before,
  .chip--live::before,
  .timer-pill__hand {
    forced-color-adjust: none;
    background-color: CanvasText;
  }
  .stepper__btn[aria-current="step"]::before { background-color: Highlight; }

  .dim-line__chip { border: 1px solid CanvasText; }
  .sticker--callout::after { display: none; }
  .u-phone3d__front,
  .u-phone3d__back { border: 2px solid CanvasText; }
  /* the camera cut-out is part of the picture: it stays black over the screenshot
     (forced to Canvas it showed as a white pill over the crop's own black one) */
  .u-phone3d__screen::after { forced-color-adjust: none; background-color: var(--device-screen); }
}

/* easytor-v2 · foundation/motion.css — the BEHAVIOUR half of the foundation (join.mjs appends it to base.css).
   ==========================================================================
   Owner: runtime. Everything here is state and motion; it paints no colour.
   Tokens (--dur-*, --ease-*, --stage-*, --dir, --start …) are read WITHOUT a
   fallback, as everywhere else (tokens.css always loads first, the fixtures
   included). A var(--x, default) in this file is a PARAMETER of a verb with its
   default (--tip, --depth, --hit-delay …), never a token.
   The cheat sheet for section builders is tools/build/RUNTIME.md.

     1. registered properties (the actor and scene contract)
     2. first paint: html.i18n-pending, anchors into stages
     3. scenes: the actor rule, the sticky-stage anatomy, fit-or-go-static
     4. entrances: [data-reveal], the word masks (.w, .w__i, .w-keep, .w-free)
     5. hits: [data-hit] + .is-hit, the prism roll [data-roll]
     6. media: a lazy video stays transparent over its poster until it has a frame
     7. the keyframe vocabulary (e-…): entrance and hit verbs, the four 3D verbs, stroke, spin
     8. failsafes: reduced motion, forced colours, print

   Head classes (set before first paint by the inline script, kept by main.js):
     html.motion  scripting on, motion allowed, the browser has what the constructions need
     html.stages  motion AND the small viewport is at least 540px tall (and no forced colours):
                  sticky stages are live
     html.rt      main.js finished its init (the 4 s watchdog removes motion/stages without it)
   Without html.motion nothing in this file hides, moves or resizes anything:
   that is the no-JS page, the reduced-motion page and the old-browser page.
   ========================================================================== */

/* --- 1. Registered properties ------------------------------------------------
   Registered = typed and NOT inherited. calc() in a slice computes to a number
   (--from: calc(.62 + var(--i) * .01)); a wrapper never hands its slice, its
   keyframes or its liveness to what is nested inside it. */
@property --from { syntax: '<number>'; inherits: false; initial-value: 0; }
@property --to { syntax: '<number>'; inherits: false; initial-value: 1; }
@property --act { syntax: '<custom-ident>'; inherits: false; initial-value: none; }
@property --scene-live { syntax: '<integer>'; inherits: false; initial-value: 0; }
@property --scene-range { syntax: '<custom-ident>'; inherits: false; initial-value: none; }

/* --- 2. First paint ------------------------------------------------------------ */

/* An English visitor: the head script set lang/dir and this class before the
   first paint; main.js swaps the strings and removes it. The animation is the
   failsafe: after 1.5 s the page shows whatever it has. */
html.i18n-pending body {
  visibility: hidden;
  animation: e-unhide 0s linear 1.5s forwards;
}
@keyframes e-unhide { to { visibility: visible; } }

/* .section--stage (an anchor lands at p = 0 with the stage filling the viewport)
   lives in base.css alone: the negative scroll margin and the dropped top padding
   apply only while the stage is live, so a static or cramped stage takes anchors
   like any section. (This file used to reset the margin a second time.) */

/* --- 3. Scenes ------------------------------------------------------------------ */

/* THE ACTOR RULE. An actor ([data-act]) plays the keyframes named by --act over
   the slice --from..--to of its scene's progress. The slice is written into the
   animation's own timing (delay = --from, duration = --to - --from, in seconds
   of a 1 s scene) and main.js sets the scene's progress as currentTime
   (p * 1000 ms) on every actor of the scene: before its slice an actor holds its
   0% keyframe, after it its 100% keyframe. Keyed on html.motion, which exists
   before the first paint, so an actor rests on its 0% keyframe (the p = 0
   state) from the first frame, long before main.js arrives.
   Set --act, --from and --to in the SAME rule block that sets --scene-live: 1. */
html.motion [data-act] {
  animation-name: var(--act);
  animation-duration: calc(max(var(--to) - var(--from), 0) * 1s);
  animation-delay: calc(var(--from) * 1s);
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: both;
  animation-play-state: paused;
}

/* The sticky-stage anatomy, live under html.stages:
     .scene          the track (its block size is the scroll travel)
     .scene__stage   sticks for the whole track, one LARGE viewport tall, paints the backgrounds
     .scene__safe    one SMALL viewport tall, padded clear of the nav and the dock:
                     everything a visitor must see lives in here
   A phone's toolbar slides in and out while the visitor scrolls; lvh for the
   painted box and svh for the content box means no strip of track ever shows
   under the stage and the composition never moves.
   No --scene-len = the track is as tall as its content (the declaration is
   invalid at computed-value time and block-size falls back to auto). */
html.stages .scene:where(:not(.is-cramped)) {
  position: relative;
  block-size: calc(var(--scene-len) + 100lvh - 100svh);
}
html.stages .scene:where(:not(.is-cramped)) > .scene__stage {
  position: sticky;
  inset-block-start: 0;
  block-size: 100lvh;
  overflow: hidden;
  overflow: clip;
}
html.stages .scene:where(:not(.is-cramped)) > .scene__stage > .scene__safe {
  position: relative;
  box-sizing: border-box;
  block-size: 100svh;
  padding-block: var(--stage-top) var(--stage-bottom);
}
/* Optional helper: a beat stacked over the others, filling the safe box's
   content area (absolute boxes ignore their parent's padding, so the layer
   repeats the safe insets). */
html.stages .scene:where(:not(.is-cramped)) > .scene__stage > .scene__safe > .scene__layer {
  position: absolute;
  inset-inline: 0;
  inset-block: var(--stage-top) var(--stage-bottom);
}

/* Fit or go static. A sticky stage (.scene) is never live without
   html.stages; main.js latches .is-cramped on a .scene whose safe box cannot
   hold its content. Section CSS writes its live layout under
   `html.stages .x.scene:not(.is-cramped)` so both switch together. */
html:not(.stages) .scene,
.scene.is-cramped {
  --scene-live: 0 !important;
}
.scene.is-cramped [data-act] {
  animation: none !important;
}

/* main.js sets this for one style flush on a language change, so every engine
   builds its actor animations again with the new --dir (on <html>; on a parked
   section when it comes back after a language change). */
.rt-rebuild [data-act] {
  animation-name: none !important;
}

/* --- 4. Entrances ------------------------------------------------------------- */

/* Pending state only under html.motion. No will-change on anything pending.
   The entrance is a `backwards` animation of the INDIVIDUAL transform
   properties (translate / scale), so it composes with whatever `transform` the
   element already has and leaves nothing behind when it ends.
   --reveal-delay staggers (set it per element or per :nth-child). */
html.motion [data-reveal]:not(.is-revealed) {
  opacity: 0;
}
html.motion [data-reveal].is-revealed {
  animation: e-rise var(--dur-3) var(--ease-out) var(--reveal-delay, 0ms) backwards;
}
html.motion [data-reveal="pop"].is-revealed {
  animation-name: e-pop;
  animation-duration: 450ms;
  animation-timing-function: cubic-bezier(.2, .7, .3, 1);
}
html.motion [data-reveal="stamp"].is-revealed {
  animation-name: e-stamp;
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(.2, .7, .3, 1);
}
/* draw: a line growing from its origin. Horizontal from the reading start by
   default; a vertical line sets --draw-x: 1; --draw-y: 0; --draw-origin: 50% 0. */
html.motion [data-reveal="draw"] {
  transform-origin: var(--draw-origin, var(--start) 50%);
}
html.motion [data-reveal="draw"].is-revealed {
  animation-name: e-draw;
  animation-timing-function: var(--ease-in-out);
}

/* Word masks. The splitter in main.js builds <span class="w"><span class="w__i">
   per word (a section may also write them by hand: the hero h1). The mask
   clips on the block axis only and is padded for ascenders and descenders with
   matching negative margins, so it never has a fixed height and the line box
   does not change. (overflow-y is the block axis here; Chromium and WebKit
   have no overflow-block.) */
html.motion .w {
  display: inline-block;
  overflow-y: clip;
  padding-block: .12em .14em;
  margin-block: -.12em -.14em;
}
html.motion .w__i {
  display: inline-block;
}
/* A no-break space does not glue two inline-block masks in Chromium: the
   splitter wraps the glued words in .w-keep, and whatever else sits inside
   that wrapper in .w-free, so only the glued pair is kept together. */
.w-keep {
  white-space: nowrap;
}
.w-free {
  white-space: normal;
}

/* data-reveal="words". Until main.js has split the heading (.is-split) it
   waits whole, like any reveal; once split, the heading is opaque and its
   words wait under their masks, then rise 90ms apart (the accent word is last
   in the markup, so it rises last). */
html.motion [data-reveal="words"].is-split:not(.is-revealed) {
  opacity: 1;
}
html.motion [data-reveal="words"].is-split:not(.is-revealed) .w__i {
  translate: 0 110%;
}
html.motion [data-reveal="words"].is-split.is-revealed {
  animation: none;
}
html.motion [data-reveal="words"].is-split.is-revealed .w__i {
  animation: e-word var(--dur-3) var(--ease-out) calc(var(--reveal-delay, 0ms) + var(--w-i, 0) * 90ms) backwards;
}

/* reveal(el), focus and location.hash reveal at once, without an entrance. */
html.motion [data-reveal].is-instant,
html.motion [data-reveal].is-instant .w__i {
  animation: none;
}
/* the words rule above weighs (0,5,1); this one must outrank it (W5: headings revealed by focus or
   the hash still played their word rise) */
html.motion [data-reveal="words"].is-split.is-instant .w__i,
html.motion [data-reveal="words"].is-split.is-revealed.is-instant .w__i {
  animation: none;
}

/* --- 5. Hits -------------------------------------------------------------------- */

/* [data-hit="pop|stamp|land|rise|fade|flash"]: under html.motion the element
   waits in its pre-state (invisible) and plays ONCE when it gets .is-hit (from a
   scene's render(), an IntersectionObserver, a tab change; EASYTOR.hit(el, on)
   adds the 2-second rule). Taking the class away returns it to the pre-state
   with a 120ms fade and no reverse play. --hit-delay staggers.
   Without html.motion it is simply visible (a flash: simply invisible). */
html.motion [data-hit]:not(.is-hit) {
  opacity: 0;
  transition: opacity 120ms linear;
}
html.motion [data-hit].is-hit {
  animation: e-fade var(--dur-2) cubic-bezier(.2, .7, .3, 1) var(--hit-delay, 0ms) backwards;
}
html.motion [data-hit="pop"].is-hit { animation-name: e-pop; animation-duration: 450ms; }
html.motion [data-hit="stamp"].is-hit { animation-name: e-stamp; animation-duration: 420ms; }
html.motion [data-hit="land"].is-hit { animation-name: e-land; animation-duration: 360ms; }
html.motion [data-hit="rise"].is-hit { animation-name: e-rise; animation-duration: 450ms; }
html.motion [data-hit="fade"].is-hit { animation-name: e-fade; }
/* flash: a veil that is invisible before, after and without motion. */
[data-hit="flash"] {
  opacity: 0;
  pointer-events: none;
}
html.motion [data-hit="flash"].is-hit {
  animation: e-flash 120ms linear var(--hit-delay, 0ms) both;
}
/* A hit asked for again within 2 s (EASYTOR.hit) shows its end state without replaying. */
html.motion [data-hit].is-hit.is-still {
  animation: none;
}
/* A stage that is static (no html.stages, or cramped) shows its hits: no render() will fire them. */
html:not(.stages) .scene [data-hit]:not([data-hit="flash"]),
.scene.is-cramped [data-hit]:not([data-hit="flash"]) {
  opacity: 1;
  animation: none;
  transition: none;
}

/* The prism roll (the switch's role line): a state, not a scrub. The rig turns
   to face --face (an integer the section's render() sets) about an axis pushed
   back by the apothem, so the face in front sits in the screen plane; a jump of
   several faces rolls through them. rotateX never mirrors. Set --apothem in the
   stage's live block: the static page shows the faces as a list, untransformed. */
html.motion [data-roll] {
  transform: translateZ(calc(-1 * var(--apothem, 0px))) rotateX(calc(var(--face, 0) * var(--roll-step, 90deg)));
  transition: transform var(--roll-dur, 450ms) var(--ease-pop);
}

/* --- 6. Media ---------------------------------------------------------------------- */

/* <img poster> then <video data-src> on top of it: EASYTOR.video moves data-src
   to src on activation and adds .is-ready once the video has a frame to show. */
video[data-src]:not(.is-ready) {
  opacity: 0;
}

/* --- 7. The keyframe vocabulary --------------------------------------------------
   Every name starts with e- (sections prefix their own with the section name).
   Use them three ways:
     as an actor     --act: e-tip-in; --from: .1; --to: .5;      (scrubbed)
     as a reveal     data-reveal / data-reveal="pop|draw|stamp|words"   (timed)
     as a hit        data-hit="pop|stamp|land|rise|fade|flash"          (timed, once)
   Entrance and hit verbs animate the INDIVIDUAL properties translate / scale,
   never `transform`, so a sticker keeps its tilt and a device its pose.
   The 3D verbs animate `transform` (they ARE the pose) and belong on a rig whose
   direct parent has the perspective; so does e-spin, which must add to a resting
   `rotate` (the timer hand). Parameters are custom properties read on
   the animated element; inside a scene, easing is linear per keyframe interval
   unless a keyframe says otherwise. */

/* rise — up and in.                    --rise: distance (14px) */
@keyframes e-rise {
  from { translate: 0 var(--rise, 14px); opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}
/* fade */
@keyframes e-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* pop — scale .34 → 1.1 → 1 (objects: stickers, badges, ticks) */
@keyframes e-pop {
  0% { scale: .34; opacity: 0; }
  60% { scale: 1.1; opacity: 1; }
  100% { scale: 1; opacity: 1; }
}
/* stamp — scale 1.3 → .94 → 1 (the pink punch line landing) */
@keyframes e-stamp {
  0% { scale: 1.3; opacity: 0; }
  55% { scale: .94; opacity: 1; }
  100% { scale: 1; opacity: 1; }
}
/* land — +5% → 1 (a logo mark settling).  --land: the start scale (1.05) */
@keyframes e-land {
  from { scale: var(--land, 1.05); opacity: 0; }
  to { scale: 1; opacity: 1; }
}
/* flash — an opacity blip.            --flash-peak: at most .4 */
@keyframes e-flash {
  0% { opacity: 0; }
  40% { opacity: var(--flash-peak, .4); }
  100% { opacity: 0; }
}
/* draw — a box growing from its transform-origin.   --draw-x / --draw-y: the start scale (0 / 1) */
@keyframes e-draw {
  from { scale: var(--draw-x, 0) var(--draw-y, 1); }
  to { scale: 1 1; }
}
/* word — one word rising from behind its mask (.w__i inside .w) */
@keyframes e-word {
  from { translate: 0 110%; }
  to { translate: 0 0; }
}
/* stroke — the SVG draw recipe: pathLength="1", stroke-dasharray: 1 2, no vector-effect */
@keyframes e-stroke {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
/* (No shared digit-strip keyframes: var() inside steps() in a keyframe is ignored
   by Chromium, so a counter writes its own, see RUNTIME.md "counters".) */
/* spin — clockwise turns (a clock hand). Never mirrored.   --spin-turns: 1
   It animates `transform`, so it ADDS to a resting `rotate` (the kit's timer hand
   rests at rotate: 42deg and keeps that angle at p = 0 and at the end). */
@keyframes e-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(calc(var(--spin-turns, 1) * 360deg)); }
}

/* turn — the device between two poses.   --turn-from / --turn-to: transform lists (the pose tokens) */
@keyframes e-turn {
  from { transform: var(--turn-from, none); }
  to { transform: var(--turn-to, none); }
}
/* turn out and back in (front → three-quarter → front).   --turn-via: the pose in the middle */
@keyframes e-turn-via {
  0% { transform: var(--turn-from, none); }
  50% { transform: var(--turn-via, none); }
  100% { transform: var(--turn-to, none); }
}
/* the full turn (the back of the device passes the camera).   --turn-deg: 360deg, mirrored by --dir */
@keyframes e-turn-full {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(calc(var(--dir) * var(--turn-deg, 360deg))); }
}
/* tip-in — a plane tipped back, landing flat; origin at its bottom edge.
   --tip: 34deg · --tip-y: 8% · --tip-scale: .94 · --tip-origin: 50% 100%
   --tip-o / --tip-o-mid: opacity at the start and at the 70% keyframe, where the
   tilt has come down to 8deg. The defaults keep a plane that carries text under
   .3 opacity while it is tilted more than 8deg; a plane without text (a floor)
   may set both to 1. */
@keyframes e-tip-in {
  0% {
    transform-origin: var(--tip-origin, 50% 100%);
    transform: rotateX(var(--tip, 34deg)) translateY(var(--tip-y, 8%)) scale(var(--tip-scale, .94));
    opacity: var(--tip-o, .004);
  }
  70% {
    transform-origin: var(--tip-origin, 50% 100%);
    transform: rotateX(clamp(-8deg, var(--tip, 34deg), 8deg)) translateY(calc(var(--tip-y, 8%) * .15)) scale(calc(1 - (1 - var(--tip-scale, .94)) * .15));
    opacity: var(--tip-o-mid, .28);
  }
  100% {
    transform-origin: var(--tip-origin, 50% 100%);
    transform: rotateX(0deg) translateY(0%) scale(1);
    opacity: 1;
  }
}
/* depth-in — from behind (or, with a positive depth, from in front) to the screen plane.
   --depth: -160px · --depth-x / --depth-y: an offset that closes with it · --depth-o: start opacity (.004) */
@keyframes e-depth-in {
  from {
    transform: translate3d(var(--depth-x, 0px), var(--depth-y, 0px), var(--depth, -160px));
    opacity: var(--depth-o, .004);
  }
  to {
    transform: translate3d(0px, 0px, 0px);
    opacity: 1;
  }
}
/* roll, scrubbed — a turn on X about an axis pushed back by the apothem.
   --apothem: half the face height · --roll-from: 0deg · --roll-to: 90deg
   (the threshold-driven roll of the switch is [data-roll] above) */
@keyframes e-roll {
  from { transform: translateZ(calc(-1 * var(--apothem, 0px))) rotateX(var(--roll-from, 0deg)); }
  to { transform: translateZ(calc(-1 * var(--apothem, 0px))) rotateX(var(--roll-to, 90deg)); }
}

/* --- 8. Failsafes ---------------------------------------------------------------- */

/* The head script does not set html.motion under reduced motion and main.js
   removes it when the setting changes; this covers the moment in between. */
@media (prefers-reduced-motion: reduce) {
  [data-act],
  [data-reveal],
  [data-hit],
  [data-roll],
  .w__i {
    animation: none !important;
    transition: none !important;
  }
  html.motion [data-reveal]:not(.is-revealed),
  html.motion [data-hit]:not(.is-hit):not([data-hit="flash"]) {
    opacity: 1 !important;
  }
  html.motion [data-reveal] .w__i {
    translate: none !important;
  }
}

/* Forced colours: scenes are static (the head script withholds html.stages and
   main.js treats no scene as live). */
@media (forced-colors: active) {
  [data-scene],
  .scene {
    --scene-live: 0 !important;
  }
  [data-act] {
    animation: none !important;
  }
}

/* Paper: main.js drops html.motion while printing; this is the belt to those braces. */
@media print {
  [data-act],
  [data-reveal],
  [data-hit],
  .w__i {
    animation: none !important;
  }
  html.motion [data-reveal]:not(.is-revealed),
  html.motion [data-hit]:not(.is-hit):not([data-hit="flash"]) {
    opacity: 1 !important;
  }
  html.motion [data-reveal] .w__i {
    translate: none !important;
  }
}
