/* ==========================================================================
   Phoenix Core prototypes — base layer
   Reset + primitives shared by every prototype. No component styles here.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--type-body-md);
  line-height: 1.45;
  color: var(--content-default);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

a { color: var(--bg-info-emphasis); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Switch -------------------------------------------------------------
   Used by preference rows and filter toggles. */
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.switch input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; opacity: 0; cursor: pointer;
}
.switch .track {
  position: absolute; inset: 0; border-radius: var(--radius-pill);
  background: var(--border-strong); transition: background .15s;
}
.switch .thumb {
  position: absolute; top: 3px; left: 3px; width: 17px; height: 17px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s;
}
.switch input:checked ~ .track { background: var(--bg-info-emphasis); }
.switch input:checked ~ .thumb { transform: translateX(17px); }
.switch input:focus-visible ~ .track { box-shadow: var(--focus-ring); }

.switch--sm { width: 34px; height: 20px; }
.switch--sm .thumb { width: 14px; height: 14px; }
.switch--sm input:checked ~ .thumb { transform: translateX(14px); }

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