/*
 * Adapted from “9 × 9 Circles” by Tom Miller / CreativeOcean.
 * Source: https://codepen.io/creativeocean/pen/Rwepojx
 */

.intro-circles {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--background);
  touch-action: none;
}

.intro-circles polygon {
  transform-box: fill-box;
  transform-origin: center;
}

.intro-circles__foreground polygon {
  mix-blend-mode: var(--intro-triangle-blend-mode, overlay);
}

.entrance-theme-picker {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.entrance-theme-picker:focus-within {
  opacity: 1;
  pointer-events: auto;
}

.entrance-theme-picker__toggle,
.entrance-theme-picker__option {
  display: block;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--foreground);
  border-radius: 50%;
  padding: 0;
  background: var(--theme-swatch, var(--foreground));
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.entrance-theme-picker__toggle {
  margin-left: auto;
  box-shadow: 0 0 0 2px var(--background);
}

.entrance-theme-picker__options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  padding: 9px;
  border: 1px solid var(--foreground);
  background: color-mix(in srgb, var(--background) 82%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.entrance-theme-picker__options[hidden] {
  display: none;
}

.entrance-theme-picker__swatches {
  display: grid;
  grid-template-columns: repeat(5, 26px);
  gap: 8px;
}

.entrance-theme-picker__option {
  position: relative;
  width: 26px;
  height: 26px;
  border-color: color-mix(in srgb, var(--foreground) 65%, transparent);
}

.entrance-theme-picker__option.is-special::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--background);
  border-radius: 50%;
  pointer-events: none;
}

.entrance-theme-picker__option[aria-pressed="true"] {
  outline: 2px solid var(--foreground);
  outline-offset: 2px;
}

.entrance-theme-picker__blend {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid color-mix(in srgb, var(--foreground) 35%, transparent);
}

.entrance-theme-picker__label {
  display: block;
  margin-bottom: 7px;
  color: var(--foreground);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.entrance-theme-picker__blend-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.entrance-theme-picker__blend-button {
  min-width: 0;
  border: 1px solid var(--foreground);
  border-radius: 0;
  padding: 5px 7px;
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 9px;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.entrance-theme-picker__blend-button[aria-pressed="true"] {
  background: var(--foreground);
  color: var(--background);
}

.entrance-theme-picker__toggle:focus-visible,
.entrance-theme-picker__option:focus-visible,
.entrance-theme-picker__blend-button:focus-visible {
  outline: 2px solid var(--foreground);
  outline-offset: 3px;
}
