:root {
    --navy: #16355A;
    --navy-dark: #0f243f;
    --blue: #1e3f6e;
    --cyan: #008080;
    --cyan-dark: #006b6b;
    --gold: #E8A020;
    --gold-dark: #d08c12;
    --cream: #fff8ec;
    --text: #172033;
    --muted: #667085;
    --line: rgba(43, 66, 101, .14);
    --bg: #f6f8fb;
    --white: #ffffff;
    --shadow: 0 24px 70px rgba(32, 54, 83, .18);
    --max: 1500px;
    --font-heading: "Literata", ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    --font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --type-display: clamp(48px, 7.4vw, 96px);
    --type-h1: clamp(38px, 5.6vw, 76px);
    --type-h2: clamp(30px, 4vw, 54px);
    --type-h3: clamp(22px, 2.5vw, 34px);
    --type-body-lg: clamp(17px, 1.4vw, 20px);
    --tracking-heading: -.038em;
    --tracking-label: .12em;
    --scrollbar-track: #0b1830;
    --scrollbar-thumb: #16355A;
    --scrollbar-thumb-hover: #1e3f6e;
}

/* Kazakh locale uses Google Sans for body text (headings stay Literata) */
html[lang="kk"] {
    --font-body: "Google Sans", "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

html,
body,
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-thumb) 0%, var(--navy-dark) 100%);
    border: 2px solid var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scrollbar-thumb-hover) 0%, var(--navy) 100%);
}

*::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.68;
    letter-spacing: -.006em;
    color: var(--text);
    background: var(--bg);
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Global mobile base styles (prevent overflow on small screens) ===== */
html,
body {
    max-width: 100%;
}

img,
video,
svg,
iframe {
    max-width: 100%;
}

img,
video {
    height: auto;
}

:where(p, li, h1, h2, h3, h4, h5, h6, a, span, td, th, dd, dt, blockquote, figcaption) {
    overflow-wrap: break-word;
}

:where(h1, h2, h3, h4, .section-title, .brand-title, .nav-brand-name, .mega strong) {
    font-family: var(--font-heading);
    font-weight: 680;
    line-height: 1.04;
    letter-spacing: var(--tracking-heading);
    font-feature-settings: "kern", "liga";
}

:where(p, li) {
    line-height: 1.68;
}

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

button {
    font: inherit;
    cursor: pointer;
    border: 0;
    background: none;
}

.topbar {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, .78);
}

.topbar-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 22px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
    min-height: 42px;
}

.topbar-links {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.topbar-links a {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    font-weight: 650;
    color: rgba(255, 255, 255, .62);
    letter-spacing: .035em;
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, .1);
    transition: color .22s ease, background .22s ease;
    position: relative;
}

.topbar-links a:first-child {
    padding-left: 0;
}

.topbar-links a:last-child {
    border-right: none;
}

.topbar-links a:hover {
    color: var(--gold);
    background: rgba(232, 160, 32, .06);
}

.topbar-links a::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .22s ease;
}

.topbar-links a:hover::before {
    transform: scaleX(1);
}

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

.lang-switch {
    display: flex;
    align-items: stretch;
    border-left: 1px solid rgba(255, 255, 255, .1);
    border-right: 1px solid rgba(255, 255, 255, .1);
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    color: rgba(255, 255, 255, .55);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: var(--tracking-label);
    text-transform: uppercase;
    border-right: 1px solid rgba(255, 255, 255, .1);
    transition: color .2s ease, background .2s ease;
    cursor: pointer;
    min-width: 44px;
}

.lang-btn:last-child {
    border-right: none;
}

.lang-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.lang-btn.is-active {
    color: var(--navy-dark);
    background: var(--gold);
    font-weight: 900;
}

.site-header-wrapper {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 140;
    border-bottom: 1px solid rgba(22, 53, 90, .12);
    box-shadow: none;
}

