/* =========================================================================
   The mask, and the two actors behind it — piece 12
   ========================================================================= */

/* ---------- page tuning -------------------------------------------------
   Values this page sets differently from css/mlfk.css, plus everything only
   this page uses. Kept explicit rather than folded into the shared file so no
   other page shifts by a pixel.
   --------------------------------------------------------------------- */
  .page { row-gap: clamp(2.6rem,6vw,4.2rem); }
  .band { padding: clamp(1.9rem,4.5vw,3rem) 0; }
  a.eyebrow { text-decoration: none; color: var(--text-muted); }
  a.eyebrow:hover { color: var(--gold); }
  h1 { font-size: clamp(2.1rem,5.8vw,3.4rem); margin: 1.1rem 0 0; max-width: 20ch; }
  .lede { margin-top: 1.2rem; }
  .whofor { margin-top: 1.4rem; }
  strong { font-weight: 600; color: inherit; }
  /* The title is put on the way a mask is: each phrase is raised, held for a
     beat at arm's length, then settled onto the face. The gold passes through
     as it lands — the moment the actor stops being himself. */
  h1 span {
    display: inline-block;
    animation: raise 1100ms cubic-bezier(.22,.7,.3,1) both,
               settle 900ms ease-in-out both;
  }
  h1 span:nth-child(1) { animation-delay: 0ms, 1200ms; }
  h1 span:nth-child(2) { animation-delay: 260ms, 1520ms; }
  h1 span:nth-child(3) { animation-delay: 520ms, 1840ms; }
  @keyframes raise {
    0%   { transform: translateY(-0.28em) scale(1.06); opacity: 0; filter: blur(4px); }
    55%  { transform: translateY(0.04em)  scale(0.99); opacity: 0.85; filter: blur(1px); }
    100% { transform: translateY(0)       scale(1);    opacity: 1; filter: blur(0); }
  }
  @keyframes settle {
    0%   { color: var(--text-primary); }
    45%  { color: var(--gold); }
    100% { color: var(--text-primary); }
  }
  .sec { column-gap: 2.4rem; }
  .step { padding-top: 0.55rem; font-size: 0.64rem; letter-spacing: 0.2em; color: var(--gold); }
@media (max-width:840px) {
    .sec { grid-template-columns: 1fr; }
    .sec > *, .step { grid-column: 1; }
}
  .hint { color: var(--acc,var(--gold)); }
  .instr-status { text-align: right; }
  .instr-cap b { color: var(--text-secondary); font-style: normal; font-weight: 600; }
  .slabs.wide { grid-template-columns: minmax(0,1fr); }
  .slab canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
    background: var(--bg-page);
    border: 1px solid var(--border-default);
  }
  .slab .cap b { color: var(--acc,var(--gold)); font-weight: 600; }
  .instr-ctl { gap: 0.8rem 1.8rem; padding: 1.2rem 0 0; }

/* ---------- the script specimen -----------------------------------------
   Used once, in the opening chapter, to show a chat transcript as the plain
   text it actually is. Not a canvas: the reader should be able to select it,
   copy it, and see that it is only characters.
   --------------------------------------------------------------------- */
  .script {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
    background: var(--bg-subtle);
    border: 1px solid var(--border-default);
    border-left: 2px solid var(--acc,var(--gold));
    border-radius: 3px;
    padding: 1rem 1.1rem;
    margin: 1.4rem 0 0;
    overflow-x: auto;
    white-space: pre;
    color: var(--text-secondary);
  }
  .script .r { color: var(--warning); font-weight: 600; }
  .script .u { color: var(--info); font-weight: 600; }
  .script .a { color: var(--gold); font-weight: 600; }
  .script .e { color: var(--text-placeholder); font-weight: 600; }

  input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 22px;
    background: transparent;
    cursor: pointer;
    margin: 0;
  }
  input[type=range]::-webkit-slider-runnable-track {
    height: 3px;
    background: var(--border-strong);
    border-radius: 2px;
  }
  input[type=range]::-moz-range-track {
    height: 3px;
    background: var(--border-strong);
    border-radius: 2px;
  }
  input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--acc,var(--gold));
    margin-top: -6.5px;
    border: 2px solid var(--bg-page);
    box-shadow: 0 0 0 1px var(--acc,var(--gold));
  }
  input[type=range]::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--acc,var(--gold));
    border: 2px solid var(--bg-page);
    box-shadow: 0 0 0 1px var(--acc,var(--gold));
  }
  .btn { font-size: 0.72rem; padding: 0.36rem 0.85rem; }
  .btn[aria-pressed="true"] {
    background: var(--acc,var(--text-primary));
    color: var(--bg-page);
    border-color: var(--acc,var(--text-primary));
  }
  .btn:disabled { opacity: 0.4; cursor: default; }
  .cta { font-size: 0.9rem; padding: 0.6rem 1.4rem; }
  .cta:hover { background: var(--acc,var(--gold-pressed)); color: #fff; }
  .cta[aria-pressed="true"] {
    background: var(--acc,var(--gold));
    color: var(--bg-page);
    border-color: var(--acc,var(--gold));
  }
  .cta:disabled { opacity: 0.4; cursor: default; }
  .btn:focus-visible, .cta:focus-visible, input[type=range]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }
  .note {
    border-left: 2px solid var(--acc,var(--gold));
    margin: 1.4rem 0 0;
    font-size: 0.94rem;
  }
  .readout { gap: 0.6rem 1.4rem; margin: 1rem 0 0; }
  .num { font-size: clamp(1.7rem,4.4vw,2.4rem); }
  table { border-collapse: collapse; width: 100%; font-size: 0.94rem; }
  td {
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.6rem 0.4rem;
    vertical-align: top;
  }
  tr:last-child td { border-bottom: 0; }
  td:first-child { width: 46%; }
  td:last-child { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-muted); }
  .bigline { max-width: 34ch; }
  .seriesnav { font-size: 0.88rem; padding-top: 1.4rem; }
  .seriesnav a {
    color: var(--gold);
    text-decoration: none;
    border-bottom: 1px solid var(--gold-border);
  }
  .seriesnav a:hover { color: var(--gold-hover); }
  footer { font-size: 0.78rem; }
