:root {
    --sage:       #4a7c5f;
    --sage-hover: #3a6c4f;
    --font:       'DM Sans', system-ui, -apple-system, sans-serif;
    --font-mono:  'DM Mono', 'Fira Code', Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: #fefdf8;
    color: #1c1a16;
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* ── Portfolio nav ───────────────────────────────────────────── */
.site-header {
    border-bottom: 1px solid #ede9e0;
    background: #fefdf8;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-home {
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sage);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.nav-home:hover { color: var(--sage-hover); }
.nav-links {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}
.nav-links a {
    font-family: var(--font);
    font-size: 0.875rem;
    color: #7a7468;
    text-decoration: none;
    transition: color 0.1s;
}
.nav-links a:hover { color: #1c1a16; }
.nav-badge {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: #7a7468;
    letter-spacing: -0.01em;
    padding-left: 1rem;
    border-left: 1px solid #e0dbd0;
}

/* ── App subtitle ────────────────────────────────────────────── */
.app-subtitle {
    text-align: center;
    padding: 10px 20px 12px;
    border-bottom: 1px solid #ede9e0;
    background: #f5f2eb;
}
.app-subtitle p { font-size: 12px; color: #7a7468; margin-top: 2px; font-family: var(--font); }
.warning {
    background: #fdf3ea;
    border: 1px solid #e8d0a0;
    border-radius: 6px;
    padding: 6px 14px;
    margin: 8px auto 0;
    max-width: 340px;
    font-size: 11px;
    color: #8a6030;
}

/* ── Layout ──────────────────────────────────────────────────── */
main {
    flex: 1;
    display: flex;
    gap: 16px;
    padding: 16px;
    max-width: 1080px;
    margin: 0 auto;
    width: 100%;
}

.viewport { flex: 1; display: flex; flex-direction: column; align-items: center; }
#display {
    border-radius: 10px;
    border: 1px solid #e0dbd0;
    max-width: 100%;
    background: #080808;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    padding-bottom: 20px;
}

/* ── Controls ────────────────────────────────────────────────── */
#startBtn {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: #4a7c5f;
    color: white;
    transition: background 0.15s;
    font-family: var(--font);
}
#startBtn:hover         { background: #2f5c42; }
#startBtn.active        { background: #c07878; }
#startBtn.active:hover  { background: #a85858; }

.cg {
    background: #f5f2eb;
    border: 1px solid #e0dbd0;
    border-radius: 8px;
    padding: 12px;
}
.cg h3 {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #7a7468;
    margin-bottom: 8px;
    font-weight: 700;
}
.cr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}
.cr label { font-size: 11px; color: #7a7468; }
.v {
    font-size: 10px;
    color: #4a7c5f;
    font-family: var(--font-mono);
    min-width: 48px;
    text-align: right;
}
input[type="range"] {
    width: 100%;
    margin-bottom: 6px;
    accent-color: #4a7c5f;
    height: 3px;
}
select {
    background: #fefdf8;
    color: #1c1a16;
    border: 1px solid #e0dbd0;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11px;
    width: 100%;
    margin-bottom: 2px;
    font-family: var(--font);
}
.cbr {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}
.cbr label { font-size: 11px; color: #7a7468; }
.cbr input  { accent-color: #4a7c5f; }
.stats {
    font-size: 9px;
    font-family: var(--font-mono);
    color: #9a9490;
    text-align: center;
    padding: 4px;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid #ede9e0;
    padding: 1.25rem 0;
    margin-top: auto;
}
.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font);
    font-size: 0.8rem;
    color: #7a7468;
    flex-wrap: wrap;
}
.footer-inner a         { color: #7a7468; text-decoration: none; }
.footer-inner a:hover   { color: var(--sage); }
.footer-sep             { opacity: 0.4; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 760px) {
    main                        { flex-direction: column; padding: 10px; }
    .sidebar                    { width: 100%; max-height: none; }
    .nav-links a:last-child     { display: none; }
}