.header {
    transition: background .22s ease, border-color .22s ease;
    border-top: 1px solid rgba(22, 53, 90, .08);
    border-bottom: 1px solid rgba(22, 53, 90, .08);
    background: linear-gradient(to bottom,
            rgba(15, 36, 63, .78) 0%,
            rgba(15, 36, 63, .58) 64%,
            rgba(15, 36, 63, .34) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    height: 120px;
}

.header.scrolled {
    background: rgba(255, 255, 255, .99);
    border-bottom-color: rgba(22, 53, 90, .12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: none;
}

.header.submenu-open:not(.scrolled) {
    background: linear-gradient(180deg, rgba(22, 53, 90, .98) 0%, rgba(22, 53, 90, .98) 100%);
    border-bottom-color: rgba(255, 255, 255, .14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.header-main {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 32px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1px;
    align-items: center;
    min-height: 110px;
    background: transparent;
    transition: min-height .36s cubic-bezier(.23, 1, .32, 1);
}

.header.scrolled .header-main {
    min-height: 96px;
}

.nav-brand {
    display: flex;
    width: 180px;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    justify-self: center;
    padding: 8px 0 32px;
    text-decoration: none;
    position: relative;
    z-index: 10;
    animation: brandIn .7s cubic-bezier(.23, 1, .32, 1) .12s both;
}

@keyframes brandIn {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(.88);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.nav-brand::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: width .4s ease;
}

.nav-brand:hover::before {
    width: 100%;
}

.brand-mark {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 48%, var(--gold) 0 31%, transparent 32%),
        conic-gradient(from 210deg, var(--cyan) 0 34%, #fff 34% 50%, var(--navy) 50% 100%);
    border: 3.5px solid rgba(255, 255, 255, .92);
    box-shadow:
        0 0 0 0.5px rgba(255, 255, 255, .3),
        0 16px 48px rgba(0, 0, 0, .38),
        0 2px 10px rgba(0, 0, 0, .2);
    position: relative;
    flex: 0 0 auto;
    will-change: transform, width, height;
    transition:
        width .42s cubic-bezier(.23, 1, .32, 1),
        height .42s cubic-bezier(.23, 1, .32, 1),
        border-color .42s ease,
        box-shadow .42s ease,
        transform .36s cubic-bezier(.23, 1, .32, 1);
}

.nav-brand:hover .brand-mark {
    transform: scale(1.09) rotate(-5deg);
    box-shadow:
        0 0 0 4px rgba(232, 160, 32, .65),
        0 22px 60px rgba(0, 0, 0, .45),
        0 4px 18px rgba(0, 0, 0, .26);
}

.header.scrolled .brand-mark {
    width: 72px;
    height: 72px;
    border-color: rgba(22, 53, 90, .28);
    border-width: 2.5px;
    box-shadow: 0 6px 22px rgba(22, 53, 90, .18), 0 0 0 0.5px rgba(255, 255, 255, .35);
}

.brand-mark.has-image {
    background: #fff;
    overflow: hidden;
}

.brand-mark.has-image::after {
    display: none;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.brand-mark::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 20px;
    left: 50%;
    top: 46%;
    transform: translate(-50%, -50%);
    background: var(--navy);
    border-radius: 10px 10px 4px 4px;
    box-shadow: 0 14px 0 -5px var(--navy);
}

.nav-brand-name {
    position: absolute;
    width: max-content;
    bottom: 6px;
    font-size: 18px;
    font-weight: 800;
    color: rgba(255, 255, 255, .98);
    text-transform: uppercase;
    line-height: 1.1;
    text-align: center;
    letter-spacing: -.006em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .65), 0 4px 32px rgba(0, 0, 0, .35);
    transition:
        opacity .42s ease,
        color .42s ease,
        text-shadow .42s ease,
        font-size .42s ease,
        letter-spacing .42s ease;
}

.header.scrolled .nav-brand-name {
    bottom: 4px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: .08em;
    color: var(--navy);
    text-shadow: none;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    flex-wrap: nowrap;
    overflow: visible;
}

.main-nav-left {
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}

.main-nav-right {
    justify-content: flex-start;
    flex: 1;
    min-width: 0;
}

.nav-trigger,
.nav-direct {
    appearance: none;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .97);
    font-weight: 800;
    font-size: 15.5px;
    letter-spacing: .008em;
    line-height: 1.05;
    padding: 10px 8px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all .2s cubic-bezier(.23, 1, .32, 1);
    position: relative;
}

.nav-trigger:hover,
.nav-trigger:focus-visible,
.nav-direct:hover,
.nav-direct:focus-visible {
    color: #fff;
    border-bottom-color: var(--gold);
    background: rgba(232, 160, 32, .12);
    outline: none;
    transform: translateY(-2px);
}

.nav-direct.is-active,
.nav-trigger.is-active {
    border-bottom-color: var(--cyan);
}

.nav-trigger svg {
    width: 10px;
    height: 10px;
    transition: transform .14s ease;
    opacity: .64;
    flex: 0 0 auto;
}

.nav-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

.nav-direct.is-active,
.nav-trigger.is-active {
    color: rgba(255, 255, 255, .98);
    border-bottom-color: rgba(0, 128, 128, .7);
}

.header.scrolled .nav-trigger,
.header.scrolled .nav-direct {
    color: #1e2e46;
}

.header.scrolled .nav-trigger:hover,
.header.scrolled .nav-trigger:focus-visible,
.header.scrolled .nav-direct:hover,
.header.scrolled .nav-direct:focus-visible {
    color: var(--navy);
}

.header.scrolled .nav-direct.is-active,
.header.scrolled .nav-trigger.is-active {
    color: var(--cyan-dark);
}

.header-controls {
    display: none;
    align-items: center;
    justify-content: flex-end;
    min-width: 44px;
}

.submenu-band {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    width: 100%;
    border-top: 1.5px solid rgba(22, 53, 90, .14);
    background: linear-gradient(180deg, rgba(255, 255, 255, .99) 0%, rgba(248, 251, 255, .98) 100%);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 10px 28px rgba(22, 53, 90, .1);
    max-height: 0;
    overflow: hidden;
    transition: max-height .36s cubic-bezier(.23, 1, .32, 1), box-shadow .24s ease;
}

.header.submenu-open .submenu-band {
    max-height: 760px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 14px 36px rgba(22, 53, 90, .14);
}

.header.submenu-open:not(.scrolled) .submenu-band {
    border-top-color: rgba(255, 255, 255, .16);
    background: linear-gradient(180deg, rgba(21, 50, 86, .99) 0%, rgba(17, 42, 73, .99) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 16px 42px rgba(8, 20, 35, .48);
}

.header.submenu-open:not(.scrolled) .submenu-faculties-all {
    border-bottom-color: rgba(255, 255, 255, .16);
}

.header.submenu-open:not(.scrolled) .submenu-faculties-all a,
.header.submenu-open:not(.scrolled) .submenu-intro strong,
.header.submenu-open:not(.scrolled) .submenu-group strong {
    color: rgba(255, 255, 255, .96);
}

.header.submenu-open:not(.scrolled) .submenu-intro p {
    color: rgba(233, 240, 250, .86);
}

.header.submenu-open:not(.scrolled) .submenu-group a {
    color: rgba(241, 246, 255, .95);
    border-bottom-color: rgba(255, 255, 255, .14);
}

.header.submenu-open:not(.scrolled) .submenu-group a:hover,
.header.submenu-open:not(.scrolled) .submenu-group a:focus-visible,
.header.submenu-open:not(.scrolled) .submenu-faculties-all a:hover,
.header.submenu-open:not(.scrolled) .submenu-panel--faculties .submenu-group strong a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.submenu-panel {
    display: none;
    max-width: var(--max);
    margin: 0 auto;
    padding: 32px 28px;
    grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(200px, 1fr));
    gap: 40px;
    animation: slideDown .36s cubic-bezier(.23, 1, .32, 1) forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.submenu-panel.is-active {
    display: grid;
}

#submenu-university {
    grid-template-columns: minmax(220px, 1.1fr) repeat(3, minmax(180px, 1fr));
    gap: 32px;
}

#submenu-learning {
    grid-template-columns: minmax(220px, 1.1fr) repeat(4, minmax(150px, 1fr));
    gap: 32px;
}

.submenu-panel--faculties {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.submenu-faculties-all {
    grid-column: 1 / -1;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(22, 53, 90, .1);
    margin-bottom: -8px;
    display: flex;
    justify-content: space-between;
}

.submenu-faculties-all a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--navy);
    transition: color .18s ease;
}

