/*
 * Base — Reset & Typography Foundation
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + var(--space-16));
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
ul, ol { list-style: none; }

/* ── Accessibility ── */
.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-to-main {
    position: absolute;
    top: -100%;
    left: var(--space-16);
    background: var(--color-navy);
    color: #fff;
    padding: var(--space-8) var(--space-16);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    z-index: 9999;
}
.skip-to-main:focus { top: var(--space-8); }

/* ── Scroll progress bar ── */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--color-navy);
    z-index: 9999;
    transition: width 0.1s linear;
}

/* ── Back to top ── */
.back-to-top {
    position: fixed;
    bottom: var(--space-32);
    right: var(--space-32);
    width: 40px; height: 40px;
    background: var(--color-navy);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 500;
}
.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Fade-in animation (triggered by IntersectionObserver) ── */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: none;
}

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