@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Space+Grotesk:wght@400;500;700&display=swap');

:root {
    --bg: #08111f;
    --bg-elevated: rgba(15, 23, 42, 0.86);
    --bg-panel: rgba(18, 28, 49, 0.82);
    --bg-soft: rgba(120, 168, 255, 0.08);
    --text: #edf3ff;
    --text-soft: #afbdd8;
    --line: rgba(166, 184, 218, 0.15);
    --line-strong: rgba(166, 184, 218, 0.3);
    --accent: #88b3ff;
    --accent-2: #9ef0d1;
    --accent-3: #f5c98b;
    --danger: #ff8f8f;
    --radius: 22px;
    --radius-sm: 14px;
    --shadow: 0 22px 60px rgba(3, 7, 18, 0.38);
    --header-height: 88px;
    --content-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(136, 179, 255, 0.18), transparent 26%),
        radial-gradient(circle at bottom right, rgba(158, 240, 209, 0.12), transparent 24%),
        linear-gradient(180deg, #06101b 0%, #08111f 100%);
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 90%);
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    background: rgba(7, 13, 24, 0.72);
    border-bottom: 1px solid var(--line);
}

.header-shell {
    max-width: var(--content-width);
    min-height: var(--header-height);
    margin: 0 auto;
    padding: 0 22px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}

.site-brand {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    text-decoration: none;
    min-width: 180px;
}

.site-brand__name {
    font-family: "Fraunces", serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-brand__tag {
    color: var(--text-soft);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text-soft);
    text-decoration: none;
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
}

.site-nav__action {
    color: var(--text) !important;
    background: linear-gradient(135deg, rgba(136, 179, 255, 0.18), rgba(158, 240, 209, 0.12));
    border-color: rgba(136, 179, 255, 0.24) !important;
}

.site-nav__action--muted {
    background: rgba(255, 255, 255, 0.04);
}

.header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.nav-toggle,
.nav-close,
.lang-selected,
.profile-toggle {
    font: inherit;
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    margin: 0 auto;
    content: "";
}

.hamburger::before {
    transform: translateY(-6px);
}

.hamburger::after {
    transform: translateY(4px);
}

.nav-close {
    display: none;
    align-self: flex-end;
    padding: 8px 0;
    background: transparent;
    border: 0;
    color: var(--text-soft);
    cursor: pointer;
}

.user-profile,
.lang-dropdown {
    position: relative;
}

.profile-toggle,
.lang-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-toggle__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 0.78rem;
    color: var(--text-soft);
}

.profile-toggle__meta strong {
    font-size: 0.92rem;
    color: var(--text);
}

.user-image {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lang-selected img,
.lang-options img {
    width: 18px;
    height: 18px;
    border-radius: 999px;
}

.dropdown-menu,
.lang-options {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 240px;
    margin: 0;
    padding: 10px;
    list-style: none;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: rgba(14, 22, 40, 0.96);
    box-shadow: var(--shadow);
    display: none;
}

.dropdown-menu.show,
.lang-options.show {
    display: block;
}

.dropdown-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 14px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 6px;
}

.dropdown-header .username {
    font-weight: 700;
}

.dropdown-header .email {
    color: var(--text-soft);
    font-size: 0.84rem;
}

.dropdown-item,
.lang-options li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease;
}

.dropdown-item:hover,
.lang-options li:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-item--danger {
    color: var(--danger);
}

main {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 34px 22px 56px;
}

@media (max-width: 980px) {
    .header-shell {
        grid-template-columns: auto auto 1fr;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .site-nav {
        position: fixed;
        top: 16px;
        left: 16px;
        right: 16px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 18px;
        border-radius: 22px;
        background: rgba(9, 15, 28, 0.98);
        border: 1px solid var(--line-strong);
        box-shadow: var(--shadow);
        z-index: 1001;
    }

    .site-nav.nav-open {
        display: flex;
    }

    .nav-close {
        display: inline-flex;
    }

    .site-nav a {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .header-shell {
        grid-template-columns: 1fr auto auto;
        gap: 10px;
        padding: 12px 16px;
    }

    .site-brand__tag,
    .profile-toggle__meta,
    #langLabel {
        display: none;
    }

    main {
        padding-left: 16px;
        padding-right: 16px;
    }
}
