/* base.css — reset, body, view switching, focus, [hidden], utilities, reduced motion. Owner: lead (Phase 4). */

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

body {
    background-color: var(--surface-0);
    color: var(--text-1);
    font-family: var(--font-ui);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}

.view-section {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- Foundation (UI refresh spec §1.3, §4.1) ---------- */
/* Visibility is driven by the `hidden` attribute (el.hidden = bool), never inline display. */
[hidden] {
    display: none !important;
}

/* One global focus ring for keyboard users; !important beats legacy `outline: none` on inputs (A3). */
:focus-visible {
    outline: 2px solid var(--focus-ring) !important;
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

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

/* English content nodes (lang="en") may use the Latin display face. */
:lang(en) {
    font-family: inherit;
}

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