.header-controls {
  gap: 16px;
}
.appearance-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 7px;
  padding: 5px 3px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.switch-label {
  font-family: var(--heading);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.4px;
}
.switch-track {
  display: block;
  position: relative;
  width: 84px;
  height: 36px;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 2px 5px #0005,
    0 1px 0 #ffffff26;
  transition: background-color 0.65s;
}
.sky-track {
  background: #5babbf;
}
.switch-orb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 28px;
  height: 28px;
  background: #ffe15a;
  border-radius: 50%;
  box-shadow:
    0 0 9px #ffe769aa,
    0 0 0 7px #ffffff16,
    0 0 0 17px #ffffff12,
    0 0 0 27px #ffffff0c;
  transition:
    transform 0.65s cubic-bezier(0.22, 0.8, 0.25, 1),
    background-color 0.65s,
    box-shadow 0.65s;
}
.switch-orb i {
  position: absolute;
  border-radius: 50%;
  background: #c1bda8;
  opacity: 0;
  transition: opacity 0.65s;
  box-shadow: inset 1px 1px 2px #918d7740;
}
.switch-orb i:nth-child(1) {
  width: 8px;
  height: 8px;
  left: 5px;
  top: 5px;
}
.switch-orb i:nth-child(2) {
  width: 5px;
  height: 5px;
  left: 17px;
  top: 10px;
}
.switch-orb i:nth-child(3) {
  width: 7px;
  height: 7px;
  left: 10px;
  top: 18px;
}
.switch-clouds,
.switch-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition:
    transform 0.65s,
    opacity 0.65s;
}
.switch-clouds {
  fill: #e6f7fa;
  filter: drop-shadow(0 1px 0 #aad5df);
}
.switch-clouds path:first-child {
  opacity: 0.65;
}
.switch-clouds path:last-child {
  opacity: 0.8;
}
.switch-stars {
  stroke: #d7e6f2;
  stroke-width: 1;
  fill: #d7e6f2;
  opacity: 0;
  transform: translateY(-12px);
}
.theme-toggle[aria-checked="true"] .sky-track {
  background: #102a40;
}
.theme-toggle[aria-checked="true"] .switch-orb {
  transform: translateX(48px);
  background: #eee9d2;
  box-shadow:
    0 0 8px #efe9d488,
    0 0 0 7px #ffffff08,
    0 0 0 17px #ffffff05,
    0 0 0 27px #ffffff03;
}
.theme-toggle[aria-checked="true"] .switch-orb i {
  opacity: 0.8;
}
.theme-toggle[aria-checked="true"] .switch-clouds {
  opacity: 0;
  transform: translateY(25px);
}
.theme-toggle[aria-checked="true"] .switch-stars {
  opacity: 0.8;
  transform: translateY(0);
}
.appearance-switch:hover .switch-track {
  outline: 1px solid var(--muted);
  outline-offset: 2px;
}
@media (max-width: 991.98px) {
  .header-controls {
    order: 1;
    width: 100%;
    justify-content: center;
    margin: 0;
    gap: 28px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
  }
}
html[data-motion="off"] .appearance-switch * {
  transition: none;
}
@media (prefers-reduced-motion: reduce) {
  .appearance-switch * {
    transition: none;
  }
}
