/* CSS Variables for theming */
:root {
    --bg-color: #fff;
    --text-color: #333;
    --header-color: #2c3e50;
    --border-color: #ddd;
    --footer-color: #777;
}
/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000;
        --text-color: #fff;
        --header-color: #fff;
        --border-color: #333;
        --footer-color: #ccc;
    }
}
/* Dark grey theme */
.dark-grey-theme {
    --bg-color: #333;
    --text-color: #ccc;
    --header-color: #ccc;
    --border-color: #555;
    --footer-color: #aaa;
}
.dark-grey-theme code {
    background: #555;
}

/* Body and general styles */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.5; margin: 0; color: var(--text-color); background-color: var(--bg-color); }


/* Heading styles */
h1 { font-size: 2em; font-weight: 300; margin: 0; color: var(--header-color); }
h3 { font-size: 1em; font-weight: 500; margin: 0 0 0.5em; color: var(--header-color); }
p { margin: 0; }
ul { margin: 0; list-style: none; padding: 0; }
footer {
    text-align: center;
    margin-top: 3em;
    padding-top: 1em;
    font-size: 0.9em;
    color: var(--footer-color);
}
/* Grid layout */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 0 20px;
}
/* Card styles */
.card {
    background: var(--bg-color);
    padding: 1em 0;
}


/* Header styles */
header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    transition: opacity 0.5s ease;
    position: relative;
}
header img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 15px;
}
#legal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    background: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 300;
    text-decoration: none;
}
li { margin-bottom: 0; font-size: 1em; }
footer p { font-size: 1em; }
/* Link styles */
a { color: var(--text-color); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}
.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #aaa;
}
.team-member, .kernel-link {
    cursor: pointer;
}
.team-member img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 10px;
}
#modal-contrast-btn {
    padding: 0;
    background: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    text-decoration: underline;
}
/* Code styles */
code { background: #f4f4f4; padding: 2px 4px; border-radius: 3px; font-family: 'Courier New', monospace; font-size: 1em; }
pre { margin: 0; white-space: pre-wrap; }
@media (prefers-color-scheme: dark) {
    code { background: #444; }
}
/* Mobile */
@media (max-width: 600px) {
    body { font-size: 14px; }
    .app-grid {
        gap: 15px;
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    h1 { font-size: 1.5em; }
    img { width: 50px; height: 50px; }
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    header img {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}
.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover {
    color: #aaa;
}
.team-member, .kernel-link {
    cursor: pointer;
}
#modal-contrast-btn {
    padding: 0;
    background: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    text-decoration: underline;
}
#legal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 0;
    background: transparent;
    color: var(--text-color);
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 300;
    text-decoration: none;
}