/* SCROLL-WRITING TEXT (component 1). The paragraph writes itself word by word as it is read.
   From About take 3's "One way of coaching" (Sam, 3 Nov: "the go-to style for this scroll writing section style").

   Markup (dark):
     <div class="tcc-write-block">
       <h2 class="tcc-write-block__label">One way of coaching</h2>         (optional)
       <p class="tcc-write" data-write>Words, with <em>emphasis</em> in cyan.</p>
     </div>
   Blue (testimonials): add tcc-write--blue to the paragraph and tcc-write-block--blue to the block, on a cyan ground.
   Script: write.js (defer). data-write="scroll" (default) scrubs with scroll; data-write="manual" waits for
   TCCWrite.create(el).play(ms), which the testimonial slider uses.

   Settled state is the design: without JS, with reduced motion, or without color-mix(), every word shows at its lit colour.

   Colours (measured, WCAG 2.1 relative luminance):
     dark  lit #8a9093 on --tcc-ground #0b0d0e = 6.02:1 (on --tcc-surface #101012 = 5.88:1); emphasis --tcc-brand 7.41:1
     blue  lit --tcc-ground #0b0d0e on --tcc-brand #36AECB = 7.41:1
   Pending words are deliberately below legibility; they all reach the lit colour by the time the block is at mid-screen. */

.tcc-write-block {
  --tcc-write-size: clamp(30px, 4vw, calc(62px + var(--tcc-up) * .05));
  /* centre the block, keep the text left-aligned (Sam, 3 Nov) */
  width: min(100%, calc(var(--tcc-write-size) * 14.4));
  margin-inline: auto;
  text-align: left;
}
.tcc-write-block .tcc-write-block__label {
  font-family: var(--tcc-font-body); font-weight: 600; font-size: 15px; line-height: 1.3; letter-spacing: .01em;
  color: var(--tcc-brand); margin-bottom: clamp(18px, 2vw, 28px);
}
.tcc-write-block--blue .tcc-write-block__label { color: var(--tcc-ground); }

.tcc-write {
  --tcc-write-lit: #8a9093;
  --tcc-write-unlit: #24282a;
  --tcc-write-accent: var(--tcc-brand);
  --tcc-write-soft: 0;
  font-family: var(--tcc-font-heading); font-weight: 500;
  font-size: var(--tcc-write-size, clamp(30px, 4vw, calc(62px + var(--tcc-up) * .05)));
  line-height: 1.1; letter-spacing: -.028em; text-wrap: pretty;
  color: var(--tcc-write-lit);
  margin: 0;
}
.tcc-write em { font-style: normal; color: var(--tcc-write-accent); }

.tcc-write--blue {
  --tcc-write-lit: var(--tcc-ground);
  --tcc-write-unlit: color-mix(in oklab, var(--tcc-brand) 80%, var(--tcc-ground));
  --tcc-write-accent: var(--tcc-ground);
  letter-spacing: -.03em;
}

/* a hyphenated word stays whole while it is written */
.tcc-write__w { white-space: nowrap; }

/* armed by write.js only when motion is allowed and color-mix() works */
.tcc-write.is-armed .tcc-write__w {
  color: color-mix(in oklab, var(--tcc-write-lit) calc(var(--k, 0) * 100%), var(--tcc-write-unlit));
}
.tcc-write.is-armed em .tcc-write__w,
.tcc-write.is-armed .tcc-write__w.is-em {
  color: color-mix(in oklab, var(--tcc-write-accent) calc(var(--k, 0) * 100%), var(--tcc-write-unlit));
}

@media (max-width: 767px) {
  .tcc-write-block { --tcc-write-size: clamp(28px, 7.6vw, 34px); }
}
