/* The Pomodoro timer's own rules, loaded after brutalist.css and kept in its layers. */

@layer tokens {
  /* The color of the time during a break. During focus it is the accent, which is already tomato red. */
  @media screen {
    :root {
      --break: #1b6b3a;
    }
  }
  @media screen and (prefers-color-scheme: dark) {
    :root {
      --break: #7fd6a2;
    }
  }
}

@layer components {
  /* The phase is the caption of the time, and sits directly on it. */
  .phase {
    margin-block-end: 0;
    font-size: var(--fs-1);
    font-weight: 700;
  }

  /* The body font with figures of one width, so the time does not shift as it counts.
     At 26vw, six characters such as 132:07 fit a screen of 320 pixels. */
  .time {
    margin-block-end: var(--s-4);
    color: var(--accent);
    font-size: clamp(var(--fs-5), 26vw, 11rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: var(--lh-tight);
    transition: color var(--motion);
  }

  /* In print there is no break color, and the time takes the accent, which prints black. */
  [data-phase="break"] .time {
    color: var(--break, var(--accent));
  }

  /* A paused time loses its color, to show at a glance that nothing is counting. */
  [data-paused] .time {
    color: var(--text-2);
  }

  /* Wide enough for Start, Pause, and Resume, so the button beside it stays where it is. */
  #main-button {
    min-inline-size: 6.5em;
  }

  /* The sound level is one word, so its field is as narrow as a field for minutes. */
  select {
    inline-size: min(100%, 16ch);
  }
}
