/* =====================================================================
   Base — reset + typography
   ===================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--ink-800);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
video,
svg,
canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: var(--brand-500);
    text-decoration: none;
    transition: color var(--dur-fast);
}

a:hover {
    color: var(--brand-600);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0 0 var(--sp-3);
    font-weight: var(--fw-bold);
    line-height: var(--lh-tight);
    color: var(--ink-900);
    letter-spacing: -0.015em;
}

h1 {
    font-size: var(--fs-4xl);
    font-weight: var(--fw-extrabold);
    letter-spacing: -0.025em;
}

h2 {
    font-size: var(--fs-3xl);
    letter-spacing: -0.02em;
}

h3 {
    font-size: var(--fs-2xl);
}

h4 {
    font-size: var(--fs-xl);
}

h5 {
    font-size: var(--fs-lg);
}

h6 {
    font-size: var(--fs-base);
}

p {
    margin: 0 0 var(--sp-4);
}

small {
    font-size: var(--fs-sm);
}

strong,
b {
    font-weight: var(--fw-semibold);
}

code,
pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 3px;
    border-radius: 4px;
}

::selection {
    background: var(--brand-100);
    color: var(--ink-900);
}

@media (hover: hover) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    ::-webkit-scrollbar-track {
        background: var(--ink-50);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--ink-200);
        border-radius: var(--r-full);
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--ink-300);
    }
}

@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;
    }
}
