/* ================================================
   Reset — minimal normalize for consistent
   cross-browser baseline.
   ================================================ */

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01", "ss03";
}

::selection {
    background: var(--color-primary-ring);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-faint);
    border: 2px solid transparent;
    background-clip: padding-box;
}

h1, h2, h3 {
    font-family: var(--font-display);
    /* Medium (not semibold) — matches the design's Cal Sans treatment.
       Cal Sans reads naturally heavier than Inter at the same weight, so
       500 here is roughly the visual weight of Inter 600. */
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-optical-sizing: auto;
}

h4, h5, h6 {
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
}

a {
    color: var(--color-text-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img, svg {
    display: block;
    max-width: 100%;
}

button {
    cursor: pointer;
    font: inherit;
    color: inherit;
    border: none;
    background: none;
}

input, select, textarea {
    font: inherit;
    color: inherit;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Headings receive programmatic focus from FocusOnNavigate for screen
   readers, but shouldn't show a visible ring — they're not interactive. */
h1:focus, h1:focus-visible,
h2:focus, h2:focus-visible,
h3:focus, h3:focus-visible {
    outline: none;
}

/* Honour the OS-level reduced-motion preference. */
@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;
    }
}
