/* ==========================================================================
   Industry case-study pages — Arabic / RTL
   Loaded after vsl.css and service.css, which supply the tokens, buttons,
   .block / .block__head / .cards scaffolding and the footer. Everything below
   is only what a case study adds: the disclosure, the before/after numbers,
   the curve, the step rail and the ledger.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Disclosure — the model notice
      Deliberately not styled as a warning. It is a statement of what the page
      is, and dressing it as an error would make an honest note look like a
      problem being apologised for.
   -------------------------------------------------------------------------- */
.disclose {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  max-width: 46rem;
  margin: var(--s-8) auto 0;
  padding: var(--s-4) var(--s-6);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
  text-align: start;
}
.disclose p {
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--fg-soft);
}
.disclose strong { color: var(--fg); font-weight: 700; }
.disclose__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  margin-block-start: 0.35rem;
  color: var(--fg-mute);
}
.disclose--tight {
  margin-block: var(--s-6) 0;
  padding-block: var(--s-3);
}
.disclose--tight p { font-size: 0.875rem; }

/* --------------------------------------------------------------------------
   2. The before/after numbers
   -------------------------------------------------------------------------- */
.block--flush { border-block-start: 0; }

.stats {
  list-style: none;
  margin: var(--s-8) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--s-4);
}

.stat {
  padding: var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink-raised);
  transition: border-color 0.25s var(--ease);
}
.stat:hover { border-color: var(--line-strong); }

.stat__label {
  font-size: 0.875rem;
  color: var(--fg-mute);
  line-height: 1.7;
}

.stat__jump {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block-start: var(--s-3);
}
.stat__before {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--fg-mute);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.stat__arrow {
  width: 1rem;
  height: 1rem;
  flex: none;
  align-self: center;
  color: var(--fg-mute);
}
.stat__after {
  font-size: clamp(2.25rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}
.stat__unit {
  font-size: 0.8125rem;
  color: var(--fg-mute);
}

/* --- The two bars --- */
.bars {
  margin-block-start: var(--s-6);
  display: grid;
  gap: var(--s-2);
}
.bar {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  align-items: center;
  gap: var(--s-3);
}
.bar__key {
  font-size: 0.75rem;
  color: var(--fg-mute);
}
.bar__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar__fill {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 999px;
  transform-origin: right center;   /* physical: bars grow from the RTL start */
  transform: scaleX(0);
  transition: transform 0.9s var(--ease);
}
/* The reveal class lands on the .stat, so the bars fill as the card arrives. */
.stat.is-in .bar__fill { transform: scaleX(1); }
.no-js .bar__fill { transform: scaleX(1); }

.bar__fill--before { background: var(--fg-mute); opacity: 0.55; }
.bar__fill--after  { background: var(--accent); }
.stat.is-in .bar__fill--after { transition-delay: 0.14s; }

.stat__delta {
  margin-block-start: var(--s-4);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   3. The curve
   -------------------------------------------------------------------------- */
.chart-wrap {
  margin-block-start: var(--s-8);
  padding: var(--s-6) var(--s-4) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink-raised);
}
@media (min-width: 40rem) {
  .chart-wrap { padding: var(--s-8) var(--s-6) var(--s-6); }
}

.chart {
  display: block;
  width: 100%;
  height: 220px;
}
@media (min-width: 40rem) { .chart { height: 260px; } }

.chart__grid   { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
.chart__axis   { stroke: var(--line-strong); stroke-width: 1; }
.chart__marker { stroke: var(--fg-mute); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.7; }
.chart__area   { fill: url(#chartFill); stroke: none; }

.chart__line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;   /* preserveAspectRatio="none" would skew it */
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 1.6s var(--ease);
}
.chart-wrap.is-in .chart__line { stroke-dashoffset: 0; }
.no-js .chart__line { stroke-dashoffset: 0; }

.chart__dot {
  fill: var(--ink-raised);
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.4s var(--ease) 1.2s;
}
.chart-wrap.is-in .chart__dot { opacity: 1; }
.no-js .chart__dot { opacity: 1; }
.chart__dot--last { fill: var(--accent); r: 5.5; }

/* LTR to match the chart: the time axis runs left-to-right so the curve reads
   as growth, and the labels have to agree with it. */
.chart__axis-labels {
  list-style: none;
  margin: var(--s-2) 0 0;
  padding: 0 1.4rem;
  display: flex;
  justify-content: space-between;
  direction: ltr;
  font-size: 0.6875rem;
  color: var(--fg-mute);
}
.chart__axis-labels li { direction: rtl; }

.chart__marker-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin-block-start: var(--s-4);
  font-size: 0.8125rem;
  color: var(--fg-mute);
}
.chart__marker-dash {
  width: 1.5rem;
  height: 0;
  border-block-start: 1px dashed var(--fg-mute);
  flex: none;
}

.chart__note {
  margin-block-start: var(--s-6);
  max-width: 44ch;
  margin-inline: auto;
  text-align: center;
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--fg-soft);
}

/* --------------------------------------------------------------------------
   4. The starting point — what was missing
   -------------------------------------------------------------------------- */
.gaps {
  list-style: none;
  margin: var(--s-8) auto 0;
  padding: 0;
  max-width: 44rem;
  display: grid;
  gap: var(--s-3);
}
.gap {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--fg-soft);
}
.gap__icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  margin-block-start: 0.45rem;
  color: var(--fg-mute);
}

