@view-transition {
    navigation: auto;
}

@layer base {
    :root {
        --color-bg: #121212;
        --color-bg-elevated: #0e0e0e;
        --color-surface: #1e1e1e;
        --color-text: #e0e0e0;
        --color-text-strong: #ffffff;
        --color-text-muted: #888888;
        --color-accent: #FFD5C4;
        --color-border: #333333;
        --font-size-xs: 0.75rem;
        --font-size-sm: 0.875rem;
        --font-size-base: 1rem;
        --font-size-lg: 1.125rem;
        --font-size-xl: 1.25rem;
        --font-size-2xl: 1.5rem;
        --font-size-4xl: 2.25rem;
        --max-width: 960px;

        color-scheme: dark;
    }

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

    html {
        font-size: 16px;
        background-color: var(--color-bg);
        scrollbar-gutter: stable;
        overflow-x: hidden;
    }

    body {
        font-family: sans-serif;
        font-size: var(--font-size-base);
        line-height: 1.7;
        overflow-wrap: anywhere;
        word-break: normal;
        line-break: strict;
        font-kerning: none;
        color: var(--color-text);
        margin: 0;
        padding: 0;
        min-width: 0;
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: var(--color-accent);
        line-height: 1.25;
        font-kerning: normal;
        font-feature-settings: "palt";
        word-break: auto-phrase;
        text-wrap: pretty;
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

    h1 {
        color: var(--color-text-strong);
        font-size: var(--font-size-4xl);
        margin-bottom: 2rem;
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }

    h4 {
        font-size: var(--font-size-lg);
    }

    h5 {
        font-size: var(--font-size-base);
    }

    h6 {
        font-size: var(--font-size-sm);
    }

    a {
        color: var(--color-text-strong);
        text-decoration: underline;
        transition: opacity 0.2s ease;

        &:hover,
        &:active {
            opacity: 0.8;
        }
    }

    p {
        margin: 1rem 0;
    }

    code {
        color: var(--color-accent);
        background-color: var(--color-surface);
        padding: 0.2em 0.4em;
        border-radius: 3px;
        font-size: 0.9em;
    }

    pre {
        background-color: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        padding: 1rem;
        overflow-x: auto;
    }

    pre code {
        background: none;
        padding: 0;
        color: inherit;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        margin: 1rem 0;
    }

    th,
    td {
        padding: 0.75rem;
        text-align: left;
        border-bottom: 1px solid var(--color-border);
    }

    th {
        color: var(--color-text-strong);
        font-weight: bold;
    }

    ::view-transition-group(root) {
        background-color: var(--color-bg);
    }
}
