/* The drawn elements in the DOM, reached by name (js/identity/dom.js): the buttons' component, icons and flags. Structure only: every colour, font, radius and frame is a token. A button is laid on its variant's Lip, the studio's nine-slice, through the --frame-* properties js/identity/pieces.js sets at boot, each a whole border-image sliced and sized as its manifest entry's nine_slice says; its label is live text in --font-ui over it (Word Krieg’s journal 017, entry 04). */

button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

/* What lays a Lip: the button, the home's menu buttons, the setup's steps; its frame is the border-image a --frame-* property holds */
.button, .menu-button, .stepper__step { border-radius: 0; border-style: solid; border-width: 0; image-rendering: pixelated; background: none; }

/* The button on its Lip, its variants and states: at rest, pressed (the face two art pixels lower, the label 4 px down with it), disabled (flat, its label greyed). `.button--pressed` and `.stepper__step--pressed` hold the pressed look for the catalogue. */
.button { min-height: 48px; padding: 0 20px; color: var(--color-text); font-family: var(--font-ui); font-weight: var(--font-weight-bold); }
.button:active:not(:disabled), .button.button--pressed { padding-top: 8px; }
.button:disabled { color: var(--color-disabled-text); cursor: default; }
.button--primary, .button--danger { color: var(--color-text-on-colour); }
.button--quiet { min-height: 40px; color: var(--color-text-muted); font-weight: var(--font-weight-semibold); }
.button--accept { color: var(--color-text-on-colour); }
/* Each Lip's three frames, at rest, pressed and disabled; a button with no variant, a home menu button and a step lay the secondary's */
.button, .menu-button, .stepper__step { border-image: var(--frame-button-secondary); }
.button:active:not(:disabled), .button.button--pressed, .menu-button:active:not(:disabled), .stepper__step:active:not(:disabled), .stepper__step.stepper__step--pressed { border-image: var(--frame-button-secondary-pressed); }
.button:disabled, .menu-button:disabled, .stepper__step:disabled { border-image: var(--frame-button-secondary-disabled); }
.button--primary, .menu-button--primary { border-image: var(--frame-button-primary); }
.button--primary:active:not(:disabled), .button--primary.button--pressed, .menu-button--primary:active:not(:disabled) { border-image: var(--frame-button-primary-pressed); }
.button--primary:disabled, .menu-button--primary:disabled { border-image: var(--frame-button-primary-disabled); }
.button--quiet { border-image: var(--frame-button-quiet); }
.button--quiet:active:not(:disabled), .button--quiet.button--pressed { border-image: var(--frame-button-quiet-pressed); }
.button--quiet:disabled { border-image: var(--frame-button-quiet-disabled); }
.button--danger { border-image: var(--frame-button-danger); }
.button--danger:active:not(:disabled), .button--danger.button--pressed { border-image: var(--frame-button-danger-pressed); }
.button--danger:disabled { border-image: var(--frame-button-danger-disabled); }
.button--accept { border-image: var(--frame-button-accept); }
.button--accept:active:not(:disabled), .button--accept.button--pressed { border-image: var(--frame-button-accept-pressed); }
.button--accept:disabled { border-image: var(--frame-button-accept-disabled); }
/* A secondary button whose action takes something away: Block Ana in a message's sheet */
.button--danger-text { color: var(--color-danger); }
.button--danger-text:disabled { color: var(--color-disabled-text); }
.button__icon { margin-right: 6px; }

