/*
 * GameTecX base layer (WP9, D-0021 (2); UI-Design-Principles Sec. 4/9).
 *
 * Reset, box-sizing, body ground, element defaults, the type scale, links, the
 * focus ring (Sec. 9) and the reduced-motion guard (Sec. 8). Loaded AFTER
 * tokens.css and BEFORE components/*. Only tokens are used — no raw hex.
 */

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

* {
    margin: 0;
}

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

body {
    min-height: 100vh;
    background: var(--gtx-bg);
    color: var(--gtx-text);
    font-family: var(--gtx-font-body);
    font-size: var(--gtx-fs-body);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Density: the management surface is compact (Sec. 5.3). */
[data-density="compact"] {
    font-size: var(--gtx-fs-ui);
}

h1,
h2,
h3,
h4 {
    font-family: var(--gtx-font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gtx-text);
}

h1 { font-size: var(--gtx-fs-h1); }
h2 { font-size: var(--gtx-fs-h2); }
h3 { font-size: var(--gtx-fs-h3); }

p {
    line-height: 1.5;
}

small {
    font-size: var(--gtx-fs-meta);
}

a {
    color: var(--gtx-accent-text);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Technical identifiers, ports, hashes, code — always mono (Sec. 4). */
code,
kbd,
samp,
pre,
.gtx-mono {
    font-family: var(--gtx-font-mono);
    font-size: 0.9em;
}

/* Tabular numerals for numbers in tables/monitoring (Sec. 4). */
.gtx-num,
[data-num] {
    font-variant-numeric: tabular-nums;
}

img,
svg {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

hr {
    border: 0;
    border-top: 1px solid var(--gtx-line);
}

/* Visible focus ring on every interactive element (Sec. 9). */
:focus-visible {
    outline: var(--gtx-focus-width) solid var(--gtx-focus);
    outline-offset: var(--gtx-focus-offset);
    border-radius: var(--gtx-r-s);
}

/* Remove the default focus outline only where :focus-visible takes over. */
:focus:not(:focus-visible) {
    outline: none;
}

/* The console/log surface is dark in BOTH themes (Sec. 6). */
.gtx-logsurface {
    background: var(--gtx-log-bg);
    color: var(--gtx-log-text);
    font-family: var(--gtx-font-mono);
    border-radius: var(--gtx-r-s);
}

/* Motion is feedback only; honour the user's reduced-motion preference (Sec. 8). */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
