:root {
    color-scheme: dark;
    /* Core palette */
    --bg-primary: #0D0A08;
    --bg-secondary: #16110E;
    --bg-tertiary: #211915;
    --panel: rgba(28, 20, 16, 0.82);
    --panel-strong: rgba(38, 28, 22, 0.94);
    --text-primary: #F0E6D8;
    --text-secondary: #BBAA95;
    --text-muted: #8B7661;
    --accent-primary: #B97735;
    --accent-secondary: #D29A5D;
    --accent-soft: rgba(185, 119, 53, 0.16);
    --border-primary: rgba(185, 119, 53, 0.20);
    --border-secondary: rgba(210, 154, 93, 0.28);
    --shadow-warm: 0 18px 60px rgba(0, 0, 0, 0.45);
    --content-width: 1600px;
    --page-padding: clamp(20px, 5vw, 96px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    scroll-behavior: smooth;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #3A2A1F #0C0907;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: radial-gradient(circle at top right, rgba(92, 56, 25, 0.12), transparent 28%), radial-gradient(circle at 18% 18%, rgba(124, 74, 33, 0.10), transparent 20%), linear-gradient(180deg, #0A0807 0%, #0D0A08 100%);
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

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

img,
video {
    height: auto;
}

#app {
    width: 100%;
    min-height: 100vh;
}

.portfolio-layout {
    width: 100%;
    min-height: 100vh;
}

    .portfolio-layout main {
        width: 100%;
        max-width: var(--content-width);
        margin: 0 auto;
        padding: 0 var(--page-padding);
    }

    /* subtle grain */
    .portfolio-layout::before {
        content: "";
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 0;
        opacity: 0.06;
        background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.07) 0 1px, transparent 1px), radial-gradient(circle at 80% 40%, rgba(255,255,255,0.05) 0 1px, transparent 1px), radial-gradient(circle at 30% 80%, rgba(255,255,255,0.06) 0 1px, transparent 1px);
        background-size: 180px 180px, 220px 220px, 200px 200px;
    }

/* Chrome / Edge / Safari / Brave / Opera */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0C0907;
}

::-webkit-scrollbar-thumb {
    background: #3A2A1F;
    border-radius: 8px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--accent-primary);
    }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px 45px 15px 20px;
    background: #8E2F16;
    color: #fff;
    z-index: 10000;
}

    #blazor-error-ui a {
        color: #fff;
        text-decoration: underline;
    }

    #blazor-error-ui .dismiss {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        cursor: pointer;
    }

:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
