:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --bg-accent: rgba(21, 204, 204, 0.12);
    --panel: #ffffff;
    --panel-soft: rgba(255, 255, 255, 0.98);
    --border: #d8dee9;
    --text: #1f2937;
    --muted: #5f6b7a;
    --accent: #2368e8;
    --accent-dark: #1851bc;
    --accent-warm: #f58220;
    --shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    --shadow-soft: 0 4px 12px rgba(15, 23, 42, 0.06);
}

:root[data-dh-theme="dark"] {
    color-scheme: dark;
    --bg: #09121c;
    --bg-accent: rgba(21, 204, 204, 0.18);
    --panel: rgba(15, 27, 41, 0.94);
    --panel-soft: rgba(18, 31, 47, 0.98);
    --border: rgba(129, 153, 184, 0.24);
    --text: #edf4ff;
    --muted: #a5b5c8;
    --accent: #4b87ff;
    --accent-dark: #78b6ff;
    --accent-warm: #f79a42;
    --shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
    --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top right, var(--bg-accent), transparent 22rem),
        linear-gradient(180deg, var(--bg) 0%, #edf3f9 100%);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

:root[data-dh-theme="dark"] body {
    background:
        radial-gradient(circle at top right, var(--bg-accent), transparent 22rem),
        linear-gradient(180deg, var(--bg) 0%, #0d1724 100%);
}

.page {
    position: relative;
    width: min(760px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 28px;
}

.page-tools {
    position: absolute;
    top: 38px;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    z-index: 30;
}

.logo-container {
    text-align: center;
    margin-bottom: 22px;
}

.logo-container img {
    max-width: 112px;
    width: 100%;
    height: auto;
    display: inline-block;
    filter: drop-shadow(0 12px 24px rgba(0, 35, 63, 0.14));
}

.language-switcher {
    position: relative;
    margin: 0;
}

.language-switcher summary {
    list-style: none;
}

.language-switcher summary::-webkit-details-marker {
    display: none;
}

.language-switcher__active,
.language-switcher__option,
.theme-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel);
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    box-shadow: var(--shadow-soft);
}

.language-switcher__active,
.theme-switch {
    width: 38px;
    cursor: pointer;
    border-color: var(--border);
    background: rgba(21, 204, 204, 0.08);
    color: var(--accent-dark);
    box-shadow: inset 0 -2px 0 var(--accent-warm);
}

.language-switcher__active:hover,
.language-switcher__active:focus,
.theme-switch:hover,
.theme-switch:focus,
.language-switcher__option:hover,
.language-switcher__option:focus {
    border-color: var(--accent);
    outline: none;
    text-decoration: none;
}

.language-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    min-width: 172px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
    box-shadow: var(--shadow), inset 0 2px 0 var(--accent-warm);
}

.language-switcher:not([open]) .language-switcher__menu {
    display: none;
}

.language-switcher__option {
    justify-content: flex-start;
    gap: 9px;
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-size: 13px;
    line-height: 1.2;
}

.language-switcher__option:hover,
.language-switcher__option:focus {
    background: rgba(35, 104, 232, 0.08);
    color: var(--accent-dark);
}

.language-switcher__label {
    white-space: nowrap;
}

.language-flag {
    display: block;
    width: 24px;
    height: 18px;
    overflow: hidden;
    border-radius: 2px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.language-flag--si {
    background-image: url("flags/si.svg");
}

.language-flag--gb {
    background-image: url("flags/gb.svg");
}

.language-flag--de {
    background-image: url("flags/de.svg");
}

.language-flag--it {
    background-image: url("flags/it.svg");
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.theme-switch__icon {
    display: block;
    position: relative;
    width: 15px;
    height: 15px;
}

.theme-switch__icon::before,
.theme-switch__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    transition: opacity 160ms ease, transform 160ms ease;
}

.theme-switch__icon::before {
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow:
        0 -8px 0 -6px currentColor,
        0 8px 0 -6px currentColor,
        8px 0 0 -6px currentColor,
        -8px 0 0 -6px currentColor,
        5px 5px 0 -6px currentColor,
        -5px 5px 0 -6px currentColor,
        5px -5px 0 -6px currentColor,
        -5px -5px 0 -6px currentColor;
    opacity: 0;
    transform: scale(0.78);
}

.theme-switch__icon::after {
    inset: 1px 0 0 1px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-top-color: transparent;
    transform: rotate(24deg);
    opacity: 1;
}

:root[data-dh-theme="dark"] .theme-switch__icon::before {
    opacity: 1;
    transform: scale(1);
}

:root[data-dh-theme="dark"] .theme-switch__icon::after {
    opacity: 0;
    transform: rotate(24deg) scale(0.72);
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(30px, 4vw, 40px);
    line-height: 1.15;
    letter-spacing: 0;
    text-align: center;
}

.subtitle {
    margin: 0 0 22px;
    color: var(--muted);
    text-align: center;
}

.panel {
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

h2 {
    margin: 22px 0 8px;
    font-size: 20px;
    letter-spacing: 0;
}

h2:first-child {
    margin-top: 0;
}

p,
ul {
    margin: 0 0 14px;
}

li {
    margin-bottom: 6px;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 20px;
    padding: 2px 7px;
    border: 1px solid #93c5fd;
    border-bottom-color: var(--accent-warm);
    border-radius: 999px;
    background: #eff6ff;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.footer {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 38px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .page {
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .logo-container {
        margin-bottom: 10px;
    }

    .logo-container img {
        max-width: 92px;
    }

    .page-tools {
        position: static;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        margin: -4px auto 18px;
        gap: 8px;
    }

    .language-switcher {
        position: relative;
        width: auto;
        margin: 0;
    }

    .language-switcher__menu {
        right: auto;
        left: 50%;
        width: max-content;
        max-width: calc(100vw - 28px);
        transform: translateX(-50%);
        z-index: 60;
    }

    .footer {
        margin-top: 48px;
        gap: 8px;
    }
}
