/* =============================================================================
   DESIGN SYSTEM - Terminal-Native Monospace-First
   ============================================================================= */

/* -----------------------------------------------------------------------------
   2a. Theme Variables - Default Green Terminal Theme (:root)
   ----------------------------------------------------------------------------- */
:root {
    /* Core colors - DO NOT CHANGE */
    --bg-color: #232323;
    --text-color: #00ff00;

    --font-mono: 'Berkeley Mono', 'JetBrains Mono', 'Fira Code', 'ui-monospace', monospace;

    --text-secondary: rgba(0, 255, 0, 0.6);

    --bg-surface-soft: #2a2a2a;
    --bg-surface-card: #2f2f2f;

    --border-hairline: rgba(0, 255, 0, 0.2);
    --border-focus: #00ff00;

    /* Accent colors */
    --color-blue: #007aff;
    --color-red: #ff3b30;
    --color-green: #30d158;
    --color-orange: #ff9f0a;
}

/* -----------------------------------------------------------------------------
   2b. Dark Theme Variables (.dark-theme)
   ----------------------------------------------------------------------------- */
.dark-theme {
    --bg-color: #000000;
    --text-color: #f2eded;

    --text-secondary: #b8b2b2;
    --text-inverse: #000000;

    --border-hairline: rgba(255, 255, 255, 0.12);
    --border-focus: #f2eded;
}

/* -----------------------------------------------------------------------------
   2c. Shared Type Scale (1.25 ratio, 16px base)
   ----------------------------------------------------------------------------- */
:root {
    --text-xs: 13px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 20px;
    --text-xl: 25px;
    --text-2xl: 31px;
    --text-3xl: 39px;

    --line-height-tight: 1.3;
    --line-height-body: 1.6;
    --line-height-code: 1.5;
}

/* -----------------------------------------------------------------------------
   2d. Shared Spacing Scale (8px grid)
   ----------------------------------------------------------------------------- */
:root {
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --space-12: 96px;
}

/* -----------------------------------------------------------------------------
   3. Typography
   ----------------------------------------------------------------------------- */
body {
    margin: 0;
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--line-height-body);
    background-color: var(--bg-color);
    color: var(--text-color);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: var(--line-height-tight);
    margin: 0;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

body:not(.page-404) a {
    font-weight: 500;
    text-decoration: none;
    color: var(--text-color);
}

body:not(.page-404) a:hover {
    text-decoration: underline;
}

body.page-404 a {
    font-weight: 500;
    text-decoration: underline;
    color: var(--text-color);
}

body.page-404 a:hover {
    text-decoration: none;
}

.text-sm {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.text-xs {
    font-size: var(--text-xs);
    color: var(--text-secondary);
}

/* -----------------------------------------------------------------------------
   4. Layout
   ----------------------------------------------------------------------------- */
header, main, footer {
    padding: 0 var(--space-2);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    position: relative;
}

.site-brand {
    display: flex;
    align-items: center;
}

.site-brand img {
    max-width: 179px;
    height: auto;
}

.site-title {
    font-size: var(--text-lg);
    text-transform: uppercase;
    margin: 0 0 0 var(--space-1);
}

.site-title a {
    text-decoration: none;
}

.site-tagline {
    font-size: var(--text-base);
    text-align: center;
}

nav {
    text-align: center;
    margin: var(--space-6) 0;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    display: inline;
    margin: 0 var(--space-2);
}

nav a {
    font-size: var(--text-lg);
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

/* Mobile menu button (hamburger) */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: var(--space-1);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-lg);
    border-radius: 4px;
}

.menu-toggle:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

main {
    text-align: center;
}

footer {
    padding: var(--space-12) 0 var(--space-4);
    text-align: center;
}

footer p {
    font-size: var(--text-sm);
    font-weight: 300;
    margin: 0 0 var(--space-1);
}

/* -----------------------------------------------------------------------------
   5. Buttons
   ----------------------------------------------------------------------------- */
.btn, #theme-switcher {
    background-color: var(--text-color);
    color: var(--bg-color);
    border-radius: 4px;
    padding: 4px var(--space-2);
    border: none;
    font-family: inherit;
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 150ms ease, opacity 150ms ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover, #theme-switcher:hover {
    opacity: 0.85;
    text-decoration: none;
}

