:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    --text: #1f2937;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e5e7eb;
    --border-strong: #d1d5db;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --focus-ring: #0ea5e9;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 24px;
    max-width: 820px;
    margin-inline: auto;
    color: var(--text);
    background: var(--bg);
}

h1 {
    font-size: clamp(1.6rem, 3vw, 2rem);
}

p,
li,
td,
th,
label,
address {
    max-width: 70ch;
}

a {
    color: var(--accent);
    text-underline-offset: 2px;
}

a:hover {
    text-decoration-thickness: 2px;
}

.profile {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.avatar {
    border-radius: 12px;
    object-fit: cover;
}

.site-nav,
section,
footer,
main > h1,
main > p,
main > ul {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-top: 18px;
}

ul,
ol {
    padding-left: 20px;
}

.site-nav ul {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    list-style: none;
    padding-left: 0;
    margin: 0;
}

form {
    display: grid;
    gap: 8px;
}

input,
textarea,
button {
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font: inherit;
}

button[type="submit"] {
    width: fit-content;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    margin-top: 6px;
}

button[type="submit"]:hover {
    background: var(--accent-hover);
}

a:focus-visible,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #111827;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    z-index: 1000;
}

table {
    width: 100%;
    border-collapse: collapse;
}

caption {
    text-align: left;
    margin-bottom: 8px;
    font-weight: 600;
}

th,
td {
    border: 1px solid var(--border-strong);
    padding: 10px;
    text-align: left;
}

@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .profile {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --text: #e5e7eb;
        --bg: #0f172a;
        --surface: #111827;
        --border: #374151;
        --border-strong: #4b5563;
        --accent: #60a5fa;
        --accent-hover: #93c5fd;
        --focus-ring: #22d3ee;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
