/* ==========================================================================
   BASE STYLE & RESET (Moments+)
   ========================================================================= */

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

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* --- Layout Containers --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin-right: auto;
    margin-left: auto;
    padding-right: var(--space-lg);
    padding-left: var(--space-lg);
}

.section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
    position: relative;
}

@media (max-width: 768px) {
    .section {
        padding-top: var(--space-2xl);
        padding-bottom: var(--space-2xl);
    }
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--space-md);
    letter-spacing: -0.03em;
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    margin-bottom: var(--space-md);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

/* --- Utility Classes --- */
.text-gradient {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-primary {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

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

.flex {
    display: flex;
}

.grid {
    display: grid;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Focus States for Accessibility --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 4px;
}

/* --- Selection Color --- */
::selection {
    background-color: rgba(99, 102, 241, 0.2);
    color: inherit;
}
body.dark ::selection {
    background-color: rgba(168, 85, 247, 0.3);
}

/* --- Images & SVG Media --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

svg {
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}
