/* FitneX - the skin the gym demonstration wears.
 *
 * It redefines the tokens the app already uses rather than introducing a
 * second vocabulary, so every existing component adopts it without being
 * touched. It applies only under [data-brand="fitnex"]; a retail deployment
 * never sets that attribute and never sees a pixel of this file.
 *
 * On the palette: the obvious move for a gym is near-black with one acid
 * accent, which is what every fitness app already looks like. A premium
 * health club is hospitality - warm light, brushed metal, water, glass - so
 * the base here is a deep cool slate rather than black, and there are two
 * accents rather than one: brass carries emphasis, pool teal carries the
 * second data series. Neither shouts.
 *
 * No webfont and no outbound request: the product renders with the network
 * unplugged, so the type stack is what the machine already has and the type
 * scale does the work instead.
 */

:root[data-brand="fitnex"] {
  /* Surfaces, from the room outward. */
  --ground: #0e1a22;
  --panel: #142430;
  --panel-2: #1a2d3a;
  --rule: #24363f;
  --rule-strong: #35505d;

  /* Chalk on slate. Cool white, never pure, so long numbers stay readable. */
  --ink: #e9eef1;
  --ink-2: #a9bcc6;
  --ink-3: #7b8f9a;

  /* Brass: warm metal under evening light. Emphasis, not decoration. */
  --accent: #c8913f;
  --accent-ink: #14202a;
  --accent-deep: #a9752c;
  --accent-soft: rgba(200, 145, 63, 0.14);

  /* Data series. Members are brass, trainers are pool teal, the club's own
     figure is a quiet slate - three hues that stay distinguishable when
     printed in grey and for the commonest colour-vision deficiencies. */
  --series-1: #c8913f;
  --series-2: #4e9fae;
  --series-3: #8595a0;
  --grid-ink: #22343e;

  --ok: #5aa36f;
  --ok-soft: rgba(90, 163, 111, 0.16);
  --warn: #cf9a3c;
  --warn-soft: rgba(207, 154, 60, 0.16);
  --alarm: #c4664f;
  --alarm-soft: rgba(196, 102, 79, 0.16);

  --sans: "Assistant", "Heebo", "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", system-ui, sans-serif;
  --serif: "Frank Ruhl Libre", "David Libre", Georgia, serif;

  --radius: 10px;
  /* Hairlines and a raised surface instead of a drop shadow under every
     card: a page of identical soft shadows is the tell of a component kit. */
  --shadow: none;
}

:root[data-brand="fitnex"] body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(78, 159, 174, 0.10), transparent 60%),
    var(--ground);
}

/* --- the mark ------------------------------------------------------------ */

.fx-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sans);
  letter-spacing: -0.01em;
}

.fx-mark svg { display: block; }

.fx-mark .fx-word {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

/* The X is the only place the brass is allowed to be loud. */
.fx-mark .fx-x { color: var(--accent); font-weight: 700; }

/* --- the banner that must never come off --------------------------------- */

.fx-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.9rem;
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.85rem;
}

.fx-banner strong { color: var(--ink); font-weight: 600; }

/* --- the day ribbon ------------------------------------------------------
 * The one loud element on the page. Time of day is the fact this product is
 * mostly about - a club is empty at eleven and full at seven - so the day
 * itself is drawn once, large, and everything else on the screen stays
 * quiet. Bars are set in the flow with no radius, because a day is
 * continuous and rounded bars would read as separate objects.
 */

.fx-ribbon {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 2px;
  height: clamp(120px, 18vw, 190px);
  padding-block-end: 1.4rem;
  position: relative;
  direction: ltr; /* the day runs left to right even in a right-to-left page */
}

.fx-ribbon-bar {
  background: linear-gradient(to top, var(--accent-deep), var(--accent));
  min-height: 2px;
  position: relative;
}

/* An hour nobody watched is drawn as absence, not as a short bar. Hatching
   says "no reading here" where a 2-pixel bar would say "almost nobody". */
.fx-ribbon-bar[data-unmeasured="true"] {
  background: repeating-linear-gradient(
    135deg, var(--rule) 0 4px, transparent 4px 8px);
}

/* Measured, but thinly. The bar's height is the count; its solidity is how
   much of the hour the camera was actually up for. Drawing a bar seen a
   tenth of the time exactly like one seen throughout is the panel-wide
   coverage chip's mistake repeated per hour. */
.fx-ribbon-bar[data-partial="true"] {
  opacity: 0.55;
  border-block-start: 2px dotted var(--rule);
}

.fx-ribbon-bar[data-peak="true"] { background: linear-gradient(to top, var(--accent), #e8b978); }

/* The live reading's own coverage, beside the Free / In use it qualifies.
   The column next to it qualifies an hour of history, which is a different
   measurement by a possibly different camera. */
.fx-live-coverage {
  display: inline-block;
  margin-inline-start: 0.5rem;
  vertical-align: middle;
}

/* Why the window's average stay is blank, said once above the table rather
   than in place of it. The hours that were matched well enough keep their
   own rows. */
.fx-withheld {
  margin: 0 0 0.4rem;
  color: var(--ink-3);
  font-size: 0.85rem;
}

.fx-ribbon-hour {
  position: absolute;
  inset-block-end: -1.25rem;
  inset-inline: 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* --- figures -------------------------------------------------------------- */

.fx-figure {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}

.fx-figure-xl { font-size: clamp(2.6rem, 7vw, 4rem); }
.fx-figure-l { font-size: clamp(1.8rem, 4vw, 2.4rem); }

.fx-figure[data-absent="true"] {
  color: var(--ink-3);
  font-weight: 500;
}

/* --- the caveat that rides with a figure --------------------------------- */

.fx-caveat {
  margin-block-start: 0.35rem;
  color: var(--ink-3);
  font-size: 0.82rem;
  line-height: 1.5;
  max-width: 46ch;
}

/* --- station states ------------------------------------------------------- */

.fx-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-2);
}

.fx-state::before {
  content: "";
  inline-size: 0.55rem;
  block-size: 0.55rem;
  border-radius: 50%;
  background: var(--ink-3);
}

.fx-state[data-state="free"]::before { background: var(--ok); }
.fx-state[data-state="busy"]::before { background: var(--accent); }
/* Three states, not two. A machine nobody can see is not a free machine. */
.fx-state[data-state="unknown"]::before {
  background: transparent;
  border: 1px dashed var(--ink-3);
}

@media (prefers-reduced-motion: reduce) {
  :root[data-brand="fitnex"] * { animation: none !important; transition: none !important; }
}

/* A coverage chip inside a figure tile, and the note that rides with a
   figure whose own qualification is not a coverage - the match rate under a
   visit length. Both are small and quiet: they qualify the number, they do
   not compete with it. */
.tile-coverage { margin-block-start: 0.4rem; }
.tile-coverage .coverage { font-size: 0.75rem; }

.tile-note {
  margin-block-start: 0.3rem;
  font-size: 0.75rem;
  color: var(--ink-3);
}
