/* =======================================================================
 * 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.
 * ======================================================================= */

@font-face {
    font-family: 'VT323';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/vt323.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

: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;
}

/* When a subtitle follows the tagline, tighten the gap so they read
   as a connected "headline + one-liner" pair rather than two floating
   blocks. */
.tagline + .subtitle {
    margin-top: -1.5rem;
    max-width: 56rem;
    line-height: 1.5;
}

/* 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); }

/* === Hero screenshots (homepage) === */

.hero-screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.25rem 0 2rem;
}

.hero-screenshots figure {
    margin: 0;
}

.hero-screenshots a {
    border-bottom: none;
    display: block;
}

.hero-screenshots a:hover {
    border-bottom: none;
}

.hero-screenshots img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    display: block;
    image-rendering: pixelated;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hero-screenshots a:hover img {
    border-color: var(--accent);
    box-shadow: 0 0 16px rgba(123, 191, 143, 0.2);
}

.hero-screenshots figcaption {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--fg-2);
    margin-top: 0.4rem;
    letter-spacing: 0.04em;
}

@media (max-width: 640px) {
    .hero-screenshots {
        grid-template-columns: 1fr;
    }
}

/* === Quick specs strip (homepage) === */

.specs-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border-strong);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    margin: 2rem 0 2.5rem;
    overflow: hidden;
}

.spec-item {
    background: var(--bg-2);
    padding: 0.7rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.spec-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.spec-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--fg-0);
}

@media (max-width: 640px) {
    .specs-strip {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Specs table (NetISA page) === */

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0 2rem;
    font-size: 0.9rem;
}

.specs-table th,
.specs-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.specs-table th {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    white-space: nowrap;
    width: 9rem;
    padding-right: 1.5rem;
}

.specs-table td {
    color: var(--fg-0);
}

.specs-table tr:last-child th,
.specs-table tr:last-child td {
    border-bottom: none;
}

.specs-table tr:hover td,
.specs-table tr:hover th {
    background: var(--bg-2);
}

@media (max-width: 640px) {
    .specs-table th {
        width: auto;
        font-size: 0.72rem;
    }
    .specs-table th,
    .specs-table td {
        padding: 0.45rem 0.5rem;
        font-size: 0.85rem;
    }
}

/* === Build log timeline === */

.log-timeline {
    margin-top: 2rem;
}

.log-entry {
    position: relative;
    padding: 0 0 2.25rem 1.75rem;
    border-left: 2px solid var(--border-strong);
}

.log-entry:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

/* Timeline dot */
.log-entry::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 0.35rem;
    width: 8px;
    height: 8px;
    background: var(--accent);
    box-shadow: 0 0 7px rgba(123, 191, 143, 0.45);
}

.log-entry:first-child::before {
    width: 10px;
    height: 10px;
    left: -6px;
    top: 0.3rem;
}

.log-date {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--fg-2);
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.log-entry h2 {
    /* Override default h2 section heading style for log entries */
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    color: var(--fg-0);
    padding-left: 0;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.log-entry h2::before {
    display: none;
}

.log-entry p {
    color: var(--fg-1);
    margin-bottom: 0;
}

/* RSS link styling */
.rss-link::before {
    content: "";
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    margin-right: 0.35em;
    background: currentColor;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='3' cy='13' r='2'/%3E%3Cpath d='M1 1a14 14 0 0114 14h-3A11 11 0 001 4V1z'/%3E%3Cpath d='M1 6a9 9 0 019 9H7A6 6 0 001 9V6z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='3' cy='13' r='2'/%3E%3Cpath d='M1 1a14 14 0 0114 14h-3A11 11 0 001 4V1z'/%3E%3Cpath d='M1 6a9 9 0 019 9H7A6 6 0 001 9V6z'/%3E%3C/svg%3E");
    mask-size: contain;
    -webkit-mask-size: contain;
    vertical-align: -0.05em;
}

/* === Screenshots === */

.screenshots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0 2rem;
}

.screenshots figure {
    margin: 0;
}

/* Center a lone trailing figure in a 2-col grid */
.screenshots figure:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 0.625rem);
    justify-self: center;
}

.screenshots img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    display: block;
    image-rendering: pixelated;
    cursor: zoom-in;
    transition: border-color 0.15s;
}

.screenshots img:hover {
    border-color: var(--accent);
}

.screenshots figcaption {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--fg-2);
    margin-top: 0.4rem;
    letter-spacing: 0.04em;
}

@media (max-width: 640px) {
    .screenshots {
        grid-template-columns: 1fr;
    }
    .screenshots figure:last-child:nth-child(odd) {
        max-width: 100%;
    }
}

/* === Real-world photo (no pixelated rendering) === */

figure.photo {
    margin: 1.5rem auto 2rem;
    max-width: 960px;
}

figure.photo img {
    width: 100%;
    height: auto;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    display: block;
    image-rendering: auto;
}

figure.photo figcaption {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--fg-2);
    margin-top: 0.4rem;
    letter-spacing: 0.04em;
    text-align: center;
}

/* === 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;
    }
}

/* === Lightbox === */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    cursor: zoom-out;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    width: 95vw;
    height: 95vh;
    object-fit: contain;
    image-rendering: pixelated;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 0 60px rgba(123, 191, 143, 0.15);
}

.lightbox .lightbox-caption {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--fg-2);
    letter-spacing: 0.04em;
    background: var(--bg-0);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    white-space: nowrap;
}

.lightbox .lightbox-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--fg-2);
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-0);
}

.lightbox .lightbox-close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* === FAQ (dl.faq) === */

dl.faq {
    margin: 1.5rem 0;
    padding: 0;
}
dl.faq dt {
    margin: 1.25rem 0 0.35rem 0;
    color: var(--accent);
    font-weight: normal;
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}
dl.faq dt::before {
    content: "? ";
    color: var(--fg-2);
    font-family: var(--font-mono, "Courier New", monospace);
}
dl.faq dd {
    margin: 0 0 0 1.1rem;
    padding-left: 0.7rem;
    border-left: 1px solid var(--border, var(--fg-3));
    color: var(--fg-1);
}

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

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