:root {
    /* Global Variables */
    --font-family-heading: "Commit Mono", monospace;
    --font-family-body: "Commit Mono", monospace;

    /* Light Mode */
    --color-background: #f5f5f5;
    --color-foreground: #212123;
    --color-interactive: #0f2b99;
    --color-interactive-hover: #0f2b99;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0a0700;
        --color-foreground: #d8d2c6;
        --color-interactive: #ffb000;
        --color-interactive-hover: #ffcc00;
    }

    img,
    video {
        opacity: 0.8;
    }
}

@font-face {
    font-family: "Commit Mono";
    src: url("CommitMono.woff2") format("woff2-variations");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Skip link to be invisible for sighted visitors */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: -1;
}

/* When skip link is focused, make visible again. */
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    z-index: 1;
}

html,
body {
    font-family: var(--font-family-body);
    scroll-behavior: smooth;
    background-color: var(--color-background);
    color: var(--color-foreground);
    font-size: 1rem;
    line-height: 1.5;
    display: grid;
    place-content: center;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    letter-spacing: 0.01em;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    &::after {
        content: "█";
        padding-left: 4px;
        animation: blink 1s infinite;
    }
}

h2 {
    font-size: 2rem;
    line-height: 1.1;
}

h3 {
    font-size: 1.5rem;
    line-height: 1.1;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    max-width: 75ch;
    hyphens: auto;
    word-break: break-word;
    overflow-wrap: break-word;
}

a,
a:visited {
    color: var(--color-interactive);
    text-decoration-skip-ink: auto;
    text-underline-offset: 0.2em;

    &:hover,
    &:focus,
    &:active {
        color: var(--color-background);
        background: var(--color-interactive-hover);
        text-decoration: none;
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }
}

::selection {
    background-color: var(--color-interactive);
    color: var(--color-background);
}

/* Blink Animation */
@keyframes blink {
    0%,
    50% {
        opacity: 1;
    }
    51%,
    100% {
        opacity: 0;
    }
}

/* Navigation - BIOS/DOS/Terminal Style */
nav {
    padding: 0;
    margin: 0;
    letter-spacing: 0.1em;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav a {
    display: block;
    padding: 0.5rem 1rem;
    transition: none;
    border: none;
    outline: none;
}

/* Enable horizontal scrolling on pre elements if content overflows */
pre {
    overflow: auto;
}
