/* ============================================
   BASE STYLES & RESET
   ============================================ */

/* Modern CSS Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

/* Smooth theme transitions */
body,
header,
footer,
nav,
.card,
.btn {
    transition: background-color var(--transition-base),
        color var(--transition-base),
        border-color var(--transition-base);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-extrabold);
}

h2 {
    font-size: var(--font-size-4xl);
}

h3 {
    font-size: var(--font-size-3xl);
}

h4 {
    font-size: var(--font-size-2xl);
}

h5 {
    font-size: var(--font-size-xl);
}

h6 {
    font-size: var(--font-size-lg);
}

p {
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

strong {
    font-weight: var(--font-weight-semibold);
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section {
    padding: var(--space-5xl) 0;
}

.section-sm {
    padding: var(--space-4xl) 0;
}

.section-lg {
    padding: 6rem 0;
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================
   FLEX UTILITIES
   ============================================ */

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

/* ============================================
   TEXT UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-primary {
    color: var(--color-primary);
}

.text-secondary {
    color: var(--color-text-secondary);
}

/* ============================================
   LIST STYLES
   ============================================ */

ul,
ol {
    list-style: none;
}

/* ============================================
   IMAGES
   ============================================ */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

svg {
    display: block;
}

/* ============================================
   BUTTONS & FORMS BASE
   ============================================ */

button {
    font-family: inherit;
    border: none;
    background: none;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   FOCUS STYLES
   ============================================ */

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ============================================
   SELECTION
   ============================================ */

::selection {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-hover);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}