/* ============================================
   BASE — Reset, Typography, Global Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
    transition:
        background-color var(--transition-smooth),
        color var(--transition-smooth);
}

/* Prevent scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    transition: color var(--transition-smooth);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}

h3 {
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
}

h4 {
    font-size: 1.125rem;
    font-weight: 600;
}

h5 {
    font-size: 1rem;
    font-weight: 600;
}

p {
    color: var(--text-secondary);
    line-height: 1.7;
    transition: color var(--transition-smooth);
}

a {
    color: var(--purple-vivid);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--purple-glow);
}

a:focus-visible {
    outline: 2px solid var(--purple-glow);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: var(--font-body);
    cursor: pointer;
    border: none;
    background: none;
    font-size: inherit;
}

button:focus-visible {
    outline: 2px solid var(--purple-glow);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* --- Utility: Screen Reader Only --- */
.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;
}

/* --- Selection Color --- */
::selection {
    background-color: var(--purple-glow);
    color: var(--text-on-purple);
}

/* --- Scrollbar (Webkit) --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--purple-vivid);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-deep);
}

/* --- Code/Mono text --- */
code,
.mono {
    font-family: var(--font-mono);
    font-size: 0.875em;
}