/* Approved slate and copper appearance palettes. */
:root {
  color-scheme: light;
  --background: #f3f0ea;
  --foreground: #303844;
  --card: #faf8f4;
  --card-foreground: #303844;
  --primary: #88583f;
  --primary-foreground: #f3f0ea;
  --muted: #e7e7e3;
  --muted-foreground: #626c76;
  --border: #c8ccd0;
  --ring: #88583f;
  --constellation: #746584;
  --radius: 0.35rem;
}

:root[data-tide="eventide"] {
  color-scheme: dark;
  --background: #29323c;
  --foreground: #e0ddd5;
  --card: #333e4a;
  --card-foreground: #e0ddd5;
  --primary: #deaa83;
  --primary-foreground: #29323c;
  --muted: #3b4651;
  --muted-foreground: #a8b0b8;
  --border: #535e69;
  --ring: #deaa83;
  --constellation: #b5a8cc;
}

.appearance-symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.appearance[hidden] {
  display: none;
}

.appearance {
  flex: none;
  color: var(--primary);
}

.appearance-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  color: inherit;
  background: transparent;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  cursor: pointer;
}

.appearance :focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 4px;
}

.appearance-current {
  display: block;
  /* The SVG's inset circle optically matches the 24px author mark. */
  width: 28px;
  height: 28px;
  pointer-events: none;
}

.appearance-icon {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.appearance-glyph {
  transition-property: none;
}

.appearance-eventide {
  transform: translateX(-24px);
}

:root[data-tide="eventide"] .appearance-morningtide {
  transform: translateX(24px);
}

:root[data-tide="eventide"] .appearance-eventide {
  transform: translateX(0);
}

/* The circular window stays still as the sun enters from the right or moon
   from the left. CSS transitions also reverse naturally on repeated taps. */
@media (prefers-reduced-motion: no-preference) {
  .appearance-glyph {
    transition: transform 460ms cubic-bezier(0.4, 0, 0.2, 1);
  }
}
