/**
 * Base Reset, Typography & Utility Styles
 */

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

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

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Accessibility Focus Ring */
:focus-visible {
    outline: 2px solid var(--color-terracotta);
    outline-offset: 4px;
}

/* Typography Rules */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.15;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.heading-accent {
    font-family: var(--font-accent);
    color: var(--color-terracotta);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 400;
    display: block;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.heading-large {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
}

.heading-medium {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.heading-small {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
}

p {
    margin-bottom: 1.25rem;
    color: var(--color-muted);
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-smooth);
}

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

svg {
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: clamp(1.25rem, 4vw, 2.5rem);
    padding-right: clamp(1.25rem, 4vw, 2.5rem);
}

.container-narrow {
    max-width: 860px;
}

/* Utility Section Spacing */
.section {
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
    position: relative;
}

.section-light {
    background-color: var(--color-background);
}

.section-surface {
    background-color: var(--color-surface);
}

.section-dark {
    background-color: var(--color-dark);
    color: var(--color-text-light);
}

.section-dark p {
    color: rgba(247, 242, 233, 0.75);
}

.section-dark h1, .section-dark h2, .section-dark h3 {
    color: var(--color-text-light);
}

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

.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 for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-terracotta);
    color: white;
    padding: 8px 16px;
    z-index: 10000;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
