/* console.css · SPEC §6.1 · owned by the console builder.
   Everything is laid out at its STAGE geometry; the REST pose is a transform. window.__lsGeo (inline in the section)
   writes the numbers on .console__stage before first paint; until console.js adds html.ls-ready, the rules marked
   "rest" below hold the rest pose, so the first frame is right without GSAP. Vars:
   --gfs giant font-size · --gbase its baseline (y) · --gcap its cap height · --col the start column ·
   --gx --gy --gr / --lx --ly the giant's and label's rest transform · --sr --ss --dev-w (≥ 1024) ·
   --box-h --ty-r --ty-s --chip-b (< 1024) · --k the chip's counter-scale (1 / rest scale). */

.console { position: relative; margin-top: calc(-1 * var(--nav-h)); --o-start: 100%; }   /* the stage starts under the sticky nav */
html[dir="ltr"] .console { --o-start: 0%; }
.console__track { position: relative; height: 560svh; }
.console__stage { position: sticky; top: 0; height: 100svh; overflow: clip; }
.console__skip { top: calc(var(--nav-h) + 8px); }   /* in the stage's stacking context the nav would cover top: 8px */

/* ---------- lede (rest) ---------- */
.console__lede { position: absolute; top: 88px; inset-inline: var(--gutter); text-align: center; }
.console__h1 { max-width: 15.8em; margin-inline: auto; }   /* em, not ch: ch follows the '0' and moves when the latin face swaps in */
.console__h1b { display: block; }
html[lang="en"] .console__h1 { max-width: none; font-size: clamp(32px, 3.1vw, 46px); }
.console__sub { margin-top: 12px; font-size: 17px; line-height: 26px; color: var(--ink-2); white-space: nowrap; }

/* ---------- the floor: one full-bleed hairline; the device and the giant stand on it ---------- */
.console__floorline { position: absolute; inset-inline: 0; top: calc(100% - 62px); height: 1px; background: var(--line); }

/* ---------- the giant + its label (stage layout; rest = transform) ---------- */
.console__gbox { position: absolute; inset: 0; pointer-events: none; transition: opacity 300ms ease-out; }
.console__gbox.is-gone { opacity: 0; }
.console__glabel {
  position: absolute; inset-inline-start: var(--gutter); bottom: calc(100% - var(--gbase) + var(--gcap) * var(--lfit, 1) + 12px);
  font-size: 17px; line-height: 1.3; color: var(--ink-2); white-space: nowrap;
}
.console__glabel-in { display: inline-block; }
/* out of flow, one em tall: a roll that changes the row's width moves nothing else */
.console__gwrap {
  position: absolute; inset-inline-start: var(--gutter); width: var(--col); height: var(--gfs);
  top: calc(var(--gbase) - .85 * var(--gfs));                              /* SG: the baseline is .85em down a 1em line */
  transform-origin: var(--o-start) calc(.85 * var(--gfs));                 /* scale from the foot */
}
.console__gwrap .giant { display: block; width: max-content; font-size: var(--gfs); }
.console__gwrap .roll { display: flex; width: max-content; --fit-origin: 100% .85em; }
html[dir="ltr"] .console__gwrap .roll { --fit-origin: 0% .85em; }
/* ₪ drawn at the digits' own stem (SG wdth 200 wght 180: .0425em; < 1024 wdth 118 wght 220: .0575em) and cap height */
.console .giant .cur {
  font-size: 1em; line-height: 1; height: 1em; width: .95em; overflow: hidden; color: transparent; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 950 707.5'%3E%3Cpath d='M21.25 707.5V21.25H627V424.5M928.75 0V686.25H323V283' fill='none' stroke='%23000' stroke-width='42.5' stroke-linejoin='round'/%3E%3C/svg%3E") 0 .1425em / 100% .7075em no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 950 707.5'%3E%3Cpath d='M21.25 707.5V21.25H627V424.5M928.75 0V686.25H323V283' fill='none' stroke='%23000' stroke-width='42.5' stroke-linejoin='round'/%3E%3C/svg%3E") 0 .1425em / 100% .7075em no-repeat;
}

/* ---------- the device on the floor (layout box unscaled; the rest pose is scale(--sr) from its foot) ---------- */
.console .device { position: absolute; z-index: 3; left: calc(50% - 170px); top: calc(100% - 62px - 660px); }
.console__shadow { left: calc(50% - 153px); width: 306px; top: calc(100% - 50px); z-index: 1; }

