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

:root {
    --bg: #0e0e0e;
    --fg: #d4d0c8;
    --fg-muted: #9e9a92;
}

[data-theme="light"] {
    --bg: #d4d0c8;
    --fg: #0e0e0e;
    --fg-muted: #6b6a67;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    transition: background 0.2s ease, color 0.2s ease;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 64px 24px 80px;
}

.layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 48px;
}

.content {
    flex: 1;
    min-width: 0;
    max-width: 480px;
}

.canvas-wrap {
    flex-shrink: 0;
    width: 400px;
}

@media (max-width: 860px) {
    .page { padding: 40px 16px 60px; }
    .layout { flex-direction: column; }
    .content { max-width: none; }
    .canvas-wrap { width: 100%; }
    body { font-size: 0.9rem; }
    h1 { font-size: 1rem; }
}

h1 {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: lowercase;
    color: var(--fg);
    margin-bottom: 20px;
}

h2 {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--fg);
    margin-bottom: 12px;
}

p {
    color: var(--fg);
    margin-bottom: 32px;
}

a {
    color: var(--fg);
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}

a:hover { opacity: 0.7; }

.rows {
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
}

.row {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.row-label {
    color: var(--fg-muted);
    min-width: 120px;
    flex-shrink: 0;
}

.row-value {
    color: var(--fg);
}

canvas {
    display: block;
    width: 100%;
    max-width: 512px;
    height: auto;
    aspect-ratio: 1;
    image-rendering: pixelated;
}

.theme-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    color: var(--fg-muted);
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.15s ease;
}

.theme-toggle:hover { color: var(--fg); }
