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

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd {
    margin: 0;
}

ul[role='list'], ol[role='list'], nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

html:focus-within {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    text-rendering: optimizeSpeed;
    line-height: 1.5;
    background-color: var(--color-bg);
    color: var(--color-fg);
    font-family: var(--font-text);
    font-size: var(--step-0);
}

a:not([class]) {
    text-decoration-skip-ink: auto;
}

img, picture {
    max-width: 100%;
    display: block;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
}

/* Typography */
h1, h2, h3, h4, h5 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-fg);
    margin-bottom: var(--space-s);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p {
    margin-bottom: var(--space-m);
    max-width: 65ch;
}

a {
    color: var(--color-brand);
    text-decoration: underline;
    text-underline-offset: 4px;
}

a:hover {
    color: var(--color-fg);
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-fg);
    color: var(--color-bg);
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Layout utilities */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-m);
}

.container-tight {
    max-width: var(--container-tight);
}

.grid {
    display: grid;
    gap: var(--grid-gap);
}

/* Header */
.site-header {
    border-bottom: 2px solid var(--color-fg);
    padding-block: var(--space-s);
    background: var(--color-surface);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    text-decoration: none;
    color: var(--color-fg);
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.logo-mark {
    background: var(--color-brand);
    color: white;
    padding: var(--space-3xs) var(--space-2xs);
    font-size: var(--step--1);
}

.logo-text {
    font-size: var(--step-0);
}

.main-nav ul {
    display: flex;
    gap: var(--space-s);
}

.main-nav a {
    text-decoration: none;
    color: var(--color-fg-muted);
    font-weight: 700;
    font-size: var(--step--1);
    font-family: var(--font-display);
    text-transform: uppercase;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--color-brand);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-fg);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
    }
}

/* Footer */
.site-footer {
    background: var(--color-fg);
    color: var(--color-surface-alt);
    padding-block: var(--space-2xl) var(--space-l);
    margin-top: var(--space-3xl);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-xl);
    border-bottom: 1px solid var(--color-fg-muted);
    padding-bottom: var(--space-xl);
    margin-bottom: var(--space-l);
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.site-footer .logo {
    color: var(--color-surface);
    margin-bottom: var(--space-s);
}

.footer-desc {
    color: var(--color-fg-muted);
    font-size: var(--step--1);
}

.site-footer h3 {
    color: var(--color-surface);
    font-size: var(--step--1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-s);
}

.site-footer ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.site-footer a {
    color: var(--color-surface-alt);
    text-decoration: none;
    font-size: var(--step--1);
}

.site-footer a:hover {
    color: var(--color-brand);
    text-decoration: underline;
}

.footer-bottom {
    font-size: var(--step--2);
    color: var(--color-fg-muted);
}
