/* Reset, type, focus and utilities. No @keyframes in this file (plan §9: keyframes live in scene.css and cats.css). */

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

html {
  background: var(--sky-top);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-scene) linear;
}

html, body { overscroll-behavior-y: none; }

body {
  margin: 0;
  min-height: 100svh;
  background: transparent;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, figure, fieldset, dl, dd, ul { margin: 0; }
fieldset { padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
ul { padding: 0; list-style: none; }
button, input, output, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; }
svg { display: block; }
canvas { display: block; }
dialog { color: inherit; }
[hidden] { display: none !important; }

/* type scale: display / body / label / meta */
.display { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); line-height: 1.15; }
.label, .row__label, .setting__label, .chip, .segment__option, .btn { font-size: 0.9375rem; }
.meta, .setting__desc, .note, .hint, .mini__time, .facts, .prose__list { font-size: 0.8125rem; }
.section__title { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); }

/* icons from the inline sprite */
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* focus: double ring, 3 px --focus plus 2 px --focus-inner */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-inner); }
.chip:has(input:focus-visible), .segment__option:has(input:focus-visible), .option:has(input:focus-visible) {
  outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-inner);
}

/* skip link: visible only while focused */
.skip { position: fixed; top: 8px; left: 8px; z-index: 8; padding: 10px 16px; border-radius: 12px; background: var(--surface-opaque); color: var(--text); text-decoration: none; transform: translateY(-200%); }
.skip:focus-visible { transform: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.link { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 8px; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 0.2em; }
noscript { position: fixed; inset: auto 16px 16px; z-index: 9; padding: 16px; border-radius: var(--radius); background: var(--surface-opaque); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (forced-colors: active) {
  .icon { forced-color-adjust: auto; }
  :focus-visible { outline-color: Highlight; }
}
