:root {
    color-scheme: dark;
    --bg: #212121;
    --fg: #dadada;
    --muted: #9e9e9e;
    --link: #42a5f5;
    --accent: #f99f56;
    --border: #3a3a3a;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #fafafa;
    --fg: #212121;
    --muted: #6b6b6b;
    --link: #1565c0;
    --accent: #c2410c;
    --border: #e2e2e2;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 62.5%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

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

a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Main */

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Home card */

.home {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}

.avatar-scene {
    perspective: 700px;
}

.avatar {
    transition: transform 0.2s ease-out;
    will-change: transform;
}

.avatar img {
    display: block;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
}

.home h1 {
    margin: 2.4rem 0 0.4rem;
    font-size: 3.2rem;
}

.error-mark {
    width: 200px;
    height: 200px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-mark .error-code {
    margin: 0;
    font-size: 6.4rem;
    font-weight: 500;
    letter-spacing: -0.05em;
    line-height: 1;
}

.error-zero {
    color: var(--accent);
}

.social-slot {
    margin: 3.2rem 0 0;
    height: 2.8rem;
}

.subtitle {
    margin: 0;
    font-size: 2rem;
    color: var(--muted);
}

.subtitle + .subtitle {
    margin-top: 0.2rem;
}

.social {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 3.2rem 0 0;
    padding: 0;
    line-height: 0;
}

.social a {
    color: var(--fg);
    display: inline-flex;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.social svg {
    width: 2.8rem;
    height: 2.8rem;
    fill: currentColor;
}

/* Theme toggle */

.theme-toggle {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    padding: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: scale(1.08);
}

.theme-toggle svg {
    width: 2rem;
    height: 2rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .avatar,
    .social a,
    .theme-toggle {
        transition: none;
    }
}
