/* ==========================================================================
   DIGINEST DASHBOARD — STYLESHEET
   ==========================================================================
   This file controls all visual styling for index.html.
   Structure (search for these numbered banners to jump around):
     1. SYSTEM DESIGN TOKENS      -> global colors, fonts (edit here to retheme)
     2. GLOBAL RESET & VIEWPORT   -> base body/background setup
     3. TOP HUD RULER & NAV BAR   -> header bar, weather widget
     4. TELEMETRY DECK            -> the 4 system-stat boxes (CPU/RAM/DISK/KERNEL)
     5. SERVICE CARDS             -> the clickable "cyberpass" tiles
     6. ARENA ZONE                -> the reactive particle canvas + quote box
     7. NEWS TICKER BAR           -> bottom scrolling headlines strip
     8. RESPONSIVE / MOBILE       -> small-screen overrides (max-width: 768px)

   Loaded by index.html via:
     <link rel="stylesheet" href="style.css">
   ========================================================================== */


/* ==========================================================================
   1. SYSTEM DESIGN TOKENS
   ========================================================================== */
/* EDIT THIS BLOCK TO RETHEME THE ENTIRE SITE.
   Every color/font below is used via var(--name) throughout this file,
   so changing a value here updates it everywhere at once. */
:root {
    --bg: #070709;
    --surface: #0f1015;
    --surface-card: #13141b;

    --border: #262730;
    --border-bright: #44475a;

    /* --- Accent colors (used for highlights, alerts, active states) --- */
    --red: #ff2a2a;        /* Hardware LED, security alerts, laser filaments */
    --amber: #ffb834;      /* Timezone clocks, weather highlights */
    --cyan: #00f0ff;       /* Active telemetry, primary tracer lasers */
    --cyan-dim: #1f3b4d;

    /* --- Text colors --- */
    --text: #f4f4f6;
    --muted: #6e7180;

    /* --- Fonts (loaded via Google Fonts <link> in index.html <head>) --- */
    --font-mono: 'JetBrains Mono', monospace;
    --font-dot: 'Silkscreen', monospace;
}

