/*
 * Base styles: the font, a small reset, typography, focus handling, page layout and utilities.
 * Everything references tokens.css; no literal colours or sizes here. The rules follow
 * Dataspatium's base.css (same type scale, focus ring, scrollbars and utilities) so that the
 * server's pages and the app read as one product, as agreed with Dataspatium.
 */

/* Inter, the same three weights Dataspatium ships, self-hosted (SIL Open Font License, fonts/LICENSE). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2"); }

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--dm-bg);
  color: var(--dm-text);
  font-family: var(--dm-font-sans);
  font-size: var(--dm-text-md);
  line-height: var(--dm-leading);
  font-feature-settings: "cv05", "ss01";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 var(--dm-s-3); font-weight: var(--dm-weight-semibold); line-height: 1.25; }
h1 { font-size: var(--dm-text-xl); }
h2 { font-size: var(--dm-text-lg); }
h3 { font-size: var(--dm-text-md); }
h4 { font-size: var(--dm-text-sm); color: var(--dm-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0 0 var(--dm-s-3); }
p:last-child { margin-bottom: 0; }
a { color: var(--dm-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Links inside running text stay underlined (WCAG 1.4.1: not by colour alone); navigation and buttons do not. */
p a, li a, td a, dd a, .card__lead a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
code, kbd, pre { font-family: var(--dm-font-mono); font-size: 0.9em; }
code { padding: 0 0.3em; border-radius: var(--dm-radius-sm); background: var(--dm-surface-2); }
code:empty { display: none; }
pre { margin: 0; white-space: pre-wrap; }
small { font-size: var(--dm-text-sm); }
hr { border: 0; border-top: 1px solid var(--dm-border); margin: var(--dm-s-3) 0; }
ul, ol { margin: 0 0 var(--dm-s-3); padding-left: 1.25rem; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--dm-focus); outline-offset: 2px; border-radius: var(--dm-radius-sm); }
::selection { background: var(--dm-selection); }

/* Scrollbars: thin and quiet */
* { scrollbar-width: thin; scrollbar-color: var(--dm-border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--dm-border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* Page frame: the top bar, the content column and the status line at the bottom */
.skip-link { position: absolute; left: var(--dm-s-3); top: -3rem; padding: var(--dm-s-2) var(--dm-s-3); background: var(--dm-surface); border: 1px solid var(--dm-border); border-radius: var(--dm-radius-sm); font-size: var(--dm-text-sm); }
.skip-link:focus { top: var(--dm-s-3); z-index: 10; }

.site-header { background: var(--dm-surface); border-bottom: 1px solid var(--dm-border); }
.site-header__inner { max-width: 72rem; min-height: var(--dm-topbar-h); margin: 0 auto; padding: 0 var(--dm-s-4); display: flex; align-items: center; gap: var(--dm-s-5); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: var(--dm-s-2); color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 22px; height: 22px; }
.brand__name { font-weight: var(--dm-weight-semibold); }
.brand__host { color: var(--dm-text-muted); font-size: var(--dm-text-sm); }

.site-main { flex: 1; width: 100%; max-width: 72rem; margin: 0 auto; padding: var(--dm-s-6) var(--dm-s-4); }
.page--narrow .site-main { max-width: 32rem; }

.site-footer { min-height: var(--dm-statusbar-h); border-top: 1px solid var(--dm-border); background: var(--dm-surface); color: var(--dm-text-muted); font-size: var(--dm-text-xs); display: flex; align-items: center; gap: var(--dm-s-4); justify-content: center; padding: var(--dm-s-1) var(--dm-s-4); }

/* Utilities, named as in Dataspatium's base.css where the same thing exists */
.muted { color: var(--dm-text-muted); }
.faint { color: var(--dm-text-faint); }
.small { font-size: var(--dm-text-sm); }
.stack > * + * { margin-top: var(--dm-s-3); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--dm-s-2); align-items: center; }
.facts { display: grid; grid-template-columns: minmax(96px, max-content) 1fr; gap: var(--dm-s-1) var(--dm-s-3); margin: 0 0 var(--dm-s-4); font-size: var(--dm-text-sm); }
.facts dt { color: var(--dm-text-muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { white-space: pre-wrap; word-break: break-word; }

/* Dataspatium's narrow breakpoint: panels become sheets there; here the page simply tightens. */
@media (max-width: 760px) {
  .site-main { padding: var(--dm-s-4); }
  .facts { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
