:root {
    --bg-color: #050505;
    --term-bg: #0a0a0a;
    --term-border: #1a1a1a;
    --term-header-bg: #111111;
    --text-color: #bbb;
    --accent-color: #666;
    --font-main: 'JetBrains Mono', monospace;
    --font-size-base: 16px;
    --highlight-color: #fff;
}

.light {
    --bg-color: #ffffff;
    --term-bg: #fff;
    --term-border: #ddd;
    --term-header-bg: #f9f9f9;
    --text-color: #222;
    --accent-color: #888;
    --highlight-color: #000;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    line-height: 1.6;
    transition: background-color 0.3s;
}

.window {
    width: 100%;
    max-width: 1200px;
    min-height: 70vh;
    border: 1px solid var(--term-border);
    background-color: var(--term-bg);
    display: flex;
    flex-direction: column;
    margin: auto;
    border-radius: 8px;
    overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s;
}

.window-system-bar {
    background-color: var(--term-header-bg);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--term-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--accent-color);
}

.window-controls {
    display: flex;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--term-border);
}

.window-body {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.term-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.user-id {
    font-weight: 700;
    color: var(--highlight-color);
    font-size: 1.1rem;
    display: inline-flex;
    align-items: baseline;
}

.cursor {
    display: inline-block;
    width: 1ch;
    height: 2px;
    background-color: var(--highlight-color);
    margin-left: 2px;
    animation: blink 1s step-end infinite;
    vertical-align: bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.term-nav {
    display: flex;
    gap: 1rem;
}

.term-nav a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.term-nav a:hover, .term-nav a.active {
    opacity: 1;
    text-decoration: underline;
}

.term-divider {
    border: 0;
    border-top: 1px solid var(--term-border);
    margin-bottom: 2rem;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.content-block {
    margin-bottom: 1.5rem;
}

.links-centered {
    text-align: center;
}

.links-val {
    display: inline-flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.cmd {
    color: var(--accent-color);
    font-weight: 500;
}

.val {
    color: var(--text-color);
}

.external-link {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.external-link-icon::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask-image: var(--mask-icon);
    mask-image: var(--mask-icon);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.link-mastodon { --mask-icon: var(--icon-mastodon); }
.link-github { --mask-icon: var(--icon-github); }

.external-link:hover {
    opacity: 0.8;
}

.ascii-art {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.2;
    margin: 0 auto 2rem auto;
    color: var(--text-color);
    text-align: left;
    white-space: pre;
    width: fit-content;
}

.welcome-text {
    margin-bottom: 2rem;
    text-align: center;
}

footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--term-border);
    font-size: 0.7rem;
    color: var(--accent-color);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
}

.footer-left { justify-self: start; }
.footer-center { justify-self: center; }
.footer-right { justify-self: end; }

.theme-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}

.theme-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.theme-option::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

#opt-light::before { -webkit-mask-image: var(--icon-light-mode); mask-image: var(--icon-light-mode); }
#opt-dark::before { -webkit-mask-image: var(--icon-dark-mode); mask-image: var(--icon-dark-mode); }

.theme-option.active {
    opacity: 1;
    font-weight: 700;
    color: var(--text-color);
}

.theme-divider {
    opacity: 0.5;
}

@media (max-width: 600px) {
    body { padding: 0.5rem; }
    .window-body { padding: 1rem; }
    .term-header { 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
    }
    .term-nav { 
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    .links-val {
        gap: 0.5rem;
        font-size: 0.8rem;
        flex-wrap: nowrap;
    }
    footer {
        grid-template-columns: 1fr 1fr 1fr;
        font-size: 0.6rem;
        gap: 0.2rem;
    }
    .ascii-art {
        font-size: 12px;
    }
}

.term-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.form-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.term-form input, 
.term-form textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--term-border);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: var(--font-size-base);
    outline: none;
    flex: 1;
    transition: border-color 0.2s;
}

.term-form input:focus, 
.term-form textarea:focus {
    border-bottom-color: var(--highlight-color);
}

.term-form textarea {
    min-height: 100px;
    resize: vertical;
}

.cmd-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--highlight-color);
    font-family: var(--font-main);
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.cmd-btn:hover {
    background-color: var(--accent-color);
    color: var(--term-bg);
}