.submenu-faculties-all a:hover {
    color: var(--cyan);
}

.submenu-panel--faculties .submenu-group strong a {
    color: inherit;
    font: inherit;
    text-decoration: none;
    transition: color .18s ease;
}

.submenu-panel--faculties .submenu-group strong a:hover {
    color: var(--cyan);
}

.submenu-intro strong {
    display: block;
    color: var(--navy);
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.08;
    letter-spacing: -.009em;
    font-family: var(--font-heading);
}

.submenu-intro p {
    color: #5d6b7f;
    font-size: 15px;
    line-height: 1.75;
    font-weight: 500;
}

.submenu-group strong {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .13em;
    color: #3d4b62;
    margin-bottom: 14px;
    font-family: var(--font-body);
    font-weight: 840;
}

.submenu-group a {
    display: block;
    padding: 11px 0;
    color: #1f2d3d;
    font-size: 14.5px;
    font-weight: 620;
    border-bottom: 1px solid rgba(22, 53, 90, .08);
    transition: all .18s cubic-bezier(.23, 1, .32, 1);
}

.submenu-group a:hover,
.submenu-group a:focus-visible {
    color: var(--cyan);
    border-bottom-color: var(--cyan);
    padding-left: 6px;
    outline: none;
}

.submenu-group a.is-active {
    color: var(--cyan);
    font-weight: 800;
    border-bottom-color: var(--cyan);
}

