/* Resets, self-hosted @font-face declarations, and base element styles. */

/* === Self-hosted fonts (WOFF2 only, no external requests) === */
@font-face {
    font-family: 'Big Shoulders Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/big-shoulders-display-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Big Shoulders Display';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/big-shoulders-display-800.woff2') format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/public-sans-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/public-sans-600.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-500.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-mono-600.woff2') format('woff2');
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    color-scheme: light dark;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--ink);
    background: var(--paper);
    min-height: 100vh;
    overflow-x: hidden;
}

img, picture, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: var(--leading-tight);
    text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { max-width: 68ch; }

/* Long unbroken strings (obfuscated emails, URLs) must not force horizontal
   scroll on narrow viewports — the container itself never scrolls sideways. */
a, .mono, .card__meta, .contact-channel dd {
    overflow-wrap: anywhere;
}

a {
    color: var(--link);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 2px; }

code, .mono, .tag, .metric, .metric__value {
    font-family: var(--font-mono);
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

ul[class], ol[class] { list-style: none; padding: 0; }

/* === Focus visibility — every interactive element gets a real, high-contrast ring === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === Skip link === */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: var(--signal);
    color: var(--signal-ink);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-mono);
    font-weight: 600;
}

.skip-link:focus {
    left: var(--space-4);
    top: var(--space-4);
}

/* === Motion === */
@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;
    }
}
