/* css/lib/dials.css · gauge component (02-dials, 27-gauges) · the instrument symbols live inline in each section (dials-*, gauges-*),
 * with the same geometry; every colour of the instrument is set here, from tokens, through classes on the shapes and gradient stops:
 * a deep polished bezel (a chrome band graded light → dark → light, a recessed inner step), a warm ivory face lit from the upper left,
 * a soft well where the bezel shades the face, fine divisions (13 major, 12 half, 24 quarter) on a hairline track,
 * a red needle with a short counterweight and a faint fixed shadow, a polished centre cap, then the glass:
 * a sheen from the upper left (≈ 9 % ink), a crescent glare and a thin rim reflection.
 * No numbers, no wordmark, no zones, no glow. The target angle sits in the markup (transform="rotate(T 100 100)"),
 * so without JS and with reduced motion the needles already read. Only <g class="dial__needle"> turns (GSAP svgOrigin "100 100"). */
@layer components {
  .dial {                                   /* size comes from --dial on the set (02 and 27 set it per width) */
    display: grid;
    justify-items: center;
    align-content: start;
    gap: var(--space-sm);
    min-inline-size: 0;
  }
  .dial .dial__svg {                       /* two classes: wins over `.diagram svg { width: 100% }` inside a drawing plate */
    inline-size: min(var(--dial, 220px), 100%);
    block-size: auto;
    aspect-ratio: 1;
    overflow: visible;
  }
  .dial__needle { will-change: transform; }

  /* ---------- the instrument (SVG classes; stop-color / fill / stroke from tokens) ---------- */
  .dial__seat  { fill: var(--color-stage); }
  .dial__edge  { stroke: color-mix(in srgb, var(--color-light) 55%, transparent); }
  .dial__chrome-hi  { stop-color: color-mix(in srgb, var(--color-light) 78%, var(--color-line)); }
  .dial__chrome-lt  { stop-color: var(--color-line); }
  .dial__chrome-lt2 { stop-color: color-mix(in srgb, var(--color-line) 70%, var(--color-edge)); }
  .dial__chrome-md  { stop-color: var(--color-edge); }
  .dial__chrome-dk  { stop-color: color-mix(in srgb, var(--color-paper-3) 70%, var(--color-stage)); }
  .dial__gap   { stroke: var(--color-stage); }
  .dial__face-hi { stop-color: color-mix(in srgb, var(--color-dial) 96%, var(--color-accent)); }
  .dial__face-md { stop-color: color-mix(in srgb, var(--color-dial) 93%, var(--color-accent)); }
  .dial__face-lo { stop-color: color-mix(in srgb, color-mix(in srgb, var(--color-dial) 92%, var(--color-accent)) 80%, var(--color-edge)); }
  .dial__well-0 { stop-color: var(--color-stage); stop-opacity: 0; }
  .dial__well-1 { stop-color: var(--color-stage); stop-opacity: 0.3; }
  .dial__ink   { stroke: var(--color-dial-ink); }
  .dial__signal { fill: var(--color-signal); }
  .dial__drop  { flood-color: var(--color-stage); flood-opacity: 0.32; }
  .dial__cap   { stroke: var(--color-stage); }
  .dial__pin   { fill: var(--color-stage); }
  .dial__sheen-0 { stop-color: var(--color-ink); stop-opacity: 0.09; }
  .dial__sheen-1 { stop-color: var(--color-ink); stop-opacity: 0.025; }
  .dial__sheen-2 { stop-color: var(--color-ink); stop-opacity: 0; }
  .dial__glare-0 { stop-color: var(--color-light); stop-opacity: 0.34; }
  .dial__glare-1 { stop-color: var(--color-light); stop-opacity: 0; }
  .dial__rim-0 { stop-color: var(--color-light); stop-opacity: 0.6; }
  .dial__rim-1 { stop-color: var(--color-light); stop-opacity: 0; }
  .dial__rim-2 { stop-color: var(--color-light); stop-opacity: 0.22; }
  .dial__mask-on  { fill: var(--color-light); }   /* mask luminance: light shows the glare, stage hides it */
  .dial__mask-off { fill: var(--color-stage); }

  /* ---------- the label: sits under its own dial, centred, tied to it by a short hairline ---------- */
  .dial__label {
    position: relative;
    max-inline-size: min(100%, 24ch);
    padding-block-start: var(--space-md);
    font: 400 var(--text-body)/1.45 var(--font-body);
    color: var(--color-ink-2);
    text-align: center;
    text-wrap: balance;
  }
  .dial__label::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline-start: 50%;
    inline-size: var(--rule-hair);
    block-size: var(--space-xs);
    background: var(--color-edge);
  }
  .dial__name { font-weight: 500; color: var(--color-ink); }

  @media (forced-colors: active) {
    .dial { forced-color-adjust: none; }
  }
  @media print {
    .dial__label { color: var(--color-ink); }
  }
}
