/* reveal.css — beat-by-beat reveal scenes (paired with reveal.js).
 * With no JS every beat is visible; the controls only exist once JS runs. */

.reveal {
  margin: var(--s-4) 0;
  padding: var(--s-3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.reveal > * { min-width: 0; }

.beat {
  padding: var(--s-2) 0;
  border-top: 1px dashed var(--border);
}
.beat:first-child { border-top: 0; padding-top: 0; }
.beat-cap {
  margin: var(--s-1) 0 0;
  font-size: .9em;
  color: var(--muted);
}
.reveal-js .beat.now .beat-cap { color: var(--accent-ink); font-weight: 600; }
.reveal-js .beat.past { opacity: .72; }

.beat.enter { animation: beat-in .38s ease both; }
@keyframes beat-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .beat.enter { animation: none; }
}

.reveal-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1);
  margin-top: var(--s-2);
  padding-top: var(--s-2);
  border-top: 1px solid var(--border);
}
.reveal-controls button {
  font: 600 14px/1 var(--mono);
  min-width: 34px; height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--blue-edge);
  background: var(--blue-bg);
  color: var(--accent-ink);
  cursor: pointer;
}
.reveal-controls button:hover { border-color: var(--accent); }
.reveal-controls .reveal-all { margin-left: auto; font-size: 12px; background: var(--panel); border-color: var(--border); color: var(--muted); }
.reveal-pos { font: 500 12px/1 var(--mono); color: var(--faint); padding: 0 var(--s-1); }

/* ---- scene helpers used by the numbers chapter ---- */

/* a stack of "floors": beats pile upward, so the first beat is the ground floor */
.reveal.stack { display: flex; flex-direction: column-reverse; }
.reveal.stack .reveal-controls { order: -1; }       /* controls stay at the bottom */
.reveal.stack .beat { border-top: 0; border-bottom: 1px dashed var(--border); }
.reveal.stack .beat:first-child { border-bottom: 0; }
.floor {
  display: flex; align-items: center; gap: var(--s-2);
  direction: rtl;
}
.floor .no-box {
  flex: none;
  width: 2.4em; height: 2.4em;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--blue-edge);
  font-family: var(--arabic); font-size: 1.2em;
}
.floor .ar { flex: 1; min-width: 0; }

/* a row of tiles (digits, days) */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3.4em, 1fr));
  gap: var(--s-2);
  direction: rtl;
  margin: var(--s-3) 0;
}
.tiles > * { min-width: 0; }
.tile {
  text-align: center;
  padding: var(--s-2) var(--s-1);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tile .big { display: block; font-family: var(--arabic); font-size: 2em; line-height: 1.6; }
.tile .sub { display: block; font: 500 11px/1.5 var(--mono); color: var(--muted); direction: ltr; }

@media print {
  .reveal-controls { display: none !important; }
  .beat { display: block !important; opacity: 1 !important; }
}
