/* ============================================================
   Synergy Sales Group: components.css
   The two ledger sheets built by js/components.js: the lead demo and the offers sheet
   ("What each one includes"). Tokens and shared classes are in core.css.
   ============================================================ */

/* A full sheet of ledger: no border, no shadow. Everything starts on the one left edge. */
.demo, .offers {
  position: fixed; inset: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  display: none; flex-direction: column;
  padding: 0 var(--pad) var(--s4);
  background-color: var(--ledger);
  --ground: var(--ledger); --surface: var(--ledger-2);
  overflow-y: auto; overscroll-behavior: contain;
}
.demo[open], .offers[open] { display: flex; }
/* a long sheet on a phone scrolls; Close stays in reach at the top, on the sheet's own ground */
:is(.demo, .offers) > .sheet__bar { position: sticky; top: 0; z-index: 1; background: linear-gradient(to bottom, var(--ledger) 0, var(--ledger) 72%, transparent 100%); }

/* ---------- 1. The lead demo ---------- */
/* The title, six rows that light one after another, "Run it again", one small note. */
.demo__body {
  flex: 1 1 auto;
  display: grid; align-content: center; justify-items: start; gap: var(--s4);
  width: 100%; max-width: 64rem;
  padding: var(--s3) 0 var(--s4);
}
.demo__title { overflow: clip; }
.demo__title > span { display: block; }
.demo__rows { display: grid; gap: var(--s3); width: 100%; }

/* --lit: 1 = lit (the default, so the rows read in full with no script), 0 = waiting.
   While a run is under way js/components.js takes each row from 0 to 1 in turn. A waiting
   row is the text colour at 55% (still 5:1 on the ledger); nothing here is ever hidden. */
.demo__row {
  --lit: 1;
  display: grid; grid-template-columns: 4.5rem minmax(0, 15rem) minmax(0, 1fr);
  column-gap: var(--s4); align-items: baseline;
}
.demo__time { font-size: 1rem; line-height: 1.5; white-space: nowrap; color: rgb(var(--bone-rgb) / calc(0.55 + 0.13 * var(--lit))); }
.demo__step { font-size: clamp(1.1875rem, 1.45vw, 1.375rem); line-height: 1.4; color: rgb(var(--bone-rgb) / calc(0.55 + 0.45 * var(--lit))); }
.demo__line { font-size: 1.125rem; line-height: 1.5; max-width: 52ch; text-wrap: pretty; color: rgb(var(--bone-rgb) / calc(0.55 + 0.13 * var(--lit))); }
.demo__note { max-width: 60ch; }

@media (max-width: 859.98px) {
  .demo__row { grid-template-columns: 4.5rem minmax(0, 12.5rem) minmax(0, 1fr); column-gap: var(--s3); }
}
@media (max-width: 699.98px) {
  .demo__body { align-content: start; gap: var(--s3); }
  .demo__row { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .demo__line { grid-column: 2; }
}
@media (min-width: 700px) and (max-height: 760px) {
  .demo__body { gap: var(--s3); padding-top: 0; }
  .demo__rows { gap: var(--s2); }
}

/* ---------- 2. The offers sheet ---------- */
/* The title, then one row for each offer: its name with the price under it on the left edge,
   and one paragraph on a second edge. Then the note and the one action. Plain rows: no rules,
   no boxes. The price is the text colour; the paragraph is the secondary colour, like the
   line of every other row on the site. */
.offers__body {
  flex: 1 1 auto;
  display: grid; align-content: center; justify-items: start; gap: var(--s4);
  width: 100%; max-width: 64rem;
  padding: var(--s3) 0 var(--s4);
}
.offers__title { overflow: clip; }
.offers__title > span { display: block; }
.offers__rows { display: grid; gap: var(--s4); width: 100%; }
.offers__row {
  display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  column-gap: var(--s4); align-items: baseline;
}
.offers__row > dt { display: grid; gap: 0; }
.offers__name { font-size: clamp(1.1875rem, 1.45vw, 1.375rem); line-height: 1.4; }
.offers__price { font-size: 1.125rem; line-height: 1.5; }
.offers__line { font-size: 1.125rem; line-height: 1.5; max-width: 56ch; text-wrap: pretty; color: var(--bone-2); }
.offers__note { max-width: 60ch; }

@media (max-width: 859.98px) {
  .offers__row { grid-template-columns: minmax(0, 13.5rem) minmax(0, 1fr); column-gap: var(--s3); }
}
@media (max-width: 699.98px) {
  .offers__body { align-content: start; gap: var(--s3); }
  .offers__rows { gap: var(--s3); }
  .offers__row { grid-template-columns: minmax(0, 1fr); row-gap: var(--s1); }
}
@media (min-width: 700px) and (max-height: 760px) {
  .offers__body { gap: var(--s3); padding-top: 0; }
  .offers__rows { gap: var(--s3); }
}

/* ---------- A detail sheet (Systems): rows may hold a short plain list ---------- */
.detail .offers__rows { gap: var(--s3); }
.detail__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35em; }
.detail__list > li { padding-left: 1.1em; text-indent: -1.1em; }
.detail__list > li::before { content: "\00b7\00a0\00a0"; color: var(--gold); }

/* ---------- The film player (components.js mountPlayer) ---------- */
/* Full screen on black: the bar with Close, the film as large as the window allows, one line. */
.player {
  position: fixed; inset: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  display: none; flex-direction: column; padding: 0 var(--pad) var(--s2);
  background: #000; --ground: #000; --surface: #000;
}
.player[open] { display: flex; }
.player__stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.player__video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: calc(100dvh - var(--frame-h) - 5rem); object-fit: contain; background: #000; }
.player__caption { text-align: center; margin: var(--s1) auto 0; max-width: 60ch; color: var(--bone-2); }