/* --------------------------------------------------------------------------
   5. The four steps — a rail down the reading edge
   -------------------------------------------------------------------------- */
.steps {
  list-style: none;
  margin: var(--s-8) auto 0;
  padding: 0;
  max-width: 44rem;
  counter-reset: step;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: var(--s-4);
  padding-block-end: var(--s-8);
}
.step:last-child { padding-block-end: 0; }

/* The connector. Physical inset: it must sit under the badge, which is in the
   first grid column, and the column order already follows direction. */
.step__rail {
  position: absolute;
  inset-block: 2.75rem 0;
  inset-inline-start: 1.32rem;
  width: 1px;
  background: var(--line);
}
.step:last-child .step__rail { display: none; }

.step__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--ink-raised);
  flex: none;
  position: relative;
  z-index: 1;
}
.step__icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.step__meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 0.75rem;
  color: var(--fg-mute);
  line-height: 2.2;
}
.step__no { font-weight: 700; color: var(--accent); }
.step__week {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.step__title {
  margin-block-start: var(--s-1);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.6;
}
.step__text {
  margin-block-start: var(--s-2);
  font-size: 0.9375rem;
  line-height: 1.95;
  color: var(--fg-soft);
}

/* --------------------------------------------------------------------------
   6. The ledger
      A real table, not a grid of divs: it is tabular data, and screen readers
      and copy-paste both benefit. Scrolls inside its own box on narrow
      screens rather than pushing the page sideways.
   -------------------------------------------------------------------------- */
.ledger-wrap {
  margin-block-start: var(--s-8);
  max-width: 44rem;
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink-raised);
  overflow-x: auto;
}

.ledger {
  width: 100%;
  /* 19rem clears a 320px viewport inside the shell padding, so the table fits
     without scrolling on every phone in use. The overflow-x on the wrapper is
     the safety net for long labels, not the normal case. */
  min-width: 19rem;
  border-collapse: collapse;
  text-align: start;
}

.ledger th,
.ledger td {
  padding: var(--s-3);
  border-block-end: 1px solid var(--line);
  vertical-align: middle;
}
@media (min-width: 30rem) {
  .ledger th,
  .ledger td { padding: var(--s-4); }
}
.ledger tbody tr:last-child th,
.ledger tbody tr:last-child td { border-block-end: 0; }

.ledger thead th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg-mute);
  text-align: start;
  background: rgba(255, 255, 255, 0.02);
}
.ledger thead th:not(:first-child) { text-align: center; }

.ledger tbody th {
  font-weight: 400;
  text-align: start;
}
.ledger__label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.6;
}
.ledger__unit {
  display: block;
  font-size: 0.75rem;
  color: var(--fg-mute);
}
.ledger__derived {
  display: inline-block;
  margin-block-start: 0.25rem;
  font-size: 0.6875rem;
  color: var(--fg-mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
}

.ledger__before,
.ledger__after {
  text-align: center;
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
}
.ledger__before { color: var(--fg-mute); }
.ledger__after  { color: var(--fg); }

.ledger__row--strong { background: rgba(222, 239, 32, 0.045); }
.ledger__row--strong .ledger__after { color: var(--accent); }

/* --------------------------------------------------------------------------
   7. The limits — where this does not apply
   -------------------------------------------------------------------------- */
.block--limits { background: var(--ink-deep); }

.block__kicker--plain {
  color: var(--fg-mute);
  border-color: var(--line-strong);
  background: transparent;
}

/* No mark chip on these — they are caveats, not products. */
.card--plain { background: rgba(255, 255, 255, 0.02); }
