:root {
    --font-sans: 'DM Sans', sans-serif;
    --font-size-base: clamp(0.9375rem, 0.25vw + 0.88rem, 1rem);
    --surface-shadow: 0 18px 45px rgba(0, 4, 40, 0.14);
    --surface-shadow-hover: 0 24px 55px rgba(0, 4, 40, 0.2);
    --motion-fast: 180ms;
    --motion-standard: 280ms;
}

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body,
button,
input,
select,
textarea,
.btn,
.form-control,
.form-select {
    font-family: var(--font-sans) !important;
    font-size: var(--font-size-base);
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 700;
}

button,
a,
.btn,
.menu-item,
.nav-link,
.card,
.stat-card,
.analytics-card,
.form-card,
.main-profile-card,
.side-panel,
.table-container,
.post-card,
.sidebar-card {
    transition: transform var(--motion-standard) ease, box-shadow var(--motion-standard) ease, background-color var(--motion-fast) ease, color var(--motion-fast) ease, border-color var(--motion-fast) ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(0, 78, 146, 0.35);
    outline-offset: 3px;
}

.card:hover,
.stat-card:hover,
.analytics-card:hover,
.form-card:hover,
.main-profile-card:hover,
.side-panel:hover,
.table-container:hover,
.post-card:hover,
.sidebar-card:hover {
    box-shadow: var(--surface-shadow-hover);
}

.menu-item:hover,
.nav-link:hover {
    transform: translateX(3px);
}

.btn:hover,
button:hover {
    transform: translateY(-2px);
}

.dashboard-wrapper,
.blog-content,
.profile-container {
    width: min(100%, 1240px);
}

.display-name,
.profile-name {
    font-size: clamp(1.65rem, 2.4vw, 2.35rem);
}

.bio-text,
.profile-bio {
    font-size: clamp(0.98rem, 0.35vw + 0.9rem, 1.1rem);
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-wrapper,
.main-content > *,
.blog-content,
.profile-card,
.login-container {
    animation: pageEnter 520ms ease both;
}

@media (max-width: 768px) {
    .dashboard-wrapper {
        margin-top: clamp(16px, 4vw, 28px);
        padding-inline: clamp(12px, 4vw, 20px);
    }

    .main-profile-card,
    .form-card,
    .analytics-card,
    .table-container {
        padding: clamp(20px, 5vw, 36px) clamp(16px, 4vw, 28px);
        border-radius: 18px;
    }

    .display-name,
    .profile-name {
        font-size: clamp(1.45rem, 7vw, 1.9rem);
    }
}

@media (max-width: 480px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar .left,
    .topbar .right {
        width: 100%;
    }

    .topbar .right {
        justify-content: flex-end;
    }

    .profile-card {
        padding: clamp(22px, 6vw, 30px) clamp(16px, 5vw, 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