/* rest, before console.js takes over (the same numbers GSAP starts from) */
html:not(.ls-ready) .console .device { transform: scale(var(--sr, .68)); }
html:not(.ls-ready) .console__shadow { transform: scaleX(var(--sr, .68)); }
html:not(.ls-ready) .console__gwrap { transform: translate(var(--gx, 0px), var(--gy, 0px)) scale(var(--gr, .5)); }
html:not(.ls-ready) .console__glabel { transform: translate(var(--lx, 0px), var(--ly, 0px)); }
html:not(.ls-ready) :is(.console__band, .console__bar) { visibility: hidden; opacity: 0; }
html:not(.ls-ready) .console__caps { opacity: 0; }

/* ---------- the power chip: a sheet on the screen's foot while the box is off, sized in rendered px (--k) ---------- */
.console__dock { position: absolute; inset: 0; z-index: 3; pointer-events: none; transition: opacity var(--d-fade) ease-out, visibility 0s; }
.console__dock > * { pointer-events: auto; }
html:not([data-box="off"]) .console__dock { opacity: 0; visibility: hidden; transition: opacity var(--d-fade) ease-out, visibility 0s var(--d-fade); }
.console__chip {
  position: absolute; inset-inline: 0; bottom: 0; font-size: calc(14px * var(--k, 1));
  display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; gap: .35em; padding: .85em .85em 1em;
  border-radius: 1.3em 1.3em 0 0; background: var(--bg); color: var(--ink); text-align: center;
  box-shadow: 0 -1px 0 var(--line), 0 -14px 30px -18px rgb(14 15 17 / .3);
}
.console__power { width: 100%; min-height: 3em; font-size: 1.143em; padding: 0 .75em; border-radius: .75em; }
.console__chip-shops { font-size: 1em; line-height: 1.3; color: var(--ink-2); }
.console__chip-keys { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; }
.console__shopkey { min-height: 3.15em; font-size: 1em; color: var(--ink); }
.console__chip-small { font-size: 1em; line-height: 1.35; color: var(--ink-2); max-width: 17em; text-wrap: balance; }
.console__chip-label { font-size: 1.143em; line-height: 1.3; font-weight: 500; text-wrap: balance; }

/* < 1024 on the stage: one slim line over the app's header (≥ 1024 the band carries the controls) */
.console__bar { display: none; }

/* ---------- the top band (≥ 1024), under the nav in every state: one hairline drawn out of the device, three cells ---------- */
.console__band { position: absolute; z-index: 4; inset-inline: 0; top: var(--nav-h); height: 48px; }
.console__rule { position: absolute; inset-inline: 0; bottom: 0; }   /* the nav's own rule is the band's top */
.console__cell { position: absolute; top: 0; height: 48px; flex-wrap: nowrap; gap: 12px; white-space: nowrap; }
.console__cell--start { inset-inline-start: var(--gutter); }
.console__cell--tools { inset-inline-end: calc(var(--gutter) + var(--dev-w, 320px) + 40px); gap: 8px; }
.console__cell--side { inset-inline-end: var(--gutter); width: var(--dev-w, 320px); justify-content: center; }
.console__cell .btn { min-height: 36px; font-size: 14px; padding: 0 14px; }
.console__cell .keys > button { min-height: 36px; padding: 0 12px; }
.console__bandname { color: var(--ink); font-weight: 500; }
html:not([data-box="off"]) .console__trykey { display: none; }