.menu-btn {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 0;
    border: 1px solid rgba(22, 53, 90, .4);
    color: var(--navy);
    place-items: center;
    font-size: 20px;
    line-height: 1;
    background: rgba(255, 255, 255, .04);
    transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.header:not(.scrolled) .menu-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}

.menu-btn:hover,
.menu-btn:focus-visible {
    background: rgba(22, 53, 90, .08);
    outline: none;
}

.header:not(.scrolled) .menu-btn:hover,
.header:not(.scrolled) .menu-btn:focus-visible {
    background: rgba(255, 255, 255, .14);
}

/* ===== Mobile slide-in drawer ===== */
.mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 38, .55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 998;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(86vw, 380px);
    max-width: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #ffffff 0%, #f4f7fa 100%);
    border-left: 1px solid rgba(22, 53, 90, .14);
    box-shadow: -24px 0 64px rgba(8, 20, 38, .32);
    transform: translateX(100%);
    transition: transform .34s cubic-bezier(.23, 1, .32, 1);
    z-index: 999;
    overscroll-behavior: contain;
}

.mobile-panel.active {
    transform: translateX(0);
}

.mobile-panel-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(22, 53, 90, .12);
    background: var(--navy-dark);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mobile-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    flex: 0 0 auto;
}

.mobile-brand span {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mobile-close {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    background: rgba(255, 255, 255, .06);
    transition: background .16s ease, border-color .16s ease;
}

.mobile-close:hover,
.mobile-close:focus-visible {
    background: rgba(255, 255, 255, .16);
    border-color: var(--gold);
    outline: none;
}

.mobile-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 8px 18px 28px;
}

.mobile-group {
    border-bottom: 1px solid rgba(22, 53, 90, .1);
    margin-bottom: 0;
}

