/* =========================================================
   base.css — Reset, typography, and global themes.
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: var(--font-size-base);
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

/* ---------------------------------------------------
   Body: the most important themed element.
   Transitions limited to color properties so layout
   is not reflowed on theme change.
   --------------------------------------------------- */
body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: 1rem;
    line-height: var(--line-height-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    transition:
        background-color var(--theme-transition),
        color var(--theme-transition);
}

/* ---------------------------------------------------
   Native scrollbar (Chromium, Edge, Safari)
   --------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--color-scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar-thumb);
    border-radius: var(--radius-pill);
    border: 2px solid var(--color-scrollbar-track);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-scrollbar-thumb-hover);
}

/* Firefox */
html {
    scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);
    scrollbar-width: thin;
}

/* ---------------------------------------------------
   Text selection
   --------------------------------------------------- */
::selection {
    background-color: var(--color-selection-bg);
    color: var(--color-selection-text);
}
::-moz-selection {
    background-color: var(--color-selection-bg);
    color: var(--color-selection-text);
}

/* ---------------------------------------------------
   Direction and font rules
   --------------------------------------------------- */
[dir="ltr"],
code,
pre,
kbd,
samp {
    font-family: var(--font-family-mono);
}

/* ---------------------------------------------------
   Headings
   --------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--space-3);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    transition: color var(--theme-transition);
}
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl);  }
h4 { font-size: var(--font-size-lg);  }

/* ---------------------------------------------------
   Paragraphs
   --------------------------------------------------- */
p {
    margin: 0 0 var(--space-4);
    color: var(--color-text);
    transition: color var(--theme-transition);
}

/* ---------------------------------------------------
   Links
   --------------------------------------------------- */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--color-link-hover);
}

/* ---------------------------------------------------
   Form elements inherit our font
   --------------------------------------------------- */
input,
textarea,
select,
button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* ---------------------------------------------------
   Images
   --------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------------------------------------------------
   Lists inside nav shouldn't be styled
   --------------------------------------------------- */
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ---------------------------------------------------
   Focus ring for accessibility
   --------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ---------------------------------------------------
   Container
   --------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

/* ---------------------------------------------------
   Skip link
   --------------------------------------------------- */
.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: 0;
    background: var(--color-primary);
    color: #fff;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
}
.skip-link:focus {
    inset-inline-start: var(--space-3);
    top: var(--space-3);
    z-index: 1000;
}

/* ---------------------------------------------------
   Hidden utility
   --------------------------------------------------- */
[hidden] { display: none !important; }