/* ===========================================================
   tanso.tech v3.2.1 - carbon capture interface
   colors: #00ff41 #00cc33 #00aa2a #ffa500 #ff3333 #33aaff #606060 #000000
   font: Fira Code (Google Fonts) - exclusive
   =========================================================== */

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

html, body {
    background: #000000;
    color: #c0c0c0;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
    min-height: 100%;
}

body {
    overflow-x: hidden;
    position: relative;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: #00ff41; color: #000000; }
sub { font-size: 0.75em; }

/* =====================================================
   CRT scanlines + phosphor vignette
   ===================================================== */
.crt-scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.18) 2px,
        rgba(0,0,0,0.18) 3px
    );
    background-size: 100% 3px;
    background-position: 0 0;
    mix-blend-mode: multiply;
    animation: crt-flicker 1.6s steps(20, end) infinite;
}
@keyframes crt-flicker {
    0%   { background-position: 0 0px; opacity: 0.95; }
    25%  { background-position: 0 1px; opacity: 1.00; }
    50%  { background-position: 0 0px; opacity: 0.92; }
    75%  { background-position: 0 1px; opacity: 1.00; }
    100% { background-position: 0 0px; opacity: 0.95; }
}

.phosphor-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 8000;
    background:
        radial-gradient(circle at 50% 50%,
            rgba(0,255,65,0.06) 0%,
            rgba(0,255,65,0.02) 35%,
            transparent 70%),
        radial-gradient(circle at 50% 50%,
            rgba(0,0,0,0) 60%,
            rgba(0,0,0,0.55) 100%);
}

/* CRT global glow on text */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 7990;
    background: linear-gradient(rgba(0,255,65,0.012), rgba(0,255,65,0.012));
}

/* =====================================================
   Matrix rain canvas
   ===================================================== */
.matrix-rain {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.55;
    pointer-events: none;
}

