/* ==========================================================================
   Reset — intentionally minimal. Normalises the handful of defaults the
   design actually fights with, and nothing else.
   ========================================================================== */

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

html {
    font-size: 16px; /* Base for rem units */
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    /* Anchored sections must clear the sticky header. Without this, jumping
       to #projects parks the heading underneath the nav bar. */
    scroll-padding-top: calc(var(--header-height) + var(--space-5));
}

body {
    margin: 0;
    font-family: var(--font-family-sans-serif);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis-weight: none;
    /* Theme switches should not flash a hard cut between palettes. */
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: var(--space-2);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

p {
    margin-top: 0;
    margin-bottom: var(--space-4);
}

ul, ol {
    margin-top: 0;
    margin-bottom: var(--space-4);
    padding-left: var(--space-5);
}

figure {
    margin: 0;
}

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

img {
    height: auto;
}

a {
    color: var(--color-accent);
    text-decoration: underline;
    background-color: transparent;
}

a:hover {
    color: var(--color-accent-hover);
}

button,
input,
optgroup,
select,
textarea {
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

button,
select {
    text-transform: none;
}

button {
    background: none;
}

[role="button"] {
    cursor: pointer;
}

/* Every interactive element gets the same visible focus treatment, and it is
   never removed — only replaced with the project's ring. */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

::selection {
    background-color: var(--color-accent-soft);
    color: var(--color-text-primary);
}
