/* Brand palette — taken from the Xero One logo */
:root {
    --brand: #02598b;
    --brand-600: #01476f;
    --brand-50: #eef6fb;
    --brand-100: #cce4f0;
    --brand-rgb: 2, 89, 139;

    /* Corporate gold — use sparingly for premium accents */
    --accent-gold: #ad946c;
    --accent-gold-light: #c4ab82;
    --accent-gold-rgb: 173, 148, 108;
    --accent-gold-muted: rgba(173, 148, 108, 0.22);

    --ink: #111111;
    --ink-soft: #1c1c1f;
    --footer-bg: #2a2e33;
    --text: #3f3f46;
    --muted: #71717a;

    --bg: #ffffff;
    --surface: #f7f7f9;
    --border: #e8e8ee;

    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-sm: 0 1px 2px rgba(17, 17, 17, 0.04), 0 1px 3px rgba(17, 17, 17, 0.06);
    --shadow-md: 0 10px 30px -12px rgba(17, 17, 17, 0.14);
    --shadow-lg: 0 30px 60px -20px rgba(17, 17, 17, 0.22);
    --shadow-brand: 0 12px 28px -10px rgba(var(--brand-rgb), 0.55);

    /* Legacy names still used across page styles */
    --primary-color: var(--brand);
    --secondary-color: var(--brand-600);
    --accent-color: var(--accent-gold);
    --dark-bg: var(--bg);
    --dark-surface: var(--surface);
    --text-primary: var(--ink);
    --text-secondary: var(--text);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    max-width: 100%;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    letter-spacing: -0.02em;
}

::selection {
    background: var(--brand);
    color: #fff;
}

/* First-load splash — static in the document so it paints before Blazor starts */
html:has(#site-splash:not(.is-done)) {
    overflow: hidden;
}

#site-splash {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    background: #070c14;
    transition: opacity 0.55s ease, visibility 0.55s ease;
}

#site-splash.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-splash-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}

.site-splash-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(28rem, 80vw);
    height: min(28rem, 80vw);
    transform: translate(-50%, -58%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(173, 148, 108, 0.28) 0%, rgba(2, 89, 139, 0.12) 42%, transparent 70%);
    pointer-events: none;
}

.site-splash-logo {
    position: relative;
    width: min(17.5rem, 68vw);
    height: auto;
    animation: splash-logo 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes splash-logo {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-splash-logo {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Home: hide the window scrollbar (content still scrolls with wheel / touch) */
html:has(.home-page) {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* legacy Edge */
}

html:has(.home-page)::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
    width: 0;
    height: 0;
}

.text-muted {
    --bs-text-opacity: 1;
    color: var(--muted) !important;
}


/* Fix horizontal scroll issue */
/*html, body {
    overflow-x: hidden !important;
    width: 100%;
    position: relative;
}*/

/*body {
    margin: 0;
    padding: 0;
}
*/
/* Contain width only: do NOT set overflow-x on .container — paired with
   default overflow-y:visible, browsers compute overflow-y:auto and show
   inner vertical scrollbars. Body already uses overflow-x:hidden. */
.container, .container-fluid {
    max-width: 100%;
}

/* Main site nav: same horizontal rhythm as Home / Xcommunity */
nav.navbar.navbar-custom > .container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1rem, 4vw, 1.25rem);
    padding-right: clamp(1rem, 4vw, 1.25rem);
    box-sizing: border-box;
}

/* Navbar: animated hamburger → X (Bootstrap sets aria-expanded on the toggler).
   Do not set display on the toggler globally — it overrides Bootstrap’s
   .navbar-expand-lg .navbar-toggler { display: none } on desktop. */
@media (max-width: 991.98px) {
    .navbar-expand-lg .navbar-toggler.nav-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-toggler.nav-hamburger {
        display: none !important;
    }
}

.navbar-toggler.nav-hamburger .navbar-toggler-icon {
    display: none;
}

.nav-hamburger-icon {
    width: 1.375rem;
    height: 0.875rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.nav-hamburger-bar {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background-color: var(--ink);
    transform-origin: center;
    transition:
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.28s ease;
}

.navbar-toggler.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.navbar-toggler.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0.15);
}

.navbar-toggler.nav-hamburger[aria-expanded="true"] .nav-hamburger-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
    .nav-hamburger-bar {
        transition-duration: 0.01ms;
    }
}

/* Fix sticky buttons positioning */
