/* cyber4.css - Imperial Design System */
:root {
    color-scheme: light;
    --bg-color: #ffffff;
    --text-color: #222222;
    --tagline-color: #666666;
    --border-color: #dddddd;
    --code-bg: #f4f4f4;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg-color: #1a1a1a;
        --text-color: #eeeeee;
        --tagline-color: #aaaaaa;
        --border-color: #444444;
        --code-bg: #2d2d2d;
    }
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-color: #ffffff;
    --text-color: #222222;
    --tagline-color: #666666;
    --border-color: #dddddd;
    --code-bg: #f4f4f4;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-color: #1a1a1a;
    --text-color: #eeeeee;
    --tagline-color: #aaaaaa;
    --border-color: #444444;
    --code-bg: #2d2d2d;
}

body {
    font-family: sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    max-width: 750px;
    margin: 40px auto;
    padding: 0 20px;
    transition: background-color 0.3s, color 0.3s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    padding-bottom: 10px;
}

.site-title {
    display: flex;
    flex-direction: column;
}

h1 { 
    margin: 0 0 0.25rem 0; 
    letter-spacing: -1px; 
    font-size: 2rem;
}

h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.35rem;
}

p {
    margin: 0 0 0.75rem 0;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    font-size: 0.85rem;
    border: none;
    background: none;
    color: var(--text-color);
    cursor: pointer;
}

.theme-toggle-label {
    font-size: 0.85rem;
}

.theme-toggle-track {
    position: relative;
    width: 34px;
    height: 18px;
    border-radius: 999px;
    background: var(--border-color);
    transition: background 0.2s ease-in-out;
}

.theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-color);
    box-shadow: 0 0 0 1px var(--border-color);
    transition: transform 0.2s ease-in-out, background 0.2s ease-in-out;
}

:root[data-theme="light"] .theme-toggle-thumb {
    background: #b0b0b0;
}

.theme-toggle[aria-checked="true"] .theme-toggle-track {
    background: var(--text-color);
}

.theme-toggle[aria-checked="true"] .theme-toggle-thumb {
    transform: translateX(16px);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 3px;
    border-radius: 4px;
}

.tagline { 
    font-style: italic; 
    color: var(--tagline-color); 
}

section { margin-bottom: 3rem; }

/* Links */
a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--tagline-color);
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

a:hover {
    background-color: var(--code-bg);
    border-bottom-color: var(--text-color);
}

/* Metadata and 404 Status */
.mono-box { 
    font-family: monospace; 
    background: var(--code-bg); 
    padding: 2px 8px; 
    border-radius: 3px;
    font-size: 0.9rem;
}

.center { text-align: center; }

footer {
    margin-top: 5rem;
    font-size: 0.85rem;
    color: var(--tagline-color);
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* Mobile mode */
@media (max-width: 600px) {
    body {
        margin: 20px auto;
        padding: 0 16px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }

    .theme-toggle {
        padding: 8px 0;
    }

    footer {
        margin-top: 3rem;
    }
}

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