.btn:focus-visible, #theme-switcher:focus-visible {
    outline: 2px solid var(--color-blue);
    outline-offset: 2px;
}

#theme-switcher {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
}

/* -----------------------------------------------------------------------------
   6. Inputs
   ----------------------------------------------------------------------------- */
.input, input[type="text"], input[type="number"], input[type="password"], input[type="email"] {
    background-color: var(--bg-color);
    border: 1px solid var(--border-hairline, rgba(0, 255, 0, 0.2));
    border-radius: 6px;
    font-family: inherit;
    color: var(--text-color);
    padding: var(--space-2);
    font-size: var(--text-base);
}

.input:focus-visible, input[type="text"]:focus-visible, input[type="number"]:focus-visible, input[type="password"]:focus-visible, input[type="email"]:focus-visible {
    outline: none;
    border-color: var(--border-focus, var(--text-color));
    box-shadow: 0 0 0 1px var(--border-focus, var(--text-color));
}

/* -----------------------------------------------------------------------------
   7. Lists with ASCII Markers
   ----------------------------------------------------------------------------- */
ul.ascii-list, ol.ascii-list {
    list-style: none;
    padding-left: 0;
}

ul.ascii-list li, ol.ascii-list li {
    position: relative;
    padding-left: var(--space-3);
    margin-bottom: var(--space-1);
}

ul.ascii-list li::before {
    content: "[*]";
    position: absolute;
    left: 0;
    color: var(--text-secondary);
}

/* Link list variant */
ul.link-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: inline-block;
}

ul.link-list li {
    position: relative;
    padding-left: 36px;
    margin-bottom: var(--space-1);
}

ul.link-list li::before {
    content: "[*]";
    position: absolute;
    left: 0;
    color: var(--text-color);
}

/* -----------------------------------------------------------------------------
   8. Code Blocks
   ----------------------------------------------------------------------------- */
pre, code {
    font-family: var(--font-mono, 'IBM Plex Mono', monospace);
    line-height: var(--line-height-code);
}

pre {
    background-color: var(--bg-surface-card);
    color: var(--text-color);
    padding: var(--space-2);
    border-radius: 4px;
    overflow-x: auto;
    font-size: var(--text-sm);
    text-align: left;
}

/* -----------------------------------------------------------------------------
   9. Images
   ----------------------------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
}

.under-construction {
    max-width: 656px;
    width: 100%;
    height: auto;
}

.linux-banner {
    max-width: 263px;
    width: 100%;
    height: auto;
}

.windows-banner {
    max-width: 250px;
    width: 100%;
    height: auto;
}

.coding-banner {
    max-width: 128px;
    width: 100%;
    height: auto;
}

.raspberrypi-banner {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.site-banner {
    max-width: 442px;
    width: 100%;
    height: auto;
}

.snail-funny {
    max-width: 300px;
    width: 100%;
    height: auto;
}

/* -----------------------------------------------------------------------------
   10. Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    :root {
        --space-12: 64px;
    }
}

@media (max-width: 480px) {
    :root {
        --space-12: 48px;
    }

    .header-container {
        flex-wrap: wrap;
    }

    #theme-switcher {
        font-size: var(--text-sm);
        padding: 3px var(--space-1);
        top: var(--space-1);
        right: var(--space-1);
    }

    .site-brand img {
        max-width: 120px;
    }

    .site-title {
        font-size: var(--text-base);
    }

    /* Mobile dropdown menu - positioned below header, centered */
    .menu-toggle {
        display: block;
        position: static;
        margin: var(--space-1) auto;
    }

    nav {
        display: none;
        margin: var(--space-2) 0;
        text-align: left;
    }

    nav.active {
        display: block;
    }

    nav ul {
        background-color: var(--bg-surface-card);
        border: 1px solid var(--border-hairline);
        border-radius: 4px;
        padding: var(--space-1);
    }

    nav li {
        display: block;
        margin: 0;
        border-bottom: 1px solid var(--border-hairline);
    }

    nav li:last-child {
        border-bottom: none;
    }

    nav a {
        display: block;
        padding: var(--space-1) var(--space-2);
        font-size: var(--text-base);
        text-decoration: none;
    }

    nav a:hover {
        background-color: var(--bg-surface-soft);
        text-decoration: none;
    }

    footer {
        padding: var(--space-8) 0 var(--space-3);
    }
}
