@layer reset, page, shell;

@layer reset {
    :root {
        color-scheme: light;
        font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body {
        min-height: 100vh;
        margin: 0;
        display: flex;
        flex-direction: column;
        background: var(--shell-paper);
    }
    a { color: inherit; }
    .page-canvas {
        flex: 1;
        min-height: 100vh;
    }
}

@layer shell {
    :root {
        --shell-ink: #151515;
        --shell-paper: #f4f1e9;
        --shell-muted: #68665f;
        --shell-accent: #e95b35;
        --shell-dark: #1d2421;
        --shell-light: #fffdf7;
    }

    .site-header {
        --header-surface-opacity: 1;
        position: fixed;
        z-index: 100;
        top: 1rem;
        left: 50%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: min(calc(100% - 2rem), 1240px);
        min-height: 5.75rem;
        padding: 1.25rem 1.75rem;
        transform: translateX(-50%);
        background: rgb(244 241 233 / var(--header-surface-opacity));
        color: var(--shell-ink);
        border: 1px solid rgb(21 21 21 / calc(var(--header-surface-opacity) * .1));
        border-radius: 1rem;
        box-shadow: 0 1.25rem 3rem rgb(21 21 21 / calc(var(--header-surface-opacity) * .12));
        will-change: background-color, border-color, box-shadow;
    }

    .site-brand {
        color: inherit;
        font-size: 1.6rem;
        font-weight: 800;
        letter-spacing: -.06em;
        line-height: 1;
        text-decoration: none;
    }

    .site-header .site-brand { font-size: clamp(2rem, 4vw, 2.7rem); }

    .site-brand span { color: var(--shell-accent); }

    .site-navigation {
        display: flex;
        align-items: center;
        gap: 1.75rem;
    }

    .site-navigation a {
        color: inherit;
        font-size: .9rem;
        font-weight: 650;
        text-decoration: none;
    }

    .site-navigation a:hover,
    .site-navigation a:focus-visible { color: var(--shell-accent); }

    .site-navigation .site-access {
        min-height: 2.5rem;
        padding: .5rem .9rem;
        display: inline-flex;
        align-items: center;
        border: 1px solid var(--shell-ink);
    }

    .site-footer {
        width: min(calc(100% - 2rem), 1240px);
        margin: 0 auto;
        padding: 2rem 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
        background: var(--shell-paper);
        color: var(--shell-ink);
        border-top: 1px solid rgba(21, 21, 21, .12);
    }

    .site-footer small { color: var(--shell-muted); }

    @media (max-width: 640px) {
        .site-header {
            top: .75rem;
            width: calc(100% - 1.5rem);
            min-height: 4.75rem;
            padding: 1rem 1.15rem;
            border-radius: .8rem;
        }

        .site-header .site-brand { font-size: 2rem; }
        .site-navigation > a:not(.site-access) { display: none; }

        .site-footer {
            width: calc(100% - 1.5rem);
            padding: 1.5rem 0;
            gap: 1rem;
        }
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
