@font-face {
    font-family: 'Spot Mono';
    src: url('./fonts/SpaceMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Spot Mono';
    src: url('./fonts/SpaceMono-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Spot Mono';
    src: url('./fonts/SpaceMono-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

:root {
    --font-serif: "Spot Mono", ui-serif, Georgia, "Times New Roman", serif;
    --text-main: #1C1C1C;
    --bg-base: rgb(249, 247, 245);
    --glow-1: rgb(234, 217, 199);
    --glow-2: rgb(202, 188, 174);
    --link-main: #B45309;
    --link-visited: #78350F;
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-main: #EBE6DF;
        --bg-base: #0B1120;
        --glow-1: rgba(31, 62, 145, 0.15);
        --glow-2: rgba(35, 71, 173, 0.16);
        --link-main: #7DD3FC;
        --link-visited: #60889E;
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

html {
    background-color: var(--bg-base);
}

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(circle at 120% 65%, var(--glow-1), transparent 50%),
        radial-gradient(circle at -20% 35%, var(--glow-2), transparent 50%);
    background-attachment: fixed;
    transition: color 0.5s ease, background-color 0.5s ease;
    font-family: var(--font-serif);
    color: var(--text-main);
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    height: 100dvh;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;

    button {
        background: none;
        border: none;
        padding: 0;
        font-family: inherit;
        font-size: inherit;
        color: inherit;
        cursor: pointer;
    }

    a {
        cursor: pointer;
        color: var(--link-main);
        text-decoration: none;
    }

    a:visited {
        color: var(--link-visited);
    }

    main {
        height: 100%;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: center;

        .active {
            display: block;
            animation: fadeIn 0.7s ease forwards;
        }

        .hidden {
            display: none;
        }

        section {
            ul {
                list-style-type: none;
                padding: 0;

                li {
                    display: flex;
                    flex-direction: column;
                }
            }

            nav {
                margin-top: 2rem;
                display: flex;
                gap: 1rem;

                button {
                    display: flex;
                    align-items: center;
                    gap: 0.4rem;

                    span {
                        transform: translateY(1px);
                    }
                }

            }
        }
    }

    p {
        margin-top: 0.5rem;
        margin-bottom: 0.5rem;
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    body > * {
        visibility: hidden;
    }

    body::after {
        content: "Please rotate your device to portrait.";
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: grid;
        place-items: center;
        padding: 1.5rem;
        background: var(--bg-base);
        color: var(--text-main);
        font: 1.25rem var(--font-serif);
        text-align: center;
        visibility: visible;
    }

    html[lang="hu"] body::after {
        content: "Kérjük, fordítsd álló helyzetbe a készüléked.";
    }
}
