/* =====================================================================
 * base.css — Reset, Typo-Defaults, globale Inheritance
 * ===================================================================== */

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

html {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: var(--line-height-normal);
    color-scheme: dark light;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Verhindert horizontalen Body-Scroll bei Drawer-Animationen */
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-regular);
    /* Subtiler Hintergrund-Verlauf für Tiefe (Linear-Look) */
    background-image:
        radial-gradient(
            ellipse at top,
            hsl(var(--hsl-accent-500) / 0.06) 0%,
            transparent 60%
        );
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text);
}

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

p {
    line-height: var(--line-height-normal);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--color-accent-hover);
}

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

button {
    cursor: pointer;
    background: transparent;
    border: 0;
}

input,
textarea {
    background: transparent;
    border: 0;
    outline: none;
}

ul, ol {
    list-style: none;
}

img, svg {
    display: block;
    max-width: 100%;
}

/* Globaler Focus-Ring — Keyboard-Accessibility */
:focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus);
    border-radius: var(--radius-sm);
}

/* Numerische Tabellen-Zellen sollen tabellarisch wirken */
.num,
.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum", "ss01";
}

/* Screen-Reader-only — barrierefreie Labels */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* Selection-Akzent */
::selection {
    background: var(--color-accent-soft);
    color: var(--color-text);
}

/* Scrollbar-Style (WebKit) — diskret, dark-mode-tauglich */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-border-strong);
}
