/* "Discovery at scale" film + usage split-flap board.
   Shared by /book-a-demo/ and /new-homepage/; relies on the kit tokens
   (--hero-bg, --font-display, --font-mono, --text-on-dark) those pages define. */

.scale-film,
.scale-stats {
  background: var(--hero-bg, #0f0e0d);
  color: var(--color-ink-inverse, #fff);
}

.scale-film {
  padding-block: var(--space-16, 4rem);
}

/* When the board follows directly (homepage), the two read as one band. */
.scale-film:has(+ .scale-stats) {
  padding-bottom: 0;
}

.lander-hero + .scale-film {
  border-top: 1px solid var(--nav-rule, #e5dfd633);
}

.scale-filmFrame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid #ffffff1f;
  box-shadow: 0 30px 80px -30px #5d37a466;
}

.scale-filmFrame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scale-filmToggle {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #ffffff33;
  background: #0f0e0dcc;
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s;
}

.scale-filmToggle:hover,
.scale-filmToggle:focus-visible {
  opacity: 1;
}

.scale-filmToggle:focus-visible {
  outline: 2px solid #b89cff;
  outline-offset: 2px;
}

.scale-filmToggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.scale-filmToggle .scale-iconPlay,
.scale-filmToggle[data-paused] .scale-iconPause {
  display: none;
}

.scale-filmToggle[data-paused] .scale-iconPlay {
  display: block;
}

.scale-stats {
  padding-block: var(--space-16, 4rem) calc(var(--space-16, 4rem) * 1.5);
  overflow: hidden;
}

.scale-statsHeader {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 3.5rem;
}

.scale-statsTitle {
  font-family: var(--font-display, Georgia, serif);
  font-weight: 300;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -.03em;
  text-wrap: balance;
  margin: 0 0 .9rem;
}

.scale-statsSub {
  font-size: .875rem;
  color: var(--text-on-dark-muted, #fff9);
  margin: 0;
}

/* Board: rows of fixed-size tiles that run past both edges of the viewport. */
.scale-board {
  --cell: 40px;
  --gap: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.scale-boardRow {
  display: flex;
  gap: var(--gap);
  flex: none;
}

.scale-cell {
  position: relative;
  width: var(--cell);
  height: calc(var(--cell) * 1.18);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: #ffffff08;
  box-shadow: inset 0 0 0 1px #ffffff0d;
  font-size: calc(var(--cell) * .58);
  line-height: 1;
  color: #fff;
}

/* The split line across the middle of each flap. */
.scale-cell::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: #0f0e0d;
  opacity: .9;
}

.scale-cell[data-label] {
  color: #ffffff73;
}

.scale-cell[data-flip] {
  animation: scale-flap .09s linear;
}

@keyframes scale-flap {
  50% { transform: scaleY(.82); }
}

@media (prefers-reduced-motion: reduce) {
  .scale-cell[data-flip] {
    animation: none;
  }
}

/* Readable list of the same figures: shown without JS, kept for screen
   readers once the visual board is built. */
.scale-statsList {
  display: grid;
  gap: .5rem;
  max-width: 32rem;
  margin: 0 auto;
  font-family: var(--font-mono, ui-monospace, monospace);
}

.scale-statsList > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #ffffff1f;
  padding-block: .5rem;
}

.scale-statsList dt {
  color: #ffffff8c;
  text-transform: uppercase;
}

.scale-statsList dd {
  margin: 0;
}

.scale-statsList[data-built] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Separate the board from a dark section that follows it (homepage Free Guide). */
.scale-stats + .kit-sectionDark {
  border-top: 1px solid var(--nav-rule, #e5dfd633);
}
