/* bability.pro - Glitch meets Handcraft Dashboard */

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

:root {
    --parchment: #f0e4d4;
    --burgundy-deep: #5c1a2a;
    --burgundy: #6b1d3a;
    --burgundy-light: #8c2f52;
    --void: #0d0509;
    --blush: #d4b8c0;
    --near-black: #1a0a10;
    --cyan: #47e8d4;
    --gold: #e8c547;
}

body {
    background-color: var(--near-black);
    color: var(--parchment);
    font-family: 'Inconsolata', monospace;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Hand-drawn filter effect */
.dashboard {
    position: relative;
    padding: 1rem;
}

/* Panel Base */
.panel {
    background: var(--void);
    border: 2px solid var(--burgundy);
    border-radius: 12px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Sketch border effect */
.panel::before {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid var(--burgundy-light);
    border-radius: 14px;
    transform: translate(2px, 2px);
    opacity: 0.4;
    pointer-events: none;
}

/* Hero Panel */
.panel-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 2rem;
    border: none;
    background: radial-gradient(ellipse at center, var(--burgundy-deep) 0%, var(--void) 70%);
}

.panel-hero::before {
    display: none;
}

.site-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 8rem);
    letter-spacing: -0.02em;
    color: var(--parchment);
    text-shadow: 2px 2px 0 var(--burgundy-deep), 0 0 40px rgba(71, 232, 212, 0.2);
    position: relative;
    z-index: 2;
}

.subtitle {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.2rem;
    color: var(--blush);
    margin-top: 1rem;
    z-index: 2;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    padding: 0.5rem 1.5rem;
    background: rgba(107, 29, 58, 0.3);
    border: 1px solid var(--burgundy);
    border-radius: 20px;
    z-index: 2;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--cyan); }
    50% { opacity: 0.4; box-shadow: 0 0 12px var(--cyan); }
}

.status-text {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--cyan);
}

/* Torus */
.torus {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--burgundy), var(--gold), var(--burgundy));
    transform: rotateX(65deg) rotateZ(0deg);
    animation: spin-torus 20s linear infinite;
    opacity: 0.3;
    filter: blur(1px);
}

.torus::after {
    content: '';
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: var(--void);
}

@keyframes spin-torus {
    from { transform: rotateX(65deg) rotateZ(0deg); }
    to { transform: rotateX(65deg) rotateZ(360deg); }
}

/* Panel Grid */
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Panel Titles */
.panel-title {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.1rem;
    color: var(--gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed var(--burgundy-light);
}

/* Readouts */
.panel-readout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(107, 29, 58, 0.5);
}

.readout-label {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--blush);
}

.readout-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cyan);
    font-family: 'Inconsolata', monospace;
}

/* Wave Panel */
.wave-container {
    height: 80px;
    overflow: hidden;
}

.wave-svg {
    width: 100%;
    height: 100%;
}

/* Memory Panel */
.memory-blocks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.mem-block {
    height: 24px;
    border-radius: 4px;
    background: rgba(107, 29, 58, 0.3);
    border: 1px solid var(--burgundy);
    transition: background 0.3s;
}

.mem-block.active {
    background: var(--burgundy-light);
    box-shadow: 0 0 6px rgba(140, 47, 82, 0.5);
}

.mem-block.glitch {
    background: var(--cyan);
    opacity: 0.7;
    animation: glitch-block 0.5s infinite;
}

@keyframes glitch-block {
    0%, 100% { transform: none; }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Entropy Panel */
.entropy-meter {
    height: 20px;
    background: rgba(107, 29, 58, 0.2);
    border: 1px solid var(--burgundy);
    border-radius: 10px;
    overflow: hidden;
}

.entropy-fill {
    height: 100%;
    width: 87%;
    background: linear-gradient(90deg, var(--burgundy), var(--gold), var(--cyan));
    border-radius: 10px;
    animation: entropy-pulse 3s ease-in-out infinite;
}

@keyframes entropy-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Terminal Panel */
.terminal-output {
    background: rgba(13, 5, 9, 0.8);
    border: 1px solid var(--burgundy);
    border-radius: 6px;
    padding: 1rem;
    font-size: 0.8rem;
    min-height: 120px;
}

.term-line {
    color: var(--blush);
    margin-bottom: 0.4rem;
    opacity: 0.8;
}

.term-line:first-child {
    color: var(--cyan);
}

.cursor {
    animation: blink-cursor 1s step-end infinite;
    color: var(--cyan);
}

@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Coordinates Panel */
.coord-display {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.coord-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.8rem;
    background: rgba(107, 29, 58, 0.15);
    border-radius: 6px;
    border-left: 3px solid var(--burgundy);
}

.coord-label {
    font-weight: 700;
    color: var(--gold);
    font-size: 0.85rem;
}

.coord-value {
    font-family: 'Inconsolata', monospace;
    color: var(--cyan);
    font-size: 1rem;
}

/* Heartbeat Panel */
.panel-heartbeat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.heartbeat-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--burgundy-light);
    animation: heartbeat 1s ease-in-out infinite;
    position: relative;
}

.heartbeat-ring::after {
    content: '';
    position: absolute;
    inset: 15%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--burgundy) 0%, transparent 70%);
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); border-color: var(--burgundy-light); }
    15% { transform: scale(1.1); border-color: var(--cyan); }
    30% { transform: scale(1); border-color: var(--burgundy-light); }
    45% { transform: scale(1.05); border-color: var(--gold); }
}

/* Footer Panel */
.panel-footer {
    text-align: center;
    border-style: dashed;
    margin-top: 1rem;
}

.footer-text {
    font-family: 'Architects Daughter', cursive;
    color: var(--blush);
    font-size: 1rem;
}

/* Glitch effect on hover */
.panel:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 20px rgba(71, 232, 212, 0.1);
}

/* Scanline overlay */
.dashboard::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(26, 10, 16, 0.03) 2px,
        rgba(26, 10, 16, 0.03) 4px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Responsive */
@media (max-width: 600px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }
    .torus {
        width: 250px;
        height: 250px;
    }
}
