html[data-theme="light"] {
  color-scheme: light;
  --ink: #f8f7fc;
  --surface: #ffffff;
  --text: #262033;
  --muted: #544d60;
  --green: #34601f;
  --violet: #684096;
  --rule: #c6bfd1;
}

html[data-theme="light"] header { background: #faf9ff; }
html[data-theme="light"] nav a { color: #4f445d; }
html[data-theme="light"] nav a:hover { color: var(--green); }
html[data-theme="light"] .hero {
  background-color: #f1edf7;
  background-image: radial-gradient(circle, #d6cfdf 1px, transparent 1.2px);
}
html[data-theme="light"] .primary {
  color: #21371b;
  background: #b5ed85;
  border-color: #598347;
  box-shadow: 3px 3px #839e71;
}
html[data-theme="light"] .secondary {
  color: var(--text);
  background: #fbfaff;
  border-color: #8d809d;
  box-shadow: 3px 3px #c2b8cd;
}
html[data-theme="light"] .art-window {
  background: #f5effc;
  border-color: #86639e;
  box-shadow: 6px 6px #c3b3d0;
}
html[data-theme="light"] .window-bar { background: #d4b9e9; }
html[data-theme="light"] figcaption { color: #493558; border-color: #9e84ac; }
html[data-theme="light"] figcaption span { color: #715784; }
html[data-theme="light"] .filters button:hover { color: var(--text); }
html[data-theme="light"] .filters button[aria-pressed="true"] {
  color: #2e521f;
  background: #dfefcf;
  border-color: #82a06f;
}
html[data-theme="light"] .card { background: var(--surface); border-color: var(--rule); }
html[data-theme="light"] .preview { --mat: #c3d8d5; }
html[data-theme="light"] .recompra .preview { --mat: #dccde4; }
html[data-theme="light"] .wave .preview { --mat: #cacfe7; }
html[data-theme="light"] .sinal .preview { --mat: #cbdbe4; }
html[data-theme="light"] .agenda .preview { --mat: #c1dacf; }
html[data-theme="light"] .xadrez .preview { --mat: #dfcdb7; }
html[data-theme="light"] .card-body .stack { color: #624e72; }
html[data-theme="light"] .history { background: #f0edf5; }
html[data-theme="light"] .entry { border-color: #ac9bb8; }
html[data-theme="light"] .entry b { color: var(--muted); }
html[data-theme="light"] .tags li { background: #faf8fd; border-color: var(--rule); }
html[data-theme="light"] :is(a, button):focus-visible { outline-color: #684096; }

.nav nav { margin-inline-start: auto; }
.theme-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--violet);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 0;
  cursor: pointer;
}
.theme-toggle[aria-pressed] { display: inline-flex; }
.theme-toggle:hover { color: var(--green); border-color: currentColor; }

/* The icon previews the other palette. */
.theme-toggle::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
}
.theme-toggle[aria-pressed="true"]::before {
  width: 10px;
  height: 10px;
  clip-path: polygon(20% 0,80% 0,80% 20%,100% 20%,100% 80%,80% 80%,80% 100%,20% 100%,20% 80%,0 80%,0 20%,20% 20%);
}
.theme-toggle[aria-pressed="true"]::after {
  position: absolute;
  content: "";
  width: 3px;
  height: 3px;
  background: currentColor;
  box-shadow: 0 -9px, 6px -6px, 9px 0, 6px 6px, 0 9px, -6px 6px, -9px 0, -6px -6px;
}
.theme-toggle[aria-pressed="false"]::before {
  clip-path: polygon(30% 0,60% 0,60% 10%,50% 10%,50% 30%,60% 30%,60% 50%,70% 50%,70% 60%,90% 60%,90% 50%,100% 50%,100% 70%,90% 70%,90% 80%,80% 80%,80% 90%,70% 90%,70% 100%,30% 100%,30% 90%,20% 90%,20% 80%,10% 80%,10% 70%,0 70%,0 30%,10% 30%,10% 20%,20% 20%,20% 10%,30% 10%);
}
@media (max-width: 560px) {
  .nav {
    display: grid;
    grid-template: "brand toggle" auto "links links" auto / 1fr auto;
    padding: 8px 0 4px;
    row-gap: 0;
    justify-content: stretch;
  }
  .nav .brand { grid-area: brand; justify-self: start; }
  .theme-toggle { grid-area: toggle; }
  .nav nav {
    grid-area: links;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    margin: 0;
  }
  .nav nav a { display: inline-flex; align-items: center; min-height: 44px; }
}
