:root {
    --orho-bg-light: #fffaf0;
}

html {
    background: var(--orho-bg-light);
}

html, body {
    margin: 0;
    font-family: 'Sora', sans-serif;
}

/* ---- Initial load splash (before Blazor boots) ---- */
#app:has(> .orho-splash) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.orho-splash {
    min-height: 100vh;
    animation: orho-pulse 1.5s ease-in-out infinite;
}

@keyframes orho-pulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Dark theme applied pre-render (see index.html) to avoid a light flash. */
html.dark,
html.dark body {
    background: #121212;
}

/* Dark mode: shadows are invisible on dark, so add a subtle edge border. */
html.dark .mud-paper.mud-elevation-1,
html.dark .mud-paper.mud-elevation-2,
html.dark .mud-paper.mud-elevation-3,
html.dark .mud-paper.mud-elevation-4 {
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html.dark .mud-paper.mud-elevation-5,
html.dark .mud-paper.mud-elevation-6,
html.dark .mud-paper.mud-elevation-7,
html.dark .mud-paper.mud-elevation-8 {
    border: 1px solid rgba(255, 255, 255, 0.11);
}

/* Smooth selection color (brand-tinted). */
::selection {
    background: color-mix(in srgb, var(--mud-palette-primary) 30%, transparent);
    color: var(--mud-palette-text-primary);
}

/* Visible focus ring for keyboard navigation (WCAG), hidden for mouse. */
:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Respect the system "reduce motion" preference (also tames the splash pulse). */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Slim custom scrollbar (webkit + Firefox). */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--mud-palette-divider) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--mud-palette-divider);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mud-palette-text-disabled);
}

/* ---- Blazor error UI ---- */
#blazor-error-ui {
    background: #ffe6e6;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #5a1a1a;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.fw-bold {
    font-weight: 600;
}

/* ---- 404 / not found ---- */
.orho-notfound {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.orho-notfound-card {
    width: 100%;
    max-width: 460px;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    border-radius: 16px;
    animation: orho-notfound-fadein 0.5s ease-out;
}

@keyframes orho-notfound-fadein {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.orho-notfound-logo {
    height: 3.5rem;
    width: auto;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.orho-notfound-number {
    font-size: clamp(3.5rem, 12vw, 5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--mud-palette-primary);
}

.orho-notfound-title {
    font-weight: 700 !important;
    margin-top: 0.5rem !important;
}

.orho-notfound-text {
    color: var(--mud-palette-text-secondary);
    line-height: 1.6 !important;
    max-width: 340px;
    margin: 0.25rem auto 0 !important;
}
