/* Global CSS rules to standardize default HTML element behavior */

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

html, body {
    margin: 0;
    padding: 0;
}

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

/* Prevents a fast tap-tap on a button from being read as a double-tap-to-zoom gesture on mobile. */
button {
    touch-action: manipulation;
}

button:focus-visible, input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

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

a:hover {
    text-decoration: underline;
}

p {
    margin: 0 0 1rem 0;
}

::selection {
    background-color: var(--accent);
    color: var(--accent-contrast);
}

/* scrollbar (Firefox) */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-deep);
}

/* scrollbar (webkit) -- thumb picks up the same warm/cool accent pairing as the chapter
   background washes and the title underlines, rather than a plain neutral grey */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent), var(--accent-warm));
    border-radius: 10px;
    border: 3px solid var(--bg-deep);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-strong), var(--accent-warm));
}
