/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: 21px;
    overflow-x: hidden;
    /* Prevent horizontal scroll from layout shifts */
    transition: background-color var(--transition-normal), color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 3.5rem;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 2rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-main);
    /* Changed to strong text color for better contrast with new theme */
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   CURSOR MANAGEMENT - Must be explicit to prevent inheritance issues
   ========================================================================== */

/* Default cursor for everything */
*, *::before, *::after {
    cursor: default;
}

/* Interactive elements get pointer cursor */
a,
button,
[role="button"],
input[type="submit"],
input[type="button"],
.btn,
.tech-btn,
.demo-btn,
.copy-btn,
.sidebar-toggle,
.sidebar-close,
.mobile-fab,
.chip,
.page-nav-item,
.desktop-nav-item,
.btn-theme,
.sidebar-list li a,
.problem-list li a,
.nav-footer a {
    cursor: pointer;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

code {
    font-family: 'Fira Code', monospace;
    /* Fallback to monospace if not available */
    font-size: 0.9em;
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1500px; /* Increased from 1200px */
    margin: 0 auto;
    padding: 0 var(--space-md); /* Reduced side padding slightly */
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.mt-sm {
    margin-top: var(--space-sm);
}

.mt-md {
    margin-top: var(--space-md);
}

.mt-lg {
    margin-top: var(--space-lg);
}

.mt-xl {
    margin-top: var(--space-xl);
}

.mb-md {
    margin-bottom: var(--space-md);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-accent {
    color: var(--accent);
}

.hidden {
    display: none !important;
}