/* ============================================================
   tools. — tokens, reset, base typography
   ============================================================ */

:root {
    --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Archivo', var(--font-sans);
    --font-body: var(--font-sans);
    --font-primary: var(--font-sans);

    /* Type scale */
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2.25rem;
    --leading-tight: 1.25;
    --leading-normal: 1.55;
    --leading-relaxed: 1.7;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 2rem;
    --space-8: 2.5rem;
    --space-9: 3rem;
    --space-10: 4rem;
    --spacing-xs: var(--space-1);
    --spacing-sm: var(--space-2);
    --spacing-md: var(--space-4);
    --spacing-lg: var(--space-5);
    --spacing-xl: var(--space-6);
    --spacing-xxl: var(--space-8);

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --border-radius: var(--radius-md);

    /* Motion */
    --ease-out: cubic-bezier(0.2, 0, 0, 1);
    --duration-fast: 100ms;
    --duration-base: 160ms;
    --transition-speed: var(--duration-base);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { cursor: pointer; font-family: inherit; font-size: inherit; border: 0; background: transparent; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
    color: var(--text);
    font-weight: 600;
}
h1 { font-size: var(--text-2xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-md); }
h4 { font-size: var(--text-base); }

p { color: var(--text-secondary); }

code, pre, kbd, samp { font-family: var(--font-mono); }

::selection { background-color: var(--accent); color: var(--bg); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.skip-link {
    position: absolute;
    top: -40px;
    left: var(--space-4);
    padding: var(--space-2) var(--space-3);
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
    z-index: 1000;
}
.skip-link:focus { top: var(--space-2); outline: none; }

.hidden { display: none !important; }
.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;
}
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Container — used by legacy tool pages */
.container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}
