/* ============================================================
   transactology.dev — terminal multiplexer
   Palette: dark-neon
   #0A0E0A terminal black   #0E120E pane dark   #141A14 surface
   #1A201A title bar        #B8C8B8 phosphor   #E0F0E0 bright
   #4AE88A success green    #E8A84A amber       #E84A4A error
   #4A8AE8 keyword blue     #3A4A3A frame green
   ============================================================ */

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

:root {
    --bg-base:    #0A0E0A;
    --bg-pane:    #0E120E;
    --bg-surface: #141A14;
    --bg-title:   #1A201A;
    --fg-text:    #B8C8B8;
    --fg-bright:  #E0F0E0;
    --fg-comment: #6A7A6A;
    --acc-success:#4AE88A;
    --acc-warning:#E8A84A;
    --acc-error:  #E84A4A;
    --acc-info:   #4A8AE8;
    --border:     #3A4A3A;
    --status-h:   32px;
}

html, body {
    height: 100%;
    background: var(--bg-base);
    color: var(--fg-text);
    font-family: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(74, 232, 138, 0.25); color: var(--fg-bright); }

/* CRT scanline ambience over the whole screen */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(74, 232, 138, 0.018) 0px,
            rgba(74, 232, 138, 0.018) 1px,
            transparent 1px,
            transparent 3px
        );
    mix-blend-mode: screen;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 99;
    background:
        radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ============================================================
   Workstation grid
   ============================================================ */
.workstation {
    display: grid;
    grid-template-columns: 65fr 35fr;
    grid-template-rows: 1fr 1fr var(--status-h);
    height: 100vh;
    width: 100vw;
    gap: 4px;
    padding: 4px;
    background: var(--bg-base);
}

.pane-main   { grid-column: 1; grid-row: 1 / span 2; }
.pane-log    { grid-column: 2; grid-row: 1; }
.pane-status { grid-column: 2; grid-row: 2; }
.status-bar  { grid-column: 1 / span 2; grid-row: 3; }

/* ============================================================
   Pane shell
   ============================================================ */
.pane {
    background: var(--bg-pane);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.pane-titlebar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-title);
    border-bottom: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 12px;
    color: var(--fg-text);
    user-select: none;
    flex: 0 0 auto;
}

.pane-title {
    color: var(--fg-bright);
    letter-spacing: 0.02em;
}

.pane-meta {
    margin-left: auto;
    color: var(--fg-comment);
    font-size: 11px;
    font-style: italic;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background: var(--border);
}

.dot-active {
    background: var(--acc-success);
    box-shadow: 0 0 6px rgba(74, 232, 138, 0.65);
    animation: dot-pulse 2s ease-in-out infinite;
}

.dot-mute    { background: var(--acc-warning); opacity: 0.55; }

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

.pane-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 22px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.pane-body::-webkit-scrollbar { width: 8px; }
.pane-body::-webkit-scrollbar-track { background: transparent; }
.pane-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 0; }
.pane-body::-webkit-scrollbar-thumb:hover { background: var(--acc-success); }

/* ============================================================
   Main pane content
   ============================================================ */
.terminal-h1 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.2;
    color: var(--acc-success);
    margin: 8px 0 4px;
    letter-spacing: -0.01em;
    text-shadow: 0 0 12px rgba(74, 232, 138, 0.35);
}

.terminal-h2 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    color: var(--acc-success);
    margin: 28px 0 12px;
    border-top: 1px dashed var(--border);
    padding-top: 18px;
}

.comment, .kw-comment {
    color: var(--fg-comment);
    font-style: italic;
    font-size: 13px;
    line-height: 1.5;
}

.comment { display: block; margin-bottom: 18px; }

.ascii-frame, .ascii-diagram, .ascii-status {
    font-family: 'JetBrains Mono', monospace;
    color: var(--border);
    font-size: 12px;
    line-height: 1.25;
    white-space: pre;
    margin: 14px 0;
    overflow-x: auto;
}

.ascii-frame {
    color: var(--acc-success);
    margin: 4px 0 22px;
    text-shadow: 0 0 8px rgba(74, 232, 138, 0.25);
}

.ascii-diagram { color: var(--fg-comment); margin: 18px 0; }

.terminal-block {
    margin: 18px 0;
    border-left: 1px solid var(--border);
    padding-left: 14px;
}

.cmd-line {
    margin: 0 0 6px;
    color: var(--fg-bright);
    font-size: 14px;
    font-weight: 500;
}

.prompt {
    color: var(--acc-success);
    font-weight: 700;
    margin-right: 8px;
}

.cmd { color: var(--fg-bright); }

.cmd-output {
    margin: 4px 0 0 0;
    color: var(--fg-text);
}

.cmd-output p { margin: 6px 0; }

.install-log {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--fg-text);
    background: var(--bg-base);
    border: 1px solid var(--border);
    padding: 10px 14px;
    margin: 6px 0;
    line-height: 1.5;
    white-space: pre-wrap;
}

.code-snippet {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.55;
    color: var(--fg-text);
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-left: 2px solid var(--acc-success);
    padding: 14px 18px;
    margin: 14px 0;
    white-space: pre;
    overflow-x: auto;
}

/* Syntax highlighting span colors */
.kw-keyword  { color: var(--acc-info);    font-weight: 700; }
.kw-string   { color: var(--acc-warning); }
.kw-success  { color: var(--acc-success); font-weight: 700; }
.kw-error    { color: var(--acc-error);   font-weight: 700; }
.kw-warning  { color: var(--acc-warning); font-weight: 700; }
.kw-number   { color: var(--acc-success); }

