/* ============================================
   MONTSE TUDELA - Base Styles
   Modern reset + Typography + Layout
   ============================================ */

/* ── Modern Reset ── */
*,
*::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);
    font-weight: var(--fw-normal);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--neutral-900);
    background-color: var(--neutral-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

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

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

ul,
ol {
    list-style: none;
}

/* ── Typography ── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    line-height: var(--leading-tight);
    color: var(--neutral-900);
}

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

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

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

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

p {
    margin-bottom: var(--space-2);
}

p:last-child {
    margin-bottom: 0;
}

strong {
    font-weight: var(--fw-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ── Layout Utilities ── */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-padding);
}

.section {
    padding-block: var(--space-8);
}

@media (min-width: 768px) {
    .section {
        padding-block: var(--space-12);
    }
}

.section--alt {
    background-color: var(--primary-50);
}

.section--dark {
    background-color: var(--neutral-900);
    color: var(--neutral-100);
}

/* Grid */
.grid {
    display: grid;
    gap: var(--space-3);
}

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

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

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

@media (min-width: 640px) {
    .grid--2 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

@media (min-width: 1024px) {
    .grid--4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .grid {
        gap: var(--space-4);
    }
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex--center {
    align-items: center;
    justify-content: center;
}

.flex--between {
    align-items: center;
    justify-content: space-between;
}

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

.flex--gap-1 {
    gap: var(--space-1);
}

.flex--gap-2 {
    gap: var(--space-2);
}

.flex--gap-3 {
    gap: var(--space-3);
}

/* ── Text Utilities ── */
.text-center {
    text-align: center;
}

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

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

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

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

.text-light {
    color: var(--neutral-100);
}

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

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

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

/* ── Section Heading ── */
.section-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.section-header h2 {
    margin-bottom: var(--space-2);
}

.section-header p {
    font-size: var(--text-lg);
    color: var(--neutral-600);
    max-width: 640px;
    margin-inline: auto;
}

/* ── Accessibility ── */
:focus-visible {
    outline: 3px solid var(--primary-500);
    outline-offset: 2px;
}

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

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-2);
    padding: var(--space-1) var(--space-2);
    background: var(--primary-700);
    color: white;
    border-radius: var(--radius-md);
    z-index: 9999;
    font-size: var(--text-sm);
}

.skip-link:focus {
    top: var(--space-1);
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}