/* ==========================================================================
   Kairo Systems practice pages (_build/systems_kit.py, behaviour in
   assets/systems.js). Loaded after signals.css, paid.css and organic.css,
   which supply the hero card, icon tabs, panels, marquee, pill toggle,
   citation cards and stops; each page then loads its own sheet for its hero
   units, its window and its figure. Same outbound-style vocabulary.

   Figure contract: an element with data-at shows its finished look by
   default (that is the no-JS state) and its pending look only under
   `.sg-js ... :not(.is-live)`. data-span elements get --p from 0 to 1.
   ========================================================================== */

[data-span] { --p: 1; }

/* ---- a drawn screen, shared by the heroes ---------------------------------- */
.sy-u { max-width: 384px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 14px 34px -14px rgba(0, 0, 0, .24); overflow: hidden; }
.sy-chrome { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #ececec; background: #f6f6f4; }
.sy-chrome span { display: flex; gap: 5px; }
.sy-chrome span i { width: 8px; height: 8px; border-radius: 50%; background: #d6d6d2; }
.sy-chrome b { flex: 1; padding: 3px 10px; border-radius: 100px; background: #fff; font-size: 10.5px; font-weight: 400; color: #70757a; text-align: center; }
/* the brand's monogram, as on the other pages */
.sy-mono {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; color: #fff; font-weight: 700; font-style: normal; font-size: 11px;
  background: conic-gradient(from 200deg, #E2520F, #F2C230, #7FB8F0, #2F5BD3, #E2520F);
}
.sy-mono--round { border-radius: 50%; }
.sy-phone {
  position: relative; width: 214px; height: 404px; padding: 30px 13px 13px; box-sizing: border-box; border-radius: 34px; border: 7px solid #1d1d1f;
  background: #f7f6f2; box-shadow: 0 18px 38px -16px rgba(0, 0, 0, .4); display: grid; align-content: start; gap: 9px; overflow: hidden;
  font-family: Arial, Helvetica, sans-serif; color: #202124;
}
.sy-phone::before { content: ""; position: absolute; top: 7px; left: 50%; width: 62px; height: 16px; border-radius: 100px; background: #1d1d1f; transform: translateX(-50%); }
.sy-bare { max-width: none; background: none; box-shadow: none; overflow: visible; display: grid; place-items: center; }

/* ---- the pinned hero (scrubhero.js) -------------------------------------------
   scrubhero.js adds .is-scrub to the section and the figure: the track grows a
   runway of scroll, the stage pins under the nav (--nav-h), and on wide screens
   the copy pins beside it, so the whole hero holds still while the moments play.
   Without .is-scrub it is a plain hero showing the first moment. */
.sh-copy, [data-scrub-hero] { min-width: 0; }   /* else a wide figure stretches its grid column past the screen */
.sh-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(14px, 2vh, 22px); justify-items: center; }
.sh-stack { display: grid; }
.sh-stack > [data-m] { grid-area: 1 / 1; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .35s ease, transform .35s ease, visibility 0s .35s; }
.sh-stack > [data-m].is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.sh-fit { display: grid; justify-items: center; width: 100%; }
.sh-fit__in { min-width: 0; max-width: 100%; transform-origin: top center; }
.sh-foot { display: grid; justify-items: center; gap: 2px; margin: 0; font-size: 11px; text-align: center; }
.sh-hint { display: none; }
.is-scrub .sh-hint { display: inline; }
[data-scrub-hero].is-scrub .sh-track { height: calc(100svh - var(--nav-h, 0px) + var(--run, 240svh)); }
[data-scrub-hero].is-scrub .sh-stage { position: sticky; top: var(--nav-h, 0px); height: calc(100svh - var(--nav-h, 0px)); align-content: center; }
@media (min-width: 901px) {
  .sh-hero.is-scrub { padding-block: 0; }
  .sh-hero.is-scrub .sg-hero__grid { align-items: start; }
  /* copy taller than the screen (a short laptop) scrolls up until its foot shows, then pins: --copy-top is that overshoot */
  .sh-hero.is-scrub .sh-copy {
    position: sticky; top: calc(var(--nav-h, 0px) + var(--copy-top, 0px)); box-sizing: border-box; min-height: calc(100svh - var(--nav-h, 0px));
    padding-block: 24px; display: grid; align-content: center;
  }
}
@media (max-width: 900px) { [data-scrub-hero] { margin-top: 8px; } }

/* ---- the flip ---------------------------------------------------------------- */
.sy-flip { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sy-flip__left { display: grid; gap: 14px; min-width: 0; }
.sy-seg { justify-self: start; flex-wrap: wrap; }
.sy-win { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; color: #202124; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .2); overflow: hidden; }
.sg-js .sy-view:not([hidden]) { animation: sg-fade 380ms var(--ease); }
html:not(.sg-js) .sy-view + .sy-view { border-top: 1px solid #ddd; }
html:not(.sg-js) .sy-seg { display: none; }
.sy-flip .og-cite { cursor: default; }
.sy-flip .og-cite p { margin-top: 4px; }
.sy-hl {
  border-radius: 3px; background: rgba(226, 82, 15, .07); box-shadow: inset 0 -2px 0 rgba(226, 82, 15, .35);
  outline: none; cursor: help; transition: background var(--fast), box-shadow var(--fast);
}
div.sy-hl, p.sy-hl, li.sy-hl { box-shadow: inset 0 0 0 1px rgba(226, 82, 15, .3); }
.sy-hl.is-hot { background: rgba(226, 82, 15, .2); box-shadow: inset 0 -2px 0 #E2520F; }
div.sy-hl.is-hot, p.sy-hl.is-hot, li.sy-hl.is-hot { box-shadow: inset 0 0 0 1.5px #E2520F; }
.sy-flip.is-focused .sy-hl:not(.is-hot) { background: transparent; box-shadow: none; }
.sy-flip.is-focused .og-cite:not(.is-hot) { opacity: .45; }

/* ---- the timeline frame ------------------------------------------------------- */
.sy-tl { --climb-bg: var(--ink); --climb-ink: var(--text); --climb-dim: var(--text-3); --climb-line: var(--line-2); position: relative; }
.sy-tl__fig { position: relative; width: 100%; }
.sy-tl__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; font-family: var(--font-mono); }
.sy-contours path { fill: none; stroke: url(#syLine); stroke-width: 1; }
.sy-axis path { fill: none; stroke: var(--text-3); stroke-width: 1; }
.sy-axis text, .sy-lab { fill: var(--text-3); font-size: 11.5px; letter-spacing: .08em; }
.sy-lab.is-live, .sy-tl .is-live > .sy-lab { fill: var(--text); }
.sy-hit { fill: transparent; cursor: ew-resize; touch-action: pan-y; }
.sy-track { fill: none; stroke: none; }
.sy-marker { pointer-events: none; }
.sy-marker__ring { fill: none; stroke: var(--orange); stroke-width: 1.5; opacity: .6; }
.sy-marker__pulse { fill: rgba(226, 82, 15, .14); transform-box: fill-box; transform-origin: center; animation: sy-pulse 2.2s var(--ease) infinite; }
@keyframes sy-pulse { 50% { transform: scale(1.35); opacity: .4; } }
.sy-tl .og-stop circle { fill: var(--ink); }
.sy-tl .og-stop.is-on circle { fill: var(--orange); }

.sy-card {
  position: absolute; display: grid; gap: 8px; padding: 16px 20px 14px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: radial-gradient(360px 160px at 0% 0%, rgba(226, 82, 15, .14), transparent 70%), rgba(var(--surface-rgb), .92);
  backdrop-filter: blur(6px); box-shadow: 0 18px 40px -26px rgba(20, 20, 20, .35);
}
.sy-card__n { margin: 0; font-size: 12px; color: var(--text-3); }
.sy-card__n b { color: var(--orange); font-weight: 500; }
.sy-step { display: grid; gap: 4px; }
.sy-step .sg-k { margin: 0; }
.sy-step h3 { margin: 0 0 2px; font-family: var(--font-display); font-size: clamp(22px, 2.3vw, 28px); font-weight: 400; line-height: 1.05; letter-spacing: -.02em; }
.sy-step p { margin: 0; font-size: 13.8px; line-height: 1.5; color: var(--text-2); }
.sg-js .sy-step:not([hidden]) { animation: sg-fade 380ms var(--ease); }
.sy-card__nav { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-top: 4px; }
.sy-card__nav .sg-climb__arrow { width: 34px; height: 34px; font-size: 14px; }
.sy-card__hint { margin: 0; font-size: 10.5px; }
.sy-tl.is-ready:not(.is-drawn) .og-stop, .sy-tl.is-ready:not(.is-drawn) .sy-card, .sy-tl.is-ready:not(.is-drawn) .sy-marker { opacity: 0; }
.sy-tl .og-stop, .sy-card, .sy-marker { transition: opacity .6s var(--ease); }
html:not(.sg-js) .sy-card { position: static; width: auto !important; margin-top: 16px; }
html:not(.sg-js) .sy-step { display: grid !important; margin-bottom: 10px; }
html:not(.sg-js) .sy-card__nav, html:not(.sg-js) .sy-card__hint, html:not(.sg-js) .sy-card__n, html:not(.sg-js) .sy-marker { display: none; }

@media (max-width: 900px) {
  .sy-flip { grid-template-columns: 1fr; }
  .sy-card { position: static; width: auto !important; margin-top: 16px; }
  /* the card has moved under the figure, so its empty headroom is cropped off the top */
  .sy-tl .pd-ridge__scroll { overflow-x: auto; overflow-y: hidden; }
  .sy-tl__fig { margin-top: calc(var(--crop) * -100%); }
}
@media (max-width: 640px) {
  .sy-tl__fig { width: 720px; margin-top: calc(var(--crop) * -720px); }
}
@media (prefers-reduced-motion: reduce) {
  .sy-marker__pulse { animation: none; }
  .sg-js .sy-view:not([hidden]), .sg-js .sy-step:not([hidden]) { animation: none; }
}
