/* ============================================================
   AVIVX — Layout
   Reset, container, grid, spacing, responsive utilities.
   ============================================================ */

/* ── RESET ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ── CONTAINER ── */
.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

@media (max-width: 640px) {
    .container,
    .container-narrow {
        padding: 0 var(--space-5);
    }
}

/* ── SECTION SPACING ── */
.section {
    padding: var(--space-24) 0;
}

.section-sm {
    padding: var(--space-16) 0;
}

.section-lg {
    padding: var(--space-32) 0;
}

@media (max-width: 768px) {
    .section {
        padding: var(--space-16) 0;
    }
    .section-sm {
        padding: var(--space-12) 0;
    }
    .section-lg {
        padding: var(--space-20) 0;
    }
}

/* ── GRID ── */
.grid {
    display: grid;
    gap: var(--space-6);
}

.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);
    }
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ── FLEX UTILITIES ── */
.flex {
    display: flex;
}

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

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

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

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

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ── TEXT UTILITIES ── */
.text-center { text-align: center; }
.text-left   { text-align: left; }

.text-sm   { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg   { font-size: var(--text-lg); }

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

.font-medium { font-weight: var(--weight-medium); }
.font-bold   { font-weight: var(--weight-bold); }

/* ── SPACING UTILITIES ── */
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }

/* ── BACKGROUND UTILITIES ── */
.bg-soft  { background: var(--color-bg-soft); }
.bg-muted { background: var(--color-bg-muted); }
.bg-white { background: var(--color-white); }

/* ── DIVIDER ── */
.divider {
    border: none;
    border-top: 1px solid var(--color-border-light);
    margin: var(--space-16) 0;
}

/* ── VISUALLY HIDDEN (a11y) ── */
.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;
}