.mobile-group summary {
    list-style: none;
    cursor: pointer;
    padding: 13px 0;
    font-size: 14.5px;
    font-weight: 790;
    color: var(--navy);
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: .01em;
    transition: color .18s ease;
}

.mobile-group summary:hover {
    color: var(--cyan-dark);
}

.mobile-group summary::-webkit-details-marker {
    display: none;
}

.mobile-group summary::after {
    content: "⊕";
    font-size: 16px;
    color: rgba(22, 53, 90, .6);
    transition: transform .24s cubic-bezier(.23, 1, .32, 1), color .18s ease;
}

.mobile-group[open] summary::after {
    content: "⊖";
    transform: rotate(180deg);
    color: var(--cyan-dark);
}

.mobile-group a {
    display: block;
    padding: 12px 0 12px 14px;
    border-top: 1px solid rgba(22, 53, 90, .08);
    color: #1f2d3d;
    font-size: 14.5px;
    font-weight: 680;
    transition: color .16s ease, padding-left .18s cubic-bezier(.23, 1, .32, 1);
}

.mobile-group a:active,
.mobile-group a:focus-visible {
    color: var(--cyan);
    padding-left: 18px;
    outline: none;
}

.mobile-direct-link {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid rgba(22, 53, 90, .12);
    font-weight: 760;
    color: var(--navy);
}

.mobile-langs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    flex-wrap: wrap;
}

.mobile-langs a {
    padding: 6px 10px;
    border: 1px solid rgba(22, 53, 90, .22);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--navy);
}

.mobile-langs a.is-active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--navy-dark);
}

@media (max-width: 1200px) {
    .header-main {
        gap: 8px;
    }

    .brand-mark {
        width: 64px;
        height: 64px;
    }

    .nav-brand-name {
        font-size: 14px;
    }

    .nav-trigger,
    .nav-direct {
        font-size: 12.5px;
        padding: 9px 6px;
    }
}

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

    .main-nav,
    .submenu-band {
        display: none;
    }

    .header {
        height: auto;
    }

    .header-main {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        min-height: 84px;
        padding: 0 16px;
    }

    .header.scrolled .header-main {
        min-height: 72px;
    }

    .nav-brand {
        grid-column: 2;
        width: auto;
        max-width: 70vw;
        padding: 6px 0;
    }

    .nav-brand::after {
        width: 100%;
    }

    .brand-mark {
        width: 48px;
        height: 48px;
    }

    .header.scrolled .brand-mark {
        width: 44px;
        height: 44px;
    }

    /* University name bleeds onto hero on small screens (absolute, bottom:-16px). Hide it; the logo identifies the site. */
    .nav-brand-name,
    .header.scrolled .nav-brand-name {
        display: none;
    }

    .header-controls {
        display: flex;
        grid-column: 3;
    }

    .menu-btn {
        display: grid;
    }
}

@media (max-width: 560px) {
    .header-main {
        min-height: 72px;
        padding: 0 12px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
    }

    .menu-btn {
        width: 42px;
        height: 42px;
        font-size: 19px;
    }

    .mobile-panel {
        width: min(92vw, 360px);
    }
}

.footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, .68);
    padding: 64px 22px 24px;
}

.footer-grid {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr repeat(3, 1fr);
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 22px;
    /* increased gap to create clearer separation between mark and text */
}

.brand-title {
    font-weight: 760;
    letter-spacing: -.035em;
    font-size: 20px;
    color: var(--navy);
    line-height: 1.05;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.footer h4 {
    color: #fff;
    font-size: 20px;
    line-height: 1.12;
    margin-bottom: 16px;
}

.footer a {
    display: block;
    padding: 7px 0;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
    line-height: 1.55;
}

.footer-accred {
    margin-top: 18px;
    font-size: 12px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .55);
}

.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    padding: 0;
}

.footer-bottom {
    max-width: var(--max);
    margin: 34px auto 0;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-grid> :first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .footer {
        padding: 44px 18px 22px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 8px;
        text-align: left;
    }
}