/* The light on the lit buttons (Word Krieg’s journal 021): a halo breathing over 4.2 s, and a band of light sweeping across in the first 23% of every 6.5 s, held in the button's box; pressed, a lit button keeps it, disabled it has none. With reduced motion the halo is held and nothing sweeps */
.button--primary:not(:disabled), .button--accept:not(:disabled) { position: relative; overflow: hidden; }
.button--primary:not(:disabled) { animation: light-halo-primary 4.2s ease-in-out infinite; }
.button--accept:not(:disabled) { animation: light-halo-accept 4.2s ease-in-out infinite; }
.button--primary:not(:disabled)::after, .button--accept:not(:disabled)::after {
  content: ''; position: absolute; inset: 0; width: 40%; pointer-events: none; mix-blend-mode: plus-lighter;
  background: linear-gradient(90deg, transparent, var(--color-light-sweep), transparent);
  animation: light-sweep 6.5s ease-in-out infinite;
}
@keyframes light-halo-primary { 0%, 100% { filter: drop-shadow(0 0 var(--size-light-rest) var(--color-light-primary)); } 50% { filter: drop-shadow(0 0 var(--size-light-peak) var(--color-light-primary)); } }
@keyframes light-halo-accept { 0%, 100% { filter: drop-shadow(0 0 var(--size-light-rest) var(--color-light-accept)); } 50% { filter: drop-shadow(0 0 var(--size-light-peak) var(--color-light-accept)); } }
/* The accent's rings' light (Word Krieg’s journal 021, entry 02; journal 006): a chosen card's and the chosen flag's. The ring is clipped to its stepped outline, so the halo is the control's own: its outline is the ring, and the shadow hugs it outside, breathing as the lit buttons' halo */
.choice--on:not(:disabled), .flag-choice__option--on { animation: light-halo-ring 4.2s ease-in-out infinite; }
@keyframes light-halo-ring { 0%, 100% { filter: drop-shadow(0 0 var(--size-light-rest) var(--color-light-ring)); } 50% { filter: drop-shadow(0 0 var(--size-light-peak) var(--color-light-ring)); } }
/* The pill's glass (Word Krieg’s journal 023): its sheen, a soft light over every glass, its middle at rest 30% across and a quarter down, towards the top left where the studio paints its light, drifting to 70% and back over 7 s: a radial gradient twice the glass's width, moved by its position. A sliding glass's sheen is an element of its own (js/shell/pill.js), held in the glass, trailing it as it moves (js/identity/glass.js) and springing back once it rests; a still glass's is its ::after. Over the studio's frame, never instead of it. The lens is an SVG filter glass.js lays on a sliding glass's labels */
.segmented__glass { overflow: hidden; }
.segmented:not(.pill) > .segmented__option--on, .choice--on { position: relative; }
.segmented__sheen, .segmented:not(.pill) > .segmented__option--on::after, .choice--on::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: plus-lighter;
  background: radial-gradient(ellipse 27.5% 75% at 25% 25%, var(--color-glass-sheen), transparent 70%) 20% 0 / 200% 100% no-repeat;
  animation: glass-drift 7s ease-in-out infinite;
}
.segmented__sheen { transition: translate 220ms ease-out; }
@keyframes glass-drift { 0%, 100% { background-position-x: 20%; } 50% { background-position-x: -20%; } }
.glass-lenses { position: absolute; width: 0; height: 0; overflow: hidden; }
@keyframes light-sweep { 0% { transform: translateX(-120%) skewX(-18deg); } 23%, 100% { transform: translateX(220%) skewX(-18deg); } }
@media (prefers-reduced-motion: reduce) {
  .button--primary:not(:disabled), .button--accept:not(:disabled) { animation: none; }
  .button--primary:not(:disabled) { filter: drop-shadow(0 0 var(--size-light-still) var(--color-light-primary)); }
  .button--accept:not(:disabled) { filter: drop-shadow(0 0 var(--size-light-still) var(--color-light-accept)); }
  .choice--on:not(:disabled), .flag-choice__option--on { animation: none; filter: drop-shadow(0 0 var(--size-light-still) var(--color-light-ring)); }
  .button--primary:not(:disabled)::after, .button--accept:not(:disabled)::after { display: none; }
  .segmented__sheen, .segmented:not(.pill) > .segmented__option--on::after, .choice--on::after { animation: none; }
  .segmented__sheen { transition: none; }
}

/* An icon: the studio's mask, coloured by the text's colour, its shade on the outer element and the mask on the inner one (a mask on the element with the filter would cut its shade away); a pixel icon 18 × 18 whatever the font size, an SVG one em; the icons the studio does not draw are Inter text */
.icon { display: inline-flex; flex: none; vertical-align: -0.125em; font-style: normal; line-height: 1; }
.icon--smooth { width: 1em; height: 1em; filter: drop-shadow(1px 1px 0 var(--color-icon-shade)); }
.icon--pixel { width: 18px; height: 18px; filter: drop-shadow(2px 2px 0 var(--color-icon-shade)); }
.icon__mask { flex: 1; background-color: currentColor; mask-position: center; mask-size: 100% 100%; mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; image-rendering: pixelated; }
.icon--text { font-family: var(--font-ui); }

/* A flag: the studio's flags sheet, positioned on its frame, 56 × 38 */
.flag { display: inline-block; flex: none; background-repeat: no-repeat; image-rendering: pixelated; }