/* live-only controls rise in */
.console [data-live-only] { visibility: hidden; opacity: 0; transform: translateY(8px); transition: opacity var(--d-rise) var(--e-rise), transform var(--d-rise) var(--e-rise), visibility 0s var(--d-rise); }
html[data-box="live"] .console [data-live-only] { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
html:not([data-box="live"]) .console__cell--tools [data-live-only] { display: none; }
.console__retry { display: none !important; }
html[data-box-slow] .console__retry { display: inline-flex !important; }

/* ---------- captions: centred between the band and the giant's label, so caption and giant read as one block ---------- */
.console__caps {
  position: absolute; z-index: 2; top: calc(var(--nav-h) + 64px); bottom: calc(100% - var(--gbase) + var(--gcap) + 58px);
  inset-inline-start: var(--gutter); width: min(440px, var(--col, 440px)); display: grid; align-content: center; pointer-events: none;
}
.console__cap { grid-area: 1 / 1; align-self: center; opacity: 0; }
.console__h2 { font-size: var(--t-h2-cap); }
html[lang="en"] .console__h2 { font-size: var(--t-h2-cap); }
.console__on { display: none; }
html:not([data-box="off"]) .console__on { display: inline; }
html:not([data-box="off"]) .console__off { display: none; }
.console__line, .console__try, .console__moves { margin-top: 12px; font-size: var(--t-line); line-height: 1.55; color: var(--ink-2); }
.console__line p + * { margin-top: 10px; }
.console__msg { margin: 12px 0 0; padding-inline-start: 14px; border-inline-start: 2px solid var(--line-strong); }
.console__msg figcaption { font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.console__msg blockquote { margin: 2px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink); }
.console__msg bdi { font-variant-numeric: tabular-nums lining-nums; }
.console__moves { counter-reset: mv; display: grid; gap: 6px; }
.console__moves > li { counter-increment: mv; display: grid; grid-template-columns: 28px 1fr; align-items: baseline; }
.console__moves > li::before { content: counter(mv, decimal-leading-zero); font-family: var(--f-code); font-weight: 420; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums slashed-zero; }
.console__short { display: none; }
.console__try { color: var(--ink); }
html[data-box="off"] .console__try { display: none; }
html:not([data-box="off"]) .console__line { display: none; }

/* < 1024-only pieces */
.console__liveline, .console__liverow { display: none; }

/* ============ < 1024: a redesign (h1, the giant on the box's top edge, the box laid out once at its live size) ============ */
@media (max-width: 1023.98px) {
  .console__track { height: 520svh; }
  .console__lede { top: 72px; text-align: start; }
  .console__h1 { max-width: none; margin: 0; font-size: 28px; text-wrap: balance; }
  html[lang="en"] .console__h1 { max-width: none; font-size: min(30px, 7.2vw); }
  .console__h1b { display: inline; }
  .console__sub { margin-top: 8px; font-size: min(15px, 3.85vw); line-height: 23px; white-space: normal; text-wrap: balance; }
  .console__floorline, .console__band, .console__shadow { display: none; }

  .console__glabel { font-size: 13px; bottom: calc(100% - var(--gbase) + var(--gcap) * var(--lfit, 1) + 6px); }
  /* ₪ at the narrow giant's stem and width */
  .console .giant .cur {
    width: .72em;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 720 707.5'%3E%3Cpath d='M28.75 707.5V28.75H475V424.5M691.25 0V678.75H245V283' fill='none' stroke='%23000' stroke-width='57.5' stroke-linejoin='round'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 720 707.5'%3E%3Cpath d='M28.75 707.5V28.75H475V424.5M691.25 0V678.75H245V283' fill='none' stroke='%23000' stroke-width='57.5' stroke-linejoin='round'/%3E%3C/svg%3E");
  }

  /* the box: laid out at its live top (nav + 96); --ty carries it to the rest and stage floors; live slides it up */
  .console .device { left: 0; right: 0; top: calc(var(--nav-h) + 96px); transform: translateY(var(--ty, var(--ty-r, 200px))); }
  html:not(.ls-ready) .console .device { transform: translateY(var(--ty-r, 200px)); }
  html[data-box="live"] .console .device { transform: none; transition: transform var(--d-lift) var(--e-lift); }
  html[data-box="live"] .console .device__lift::before { opacity: 0; }
  .console .device__screen { height: var(--box-h, max(300px, calc(100svh - 300px))); }

  .console__chip { inset-inline: 12px; bottom: var(--chip-b, 12px); max-width: 420px; margin-inline: auto; border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 18px 36px -18px rgb(14 15 17 / .3); }

  .console__bar {
    display: flex; position: absolute; inset-inline: 0; top: 0; min-height: 56px; align-items: center; justify-content: space-between; gap: 10px;
    padding-block: 6px; padding-inline: 14px 6px; background: var(--bg); box-shadow: 0 1px 0 var(--line), 0 8px 18px -14px rgb(14 15 17 / .3);
    visibility: hidden; opacity: 0;
  }
  .console__bar-label { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.3; color: var(--ink); min-width: 0; }
  .console__barkey { min-height: 44px; font-size: 15px; padding: 0 14px; flex: none; }

  .console__caps { top: calc(var(--nav-h) + 8px); bottom: auto; width: auto; inset-inline: var(--gutter); align-content: start; }
  .console__cap { align-self: start; }
  .console__h2 { font-size: 20px; }
  .console__line, .console__try, .console__moves { margin-top: 6px; font-size: 14px; line-height: 1.45; }
  .console__moves { gap: 2px; }
  .console__moves > li { grid-template-columns: 22px 1fr; }
  .console__moves > li::before { font-size: 11px; }
  .console__line p + * { margin-top: 4px; }
  .console__msg { margin-top: 4px; padding-inline-start: 10px; }
  .console__msg figcaption { font-size: 11px; }
  .console__msg blockquote { font-size: 14px; line-height: 1.4; }

  /* live: the try line and the switch row under the nav; the box slides up to nav + 96 and leaves ≥ 300 px of page */
  .console__liveline, .console__liverow {
    display: flex; position: absolute; z-index: 4; inset-inline: var(--gutter); align-items: center; gap: 10px;
    visibility: hidden; opacity: 0; transition: opacity var(--d-fade) ease-out, visibility 0s var(--d-fade);
  }
  .console__liveline { top: var(--nav-h); height: 44px; }
  .console__liverow { top: calc(var(--nav-h) + 44px); height: 44px; justify-content: space-between; }
  html[data-box="live"] .console__liveline, html[data-box="live"] .console__liverow { visibility: visible; opacity: 1; transition-delay: 0s; }
  html[data-box="live"] :is(.console__caps, .console__gbox) { opacity: 0 !important; transition: opacity var(--d-fade) ease-out; }
  .console__minitry { font-size: 13px; line-height: 1.35; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .console__mswitch { flex: 1; }
  .console__mswitch > button { flex: 1; padding: 0 8px; font-size: 14px; }
  .console__liverow .console__more { min-height: 44px; padding: 0 14px; flex: none; }
  .console__liverow .console__retry { flex: none; }
  html[data-box-slow] .console__liverow .console__more { display: none; }
}

/* phones: the box keeps the page's side gutter instead of running edge to edge */
@media (max-width: 767.98px) {
  .console .device { inset-inline: var(--gutter); width: auto; }
  .console__mock { height: min(420px, 110vw); }
  .console__breading .giant { font-size: min(17vw, 96px); }   /* "#0044" (5 wide glyphs) fits the column without the fit-scale clipping it */
}

/* the "More" popover (native top layer; without popover support console.js toggles [hidden], same box) */
.console__pop {
  position: fixed; z-index: 60; margin: 0; inset: auto; top: calc(var(--nav-h) + 92px); inset-inline-end: var(--gutter); inset-inline-start: auto;
  width: min(calc(100vw - 2 * var(--gutter)), 360px); padding: 16px; border: 0; border-radius: 16px;
  background: var(--bg); color: var(--ink); box-shadow: 0 0 0 1px var(--line), var(--shadow-lift);
}
.console__pop[hidden] { display: none; }
.console__pop-title { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.console__mpicker { display: flex; width: 100%; }
.console__mpicker > button { flex: 1; padding: 0 6px; }
.console__pop-row { display: flex; gap: 8px; margin-top: 12px; }
.console__pop-row .btn { flex: 1; }
@media (min-width: 1024px) {
  .console__pop { top: calc(var(--nav-h) + 52px); inset-inline-end: calc(var(--gutter) + var(--dev-w, 320px) + 40px); width: auto; padding: 12px; }
  .console__pop-shops { display: none; }
  .console__pop-row { margin-top: 0; }
}

/* ============ reduced motion and short screens: not sticky; screen 1 at rest; five stacked blocks ============ */
@media (prefers-reduced-motion: reduce) {
  .console__track { height: auto; }
  .console__stage { position: relative; height: max(100svh, 624px); }
}
.console--calm .console__track { height: auto; }
.console--calm .console__stage { position: relative; height: max(100svh, 624px); }
.console__calm { display: grid; gap: var(--s8); padding-block: var(--s8) var(--s9); }
.console__calm[hidden] { display: none; }
.console__block { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s7); align-items: end; padding-top: var(--s7); border-top: 1px solid var(--line); }
.console__block .console__cap { opacity: 1; }
.console__breading { margin-top: var(--s6); display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.console__blabel { font-size: 17px; color: var(--ink-2); }
.console__breading .giant { font-size: clamp(56px, 8vw, 120px); }
.console__bgiant { display: block; width: 100%; overflow: clip; }   /* .roll is fit-scaled; its layout box must not widen the page */
.console__mock { width: 300px; height: 600px; }
.console__mock-in { width: 340px; height: 660px; padding: var(--rim-w); border-radius: 36px; background: var(--rim); box-shadow: inset 0 1px 0 var(--rim-hi), var(--shadow-rest); transform: scale(calc(300 / 340)); transform-origin: var(--o-start) 0; }
.console__mock-screen { position: relative; width: 320px; height: 640px; border-radius: 28px; overflow: clip; background: #F5F4F0; }
.console__mock-screen > * { position: absolute; inset: 0; }
@media (max-width: 1023.98px) {
  .console__block { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
  .console__mock { width: min(100%, 560px); height: 420px; margin-inline: auto; }
  .console__mock-in { width: 100%; height: 100%; padding: 0; border-radius: 24px 24px 0 0; background: none; box-shadow: var(--shadow-rest); transform: none; }
  .console__mock-screen { width: 100%; height: 100%; border-radius: 24px 24px 0 0; border: 1px solid var(--line-strong); border-bottom: 0; }
  .console__breading .giant { font-size: min(30vw, 120px); }
}
html[dir="ltr"] .console .giant .cur { margin-inline-end: .14em; }   /* en "₪379": the drawn ₪ has no side bearing of its own */
.console__skip { transform: translateY(calc(-100% - var(--nav-h) - 24px)); }   /* lower than the global skip, so it hides further up */
.console__skip:focus { transform: none; }
