/* Base: reset, type, focus, text helpers, layout utilities, motion.
 *
 * Source of truth: docs/superpowers/specs/mockups/2026-11-16-ui-overhaul.html.
 * Every value comes from tokens.css. Element defaults sit at zero
 * specificity so a class on the element wins.
 */

/* Inter stands in for San Francisco where the system has none. A browser
 * fetches a web font only when it draws with it, so Apple devices never do. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/InterVariable.woff2") format("woff2");
}

/* ============================================================ preflight === */

*, *::before, *::after { box-sizing: border-box; }
:where(h1, h2, h3, h4, h5, h6, p, dl, dd, blockquote, figure, hr) { margin: 0; }
:where(h1, h2, h3, h4, h5, h6) { font-size: inherit; font-weight: inherit; }
:where(ol, ul, menu) { list-style: none; margin: 0; padding: 0; }
:where(img, svg, video, canvas) { display: block; max-width: 100%; }
:where(img, video) { height: auto; }
:where(button, input, select, optgroup, textarea) { font: inherit; color: inherit; margin: 0; }
:where(button, [role="button"]) { cursor: pointer; }
:where(table) { border-collapse: collapse; text-indent: 0; border-color: inherit; }
:where(a) { color: inherit; text-decoration: inherit; }
:where(fieldset) { margin: 0; padding: 0; border: 0; min-width: 0; }
:where(legend) { padding: 0; }
a, summary, button, label { -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--paper); color: var(--ink);
  font: var(--fs-md)/var(--lh) var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--paper); }

/* ========================================================= a11y helpers === */

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  padding: var(--sp-2) var(--sp-3);
  background: var(--paper); color: var(--ink);
  font: 600 var(--fs-md)/1 var(--sans); border: 2px solid var(--ink); border-radius: 0 0 var(--r) 0;
}
/* it sits in the window's corner, so its ring is drawn inside it */
.skip:focus { left: 0; outline-offset: -4px; }

/* One ring on every surface. A text field draws its own: border plus a 3px shadow. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

/* ========================================================= text helpers === */

.muted, .dim { color: var(--sub); }
.pos { color: var(--up); }   /* legacy sign colour, not a position */
.neg { color: var(--down); }
.up { color: var(--up); font-weight: 600; }
.dn { color: var(--down); font-weight: 600; }
.hot { color: var(--hot); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.cond { font-family: var(--sans); }

/* A link in running text is underlined; one in a table or menu underlines
 * under the pointer (tables.css, shell.css). */
.link, .link-accent {
  color: var(--ink); text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.link:hover, .link-accent:hover { color: var(--ink-hover); text-decoration-thickness: 2px; }
.link.dim { color: var(--sub); }

.note { font-size: var(--fs-sm); line-height: 1.55; color: var(--sub); }
.eyebrow, .card-title { font: 500 var(--fs-sm)/1.3 var(--sans); color: var(--sub); }
.count, .section-title .count {
  font: 400 var(--fs-sm)/1 var(--sans); letter-spacing: 0;
  color: var(--sub); font-variant-numeric: tabular-nums;
}
.page-title { font: 600 var(--fs-3xl)/1.08 var(--sans); letter-spacing: var(--tight); color: var(--ink); }
.page-sub { color: var(--sub); font-size: var(--fs-md); }
.req { color: var(--down); }

/* ============================================================ utilities ===
 * The layout utilities the templates use, on a 0.25rem spacing scale. */

.flex { display: flex; }
.grid { display: grid; }
.inline-block { display: inline-block; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-none { flex: none; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-x-6 { column-gap: 1.5rem; }
.gap-y-3 { row-gap: .75rem; }

.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: .75rem; }
.ml-1 { margin-left: .25rem; }
.ml-2 { margin-left: .5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: .75rem; }

.w-12 { width: 3rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-32 { width: 8rem; }
.w-40 { width: 10rem; }
.w-48 { width: 12rem; }
.w-56 { width: 14rem; }
.h-12 { height: 3rem; }
.min-h-dvh { min-height: 100vh; min-height: 100dvh; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }

.text-xs { font-size: .75rem; line-height: 1rem; }
.text-sm { font-size: .875rem; line-height: 1.25rem; }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:col-span-3 { grid-column: span 3 / span 3; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ================================================================ motion === */

a, button, summary { transition: color 160ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease); }

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