/* ============ TOKENS ============ */
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-alt: #e8eff3;
    --topbar-bg: #f7f8f9;
    --band: #0d2136;
    --band-alt: #123049;
    --ink: #132030;
    --ink-muted: #4c5c6b;
    --on-dark: #eef4f8;
    --on-dark-muted: #a9bccb;
    --brand: #16324f;
    --accent: #a41f2c;
    --accent-strong: #7e1620;
    --accent-on-dark: #e2707a;
    --gold: #c9a24b;
    --border: #d7e2e8;
    --border-on-dark: #28425c;
    --focus: #3f7fbf;
    --shadow: 0 20px 50px -25px rgba(13,33,54,0.35);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a1723;
        --surface: #0f2135;
        --surface-alt: #132a41;
        --topbar-bg: #122539;
        --band: #060f19;
        --band-alt: #0b1c2c;
        --ink: #e9f1f6;
        --ink-muted: #a2b5c5;
        --on-dark: #eef4f8;
        --on-dark-muted: #93a9bb;
        --brand: #8fb8dd;
        --accent: #e2707a;
        --accent-strong: #c94f5b;
        --accent-on-dark: #e2707a;
        --gold: #dcb96f;
        --border: #1f3550;
        --border-on-dark: #1c3049;
        --shadow: 0 20px 50px -25px rgba(0,0,0,0.6);
    }
}

:root[data-theme="dark"] {
    --bg: #0a1723;
    --surface: #0f2135;
    --surface-alt: #132a41;
    --topbar-bg: #122539;
    --band: #060f19;
    --band-alt: #0b1c2c;
    --ink: #e9f1f6;
    --ink-muted: #a2b5c5;
    --on-dark: #eef4f8;
    --on-dark-muted: #93a9bb;
    --brand: #8fb8dd;
    --accent: #e2707a;
    --accent-strong: #c94f5b;
    --accent-on-dark: #e2707a;
    --gold: #dcb96f;
    --border: #1f3550;
    --border-on-dark: #1c3049;
    --shadow: 0 20px 50px -25px rgba(0,0,0,0.6);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg {
    width: 100%;
}

h1, h2, h3, h4 {
    font-family: "Archivo", "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.14;
    text-wrap: balance;
    margin: 0;
    color: var(--ink);
}

p {
    margin: 0;
}

a {
    color: inherit;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.wrap {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 20px;
}

/* ============ TOPBAR (HKU-style: light, segmented) ============ */
.topbar {
    background: var(--topbar-bg);
    color: var(--ink-muted);
    font-size: .8rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

    .topbar .wrap {
        display: flex;
        align-items: stretch;
        justify-content: space-between;
        gap: 16px;
        flex-wrap: wrap;
        max-width: none;
        padding-inline: clamp(16px,3vw,40px);
    }

.topbar-social {
    display: flex;
    align-items: stretch;
}

    .topbar-social a {
        display: flex;
        align-items: center;
        padding: 9px 14px;
        border-left: 1px solid var(--border);
        color: var(--ink-muted);
        text-decoration: none;
    }

        .topbar-social a:last-child {
            border-right: 1px solid var(--border);
        }

        .topbar-social a:hover {
            color: var(--accent);
        }

    .topbar-social i {
        font-size: 14px;
    }

.topbar-right {
    display: flex;
    align-items: stretch;
}

.utility-links {
    display: flex;
    align-items: stretch;
}

    .utility-links a {
        display: flex;
        align-items: center;
        padding: 9px 16px;
        border-left: 1px solid var(--border);
        text-decoration: none;
        color: var(--ink-muted);
        font-weight: 500;
        white-space: nowrap;
    }

        .utility-links a:hover {
            background: var(--surface);
            color: var(--ink);
        }

        .utility-links a.emphasis {
            font-weight: 700;
            color: var(--ink);
        }

.lang-switch {
    position: relative;
    border-left: 1px solid var(--border);
    display: flex;
    align-items: stretch;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ink-muted);
    font-weight: 700;
    font-size: .78rem;
    padding: 9px 16px;
    border-radius: 0;
}

    .lang-current:hover, .lang-switch.show .lang-current {
        color: var(--ink);
    }

    .lang-current .globe {
        font-size: 14px;
        flex: none;
    }

    .lang-current.dropdown-toggle::after {
        transition: transform .15s ease;
    }

.lang-switch.show .lang-current.dropdown-toggle::after {
    transform: rotate(180deg);
}

.lang-menu {
    min-width: 140px;
    margin: 0;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    box-shadow: var(--shadow);
}

    .lang-menu .dropdown-item {
        padding: 8px 10px;
        border-radius: 8px;
        font-size: .85rem;
        font-weight: 600;
        color: var(--ink-muted);
    }

        .lang-menu .dropdown-item:hover, .lang-menu .dropdown-item:focus {
            background: var(--surface-alt);
            color: var(--accent);
        }

        .lang-menu .dropdown-item[aria-selected="true"] {
            color: var(--accent);
        }

/* ============ HEADER (Bootstrap navbar, restyled to brand) ============ */
.site-header .navbar {
    padding: 0;
    max-width: none;
    padding-inline: clamp(16px,3vw,40px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: var(--ink);
    padding-block: 34px;
    margin: 0;
    font-size: inherit;
}

.brand-mark {
    width: 420px;
    height: 104px;
    object-fit: contain;
    flex: none;
    margin-block: -23px;
}

.brand-divider {
    width: 1px;
    height: 38px;
    background: var(--border);
    flex: none;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    gap: 2px;
}

    .brand-text .u, .brand-text .f {
        font-family: "Archivo",sans-serif;
        font-weight: 800;
        font-size: 1rem;
        letter-spacing: 0;
        color: var(--ink);
    }

.primary-nav {
    gap: 15px;
}

    .primary-nav.navbar-nav {
        --bs-navbar-nav-link-padding-x: 0;
    }

.nav-link {
    white-space: nowrap;
    color: var(--ink);
    font-family: "Archivo",sans-serif;
    font-weight: 700;
    font-size: .76rem;
    padding-block: 46px;
    padding-inline: 0;
}

.nav-item:hover .nav-link, .nav-item .nav-link:hover, .nav-item .nav-link:focus, .nav-item.show .nav-link {
    color: var(--accent);
}

.dropdown-toggle::after {
    transition: transform .15s ease;
    vertical-align: 1px;
}

.nav-item.show .dropdown-toggle::after, .nav-item:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    width: 300px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
    padding: 10px;
}

.dropdown-item {
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--ink-muted);
    font-weight: 600;
    font-size: 14px;
    white-space: wrap;
}

    .dropdown-item:hover, .dropdown-item:focus {
        background: var(--surface-alt);
        color: var(--accent);
    }

.nav-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: none;
}

    .nav-toggle i {
        font-size: 20px;
        line-height: 1;
    }

