/* css/sections/02-dials.css · H02 · the face of the machine: pump left, steam right, group lower in the middle.
 * Every label stands right under its own dial (centred, tied to it by a short hairline: css/lib/dials.css), on every width:
 * the reader reads each needle with its line. DOM and reading order: pump, group, steam (the order the labels appear in). */
@layer sections {
  .s-dials {
    position: relative;
    background:
      radial-gradient(ellipse 46% 40% at 50% 64%, color-mix(in oklch, var(--color-light) 3.5%, transparent), transparent 100%),
      linear-gradient(to top, var(--color-stage), transparent var(--space-2xl)),   /* Integration: paper melts back into the stage of 03 */
      linear-gradient(to bottom, var(--color-stage), var(--color-paper) var(--gap-c))
      var(--color-paper);   /* stage melts into paper: no seam under the hero */
    padding-block: var(--gap-c) var(--space-2xl);
  }
  .dials__defs { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
  .dials__inner {
    display: grid;
    grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
    column-gap: var(--gap-columns);
    row-gap: var(--space-2xl);
  }
  .dials__title { grid-column: 1 / -1; }

  /* ---------- phone and tablet: pump and steam side by side, group centred under them; every label right under its own dial ---------- */
  .dials__set {
    --dial: min(38vw, 150px);
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--gap-columns);
    row-gap: var(--space-xl);
    align-items: start;
  }
  .dials__set .dial--pump  { grid-column: 1; grid-row: 1; }
  .dials__set .dial--steam { grid-column: 2; grid-row: 1; }
  .dials__set .dial--group { grid-column: 1 / -1; grid-row: 2; }

  @media (min-width: 40em) {
    .dials__set {
      --dial: min(26vw, 200px);
      justify-self: start;
      inline-size: min(100%, 36rem);
    }
  }

  /* ---------- desktop: title in columns 1–4, the three dials as a wide V in columns 5–12 ----------
   * Pump and steam at the top, the group lower between them, so the labels under pump and steam sit beside the group, never under it.
   * Height ≈ 1.62 dials + one label (about 60 % of a 900 px window); the dial is capped by the window height and width. */
  @media (min-width: 64em) {
    .s-dials {
      background:
        radial-gradient(ellipse 40% 46% at 68% 48%, color-mix(in oklch, var(--color-light) 4%, transparent), transparent 100%),
        linear-gradient(to top, var(--color-stage), transparent var(--space-2xl)),
        linear-gradient(to bottom, var(--color-stage), var(--color-paper) var(--gap-c))
        var(--color-paper);
      /* small top padding: the bezels of the two upper dials are what shows in the hero's peek */
      padding-block: var(--space-xl) var(--space-3xl);
    }
    .dials__inner { row-gap: 0; }
    .dials__title {
      grid-area: 1 / 1 / 2 / 5;
      align-self: start;
      margin-block-start: var(--space-2xl);
      position: relative;
      z-index: 1;
    }
    .dials__set {
      --dial: clamp(170px, min(30svh, 18vw), 17rem);
      grid-area: 1 / 5 / 2 / -1;
      inline-size: auto;
      justify-self: stretch;
      grid-template-columns: repeat(3, minmax(0, var(--dial)));
      justify-content: space-between;
      column-gap: var(--space-lg);
      row-gap: 0;
    }
    .dials__set .dial--pump  { grid-column: 1; grid-row: 1; }
    .dials__set .dial--group { grid-column: 2; grid-row: 1; margin-block-start: calc(var(--dial) * 0.62); }
    .dials__set .dial--steam { grid-column: 3; grid-row: 1; }
    .dials__set .dial__label { max-inline-size: 100%; }
  }
}
