/*
 * Shared look of the whole site: the 3D world's interface, the simple pages
 * and the admin view all start from these tokens. The season sets
 * data-season on <html>, which swaps the accent and background tint.
 */

:root {
    --font: "Avenir Next", "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    --ink: #1f1d2b;
    --ink-soft: #55516a;
    --paper: #f6f3ee;
    --surface: #ffffff;
    --line: #e4dfd6;
    --accent: #3b62d8;
    --accent-ink: #ffffff;
    --accent-soft: #e6ecfd;
    --danger: #b3261e;
    --focus: #1f1d2b;

    --radius: 14px;
    --radius-small: 9px;
    --shadow: 0 10px 30px rgb(31 29 43 / 0.12), 0 2px 6px rgb(31 29 43 / 0.08);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-season="winter"] { --accent: #2f6fdd; --accent-soft: #e2edff; --paper: #f1f5fb; --line: #dbe3f0; }
:root[data-season="spring"] { --accent: #c2356f; --accent-soft: #fde6ef; --paper: #fbf3f6; --line: #f0dde5; }
:root[data-season="summer"] { --accent: #b85c00; --accent-soft: #fdefd6; --paper: #fbf6ea; --line: #efe4cb; }
:root[data-season="fall"]   { --accent: #b5421f; --accent-soft: #fbe5d8; --paper: #f9f1e8; --line: #eeddcb; }

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

html {
    font-family: var(--font);
    font-size: 100%;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-text-size-adjust: 100%;
    transition: background-color 0.8s ease;
}

body { margin: 0; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 800; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

/* Keyboard focus is always clearly visible */
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 6px;
    box-shadow: 0 0 0 6px rgb(255 255 255 / 0.9);
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

.eyebrow {
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.16em;
    text-transform: uppercase; color: var(--accent);
}

/* Buttons */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
    min-height: 44px; padding: 0.6em 1.15em;
    font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none;
    color: var(--ink); background: var(--surface);
    border: 2px solid var(--ink); border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background-color 0.2s, color 0.2s, border-color 0.4s;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0); }
.button-primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.button-small { min-height: 38px; padding: 0.4em 0.95em; font-size: 0.92rem; }
.button-large { min-height: 54px; padding: 0.7em 2.4em; font-size: 1.15rem; }
.button-danger { color: var(--danger); border-color: var(--danger); }
.button[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.icon-button {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px; padding: 0;
    color: var(--ink); background: var(--surface);
    border: 2px solid var(--ink); border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background-color 0.2s;
}
.icon-button:hover { transform: translateY(-2px); }
.icon { width: 22px; height: 22px; fill: currentColor; }
.icon .stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.tag {
    display: inline-block; padding: 0.22em 0.75em;
    font-size: 0.84rem; font-weight: 700; text-decoration: none;
    color: var(--ink); background: var(--accent-soft);
    border-radius: 999px; border: 2px solid transparent;
    transition: background-color 0.4s;
}
a.tag:hover { border-color: var(--accent); }
.tag.is-active { color: var(--accent-ink); background: var(--accent); }

.badge {
    display: inline-block; vertical-align: middle; padding: 0.15em 0.6em;
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent-ink); background: var(--accent); border-radius: 999px;
}

/* Text written in Markdown (project descriptions, About) */
.prose > * + * { margin-top: 0.9em; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose h3, .prose h4 { font-size: 1.1rem; margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 0.35em; }
.prose code { font-family: var(--font-mono); font-size: 0.9em; padding: 0.1em 0.35em; background: var(--accent-soft); border-radius: 5px; }
.prose pre { padding: 1em; overflow-x: auto; background: var(--ink); color: #fff; border-radius: var(--radius-small); }
.prose pre code { padding: 0; background: none; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 1em; border-left: 4px solid var(--accent); color: var(--ink-soft); }

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