/* ============================================================
   Reset & Base Styles
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    font-weight: var(--fw-normal);
    line-height: var(--lh-normal);
    color: var(--color-text);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.section {
    padding: var(--space-4xl) 0;
}

.section--bg {
    background-color: var(--color-bg);
}

.section--dark {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ============================================================
   Grid System
   ============================================================ */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid--4,
    .grid--3,
    .grid--2 { grid-template-columns: 1fr; }

    .section { padding: var(--space-2xl) 0; }
    .container { padding: 0 var(--space-md); }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.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); }
.gap-xl { gap: var(--space-xl); }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--color-primary);
}

h1 { font-size: var(--fs-4xl); margin-bottom: var(--space-lg); }
h2 { font-size: var(--fs-3xl); margin-bottom: var(--space-lg); }
h3 { font-size: var(--fs-2xl); margin-bottom: var(--space-md); }
h4 { font-size: var(--fs-xl);  margin-bottom: var(--space-md); }
h5 { font-size: var(--fs-lg);  margin-bottom: var(--space-sm); }
h6 { font-size: var(--fs-md);  margin-bottom: var(--space-sm); }

@media (max-width: 768px) {
    h1 { font-size: var(--fs-2xl); }
    h2 { font-size: var(--fs-xl); }
    h3 { font-size: var(--fs-lg); }
}

p {
    margin-bottom: var(--space-md);
    line-height: var(--lh-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================================
   Text Utilities
   ============================================================ */
.text-center { text-align: center; }
.text-white { color: var(--color-white); }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.05em; }
.font-medium { font-weight: var(--fw-medium); }
.font-semibold { font-weight: var(--fw-semibold); }
.font-bold { font-weight: var(--fw-bold); }

/* ============================================================
   Spacing Utilities
   ============================================================ */
.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); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* ============================================================
   Visibility
   ============================================================ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}