/* Feature list & step list */
.feature-list, .step-list {
    list-style: none;
    margin: 8px 0;
    padding: 0;
}

.feature-list li, .step-list li {
    padding: 4px 0;
    color: var(--fg-text);
    font-size: 14px;
    line-height: 1.6;
}

.feature-list li .kw-success,
.feature-list li .kw-warning {
    margin-right: 10px;
    font-weight: 700;
}

.step-list li .kw-number {
    margin-right: 12px;
    color: var(--acc-success);
}

/* Trailing prompt with blinking cursor */
.prompt-line {
    margin-top: 30px;
    font-size: 14px;
    color: var(--acc-success);
    font-weight: 700;
}

.cursor-blink {
    display: inline-block;
    color: var(--acc-success);
    animation: blink 1s step-end infinite;
    margin-left: 4px;
}

@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

/* ============================================================
   Transaction log pane
   ============================================================ */
.pane-body-log {
    padding: 12px 14px;
    background:
        linear-gradient(180deg,
            rgba(10,14,10,0.6) 0%,
            transparent 8%,
            transparent 92%,
            rgba(10,14,10,0.85) 100%),
        var(--bg-pane);
}

.log-stream {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.55;
    color: var(--fg-text);
    white-space: pre;
    margin: 0;
}

.log-line {
    display: block;
    padding: 1px 0;
    transition: opacity 0.4s ease;
}

.log-line.fresh {
    color: var(--fg-bright);
    text-shadow: 0 0 4px rgba(74, 232, 138, 0.3);
}

.log-ts    { color: var(--fg-comment); }
.log-ok    { color: var(--acc-success); font-weight: 700; }
.log-warn  { color: var(--acc-warning); font-weight: 700; }
.log-err   { color: var(--acc-error);   font-weight: 700; }
.log-hash  { color: var(--acc-info); }
.log-amt   { color: var(--acc-warning); }
.log-lat   { color: var(--fg-text); }
.log-key   { color: var(--fg-comment); }

/* ============================================================
   System status pane
   ============================================================ */
.pane-body-status {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-left: 2px solid var(--border);
    padding-left: 10px;
}

.metric-label {
    font-size: 11px;
    color: var(--fg-comment);
    font-style: italic;
    letter-spacing: 0.02em;
}

.metric-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--acc-success);
    line-height: 1.1;
    text-shadow: 0 0 8px rgba(74, 232, 138, 0.35);
    font-variant-numeric: tabular-nums;
}

.heartbeat-box {
    border: 1px solid var(--border);
    background: var(--bg-base);
    padding: 8px 10px 6px;
}

.heartbeat-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 4px;
}

.heartbeat-bpm {
    color: var(--acc-success);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 6px rgba(74, 232, 138, 0.4);
}

.heartbeat-svg {
    display: block;
    width: 100%;
    height: 90px;
    background:
        linear-gradient(
            to right,
            rgba(74,232,138,0.04) 0%,
            rgba(74,232,138,0.08) 50%,
            rgba(74,232,138,0.04) 100%);
}

.hb-line {
    fill: none;
    stroke: var(--acc-success);
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 0 3px rgba(74, 232, 138, 0.65));
}

.hb-grid {
    stroke: var(--border);
    stroke-width: 0.5;
    stroke-dasharray: 2 4;
    opacity: 0.6;
}

.hb-grid-faint { opacity: 0.25; }

.ascii-status {
    color: var(--fg-text);
    font-size: 11.5px;
    line-height: 1.35;
    margin: 0;
}

/* ============================================================
   Status bar (bottom)
   ============================================================ */
.status-bar {
    background: var(--bg-title);
    border: 1px solid var(--border);
    color: var(--fg-text);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: var(--status-h);
    overflow: hidden;
    white-space: nowrap;
}

.status-seg-user {
    color: var(--acc-success);
    font-weight: 700;
}

.status-seg-clock {
    margin-left: auto;
    color: var(--fg-bright);
    font-variant-numeric: tabular-nums;
}

.status-sep { color: var(--border); }

.status-seg span {
    color: var(--acc-success);
    font-weight: 500;
    margin-left: 4px;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Typewriter cursor for typing blocks
   ============================================================ */
.cmd.typing::after {
    content: "█";
    color: var(--acc-success);
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
}

.cmd-output {
    transition: opacity 0.25s ease;
}

.cmd-output.pending {
    opacity: 0;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* ============================================================
   Responsive — collapse panes on narrow viewports
   ============================================================ */
@media (max-width: 900px) {
    .workstation {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 220px 220px var(--status-h);
        height: 100vh;
    }
    .pane-main   { grid-column: 1; grid-row: 1; }
    .pane-log    { grid-column: 1; grid-row: 2; }
    .pane-status { grid-column: 1; grid-row: 3; }
    .status-bar  { grid-column: 1; grid-row: 4; }

    .terminal-h1 { font-size: 24px; }
    .terminal-h2 { font-size: 16px; }
    .ascii-frame, .ascii-diagram { font-size: 10px; }
}

@media (max-width: 540px) {
    .pane-body { padding: 12px 14px; }
    .metric-grid { grid-template-columns: 1fr; }
    .status-bar { font-size: 10px; gap: 6px; padding: 0 8px; }
}