/* =====================================================
   Boot screen
   ===================================================== */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: #000;
    color: #00ff41;
    padding: 32px 48px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 22px;
    transition: opacity 600ms ease, visibility 0s linear 600ms;
}
.boot-screen.done {
    opacity: 0;
    visibility: hidden;
}
.boot-output {
    white-space: pre;
}
.boot-output .boot-line {
    display: block;
    color: #00ff41;
    text-shadow: 0 0 4px rgba(0,255,65,0.4);
}
.boot-output .boot-line.cmd { color: #c0c0c0; }
.boot-output .boot-line.ok { color: #00cc33; }
.boot-output .boot-line.amber { color: #ffa500; }
.boot-output .boot-line.err { color: #ff3333; }
.boot-output .boot-cursor {
    display: inline-block;
    width: 9px;
    height: 18px;
    background: #00ff41;
    vertical-align: -3px;
    animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* =====================================================
   HUD root + content
   ===================================================== */
.hud-root {
    position: relative;
    z-index: 100;
    min-height: 100vh;
    padding: 0 48px 96px 48px;
    opacity: 0;
    transition: opacity 400ms ease;
}
.hud-root.live { opacity: 1; }

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 24px;
}

/* =====================================================
   Top command prompt
   ===================================================== */
.cmd-prompt {
    position: sticky;
    top: 0;
    z-index: 200;
    margin: 0 -48px 32px -48px;
    padding: 14px 48px;
    background: rgba(0,0,0,0.86);
    border-bottom: 1px solid rgba(0,255,65,0.25);
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    cursor: text;
}
.cmd-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 22px;
}
.cmd-symbol { color: #00ff41; font-weight: 700; }
.cmd-host { color: #00cc33; }
.cmd-sep { color: #606060; }
.cmd-section { color: #ffa500; }
.cmd-cursor {
    color: #00ff41;
    margin-left: 4px;
    animation: blink 1s step-start infinite;
    font-size: 14px;
    line-height: 22px;
}

.cmd-meta {
    display: flex;
    gap: 24px;
    margin-left: auto;
    font-size: 12px;
    color: #606060;
}
.cmd-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.04em;
}
.heartbeat-dot {
    width: 6px; height: 6px;
    border-radius: 0;
    background: #00ff41;
    box-shadow: 0 0 6px rgba(0,255,65,0.6);
    animation: heartbeat 2s ease-in-out infinite;
}
@keyframes heartbeat {
    0%, 100% { opacity: 0.45; box-shadow: 0 0 4px rgba(0,255,65,0.3); }
    50%      { opacity: 1.00; box-shadow: 0 0 10px rgba(0,255,65,0.85); }
}

.cmd-autocomplete {
    width: 100%;
    margin-top: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(0,255,65,0.35);
    background: rgba(0,0,0,0.92);
    font-size: 13px;
    line-height: 22px;
    box-shadow: 0 0 16px rgba(0,255,65,0.08);
}
.cmd-autocomplete[hidden] { display: none; }
.cmd-auto-line { color: #c0c0c0; }
.cmd-auto-label { color: #606060; margin-top: 4px; }
.cmd-auto-list {
    list-style: none;
    margin-top: 4px;
    padding-left: 16px;
}
.cmd-auto-list li {
    display: flex;
    gap: 14px;
    padding: 2px 0;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.cmd-auto-list li:hover {
    background: rgba(0,255,65,0.08);
}
.cmd-auto-list li:hover .auto-key {
    color: #00ff41;
}
.auto-key {
    color: #ffa500;
    min-width: 96px;
    display: inline-block;
}
.auto-desc { color: #606060; }

/* =====================================================
   Code-block sections
   ===================================================== */
.code-section {
    padding: 56px 0 24px 0;
}
.delim {
    color: rgba(0,255,65,0.30);
    font-size: 13px;
    line-height: 22px;
    letter-spacing: 0.02em;
    margin: 8px 0 24px 0;
    white-space: nowrap;
    overflow: hidden;
}
.delim-end { margin: 24px 0 8px 0; }
.delim::before { content: attr(data-text); }
.delim.typed::before {
    content: '';
}
.delim-typed-text { color: rgba(0,255,65,0.30); }

/* =====================================================
   HUD panels (no background, thin border, label)
   ===================================================== */
.hud-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 28px;
}
.hud-grid.two-col {
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) {
    .hud-grid.two-col { grid-template-columns: 1fr; }
    .hud-root { padding: 0 20px 64px 20px; }
    .cmd-prompt { margin: 0 -20px 24px -20px; padding: 12px 20px; }
}

.hud-panel {
    position: relative;
    border: 1px solid rgba(0,255,65,0.40);
    padding: 14px 18px 18px 18px;
    background: transparent;
    transition: border-color 200ms ease, box-shadow 200ms ease, height 220ms ease;
    overflow: hidden;
}
.hud-panel.flash {
    border-color: rgba(0,255,65,1);
    box-shadow: 0 0 20px rgba(0,255,65,0.35), inset 0 0 18px rgba(0,255,65,0.06);
}
.hud-panel:hover {
    border-color: rgba(0,255,65,0.80);
    box-shadow: 0 0 12px rgba(0,255,65,0.10);
}
.hud-panel:hover .panel-tag { color: #00ff41; opacity: 1; }
.hud-panel.collapsed .panel-body { display: none; }
.hud-panel.collapsed { padding-bottom: 14px; }
.panel-wide { grid-column: 1 / -1; }

.panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px dashed rgba(0,255,65,0.18);
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.panel-tag {
    color: #00ff41;
    opacity: 0.7;
    font-size: 11px;
    letter-spacing: 0.06em;
    transition: color 200ms ease, opacity 200ms ease;
}
.panel-title {
    color: #c0c0c0;
    font-size: 13px;
    font-weight: 500;
}
.panel-collapse {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: #606060;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    transition: color 150ms ease;
}
.panel-collapse:hover { color: #ff3333; }

.panel-body { display: block; }

/* =====================================================
   Typography helpers
   ===================================================== */
.hero-h1 {
    font-size: 28px;
    line-height: 36px;
    font-weight: 700;
    color: #00ff41;
    margin: 4px 0 6px 0;
    letter-spacing: -0.005em;
    text-shadow: 0 0 6px rgba(0,255,65,0.35);
}
.hero-sub {
    color: #606060;
    font-size: 13px;
    line-height: 20px;
    margin-bottom: 14px;
}
.h2 {
    font-size: 22px;
    line-height: 30px;
    font-weight: 600;
    color: #00cc33;
    margin: 4px 0 12px 0;
}
.h3 {
    font-size: 18px;
    line-height: 26px;
    font-weight: 500;
    color: #00aa2a;
    margin: 4px 0 10px 0;
}
.body-line {
    color: #c0c0c0;
    font-size: 14px;
    line-height: 22px;
    margin-bottom: 12px;
}
.comment-line {
    color: #606060;
    font-size: 13px;
    line-height: 20px;
    margin: 8px 0;
}
.ts-line {
    color: #606060;
    font-size: 12px;
    line-height: 20px;
    margin-bottom: 10px;
    letter-spacing: 0.02em;
}

.cursor-inline {
    display: inline-block;
    color: #00ff41;
    margin-left: 2px;
    animation: blink 1s step-start infinite;
}
.cursor-inline-sm {
    display: inline-block;
    color: #00ff41;
    margin-left: 2px;
    width: 7px;
    animation: blink 1s step-start infinite;
}

.data-val {
    color: #ffa500;
    font-weight: 500;
    transition: filter 220ms ease, opacity 220ms ease;
}
.data-val.updating {
    filter: blur(4px);
    opacity: 0.4;
}

.unit { color: #606060; margin-left: 6px; font-size: 12px; }
.ok      { color: #00cc33; }
.warn    { color: #ffa500; }
.err     { color: #ff3333; }
.confirm { color: #33aaff; }

/* =====================================================
   Hero actions
   ===================================================== */
.hero-actions {
    display: flex;
    gap: 28px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.action-link {
    color: #00ff41;
    cursor: pointer;
    transition: color 150ms ease, text-shadow 150ms ease;
    font-size: 14px;
}
.action-link.confirm { color: #33aaff; }
.action-link:hover {
    color: #ffa500;
    text-shadow: 0 0 8px rgba(255,165,0,0.4);
}

/* =====================================================
   KV list
   ===================================================== */
.kv-list {
    list-style: none;
    display: grid;
    gap: 6px;
}
.kv-list.small { font-size: 13px; }
.kv-list li {
    display: grid;
    grid-template-columns: 130px 24px 1fr 60px 60px;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
    line-height: 20px;
}
.kv-list .k { color: #c0c0c0; }
.kv-list .sep { color: #606060; text-align: center; }
.kv-list.small li { grid-template-columns: 80px 24px 1fr; }

/* =====================================================
   ASCII diagram + stack
   ===================================================== */
.ascii-diagram, .ascii-stack, .release-block, .contact-block {
    color: #00ff41;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 18px;
    white-space: pre;
    overflow-x: auto;
    padding: 10px 0;
    text-shadow: 0 0 5px rgba(0,255,65,0.25);
}
.ascii-stack { color: #00cc33; }
.release-block, .contact-block {
    color: #c0c0c0;
    text-shadow: none;
    font-size: 13px;
    line-height: 20px;
}
.release-block { color: #c0c0c0; }
.contact-block { color: #00ff41; text-shadow: 0 0 4px rgba(0,255,65,0.2); }

/* =====================================================
   Bar chart
   ===================================================== */
.bar-chart {
    display: grid;
    gap: 8px;
    margin-top: 6px;
}
.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}
.bar-label { color: #c0c0c0; }
.bar-track {
    height: 8px;
    background: rgba(0,255,65,0.08);
    border: 1px solid rgba(0,255,65,0.2);
    position: relative;
    overflow: hidden;
}
.bar-fill {
    position: absolute;
    inset: 0;
    width: var(--w, 0%);
    background: linear-gradient(to right,
        rgba(0,255,65,0.6),
        rgba(0,255,65,1) 90%);
    box-shadow: 0 0 6px rgba(0,255,65,0.5);
    transition: width 600ms cubic-bezier(0.2, 0.7, 0.1, 1);
}
.bar-fill.high { background: linear-gradient(to right, #ffa500, #ff3333); box-shadow: 0 0 6px rgba(255,165,0,0.5); }

/* =====================================================
   Log list
   ===================================================== */
.log-list {
    list-style: none;
    display: grid;
    gap: 4px;
    font-size: 13px;
    line-height: 20px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}
.log-list::-webkit-scrollbar { width: 4px; }
.log-list::-webkit-scrollbar-thumb { background: rgba(0,255,65,0.4); }
.log-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.5); }
.log-list li {
    display: grid;
    grid-template-columns: 70px 60px 1fr;
    gap: 10px;
    color: #c0c0c0;
}
.log-ts { color: #606060; }
.log-level {
    font-weight: 600;
    letter-spacing: 0.02em;
}
.log-level.ok   { color: #00cc33; }
.log-level.warn { color: #ffa500; }
.log-level.err  { color: #ff3333; }

/* =====================================================
   Data table
   ===================================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 6px;
}
.data-table th, .data-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px dashed rgba(0,255,65,0.2);
}
.data-table th {
    color: #00aa2a;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0.04em;
}
.data-table td { color: #c0c0c0; }
.data-table tbody tr:hover { background: rgba(0,255,65,0.05); }

/* =====================================================
   Sparkline
   ===================================================== */
.sparkline {
    width: 100%;
    height: 110px;
    border: 1px solid rgba(0,255,65,0.2);
    padding: 8px;
    position: relative;
}
.sparkline svg {
    width: 100%;
    height: 80px;
    display: block;
    filter: drop-shadow(0 0 3px rgba(0,255,65,0.6));
}
.spark-axis {
    display: flex;
    justify-content: space-between;
    color: #606060;
    font-size: 11px;
    margin-top: 4px;
}

/* =====================================================
   Footer strip
   ===================================================== */
.footer-strip {
    margin-top: 56px;
    padding-top: 18px;
    border-top: 1px dashed rgba(0,255,65,0.25);
    color: #606060;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

/* =====================================================
   Right gutter scroll position
   ===================================================== */
.scroll-gutter {
    position: fixed;
    top: 96px;
    right: 12px;
    bottom: 24px;
    z-index: 150;
    width: 90px;
    display: flex;
    align-items: stretch;
    gap: 10px;
    pointer-events: none;
}
.scroll-track {
    width: 2px;
    background: rgba(0,255,65,0.18);
    position: relative;
}
.scroll-thumb {
    position: absolute;
    left: -2px;
    width: 6px;
    height: 12%;
    background: #00ff41;
    box-shadow: 0 0 6px rgba(0,255,65,0.6);
    transition: top 80ms linear;
}
.scroll-marks {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #606060;
    font-size: 10px;
    letter-spacing: 0.05em;
}
.scroll-marks span {
    transition: color 150ms ease;
}
.scroll-marks span.active {
    color: #ffa500;
    text-shadow: 0 0 4px rgba(255,165,0,0.4);
}
@media (max-width: 1100px) {
    .scroll-gutter { display: none; }
}

/* =====================================================
   Section enter / exit
   ===================================================== */
.code-section .panel-body {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 480ms ease 80ms, transform 480ms ease 80ms;
}
.code-section.in-view .panel-body {
    opacity: 1;
    transform: translateY(0);
}
.code-section .delim {
    opacity: 0;
}
.code-section.in-view .delim { opacity: 1; }
