/*
 * Base styles: font faces, reset, document typography, focus handling.
 * Requires tokens.css.
 */

/* Inter variable (weights 100–900), self-hosted. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    tab-size: 4;
    scroll-padding-top: calc(var(--topbar-h) + var(--space-4));
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading);
    font-feature-settings: "cv11", "ss01";
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* Icons from the icon kit stay inline. */
i[class*="fa-"],
svg.svg-inline--fa {
    display: inline-block;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

button:disabled {
    cursor: not-allowed;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    overflow-wrap: break-word;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

fieldset {
    border: 0;
    padding: 0;
    min-width: 0;
}

legend {
    padding: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
}

[hidden] {
    display: none !important;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.011em;
}

h1 {
    font-size: var(--text-2xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--text-lg);
    letter-spacing: -0.014em;
}

h3 {
    font-size: var(--text-md);
}

h4,
h5,
h6 {
    font-size: var(--text-base);
}

a {
    color: var(--link);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease);
}

a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
}

strong,
b {
    font-weight: 600;
}

small {
    font-size: var(--text-sm);
}

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

code {
    padding: 1px 5px;
    border-radius: var(--radius-xs);
    background: var(--surface-active);
    color: var(--text);
}

pre {
    padding: var(--space-3) var(--space-4);
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-muted);
    line-height: var(--leading);
}

pre code {
    padding: 0;
    background: none;
}

kbd {
    display: inline-block;
    min-width: 20px;
    padding: 1px 5px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: var(--radius-xs);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

::selection {
    background: rgba(69, 69, 255, 0.2);
}

/* Focus: visible ring for keyboard users only. */
:focus {
    outline: none;
}

:focus-visible {
    outline: var(--focus-width) solid var(--focus);
    outline-offset: var(--focus-offset);
    border-radius: var(--radius-xs);
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
        scroll-behavior: auto !important;
    }
}
