@font-face {
    font-family: "Montserratarm";
    src: url("../fonts/Montserratarm-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserratarm";
    src: url("../fonts/Montserratarm-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserratarm";
    src: url("../fonts/Montserratarm-SemiBold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Montserratarm";
    src: url("../fonts/Montserratarm-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
    color-scheme: dark;
    scrollbar-color: rgba(249, 137, 61, 0.45) var(--bg-base);
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(249, 137, 61, 0.34);
    color: var(--text-primary);
}

body.ms-scroll-lock {
    overflow: hidden;
}

img,
svg,
iframe {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

picture {
    display: contents;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(249, 137, 61, 0.22);
}

h1:focus,
h1:focus-visible,
main:focus,
main:focus-visible {
    outline: none;
    box-shadow: none;
}

.ms-hp-field {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    opacity: 0;
    pointer-events: none;
}

.ms-media-skeleton {
    background: linear-gradient(
        105deg,
        rgba(29, 29, 34, 0.88) 25%,
        rgba(48, 46, 56, 0.94) 50%,
        rgba(29, 29, 34, 0.88) 75%
    );
    background-size: 200% 100%;
    animation: msSkeletonShimmer 1.5s ease-in-out 2;
}

@keyframes msSkeletonShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

h1,
h2,
h3,
h4 {
    overflow-wrap: anywhere;
    hyphens: manual;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

.ms-skip-link {
    position: fixed;
    top: -100px;
    inset-inline-start: 1rem;
    z-index: 2100;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #161618;
    font-weight: 700;
    font-size: var(--text-sm);
    box-shadow: var(--shadow-card);
    transition: top var(--duration-fast) var(--ease);
}

.ms-skip-link:focus {
    top: 1rem;
}

.ms-container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.ms-section {
    position: relative;
    padding-block: var(--section-gap);
}

.ms-section[id],
#main-content {
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.ms-section--compact {
    padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.ms-section-head {
    max-width: 780px;
    margin-inline: auto;
    margin-bottom: clamp(2.25rem, 4.5vw, 3.5rem);
    text-align: center;
}

.ms-section-head__title {
    position: relative;
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.24;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding-bottom: 1rem;
    margin-bottom: 0.95rem;
}

.ms-section-head__title::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 64px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent-strong), var(--accent), rgba(214, 184, 141, 0.75));
    box-shadow: 0 0 14px var(--accent-glow);
}

.ms-section-head__desc {
    font-size: var(--text-lg);
    color: var(--text-secondary);
    line-height: 1.72;
}

.ms-section__footer {
    display: flex;
    justify-content: center;
    margin-top: clamp(2.25rem, 3.75vw, 3.25rem);
}

.ms-accent-rule {
    width: 76px;
    height: 3px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent-strong), var(--accent), rgba(214, 184, 141, 0.6));
    box-shadow: 0 0 12px var(--accent-glow);
    margin-block: 1.2rem;
}

html[dir="rtl"] .ms-accent-rule {
    background: linear-gradient(270deg, var(--accent-strong), var(--accent), rgba(214, 184, 141, 0.6));
}

/* RTL & Multi-Script Typography Refinements */
html[dir="rtl"] body {
    line-height: 1.82;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .ms-btn,
html[dir="rtl"] .ms-hero__subtitle,
html[dir="rtl"] .ms-section-head__title,
html[dir="rtl"] .ms-eco-card__title,
html[dir="rtl"] .ms-faq-item__trigger,
html[dir="rtl"] .ms-footer__heading,
html[dir="rtl"] .ms-course-card__badge,
html[dir="rtl"] .ms-legal-card__meta,
html[dir="rtl"] .ms-vacancy-card__deadline-label {
    letter-spacing: 0;
}

html[dir="rtl"] .ms-hero__subtitle,
html[dir="rtl"] .ms-page-hero__title,
html[dir="rtl"] .mm-hero__title {
    line-height: 1.38;
    padding-block: 0.12em;
}

html:lang(hi) body {
    line-height: 1.84;
}

html:lang(hi) h1,
html:lang(hi) h2,
html:lang(hi) h3,
html:lang(hi) h4,
html:lang(hi) .ms-hero__subtitle,
html:lang(hi) .ms-page-hero__title,
html:lang(hi) .ms-section-head__title,
html:lang(hi) .ms-eco-card__title,
html:lang(hi) .ms-faq-item__question,
html:lang(hi) .mm-hero__title,
html:lang(hi) .mm-section__title {
    line-height: 1.44;
    padding-block: 0.14em;
}

html:lang(hi) .ms-section-head__title,
html:lang(hi) .ms-btn,
html:lang(hi) .ms-hero__subtitle,
html:lang(hi) .ms-page-hero__title,
html:lang(hi) .ms-eco-card__title,
html:lang(hi) .ms-faq-item__trigger,
html:lang(hi) .ms-support-panel__title,
html:lang(hi) .ms-course-card__badge,
html:lang(hi) .ms-course-hero__title,
html:lang(hi) .ms-jobs-cta__title,
html:lang(hi) .ms-vacancy-card__deadline-label,
html:lang(hi) .ms-auth-card__title,
html:lang(hi) .ms-legal-card__meta,
html:lang(hi) .ms-footer__heading {
    text-transform: none;
    letter-spacing: 0;
}

html:lang(ka) body,
html:lang(hy) body {
    line-height: 1.68;
}

html:lang(ka) .ms-section-head__title,
html:lang(ka) .ms-btn,
html:lang(ka) .ms-hero__subtitle,
html:lang(ka) .ms-page-hero__title,
html:lang(ka) .ms-eco-card__title,
html:lang(ka) .ms-faq-item__trigger,
html:lang(ka) .ms-support-panel__title,
html:lang(ka) .ms-course-card__badge,
html:lang(ka) .ms-course-hero__title,
html:lang(ka) .ms-jobs-cta__title,
html:lang(ka) .ms-vacancy-card__deadline-label,
html:lang(ka) .ms-auth-card__title,
html:lang(ka) .ms-legal-card__meta,
html:lang(ka) .ms-footer__heading {
    text-transform: none;
    letter-spacing: 0;
}

html:lang(de) h1,
html:lang(de) h2,
html:lang(de) h3,
html:lang(de) h4,
html:lang(de) .ms-hero__subtitle,
html:lang(nl) h1,
html:lang(nl) h2,
html:lang(nl) h3,
html:lang(nl) h4,
html:lang(nl) .ms-hero__subtitle,
html:lang(sv) h1,
html:lang(sv) h2,
html:lang(sv) h3,
html:lang(sv) h4,
html:lang(sv) .ms-hero__subtitle {
    hyphens: auto;
}

html:lang(ko) body {
    word-break: keep-all;
    overflow-wrap: break-word;
    line-height: 1.72;
}

html:lang(zh-Hans) body,
html:lang(ja) body {
    line-break: strict;
    line-height: 1.78;
}

/* Scroll Reveal handled safely via Web Animations API in site.js (never hides content on Blazor re-render) */

/* Blazor Error UI */
#blazor-error-ui {
    background: #2b1d17;
    color: #fff;
    border-top: 2px solid var(--accent-strong);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.75rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
    align-items: center;
    gap: 1rem;
    font-size: var(--text-sm);
}

#blazor-error-ui .reload {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    margin-inline-start: auto;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-delay: 0ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
