/* Approved artwork, with matching Rive and SVG fallback timing. */
.theme-switch {
  position: fixed; top: 43px; left: 50%; z-index: 60;
  display: flex; flex: none; width: 44px; height: 44px;
  min-inline-size: 0; margin: 0; padding: 0; border: 0;
  border-radius: 24px; background: var(--paper); color: var(--wine);
  box-shadow: 0 5px 18px var(--palette-shadow); isolation: isolate;
  --theme-duration: 220ms; --theme-ease: cubic-bezier(.22,1,.36,1);
  transition: width var(--theme-duration) var(--theme-ease);
}
.study-controls > .theme-switch { position: relative; top: auto; left: auto; order: 5; }
.theme-corner { position: fixed; top: 43px; right: 61px; z-index: 65; }
.theme-corner > .theme-switch { position: relative; inset: auto; }
.theme-corner .theme-switch label:last-child .theme-tip { left: auto; right: 0; transform: none; }
@media (max-width: 700px) { .theme-corner { top: 28px; right: 28px; } }
.theme-switch[data-expanded="true"] { width: 132px; --theme-duration: 280ms; }
.theme-switch > .theme-switch-art, .theme-switch > canvas { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 132px; height: 44px; pointer-events: none; }
.theme-switch > canvas { opacity: 0; border-radius: 22px; }
.theme-options { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; width: 132px; height: 44px; }
.theme-options[hidden] { display: none !important; }
.theme-options > label { position: relative; display: grid; place-items: center; flex: none; width: 44px; height: 44px; cursor: pointer; }
.theme-trigger { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.theme-trigger:focus-visible { outline: none; }
.theme-switch:has(.theme-trigger:focus-visible) > .theme-trigger-focus { position: absolute; z-index: 3; top: 1px; left: 50%; transform: translateX(-50%); width: 42px; height: 42px; border: 2px solid var(--violet); border-radius: 50%; outline: 2px solid var(--paper); outline-offset: 1px; pointer-events: none; }
.theme-switch input { position: absolute; inset: 0; width: 44px; height: 44px; margin: 0; opacity: 0; cursor: pointer; }
.theme-switch input:focus-visible ~ .theme-focus { position: absolute; inset: 1px; border: 2px solid var(--violet); border-radius: 50%; outline: 2px solid var(--paper); outline-offset: 1px; }
.theme-switch .theme-tip { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); padding: 7px 10px; width: max-content; max-width: 180px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--wine); font: 500 11px/1.4 var(--font-body, Manrope, sans-serif); opacity: 0; pointer-events: none; }
.theme-switch label:hover .theme-tip, .theme-switch input:focus-visible ~ .theme-tip { opacity: 1; }
.theme-switch[data-rive="ready"] > canvas { opacity: 1; }
.theme-switch[data-rive="ready"] > .theme-switch-art { opacity: 0; }
.theme-switch[data-rive="ready"] { width: var(--theme-width, 44px); transition: none; }
.theme-switch[data-expanded="false"] .theme-tip { display: none; }
.appearance-controls > .theme-switch { position: relative; top: auto; left: auto; }
.theme-switch-art .ts-shell { transition: x var(--theme-duration) var(--theme-ease), width var(--theme-duration) var(--theme-ease); }
.theme-switch-art .ts-selection { transition: transform 280ms var(--theme-ease); }
.theme-switch-art .ts-icon { transition: transform var(--theme-duration) var(--theme-ease), opacity 160ms ease, color 180ms ease; }
.theme-switch .theme-tip { transition: opacity 120ms ease; transition-delay: 180ms; }
/* Named project cards retain their navigation morph outside a theme change. */
:root[data-theme-transition="reveal"] .card-face { view-transition-name: none !important; }
:root[data-theme-transition="reveal"] body { transition: none !important; }
:root[data-theme-transition="reveal"]::view-transition { pointer-events: none; }
:root[data-theme-transition="reveal"]::view-transition-group(root),
:root[data-theme-transition="reveal"]::view-transition-old(root),
:root[data-theme-transition="reveal"]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root[data-theme-transition="reveal"]::view-transition-image-pair(root) { isolation: auto; }
@media (prefers-reduced-motion: reduce) {
  .theme-switch, .theme-switch-art .ts-shell, .theme-switch-art .ts-selection,
  .theme-switch-art .ts-icon, .theme-switch .theme-tip { transition: none !important; }
}
@media (min-width: 1101px) and (max-width: 1400px) {
  .study-controls { left: calc(50% - 30px); }
  .study-controls > .palette-lab summary { width: 146px; min-width: 146px; }
  .study-controls > .type-lab summary { width: 100px; min-width: 100px; }
  .study-controls > .foil-lab summary { width: 96px; }
  .study-controls > .card-lab summary { width: 104px; }
  .study-controls .palette-dots, .study-controls .type-symbol, .card-frame-chip { display: none; }
}
@media (min-width: 1401px) and (max-width: 1550px) {
  .study-controls > .palette-lab summary { width: 188px; min-width: 188px; }
  .study-controls > .type-lab summary { width: 136px; min-width: 136px; }
  .study-controls > .foil-lab summary { width: 112px; }
  .study-controls > .card-lab summary { width: 144px; }
  .study-controls .palette-dots, .study-controls .type-symbol, .card-frame-chip { display: none; }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .study-controls { left: 50%; right: auto; transform: translateX(-50%); }
  .study-controls > .palette-lab summary { width: 78px; min-width: 78px; padding-inline: 12px; }
  .study-controls > .type-lab summary { width: 70px; min-width: 70px; padding-inline: 12px; justify-content: center; }
  .study-controls > .foil-lab summary { width: 86px; gap: 6px; }
  .study-controls > .card-lab summary { width: 76px; justify-content: center; }
  .study-controls .palette-mobile-label, .study-controls .type-mobile-label { display: inline; }
  .study-controls #palette-current, .study-controls #type-current, .study-controls .palette-dots, .study-controls .type-symbol, .study-controls .type-chevron, .foil-chevron, #card-current, .card-chevron, .card-frame-chip { display: none; }
}
@media (min-width: 701px) and (max-width: 850px) { .study-controls { top: 132px; } }
@media (min-width: 701px) and (max-width: 1200px) { .masthead > .text-link { display: none; } }
@media (max-width: 700px) {
  .study-controls > .theme-switch { align-self: flex-end; }
  .theme-switch .theme-tip { top: auto; bottom: calc(100% + 10px); }
  .theme-switch label:last-child .theme-tip { left: auto; right: 0; transform: none; }
}
@media (max-width: 420px) { .appearance-controls .palette-lab summary, .appearance-controls .type-lab summary { min-width: 78px; width: 78px; padding-inline: 10px; } }
@media (max-width: 359px) { .appearance-controls { flex-wrap: wrap; max-width: 100%; } }
@media (forced-colors: active) {
  .theme-switch[data-rive="ready"] > canvas { display: none; }
  .theme-switch[data-rive="ready"] > .theme-switch-art { opacity: 1; }
  .theme-switch input:checked ~ .theme-focus { position: absolute; inset: 3px; border: 2px solid Highlight; border-radius: 50%; }
}
