:root {
    --bg: #f5f0e6;
    --bg-paper: #faf7f0;
    --ink: #2d2d2d;
    --ink-light: #5a5a5a;
    --accent: #ff6b35;
    --accent-yellow: #ffe66d;
    --line: rgba(45, 45, 45, 0.12);
}

[data-theme="dark"] {
    --bg: #1a1814;
    --bg-paper: #232019;
    --ink: #f5f0e6;
    --ink-light: #a8a28f;
    --accent: #ff8c5a;
    --line: rgba(245, 240, 230, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    min-height: 100vh;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.site-nav .logo {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-nav-actions a,
.theme-toggle {
    font-size: 0.9rem;
    color: var(--ink-light);
    text-decoration: none;
}

.site-nav-actions a:hover { color: var(--accent); }

.theme-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    background: var(--bg-paper);
    border-radius: 50%;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex: 0 0 auto;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover {
    background: color-mix(in srgb, var(--accent-yellow) 45%, var(--bg-paper));
    border-color: var(--accent);
    transform: rotate(8deg);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--ink);
    stroke-width: 2;
    fill: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.theme-toggle .sun {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

.theme-toggle .moon {
    opacity: 1;
    transform: rotate(0) scale(1);
    position: absolute;
}

[data-theme="dark"] .theme-toggle .sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="dark"] .theme-toggle .moon {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

.doc {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.doc h1 {
    font-family: 'Caveat', cursive;
    font-size: clamp(2.2rem, 7vw, 3rem);
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.doc .lede {
    color: var(--ink-light);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--ink-light);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.doc section {
    margin-bottom: 2rem;
}

.doc h2 {
    font-family: 'Caveat', cursive;
    font-size: 1.85rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.35rem;
    border-bottom: 3px solid var(--accent-yellow);
    display: inline-block;
}

.doc h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.doc p,
.doc li {
    margin-bottom: 0.75rem;
}

.doc ul {
    padding-left: 1.25rem;
}

.doc li {
    color: var(--ink-light);
}

.doc li strong {
    color: var(--ink);
}

.doc a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.doc code {
    font-size: 0.92em;
}

.doc-note {
    background: color-mix(in srgb, var(--accent-yellow) 35%, var(--bg-paper));
    border-left: 3px solid var(--accent);
    padding: 0.85rem 1rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.95rem;
    color: var(--ink-light);
}

.doc-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
    color: var(--ink-light);
}

.doc-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.doc-footer nav a {
    color: var(--ink);
    text-decoration: none;
}

.doc-footer nav a:hover {
    color: var(--accent);
}

.doc-footer nav span {
    opacity: 0.45;
}