/* ==========================================================================
   2. GLOBAL RESET & BASE VIEWPORT
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    position: relative;
    padding-bottom: 50px;
    overflow-x: hidden;
}

/* Technical Blueprint Grid Background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 32px 32px, 96px 96px, 96px 96px;
    pointer-events: none;
    z-index: 0;
}

/* Halftone Dither Bleed on Right Margin */
body::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 220px;
    background-image: 
        radial-gradient(circle, rgba(255, 42, 42, 0.12) 1.2px, transparent 1.2px),
        radial-gradient(circle, rgba(255, 255, 255, 0.04) 1.5px, transparent 1.5px);
    background-size: 8px 8px, 16px 16px;
    mask-image: linear-gradient(to left, black 20%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   3. TOP HUD RULER & NAV BAR
   ========================================================================== */
.hud-ruler {
    display: flex;
    justify-content: space-between;
    padding: 10px 0 6px;
    font-size: 0.65rem;
    color: var(--muted);
    border-bottom: 1px dashed var(--border);
    letter-spacing: 0.1em;
    white-space: nowrap;
    overflow: hidden;
}

.top-nav {
    margin-top: 14px;
    padding: 16px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.top-nav::before {
    content: "+";
    position: absolute;
    top: -6px;
    left: -4px;
    color: var(--red);
    font-size: 0.8rem;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sec-stamp {
    background: var(--red);
    color: #000;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    letter-spacing: 0.08em;
}

.brand-text {
    font-family: var(--font-dot);
    font-size: 1.25rem;
    letter-spacing: 0.15em;
}

.weather-telemetry {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
}

.wx-selector {
    background: #000;
    border: 1px solid var(--border-bright);
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: border-color 0.2s, color 0.2s;
}

.wx-selector:hover, .wx-selector:focus {
    border-color: var(--cyan);
    color: var(--cyan);
}

.wx-selector option {
    background: #0f1015;
    color: var(--text);
    font-family: var(--font-mono);
}

.wx-clock {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.08em;
    padding: 0 4px;
    white-space: nowrap;
}

/* ==========================================================================
   4. TELEMETRY DECK (SYSTEM METRICS)
   ========================================================================== */
.telemetry-deck {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.telem-box {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.box-hud-corner {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.55rem;
    color: var(--muted);
}

.telem-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.telem-title {
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.08em;
    font-weight: 700;
}

.telem-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.pixel-heatmap {
    font-size: 0.6rem;
    line-height: 1.15;
    letter-spacing: 2px;
    color: #1f222e;
    user-select: none;
    font-family: var(--font-mono);
}

.pixel-heatmap .fill-hi { 
    color: var(--cyan); 
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.6); 
}
.pixel-heatmap .fill-md { 
    color: #5cc2c7; 
}
.pixel-heatmap .fill-dim { 
    color: #224d52; 
}

/* ==========================================================================
   5. SERVICE CARDS (CYBERPASSES)
   ==========================================================================
   Styles for the clickable tiles (qBittorrent, Jellyfin, CasaOS, etc).
   The actual card markup (one per service) lives in index.html inside
   <main class="cards-deck">. To add a new service, copy an existing
   <a class="pass-card">...</a> block in index.html — no CSS changes needed,
   the grid (.cards-deck) automatically reflows to fit however many cards exist.
   ========================================================================== */
.cards-deck {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.pass-card {
    background: var(--surface-card);
    border: 1px solid var(--border);
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 230px;
    padding: 24px 22px 18px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.pass-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 20px;
    width: 60px;
    height: 4px;
    background: var(--red);
}

.pass-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-bright);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.card-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-callout {
    font-family: var(--font-dot);
    font-size: 0.65rem;
    color: var(--red);
    letter-spacing: 0.12em;
}

.chip-graphic {
    width: 28px;
    height: 20px;
    background: #c5a059;
    border-radius: 3px;
    border: 1px solid #7c622f;
    position: relative;
}

.chip-graphic::after {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid #5a451d;
    border-left: none;
    border-right: none;
}

.pass-card h2 {
    font-family: var(--font-dot);
    font-size: 1.45rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.pass-card p {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
}

.card-footer-strip {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border);
    padding-top: 14px;
}

.barcode-decor {
    letter-spacing: 1px;
    font-size: 0.65rem;
    font-family: monospace;
    color: var(--muted);
    opacity: 0.7;
}

.pass-btn {
    background: var(--text);
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 5px 12px;
    letter-spacing: 0.08em;
    transition: background 0.2s, color 0.2s;
}

.pass-card:hover .pass-btn {
    background: var(--red);
    color: #fff;
}

/* ==========================================================================
   6. ARENA ZONE (INTERACTIVE DOT MATRIX + TACTICAL HUD FRAME + QUOTES)
   ========================================================================== */
.arena-zone {
    margin-top: 24px;
    min-height: 290px;
    position: relative;
    background: #000;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* Bottom-right corner readout — replaces what used to be a static ::after
   label. Now a real element so app.js can live-update the lock counter. */
.arena-hud {
    position: absolute;
    bottom: 6px;
    right: 8px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    pointer-events: none;
    text-align: right;
}

.arena-hud-line {
    font-size: 0.55rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

/* The dynamic half — glows cyan so a change (a new node locking) catches the eye */
.arena-hud-counter {
    color: var(--cyan);
    font-weight: 700;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

/* First-visit nudge telling people the field responds to clicks/taps.
   Starts invisible; app.js adds .is-visible on load and removes it again
   on first interaction (or after 6s) — see the hintEl logic in app.js. */
.arena-hint {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    color: var(--muted);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    white-space: nowrap;
}

.arena-hint.is-visible {
    opacity: 0.9;
}

#matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
    cursor: crosshair;
}

/* Tactical HUD Glass Frame for Quote Readability */
.quote-container {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px 36px;
    max-width: 800px;
    pointer-events: none;
    background: rgba(7, 7, 9, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.85);
}

/* Technical Corner Registration Brackets */
.quote-container::before, .quote-container::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    border: 1.5px solid var(--cyan);
    pointer-events: none;
}

.quote-container::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.quote-container::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.quote-tag {
    font-family: var(--font-dot);
    font-size: 0.65rem;
    color: var(--red);
    letter-spacing: 0.16em;
    margin-bottom: 10px;
    text-shadow: 0 0 8px rgba(255, 42, 42, 0.4);
}

.quote-text {
    font-size: clamp(0.85rem, 1.35vw, 1.05rem);
    line-height: 1.65;
    color: #f4f4f6;
    font-style: italic;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}

.quote-author {
    margin-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--amber);
    font-weight: 700;
    letter-spacing: 0.08em;
    transition: opacity 0.5s ease;
    text-shadow: 0 0 8px rgba(255, 184, 52, 0.3);
}

/* ==========================================================================
   7. MULTI-OUTLET NEWS TICKER BAR (BOTTOM FIXED)
   ========================================================================== */
.news-ticker-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 38px;
    background: #000;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    z-index: 999;
}

.ticker-lead {
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-dot);
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 2;
}

.ticker-track-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to right, transparent, black 2%, black 98%, transparent);
}

.ticker-track {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-crawl 110s linear infinite;
}

.ticker-track:hover {
    animation-play-state: paused;
}

@keyframes ticker-crawl {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.ticker-item {
    margin-right: 32px;
    text-decoration: none;
    font-size: 0.75rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ticker-item:hover {
    color: var(--text);
}

.src-tag {
    font-family: var(--font-dot);
    font-size: 0.55rem;
    background: #191b24;
    color: var(--cyan);
    padding: 1px 5px;
    border: 1px solid var(--border-bright);
}

/* ==========================================================================
   8. RESPONSIVE MOBILE TACTICAL BREAKPOINTS (CLEAN TWO-ROW STACK)
   ==========================================================================
   Everything in this block only applies when the viewport is 768px or
   narrower (phones/small tablets). It re-stacks the nav bar and hides a
   few non-essential HUD labels to avoid overflow. Adjust the 768px value
   below if you want the breakpoint to trigger at a different width.
   ========================================================================== */
@media (max-width: 768px) {
    /* Prevent top calibration ruler overflow */
    .hud-ruler span:nth-child(2),
    .hud-ruler span:nth-child(3) {
        display: none;
    }

    /* Convert navbar to clean two-stage HUD */
    .top-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }

    .brand-wrap {
        width: 100%;
        justify-content: flex-start;
    }

    /* Distribute dropdown, clock, and temp across dedicated sub-row */
    .weather-telemetry {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px dashed var(--border);
        padding-top: 10px;
        gap: 8px;
    }

    .wx-selector {
        flex: 1;
        max-width: 160px;
        font-size: 0.65rem;
    }

    .wx-clock {
        font-size: 0.7rem;
    }

    #wx-temp {
        font-size: 0.75rem;
    }

    #wx-desc {
        display: none;
    }

    .ticker-lead span { 
        display: none; 
    }
}
