:root {
    color-scheme: light dark;

    --background: #e9e5dc;
    --paper: #faf8f2;
    --ink: #1b1b1b;
    --line: rgba(27, 27, 27, 0.22);
    --shadow: rgba(0, 0, 0, 0.16);

    --background-grain: rgba(20, 20, 20, 0.045);
    --paper-grain: rgba(20, 20, 20, 0.025);

    --card-border: rgba(0, 0, 0, 0.12);
    --card-highlight: rgba(255, 255, 255, 0.7);
    --banner-border: rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 32px 18px;

    display: grid;
    place-items: center;

    color: var(--ink);
    background-color: var(--background);
    background-image:
        radial-gradient(
            circle,
            var(--background-grain) 0.5px,
            transparent 0.65px
        );
    background-size: 4px 4px;

    font-family:
        Inter,
        "Helvetica Neue",
        Helvetica,
        Arial,
        sans-serif;
}

.site-shell {
    position: relative;
    width: min(88vw, 720px);
    padding-top: 78px;
}

.eye-banner {
    position: absolute;
    top: 0;
    left: 50%;
    z-index: 0;

    width: 85%;
    height: 110px;

    background-color: #1d1d1d;
    background-image: url("assets/eye-banner.gif");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;

    border: 1px solid var(--banner-border);

    box-shadow:
        0 10px 22px rgba(0, 0, 0, 0.12);

    transform: translateX(-50%);

    filter: contrast(1.06);
    image-rendering: pixelated;
}

.card {
    position: relative;
    z-index: 1;

    width: 100%;
    min-height: 320px;
    padding: clamp(32px, 5vw, 48px);

    display: flex;
    flex-direction: column;
    justify-content: center;

    background-color: var(--paper);
    background-image:
        radial-gradient(
            circle,
            var(--paper-grain) 0.4px,
            transparent 0.55px
        );
    background-size: 5px 5px;

    border: 1px solid var(--card-border);
    border-radius: 10px;

    box-shadow:
        0 18px 38px var(--shadow),
        0 3px 8px rgba(0, 0, 0, 0.07),
        inset 0 1px 0 var(--card-highlight);
}

h1 {
    margin: 0;

    font-size: clamp(2.25rem, 5.5vw, 3.65rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.055em;
}

.divider {
    width: 100%;
    height: 1px;
    margin: clamp(22px, 4vw, 30px) 0;

    background-image:
        repeating-linear-gradient(
            to right,
            var(--line) 0,
            var(--line) 1px,
            transparent 1px,
            transparent 3px
        );
}

nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-link {
    width: fit-content;

    display: grid;
    grid-template-columns: 28px auto;
    align-items: center;
    column-gap: 14px;

    color: inherit;
    text-decoration: none;

    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 300;
    line-height: 1.2;

    transition: opacity 150ms ease;
}

.card-link:hover {
    opacity: 0.6;
}

.card-link:focus-visible {
    outline: 2px dotted currentColor;
    outline-offset: 6px;
}

.icon {
    display: block;

    width: 24px;
    height: 24px;

    object-fit: contain;
    filter: none;
    image-rendering: pixelated;
}

.link-label {
    position: static;
}

.link-label::after {
    display: none;
}

@media (max-width: 640px) {
    body {
        padding: 22px 14px;
    }

    .site-shell {
        width: min(100%, 520px);
        padding-top: 60px;
    }

    .eye-banner {
        width: 84%;
        height: 92px;
    }

    .card {
        min-height: 0;
        padding: 30px 24px;
    }

    h1 {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .divider {
        margin: 22px 0;
    }

    nav {
        gap: 15px;
    }

    .card-link {
        grid-template-columns: 26px auto;
        column-gap: 12px;
        font-size: 1rem;
    }

    .icon {
        width: 22px;
        height: 22px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --background: #101010;
        --paper: #1b1b1b;
        --ink: #eeeeea;
        --line: rgba(238, 238, 234, 0.22);
        --shadow: rgba(0, 0, 0, 0.48);

        --background-grain: rgba(255, 255, 255, 0.035);
        --paper-grain: rgba(255, 255, 255, 0.022);

        --card-border: rgba(255, 255, 255, 0.1);
        --card-highlight: rgba(255, 255, 255, 0.05);
        --banner-border: rgba(255, 255, 255, 0.08);
    }

    .icon {
        filter: invert(1);
    }

    .eye-banner {
        box-shadow:
            0 10px 22px rgba(0, 0, 0, 0.38);

        filter:
            contrast(1.08)
            brightness(0.92);
    }

    .card {
        box-shadow:
            0 18px 38px var(--shadow),
            0 3px 8px rgba(0, 0, 0, 0.28),
            inset 0 1px 0 var(--card-highlight);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
