/* martialaw.quest — Surveillance Control Room Dashboard */

:root {
    --command-dark: #0a1018;
    --panel-bg: #0d1520;
    --grid-wire: #2a3a4a;
    --steel-blue: #6b7d94;
    --display-white: #d0dae8;
    --alert-amber: #f59e0b;
    --alert-red: #ef4444;
    --status-green: #4ade80;
    --deep-bg: #101828;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--command-dark);
    color: var(--display-white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scan-line CRT overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
}

/* ====================== COMMAND WALL ====================== */
.command-wall {
    width: 100vw;
    height: 100vh;
    padding: 12px;
    display: flex;
    align-items: stretch;
}

.bento-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    width: 100%;
    height: 100%;
}

/* Panel base */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--grid-wire);
    border-radius: 2px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(42, 58, 74, 0.4);
    border-bottom: 1px solid var(--grid-wire);
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--steel-blue);
    flex-shrink: 0;
}

.panel-content {
    flex: 1;
    padding: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Status dots */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.green {
    background: var(--status-green);
    box-shadow: 0 0 6px var(--status-green);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-dot.amber {
    background: var(--alert-amber);
    box-shadow: 0 0 6px var(--alert-amber);
    animation: pulse-amber 1.5s ease-in-out infinite;
}

.status-dot.red {
    background: var(--alert-red);
    box-shadow: 0 0 6px var(--alert-red);
    animation: pulse-red 1s ease-in-out infinite;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes pulse-amber {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@keyframes pulse-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Panel A: Main title */
.panel-a {
    grid-column: 1;
    grid-row: 1 / 3;
}

.domain-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--display-white);
    margin-bottom: 8px;
}

.subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: var(--steel-blue);
    letter-spacing: 0.08em;
    margin-bottom: 24px;
}

.threat-level {
    margin-top: auto;
}

.threat-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--steel-blue);
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 6px;
}

.threat-bar {
    width: 100%;
    height: 8px;
    background: var(--grid-wire);
    border-radius: 1px;
    overflow: hidden;
    margin-bottom: 6px;
}

.threat-fill {
    width: 72%;
    height: 100%;
    background: linear-gradient(90deg, var(--alert-amber), var(--alert-red));
    border-radius: 1px;
    animation: threat-pulse 3s ease-in-out infinite;
}

@keyframes threat-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.threat-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--alert-amber);
    letter-spacing: 0.15em;
}

/* Panel B: Ticker */
.panel-b {
    grid-column: 2;
    grid-row: 1;
}

.ticker-wrap {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.ticker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: ticker-scroll 30s linear infinite;
}

.ticker-item {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    color: var(--alert-amber);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.8;
}

@keyframes ticker-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Panel C: World map */
.panel-c {
    grid-column: 2;
    grid-row: 2;
}

.map-panel {
    position: relative;
    align-items: center;
    justify-content: center;
}

.world-map {
    width: 100%;
    height: auto;
    max-height: 100%;
}

.continent {
    fill: none;
    stroke: var(--grid-wire);
    stroke-width: 0.5;
    transition: fill 0.3s;
}

.incident-dot {
    fill: rgba(245, 158, 11, 0.3);
    stroke: var(--alert-amber);
    stroke-width: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.incident-dot:hover {
    fill: rgba(245, 158, 11, 0.6);
    r: 12;
}

.map-tooltip {
    position: absolute;
    background: var(--panel-bg);
    border: 1px solid var(--alert-amber);
    padding: 4px 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--alert-amber);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
    white-space: nowrap;
}

.map-tooltip.visible {
    opacity: 1;
}

/* Panel D: Status grid */
.panel-d {
    grid-column: 1;
    grid-row: 3;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--grid-wire);
    border-radius: 2px;
}

.status-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--steel-blue);
    letter-spacing: 0.1em;
}

.status-indicator {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.status-indicator.active {
    color: var(--alert-red);
}

.status-indicator.suspended {
    color: var(--alert-amber);
}

.status-indicator.restricted {
    color: var(--alert-amber);
}

/* Panel E: Uptime counter */
.panel-e {
    grid-column: 2;
    grid-row: 3;
}

.counter-panel {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.counter-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--steel-blue);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.counter {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: var(--status-green);
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.counter-sub {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--steel-blue);
    letter-spacing: 0.1em;
    margin-top: 8px;
}

/* Panel F: Data stream — hidden on default grid, shown on larger screens */
.panel-f {
    display: none;
}

.data-stream {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--status-green);
    opacity: 0.6;
    overflow: hidden;
    height: 100%;
    line-height: 1.6;
}

/* ====================== DEFINITION SECTION ====================== */
.definition-section {
    padding: 60px 20px;
    background: var(--command-dark);
}

.section-container {
    max-width: 1100px;
    margin: 0 auto;
    border: 1px solid var(--grid-wire);
    border-radius: 2px;
    overflow: hidden;
}

.section-header-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(42, 58, 74, 0.4);
    border-bottom: 1px solid var(--grid-wire);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--steel-blue);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.definition-content {
    padding: 40px 30px;
}

.section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--display-white);
    letter-spacing: 0.1em;
    margin-bottom: 30px;
}

.definition-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.def-block {
    padding: 20px;
    border: 1px solid var(--grid-wire);
    border-radius: 2px;
}

.def-block h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--alert-amber);
    letter-spacing: 0.12em;
    margin-bottom: 12px;
}

.def-block p,
.def-block li {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--steel-blue);
    line-height: 1.7;
}

.def-block ul {
    list-style: none;
    padding: 0;
}

.def-block li::before {
    content: "▸ ";
    color: var(--alert-amber);
}

/* ====================== TIMELINE SECTION ====================== */
.timeline-section {
    padding: 60px 20px;
    background: var(--command-dark);
}

.timeline {
    padding: 30px;
}

.timeline-entry {
    display: flex;
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid var(--grid-wire);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: var(--alert-amber);
    flex-shrink: 0;
    width: 80px;
    letter-spacing: 0.05em;
}

.timeline-detail h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--display-white);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.timeline-detail p {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--steel-blue);
    line-height: 1.7;
}

/* ====================== FOOTER ====================== */
.footer {
    border-top: 1px solid var(--grid-wire);
}

.footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--steel-blue);
    letter-spacing: 0.08em;
}

.footer-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-domain {
    color: var(--display-white);
}

/* ====================== RESPONSIVE ====================== */
@media (min-width: 1200px) {
    .bento-grid {
        grid-template-columns: 3fr 2fr 1.5fr;
        grid-template-rows: 1fr 1fr;
    }

    .panel-a {
        grid-column: 1;
        grid-row: 1 / 3;
    }

    .panel-b {
        grid-column: 2;
        grid-row: 1;
    }

    .panel-c {
        grid-column: 2;
        grid-row: 2;
    }

    .panel-d {
        grid-column: 3;
        grid-row: 1;
    }

    .panel-e {
        grid-column: 3;
        grid-row: 2;
    }

    .panel-f {
        display: flex;
        grid-column: 1 / 4;
        grid-row: 3;
    }

    .bento-grid {
        grid-template-rows: 1fr 1fr 0.5fr;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .panel-a {
        grid-column: 1;
        grid-row: auto;
        min-height: 200px;
    }

    .panel-b,
    .panel-c,
    .panel-d,
    .panel-e {
        grid-column: 1;
        grid-row: auto;
        min-height: 150px;
    }

    .command-wall {
        height: auto;
        min-height: 100vh;
    }

    .status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .definition-grid {
        grid-template-columns: 1fr;
    }

    .timeline-entry {
        flex-direction: column;
        gap: 8px;
    }

    .footer-bar {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}