.navbar-collapse.show, .navbar-collapse.collapsing {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-inline: -1px;
    padding: 8px;
    max-height: 75vh;
    overflow-y: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: .95rem;
    padding: 13px 24px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    cursor: pointer;
}

/* ============ FOOTER ============ */
footer {
    background: var(--band-alt);
    color: var(--on-dark-muted);
    font-size: .9rem;
}

    footer .wrap {
        max-width: 1360px;
    }

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 32px;
    row-gap: 32px;
    padding-block: 52px 32px;
}

@media (min-width:768px) {
    .footer-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (min-width:992px) {
    .footer-grid {

    }
}

.footer-about {
    width: 100%;
}

.footer-grid > div {
    width: 100%;
}

.footer-grid h4 {
    color: var(--on-dark);
    font-family: "Archivo",sans-serif;
    font-size: 16px;
    margin-bottom: 14px;
    font-weight: 500;
}

.footer-grid ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 9px;
}

.footer-grid a {
    text-decoration: none;
    color: var(--on-dark-muted);
}

    .footer-grid a:hover {
        color: var(--on-dark);
    }

.footer-about p {
    margin-bottom: 16px;
}

.footer-about .social {
    display: flex;
    gap: 10px;
}

    .footer-about .social a {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        flex: none;
        display: grid;
        place-items: center;
        background: rgba(255,255,255,.08);
        color: var(--on-dark-muted);
        text-decoration: none;
        transition: background .15s ease, color .15s ease;
    }

        .footer-about .social a:hover {
            background: rgba(255,255,255,.18);
            color: var(--on-dark);
        }

    .footer-about .social i {
        font-size: 15px;
    }

.footer-bottom {
    border-top: 1px solid var(--border-on-dark);
    padding-block: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .8rem;
}

/* ============ RESPONSIVE (shared) ============ */
@media (max-width:991.98px) {
    .nav-item {
        align-items: stretch;
    }

    .nav-link {
        padding-block: 14px;
    }

    .dropdown-menu {
        position: static;
        border: none;
        box-shadow: none;
        background: none;
        padding: 0 0 6px 14px;
        border-radius: 0;
    }

    .dropdown-item:hover, .dropdown-item:focus {
        background: none;
        color: var(--accent);
    }
}

@media (max-width:620px) {
    .topbar-social {
        display: none;
    }

    .utility-links a:not(.emphasis) {
        display: none;
    }
}
