/* 1. Variables & Setup */
:root {
    --bg-page: #f4f4f4;
    --bg-surface: #ffffff;
    --text-main: #222222;
    --text-muted: #4b5468;
    --border-color: #d4dae7;
    --accent: #5f8cff;
    --radius: 8px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-page: #121212;
        --bg-surface: #1e1e1e;
        --text-main: #dddddd;
        --text-muted: #9aa1b1;
        --border-color: #333333;
    }
}

/* 2. Base Styles */
* { box-sizing: border-box; }

html,
body {
    min-height: 100%;
}

body {
    position: relative;
    isolation: isolate;
    margin: 2rem auto;
    padding: 1.5rem;
    max-width: 960px;
    font-family: system-ui, sans-serif;
    line-height: 1.5;
    background-color: var(--bg-page);
    color: var(--text-main);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("./bg.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.02);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url("./bg.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.02);
    filter: blur(3px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 20%, black 100%);
    mask-image: linear-gradient(to bottom, transparent 20%, black 100%);
}

@media (prefers-color-scheme: dark) {
    body::before {
        filter: invert(0.9);
    }

    body::after {
        filter: invert(0.9) blur(3px);
    }
}

main {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: calc(var(--radius) + 2rem);
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 3. Typography & Elements */
h1 { margin-top: 0; }

#lang-selector {
    margin: 0.5rem 0 1rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-surface);
    color: var(--text-main);
    font: inherit;
}

#lang-selector:focus-visible {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
    outline-offset: 1px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
}

.notice {
    padding: 1rem;
    background: rgba(95, 140, 255, 0.1);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

/* 4. Navigation Grid */
nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

/* 5. Link Cards */
.link-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.link-card-main {
    background: var(--accent);
}

.link-card:hover,
.link-card:focus-visible {
    border-color: var(--accent);
    transform: translateY(-2px);
    outline: none;
}

.link-card span {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--accent);
}

.link-card-main span {
    color: white;
}

.link-card small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.link-card-main small {
    color: white;
}

/* 6. Responsive */
@media (max-width: 720px) {
    body { margin: 0; padding: 1rem; }
    main { padding: 1.25rem; border: none; }
    nav { grid-template-columns: 1fr; }
}
