/* Base: reset, the two type voices, focus, scrollbars and small utilities. Tokens live in tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--ink-0);
  color: var(--star-1);
  font: var(--w-regular) var(--fs-md) / var(--lh-body) var(--font-sans);
  font-variant-numeric: tabular-nums lining-nums;   /* both families default to tabular figures; say so anyway */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; margin: 0; }
button:disabled { cursor: default; }
input, textarea { caret-color: var(--accent); }
::placeholder { color: var(--star-3); opacity: 1; }
::selection { background: var(--accent-wash); color: var(--star-1); }
a { color: var(--accent); text-decoration-color: var(--accent-rule); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hi); }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, canvas { display: block; }
[hidden] { display: none !important; }

/* Themed scrollbars: native ones are grey, which would break red night mode. */
* { scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
:root[data-theme='red'] { color-scheme: dark; }
/* Touch screens draw an overlay scrollbar of their own colour (grey-blue, even in red mode, and scrollbar-color does not
   reach it): in red mode it is hidden. (data-input comes from the device check: emulators and some tablets do not
   report a coarse pointer.) */
:root[data-theme='red'][data-input='touch'] * { scrollbar-width: none; }
:root[data-theme='red'][data-input='touch'] ::-webkit-scrollbar { display: none; }
@media (pointer: coarse) { :root[data-theme='red'] * { scrollbar-width: none; } :root[data-theme='red'] ::-webkit-scrollbar { display: none; } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }

/* Focus: a brass ring with a dark collar, visible over the brightest daytime sky. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 5px rgb(0 0 0 / 0.55); border-radius: var(--r-sm); }

/* ---------------------------------------------------------------- type roles */
.t-display { font: var(--w-regular) var(--fs-2xl) / var(--lh-tight) var(--font-serif); letter-spacing: -0.005em; color: var(--star-1); }
.t-title { font: var(--w-regular) var(--fs-xl) / var(--lh-snug) var(--font-serif); color: var(--star-1); }
.t-atlas {   /* letter-spaced roman capitals: constellation voice, mode names, plate captions */
  font-family: var(--font-serif); font-weight: var(--w-regular); text-transform: uppercase;
  letter-spacing: var(--track-atlas); font-feature-settings: 'case' 1;
}
.t-italic { font-family: var(--font-serif); font-style: italic; }
.t-eyebrow { font: var(--w-strong) var(--fs-2xs) / 1.2 var(--font-sans); letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--star-3); font-feature-settings: 'case' 1; }
.t-caption { font: italic var(--w-regular) var(--fs-lg) / var(--lh-snug) var(--font-serif); color: var(--star-1); }
.t-num { font-variant-numeric: tabular-nums lining-nums; }
.t-prop { font-variant-numeric: proportional-nums; }
.t-dim { color: var(--star-2); }
.t-faint { color: var(--star-3); }
.t-small { font-size: var(--fs-sm); }
.t-xs { font-size: var(--fs-xs); }
/* Spaced capitals are a Latin (and Greek and Cyrillic) voice. Arabic, Persian and Urdu letters join, and Safari breaks
   the joining under any letter-spacing; Hebrew is not tracked; Devanagari and the other Indic scripts hang from a
   headline that tracking cuts into pieces; Thai, Tibetan and Myanmar stack clusters; Chinese, Japanese and Korean sit
   on their own square grid. In these languages the atlas, eyebrow, tag and dock voices keep their face, size and
   colour and lose only the tracking and the forced capitals (which these scripts do not have). By the element's own
   language, so a name marked lang="hi" in a Latin interface is spared too. (The sky's labels decide the same per name,
   by script: sky/render/labels.js.) */
:is(:lang(ar), :lang(fa), :lang(ur), :lang(ps), :lang(ckb), :lang(sd), :lang(ug), :lang(he), :lang(yi), :lang(hi), :lang(mr), :lang(ne), :lang(sa),
  :lang(bn), :lang(as), :lang(pa), :lang(gu), :lang(or), :lang(ta), :lang(te), :lang(kn), :lang(ml), :lang(si), :lang(th), :lang(lo), :lang(my),
  :lang(km), :lang(bo), :lang(dv), :lang(ja), :lang(zh), :lang(ko)) { letter-spacing: normal !important; text-transform: none !important; }

/* ---------------------------------------------------------------- utilities */
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; inset-block-start: calc(var(--safe-t) + 8px); inset-inline-start: 8px; z-index: 100; padding: 10px 14px; background: var(--smoke-3); color: var(--star-1); border: 1px solid var(--accent-rule); border-radius: var(--r-sm); transform: translateY(calc(-100% - var(--safe-t) - 12px)); }
.skip-link:focus { transform: none; }
.icon { width: 1.25rem; height: 1.25rem; flex: none; stroke-width: 1.25; }
.icon.sm { width: 1rem; height: 1rem; }
.icon.lg { width: 1.5rem; height: 1.5rem; }
[dir='rtl'] .icon.flip-rtl { transform: scaleX(-1); }
kbd { font: var(--w-medium) var(--fs-2xs) / 1 var(--font-sans); color: var(--star-2); border: 1px solid var(--rule-2); border-bottom-width: 2px; border-radius: var(--r-xs); padding: 2px 5px; min-width: 1.4em; text-align: center; display: inline-block; white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
