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

/* root */
html {
    color-scheme: light dark;
    -webkit-text-size-adjust: 100%;
    
    /*
    https://coolors.co/palette/191716-e6af2e-e0e2db-3d348b
    */
    
    --bg: #e0e2db;
    --text: #191716;
    --accent: #3d348b;
    --structure: #e6af2e;
    
    --content-width: 100%;
    --content-padding: 1rem;
    
    --nav-direction: column;
    --nav-gap: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    html {
        --bg: #191716;
        --text: #e0e2db;
        --accent: #e6af2e;
        --structure: #3d348b;
    }
}

@media (min-width: 768px) {
    html {
        --content-width: 720px;
        --content-padding: 2rem;
        
        --nav-direction: row;
        --nav-gap: 2rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: clamp(15px 1.6vw, 18px);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

h1 {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
}
h2 {
    font-size: clamp(1.4rem, 3vw, 2.4rem);
}
p, li, blockquote {
    max-width: 65ch;
}

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

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

input, button, textarea, select {
    font: inherit;
    color: inherit;
}
button, [type="button"], [type="reset"], [type="submit"] {
    -webkit-appearance: button;
}

:focus-visible {
    outline: 2px solid var(--interactive);
    outline-offset: 2px;
}

.content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--content-padding);
}

nav {
    display: flex;
    flex-direction: var(--nav-direction);
    gap: var(--nav-gap);
}

section {
    padding: clamp(2rem, 3vw, 4rem) 0;
}

p {
    margin-bottom: 1em;
}

ul, ol {
    padding-left: 1em;
    margin-bottom: 1em;
}

#animation-canvas {
    position: fixed;
    bottom: 0;
    left: 0;
    image-rendering: pixelated;
}

#high-score {
    position: fixed;
    top: 0;
    right: 0;
    color: var(--accent);
}
