/* =======================================================================
 * Barely Booting. Retro computing workshop aesthetic.
 * =======================================================================
 * Dark green-black base inspired by an unpowered CRT and FR-4 PCB under
 * dim bench lighting. Phosphor green primary accent (P1-tube muted),
 * warm amber secondary, copper trace detailing. System fonts for speed;
 * VT323 is loaded only for the brand wordmark and hero headings.
 * ======================================================================= */

:root {
    /* Backgrounds (deepest to elevated) */
    --bg-0: #0c1210;
    --bg-1: #12181a;
    --bg-2: #1a2024;
    --bg-3: #222830;

    /* Foregrounds (brightest to dimmest) */
    --fg-0: #e8dcc4;
    --fg-1: #b8ad97;
    --fg-2: #7e755f;
    --fg-3: #4d4738;

    /* Accents */
    --accent:        #7bbf8f;
    --accent-hover:  #9dd4af;
    --accent-amber:  #d4a355;
    --accent-copper: #a06d3c;
    --accent-oxide:  #4a7880;

    /* Status */
    --status-red:    #d45a3d;
    --status-green:  #7bbf8f;
    --status-amber:  #d4a355;

    /* Borders */
    --border:        #2a332e;
    --border-strong: #3a4a42;

    /* Layout tokens */
    --max-width: 720px;
    --radius:    3px;

    /* Typography */
    --font-body:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-mono:    ui-monospace, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-display: "VT323", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html {
    background: var(--bg-1);
    color: var(--fg-0);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image:
        /* very faint CRT scanline, kept at low opacity so text stays clean */
        repeating-linear-gradient(
            180deg,
            transparent 0,
            transparent 2px,
            rgba(0, 0, 0, 0.09) 2px,
            rgba(0, 0, 0, 0.09) 3px
        );
    background-attachment: fixed;
}

main {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    padding: 2.75rem 1.25rem 4rem;
}

/* === Typography === */

h1, h2, h3 {
    color: var(--fg-0);
    line-height: 1.2;
    margin-top: 2.75rem;
    margin-bottom: 1rem;
}

h1 {
    font-family: var(--font-display);
    font-size: 3.4rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
    text-shadow: 0 0 18px rgba(123, 191, 143, 0.18);
}

h2 {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    padding-left: 1.25rem;
    position: relative;
    margin-top: 3rem;
}

h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.48em;
    width: 0.55rem;
    height: 0.55rem;
    background: var(--accent);
    box-shadow: 0 0 7px rgba(123, 191, 143, 0.45);
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--fg-0);
}

p {
    margin: 0 0 1.15rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent);
    padding-bottom: 1px;
    transition: color 0.15s ease, border-color 0.15s ease, text-shadow 0.15s ease, border-bottom-style 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
    border-bottom-style: solid;
    text-shadow: 0 0 9px rgba(157, 212, 175, 0.38);
}

a:focus-visible {
    outline: 2px solid var(--accent-hover);
    outline-offset: 3px;
    border-radius: 2px;
}

strong { color: var(--fg-0); }

code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

code {
    background: var(--bg-0);
    color: var(--accent-amber);
    padding: 0.1em 0.45em;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

pre {
    background: var(--bg-0);
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    margin: 1.5rem 0;
}

pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: var(--fg-0);
}

ul, ol {
    padding-left: 1.35rem;
    margin: 0 0 1.25rem;
}

li {
    margin-bottom: 0.42rem;
}

hr {
    border: none;
    border-top: 1px dashed var(--border-strong);
    margin: 2.75rem 0;
    position: relative;
}

/* === Page-specific building blocks === */

.tagline {
    color: var(--accent-amber);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 2rem;
}

.subtitle {
    color: var(--fg-1);
    font-size: 1.05rem;
    margin-top: 0;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Status panel: BIOS dialog feel, corner bracket label */
.status {
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.15rem;
    margin: 1.75rem 0 2.25rem;
    color: var(--fg-0);
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.55;
    position: relative;
}

.status::before {
    content: "[ STATUS ]";
    position: absolute;
    top: -0.65rem;
    left: 1rem;
    background: var(--bg-1);
    padding: 0 0.45rem;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    font-weight: 600;
}

.status strong {
    color: var(--accent);
}

.link-list {
    list-style: none;
    padding-left: 0;
}

.link-list li {
    margin-bottom: 0.65rem;
    position: relative;
    padding-left: 1.1rem;
}

.link-list li::before {
    content: "▸";
    color: var(--accent);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 0.95em;
}

.muted { color: var(--fg-2); }

/* === Navigation === */

nav.site-nav {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border-strong);
    position: relative;
}

/* copper trace line under the nav */
nav.site-nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 1px;
    background: var(--accent-copper);
    opacity: 0.45;
}

nav.site-nav .nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

nav.site-nav .brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    color: var(--fg-0);
    line-height: 1;
    border-bottom: none;
    padding: 0;
}

nav.site-nav .brand:hover {
    color: var(--accent);
    border-bottom: none;
    text-shadow: 0 0 12px rgba(123, 191, 143, 0.45);
}

nav.site-nav .brand svg {
    color: var(--accent);
    flex-shrink: 0;
    display: block;
}

nav.site-nav .brand .cursor {
    display: inline-block;
    color: var(--accent);
    margin-left: 0.08em;
    width: 0.55ch;
    animation: bb-blink 1.1s steps(2, start) infinite;
}

@keyframes bb-blink {
    to { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    nav.site-nav .brand .cursor {
        animation: none;
    }
}

nav.site-nav .nav-links {
    display: flex;
    gap: 1.35rem;
    flex-wrap: wrap;
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
}

nav.site-nav .nav-links a {
    color: var(--fg-1);
    border-bottom: none;
    padding: 0.3rem 0.1rem;
}

nav.site-nav .nav-links a:hover {
    color: var(--accent);
    border-bottom: none;
    text-shadow: 0 0 8px rgba(123, 191, 143, 0.35);
}

nav.site-nav .nav-links a.active {
    color: var(--accent);
}

nav.site-nav .nav-links a.active::before {
    content: "[ ";
    color: var(--accent-amber);
}

nav.site-nav .nav-links a.active::after {
    content: " ]";
    color: var(--accent-amber);
}

/* === Footer (equipment label) === */

footer.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border-strong);
    color: var(--fg-2);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    margin-top: auto;
    position: relative;
}

footer.site-footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -3px;
    height: 1px;
    background: var(--accent-copper);
    opacity: 0.45;
}

footer.site-footer .footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

footer.site-footer a {
    color: var(--fg-1);
    border-bottom: none;
}

footer.site-footer a:hover {
    color: var(--accent);
    border-bottom: none;
}

footer.site-footer .footer-links {
    display: flex;
    gap: 1.25rem;
}

/* === Mobile === */

@media (max-width: 640px) {
    html { font-size: 15.5px; }

    body {
        /* Drop the scanline on small screens where it reduces clarity */
        background-image: none;
    }

    main { padding: 2rem 1rem 3rem; }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 0.86rem; }

    nav.site-nav .nav-inner {
        gap: 0.85rem;
        padding: 0.9rem 1rem;
    }
    nav.site-nav .brand {
        font-size: 1.35rem;
    }
    nav.site-nav .nav-links {
        gap: 1.1rem;
        margin-left: 0;
        width: 100%;
    }

    footer.site-footer .footer-inner {
        flex-direction: column;
        text-align: center;
        padding: 1.25rem 1rem;
    }
}

/* === Motion preferences === */

@media (prefers-reduced-motion: reduce) {
    a {
        transition: none;
    }
    body {
        background-image: none;
    }
}
