/* =========================================================================
   Text and textile are the same word — piece 13
   =========================================================================
   Shared furniture below is byte-identical to css/the-mask.css on purpose.
   The page stylesheets in this directory have drifted from each other by
   copy-and-nudge (0.72rem vs 0.73rem and so on), which is what makes them
   hard to merge; this file deliberately adds none of that. Only the blocks
   under "the loom itself" are new.
   ========================================================================= */

/* ---------- page tuning ---------- */
  .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; }
  .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 loom itself ---------------------------------------------
   The title is thrown like a shuttle: each phrase enters from the side the
   previous one left, so the three lines read as three passes across a warp.
   --------------------------------------------------------------------- */
  h1 span {
    display: inline-block;
    animation: throw 1000ms cubic-bezier(.2,.75,.25,1) both,
               beat 820ms ease-in-out both;
  }
  h1 span:nth-child(1) { animation-delay: 0ms, 1080ms; }
  h1 span:nth-child(2) { animation-delay: 300ms, 1400ms; }
  h1 span:nth-child(3) { animation-delay: 600ms, 1720ms; }
  h1 span:nth-child(even) { animation-name: throwBack, beat; }
  @keyframes throw {
    0%   { transform: translateX(-0.6em); opacity: 0; filter: blur(3px); }
    100% { transform: translateX(0);      opacity: 1; filter: blur(0); }
  }
  @keyframes throwBack {
    0%   { transform: translateX(0.6em); opacity: 0; filter: blur(3px); }
    100% { transform: translateX(0);     opacity: 1; filter: blur(0); }
  }
  @keyframes beat {
    0%   { color: var(--text-primary); }
    45%  { color: var(--teal); }
    100% { color: var(--text-primary); }
  }

/* The etymology callout: one fact, given room. Used once, in chapter one. */
  .etym {
    margin: 1.6rem 0 0;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--border-default);
    border-left: 2px solid var(--teal);
    border-radius: 3px;
    background: var(--bg-subtle);
  }
  .etym .word {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal);
  }
  .etym p { margin: 0.5rem 0 0; font-size: 0.97rem; }

/* The six pieces this one ties together, as a plain list of links. */
  .knits { list-style: none; margin: 1.4rem 0 0; padding: 0; font-size: 0.94rem; }
  .knits li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
  }
  .knits li:last-child { border-bottom: 0; }
  .knits a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-border); }
  .knits a:hover { color: var(--gold-hover); }
  .knits .which {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-right: 0.6rem;
  }

/* ---------- controls ---------- */
  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; }
