/**
 * DeutschGuide — Base Styles
 * Setups reset, modern typography, custom scrollbars, selections, and transition foundations.
 */

/* ─── Modern CSS Reset ────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-app);
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ─── Typography Setup ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: var(--space-2);
}

h1 { font-size: var(--text-4xl); font-weight: var(--font-extrabold); letter-spacing: 0; }
h2 { font-size: var(--text-3xl); letter-spacing: 0; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

/* ─── Scrollbars ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-app);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ─── Selections ──────────────────────────────────────────────────────────── */
::selection {
    background-color: var(--primary-light);
    color: #FFFFFF;
}

/* ─── Focus States for Accessibility ──────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 4px;
}

/* ─── Images ──────────────────────────────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ─── Buttons Reset ───────────────────────────────────────────────────────── */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}
button {
    cursor: pointer;
    border: none;
    background: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
