/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f0f0f0;
    --text: #111111;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #e5e5e5;
    --accent: #111111;
    --accent-hover: #333333;
    --radius: 12px;
    --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ── Header ── */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    border-bottom: none;
    transition: background 0.3s, border-color 0.3s;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
}

/* ── Logo ── */
.logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--text);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg { width: 18px; height: 18px; color: white; }
.logo-img { width: 20px; height: 20px; }
.logo-img-dark { display: none; }
.logo-img-white { display: block; }

/* ── Centered Nav ── */
.nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-tertiary);
}

/* ── Header CTA button ── */
.header-cta {
    justify-self: end;
}

/* ── Header on dark hero ── */
.header:not(.scrolled) .logo { color: #ffffff; }
.header:not(.scrolled) .nav-link { color: rgba(255,255,255,0.7); }
.header:not(.scrolled) .nav-link:hover { color: #ffffff; background: rgba(255,255,255,0.1); }
.header:not(.scrolled) .btn-primary { background: #ffffff; color: #111111; }
.header:not(.scrolled) .btn-primary:hover { background: rgba(255,255,255,0.85); }
.header:not(.scrolled) .logo-icon { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2); }
.header:not(.scrolled) .mobile-menu-btn { color: #ffffff; }

/* ── Nav Dropdown ── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-dropdown-trigger svg {
    transition: transform 0.2s;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 220px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}

.header:not(.scrolled) .nav-dropdown-menu {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown:hover .nav-dropdown-trigger svg,
.nav-dropdown.open .nav-dropdown-trigger svg {
    transform: rotate(180deg);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: background 0.12s;
    text-decoration: none;
}

.nav-dropdown-item:hover {
    background: var(--bg-tertiary);
}

.header:not(.scrolled) .nav-dropdown-item {
    color: rgba(255,255,255,0.8);
}

.header:not(.scrolled) .nav-dropdown-item:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.nav-dropdown-item-name {
    font-weight: 500;
}

.nav-dropdown-badge {
    font-size: 10px;
    font-weight: 700;
    background: var(--text);
    color: white;
    padding: 2px 7px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.header:not(.scrolled) .nav-dropdown-badge {
    background: #ffffff;
    color: #0a0a0a;
}

/* ── Language Switcher ── */
.lang-switcher {
    position: relative;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.lang-trigger:hover {
    background: var(--bg-tertiary);
    color: var(--text);
}

.header:not(.scrolled) .lang-trigger {
    color: rgba(255,255,255,0.7);
}

.header:not(.scrolled) .lang-trigger:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.lang-flag {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lang-trigger svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}

.header:not(.scrolled) .lang-menu {
    background: #1a1a1a;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.lang-switcher:hover .lang-menu,
.lang-switcher.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-switcher:hover .lang-trigger svg,
.lang-switcher.open .lang-trigger svg {
    transform: rotate(180deg);
}

.lang-menu::-webkit-scrollbar { width: 4px; }
.lang-menu::-webkit-scrollbar-track { background: transparent; }
.lang-menu::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.header:not(.scrolled) .lang-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.lang-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-sm);
    transition: background 0.12s;
    text-decoration: none;
}

.lang-item:hover {
    background: var(--bg-tertiary);
}

.lang-item.active {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.header:not(.scrolled) .lang-item {
    color: rgba(255,255,255,0.75);
}

.header:not(.scrolled) .lang-item:hover,
.header:not(.scrolled) .lang-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.lang-item .lang-flag {
    width: 18px;
    height: 18px;
}

.lang-code {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-left: auto;
    text-transform: uppercase;
}

.header:not(.scrolled) .lang-code {
    color: rgba(255,255,255,0.3);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-tertiary); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-large { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px 24px;
    background: var(--bg);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.footer-brand { padding-right: 24px; }

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 12px;
}

.footer-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--text);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-logo-img { width: 18px; height: 18px; }

.footer-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-heading {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.footer-col a {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col a:hover { color: var(--text); }

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-tertiary);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .footer-brand {
        grid-column: span 2;
        padding-right: 0;
    }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-brand { grid-column: span 1; }
}

/* ── Mobile ── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
}

.mobile-menu-btn svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
    .header-inner {
        display: flex;
        justify-content: space-between;
    }
    .nav { display: none; }
    .header-cta { display: none; }
    .mobile-menu-btn { display: block; }

    .nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #111111;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 16px 24px;
        gap: 4px;
    }

    .header.scrolled .nav.open {
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }
    .header.scrolled .nav.open .nav-link { color: var(--text-secondary); }
    .header.scrolled .nav.open .btn-primary { background: var(--accent); color: white; }

    .nav.open .nav-link,
    .nav.open .btn { width: 100%; text-align: center; }

    /* Mobile dropdown */
    .nav.open .nav-dropdown { width: 100%; }
    .nav.open .nav-dropdown-trigger { width: 100%; justify-content: center; }
    .nav.open .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
        background: transparent;
        transition: max-height 0.3s, opacity 0.2s, visibility 0.2s, padding 0.2s;
    }
    .nav.open .nav-dropdown.open .nav-dropdown-menu {
        opacity: 1;
        visibility: visible;
        max-height: 400px;
        padding: 4px 0;
    }
    .nav.open .nav-dropdown-item {
        justify-content: center;
    }
    .header:not(.scrolled) .nav.open .nav-dropdown-menu {
        background: transparent;
        border: none;
    }

    /* Mobile lang switcher */
    .nav.open .lang-switcher { width: 100%; }
    .nav.open .lang-trigger { width: 100%; justify-content: center; }
    .nav.open .lang-menu {
        position: static;
        transform: none;
        opacity: 0;
        visibility: hidden;
        max-height: 0;
        overflow: hidden;
        box-shadow: none;
        border: none;
        padding: 0;
        background: transparent;
        transition: max-height 0.3s, opacity 0.2s, visibility 0.2s;
    }
    .nav.open .lang-switcher.open .lang-menu {
        opacity: 1;
        visibility: visible;
        max-height: 500px;
        padding: 4px 0;
    }
    .nav.open .lang-item { justify-content: center; }
    .header:not(.scrolled) .nav.open .lang-menu {
        background: transparent;
        border: none;
    }

    .footer-inner { flex-direction: column; text-align: center; }
}
