/* ============================================
   Base Styles — Reset, Typography, Layout
   ============================================ */

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

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

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

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

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

a:hover {
    color: var(--color-primary-dark);
}

ul,
ol {
    list-style: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    background: none;
    outline: none;
}

button {
    cursor: pointer;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: var(--leading-tight);
    color: var(--color-text);
}

h1 {
    font-size: var(--text-5xl);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-4xl);
    font-weight: 700;
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--text-2xl);
    font-weight: 600;
}

h4 {
    font-size: var(--text-xl);
    font-weight: 600;
}

h5 {
    font-size: var(--text-lg);
    font-weight: 500;
}

p {
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

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

/* ---- Layout ---- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.container-narrow {
    max-width: var(--container-narrow);
}

.container-wide {
    max-width: var(--container-wide);
}

.section {
    padding: var(--space-24) 0;
    background-color: var(--color-bg);
    transition: background-color var(--transition-slow);
}

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

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

/* Alternating section background — replaces inline styles */
.section-alt {
    background-color: var(--color-bg-alt);
    transition: background-color var(--transition-slow);
}

/* ---- Flex / Grid Utilities ---- */
.flex {
    display: flex;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

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

.items-start {
    align-items: flex-start;
}

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

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

.grid {
    display: grid;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

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

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

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    h1 {
        font-size: var(--text-4xl);
    }

    h2 {
        font-size: var(--text-3xl);
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }

    h3 {
        font-size: var(--text-xl);
    }

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

    .container {
        padding: 0 var(--space-4);
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

/* ---- Page wrapper ---- */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: var(--navbar-height);
}