/* ==========================================================================
   Base — Reset + Typography + Utilities
   ========================================================================== */

/* Box sizing */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Reset margins */
body,
h1, h2, h3, h4, h5, h6,
p,
figure,
blockquote,
dl, dd {
    margin: 0;
}

/* Remove list styles */
ul[role='list'],
ol[role='list'] {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Body */
html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-body);
    line-height: 1.6;
    color: var(--color-text-dark);
    background-color: #F8F6EF;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
}

/* Buttons reset */
button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Images */
img,
picture,
svg {
    display: block;
    max-width: 100%;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

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

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }

/* Paragraphs */
p {
    color: var(--color-text-gray);
    line-height: 1.7;
}

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

/* Section */
.section {
    padding: var(--section-padding);
}

/* Section Label (small green text above headings) */
.section-label {
    font-family: var(--font-heading);
    font-size: var(--text-body-sm);
    font-weight: 600;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-xs);
}

/* Section Heading */
.section-heading {
    font-size: var(--text-h2);
    margin-bottom: var(--space-md);
}

/* Screen reader only */
.sr-only,
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-content link — hidden until focused */
.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    z-index: 1000;
    padding: 12px 20px;
    background-color: var(--color-primary);
    color: #1b0b03;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 16px;
    outline: 2px solid #1b0b03;
    outline-offset: 2px;
    color: #1b0b03;
}

/* Global focus styles — applies to anything that doesn't override it */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* main has tabindex=-1 for skip-link target; suppress its focus ring */
main:focus,
main:focus-visible {
    outline: none;
}

/* ==========================================================================
   Responsive Typography
   ========================================================================== */

@media (max-width: 1100px) {
    h1 { font-size: 40px; }
    h2 { font-size: 30px; }
    h3 { font-size: 24px; }
}

@media (max-width: 768px) {
    body {
        font-size: var(--text-body-mobile);
    }

    h1 { font-size: var(--text-h1-mobile); }
    h2 { font-size: var(--text-h2-mobile); }
    h3 { font-size: var(--text-h3-mobile); }
    h4 { font-size: var(--text-h4-mobile); }

    .section {
        padding: var(--section-padding-mobile);
    }

    .section-heading {
        font-size: var(--text-h2-mobile);
    }
}

/* ==========================================================================
   Reduced motion — disable transitions/animations for users who request it
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
