/* Base layer — reset, document defaults, typography, ambient, motion, a11y helpers.
   Class names preserved from the pre-refresh inline system so existing pages
   keep rendering. Loaded on every page after tokens.css. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 0.5em;
    color: var(--text);
}
a { color: inherit; }
img { display: block; max-width: 100%; }
/* The hidden attribute must always win — author display rules on components
   (.btn { display:inline-flex } etc.) would otherwise override the UA's
   [hidden]{display:none} and show "hidden" elements. */
[hidden] { display: none !important; }

/* ── Skip link (first focusable element on every page) ── */
.skip-link {
    position: absolute;
    left: 12px; top: -48px;
    z-index: 100;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--primary-strong);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 12px; outline: none; box-shadow: var(--focus-ring); }

/* ── Visible focus for keyboard users everywhere ── */
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }

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

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

/* ── Ambient orbs (kept but calmed; opt-in via .bg-orbs element) ── */
.bg-orbs {
    position: fixed; inset: 0; z-index: -1;
    pointer-events: none; overflow: hidden;
}
.bg-orbs::before, .bg-orbs::after {
    content: ''; position: absolute;
    width: 620px; height: 620px; border-radius: 50%;
    filter: blur(150px); opacity: 0.10;
}
.bg-orbs::before {
    top: -280px; left: -200px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
}
.bg-orbs::after {
    bottom: -280px; right: -200px;
    background: radial-gradient(circle, var(--accent), transparent 70%);
}

/* ── Reveal-on-scroll ── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.06s; }
.reveal-delay-2 { transition-delay: 0.12s; }
.reveal-delay-3 { transition-delay: 0.18s; }
.reveal-delay-4 { transition-delay: 0.24s; }
.reveal-delay-5 { transition-delay: 0.30s; }

/* ── Reduced motion: disable all decorative motion ── */
@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;
    }
    .reveal { opacity: 1; transform: none; }
}
