/* Reset, typography, focus, utilities. */

*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  font-family: var(--font-sans);
  tab-size: 4;
}

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: 600; }
code, pre { font-family: var(--font-mono); font-size: 0.9em; }
img, svg, canvas, video { display: block; max-width: 100%; }
table { border-collapse: collapse; border-color: inherit; text-indent: 0; }
summary { display: list-item; }

button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
  opacity: 1;
}

button { cursor: pointer; text-align: inherit; }
button:disabled { cursor: not-allowed; }
/* Text boxes grow with what's written (scripts do it where field-sizing isn't supported), never by hand. */
textarea { resize: none; field-sizing: content; overflow-wrap: anywhere; }
::placeholder { color: var(--muted); opacity: 1; }
[hidden]:not([hidden='until-found']) { display: none !important; }

::selection { background: color-mix(in oklab, var(--s1) 28%, transparent); }

/* One consistent, visible focus ring for every interactive element. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }
/* A heading that a script moves focus to (a new puzzle, the end of a set) is a reading
   position, like `main` after "Skip to content": no ring. */
:is(h1, h2)[tabindex='-1']:focus { outline: none; }

/* ─── Utilities ─────────────────────────────────────────────────────────── */

.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;
}

.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.is-muted { color: var(--muted); }
.is-strong { font-weight: 600; }
.grow { flex: 1; }

.icon { flex-shrink: 0; }
.spinner { flex-shrink: 0; animation: bt-spin 0.9s linear infinite; }
.breathe { animation: bt-breathe 1.8s ease-in-out infinite; }
.draw { stroke-dasharray: var(--bt-draw-length, 48); animation: bt-draw 520ms 120ms cubic-bezier(0.4, 0, 0.2, 1) both; }

.link-strong { font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.link-quiet { font-weight: 500; color: var(--ink-2); }
.link-quiet:hover { color: var(--ink); text-decoration: underline; }

/* Loading placeholder shapes. */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in oklab, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: bt-shimmer 1.6s linear infinite;
  border-radius: 0.375rem;
}

.sk-col { display: flex; flex-direction: column; gap: 0.375rem; }
.sk-line { height: 1rem; }
.sk-thin { height: 0.75rem; }
.sk-tall { height: 1.5rem; }
.sk-body { height: 1.25rem; margin-top: 0.5rem; }
.sk-avatar { height: 2.5rem; width: 2.5rem; flex-shrink: 0; border-radius: 9999px; }
.sk-avatar-xl { height: 5rem; width: 5rem; }
.sk-round { height: 2.75rem; width: 2.75rem; border-radius: 9999px; }
.sk-option { height: 2.5rem; width: 100%; border-radius: 0.75rem; }
.sk-options { margin-top: 1rem; gap: 0.5rem; }
.sk-w-20 { width: 5rem; } .sk-w-24 { width: 6rem; } .sk-w-28 { width: 7rem; } .sk-w-32 { width: 8rem; }
.sk-w-48 { width: 12rem; } .sk-w-64 { width: 16rem; }
.sk-w-1-3 { width: 33.333%; } .sk-w-1-2 { width: 50%; } .sk-w-2-3 { width: 66.667%; }
.sk-w-3-4 { width: 75%; } .sk-w-11-12 { width: 91.667%; }
.sk-tabs { height: 2.5rem; width: 100%; border-radius: 0.75rem; }
.sk-chart, .sk-panel { height: 20rem; width: 100%; border-radius: 1rem; }
.sk-split { height: 20rem; width: 100%; border-radius: 1rem; }
.sk-tile { height: 7rem; border-radius: 1rem; }
.sk-stem { aspect-ratio: 16 / 9; width: 100%; border-radius: 1rem; }
.sk-option-card { aspect-ratio: 4 / 3; width: 100%; border-radius: 1rem; }

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

@media (forced-colors: active) {
  .chart-mark { forced-color-adjust: none; }
}
