:root {
  color-scheme: dark;
  --shell-bg: #0c0e0f;
  --panel-bg: rgba(14, 16, 17, 0.94);
  --panel-raised: #181a1b;
  --text: #f0ede5;
  --muted: #9e9a91;
  --faint: #6f6d67;
  --line: rgba(240, 237, 229, 0.14);
  --line-strong: rgba(240, 237, 229, 0.26);
  --accent: #d0a15d;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--shell-bg);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

.comparison-stage,
.artwork-frame {
  width: 100%;
  height: 100%;
}

.comparison-stage {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 12%, rgba(208, 161, 93, 0.08), transparent 34%),
    var(--shell-bg);
}

.artwork-frame {
  display: block;
  border: 0;
  background: var(--shell-bg);
}

.loading-screen {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-content: center;
  gap: 14px;
  color: var(--muted);
  background: var(--shell-bg);
  opacity: 1;
  visibility: visible;
  transition: opacity 240ms ease;
}

.loading-screen[data-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen p {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.loading-rule {
  width: 100%;
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.loading-rule::after {
  content: "";
  display: block;
  width: 42%;
  height: 1px;
  background: var(--accent);
  animation: loading-scan 1.1s ease-in-out infinite alternate;
}

.model-switcher {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 10;
  width: 0;
  height: 0;
  color: var(--text);
}

.model-switcher[data-side="left"] {
  right: auto;
  left: 0;
}

.switcher-toggle {
  position: absolute;
  top: 0;
  right: -28px;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(240, 237, 229, 0.11), transparent 34%),
    rgba(13, 15, 16, 0.91);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translateY(-50%);
  transition:
    right 180ms ease,
    left 180ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.model-switcher[data-side="left"] .switcher-toggle {
  right: auto;
  left: -28px;
}

.model-switcher[data-side="right"] .switcher-toggle:hover,
.model-switcher[data-side="right"] .switcher-toggle:focus-visible,
.model-switcher[data-side="right"][data-open="true"] .switcher-toggle,
.model-switcher[data-side="right"][data-dragging="true"] .switcher-toggle {
  right: 12px;
}

.model-switcher[data-side="left"] .switcher-toggle:hover,
.model-switcher[data-side="left"] .switcher-toggle:focus-visible,
.model-switcher[data-side="left"][data-open="true"] .switcher-toggle,
.model-switcher[data-side="left"][data-dragging="true"] .switcher-toggle {
  left: 12px;
}

.switcher-toggle:hover,
.model-switcher[data-open="true"] .switcher-toggle,
.model-switcher[data-dragging="true"] .switcher-toggle {
  border-color: rgba(208, 161, 93, 0.62);
  background: rgba(20, 22, 23, 0.93);
  box-shadow:
    0 14px 42px rgba(0, 0, 0, 0.42),
    0 0 0 3px rgba(208, 161, 93, 0.08);
}

.switcher-toggle:active,
.model-switcher[data-dragging="true"] .switcher-toggle {
  cursor: grabbing;
}

.orb-count {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 9px;
  letter-spacing: 0.12em;
  transform: translateX(1px);
}

.orb-mark {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(240, 237, 229, 0.16);
  border-radius: 50%;
  transition:
    border-color 160ms ease,
    transform 180ms ease;
}

.orb-mark::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(208, 161, 93, 0.1);
  transform: translateX(-50%);
}

.model-switcher[data-open="true"] .orb-mark {
  border-color: rgba(208, 161, 93, 0.5);
  transform: rotate(90deg);
}

.panel-header,
.model-number,
.model-interface {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.switcher-panel {
  position: fixed;
  top: 12px;
  right: 80px;
  z-index: 11;
  width: min(356px, calc(100vw - 96px));
  max-height: calc(100vh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--panel-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px) scale(0.985);
  transform-origin: center right;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.model-switcher[data-side="left"] .switcher-panel {
  right: auto;
  left: 80px;
  transform: translateX(-8px) scale(0.985);
  transform-origin: center left;
}

.model-switcher[data-open="true"] .switcher-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
}

.panel-header p,
.panel-footer p {
  margin: 0;
}

.model-list {
  display: grid;
  padding: 5px;
}

.model-option {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 8px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 11px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 1px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 150ms ease,
    background-color 150ms ease;
}

.model-option:hover {
  background: rgba(240, 237, 229, 0.055);
}

.model-option[aria-current="true"] {
  border-left-color: var(--accent);
  background: rgba(208, 161, 93, 0.075);
}

.model-number {
  align-self: start;
  padding-top: 4px;
  color: var(--faint);
  font-size: 9px;
}

.model-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.model-name {
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-interface {
  color: var(--muted);
  font-size: 8px;
}

.model-indicator {
  width: 5px;
  height: 5px;
  border: 1px solid var(--faint);
  border-radius: 50%;
}

.model-option[aria-current="true"] .model-indicator {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(208, 161, 93, 0.12);
}

.panel-footer {
  display: grid;
  gap: 13px;
  padding: 14px 16px 15px;
  border-top: 1px solid var(--line);
}

.panel-footer p {
  color: var(--faint);
  font-size: 9px;
  line-height: 1.5;
}

.panel-actions {
  display: flex;
  gap: 18px;
}

.panel-actions a {
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
  text-underline-offset: 4px;
}

.panel-actions a:hover {
  color: var(--text);
  text-decoration: underline;
}

.switcher-toggle:focus-visible,
.model-option:focus-visible,
.panel-actions a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.noscript-message {
  position: fixed;
  inset: auto 18px 18px;
  z-index: 20;
  padding: 12px 14px;
  color: var(--text);
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  font-size: 11px;
}

@keyframes loading-scan {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(138%);
  }
}

@media (max-width: 767px) {
  .model-option {
    grid-template-columns: 24px minmax(0, 1fr) 8px;
    gap: 10px;
  }

  .panel-actions {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
