/* ==========================================================================
   nfth.ing — Brutalist Typewriter Vault
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Libre Baskerville', Georgia, serif;
    background: #1A1408;
    color: #B8A070;
}

/* --- Gradient Mesh Backdrop --- */
#gradient-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 45deg at 30% 40%, #C8A870, #A88850, #D8C090, #B8A068, #C8A870);
    opacity: 0.12;
    filter: blur(80px);
    z-index: 0;
    animation: meshDrift 20s ease-in-out infinite alternate;
}

@keyframes meshDrift {
    0% {
        transform: scale(1) translate(0, 0);
    }
    33% {
        transform: scale(1.1) translate(3%, -2%);
    }
    66% {
        transform: scale(0.95) translate(-2%, 3%);
    }
    100% {
        transform: scale(1.05) translate(1%, -1%);
    }
}

/* --- Scan Line Overlay --- */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0,0,0,0.03) 2px,
        rgba(0,0,0,0.03) 4px
    );
    pointer-events: none;
    z-index: 100;
    animation: scanShimmer 8s linear infinite;
}

@keyframes scanShimmer {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* --- Vault Container --- */
#vault {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    padding: 20px;
}

/* --- Vault Panels --- */
.vault-panel {
    position: absolute;
    background: rgba(40,32,20,0.85);
    border: 2px solid #6A5A38;
    padding: 0;
    opacity: 0;
    transform: translateY(8px);
    animation: panelMaterialize 0.6s ease-out forwards;
    overflow: hidden;
}

.vault-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        transparent,
        transparent 2px,
        rgba(0,0,0,0.02) 2px,
        rgba(0,0,0,0.02) 4px
    );
    pointer-events: none;
}

@keyframes panelMaterialize {
    0% {
        opacity: 0;
        transform: translateY(8px);
        border-color: transparent;
    }
    60% {
        opacity: 0.8;
        border-color: #8A7848;
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        border-color: #6A5A38;
    }
}

/* Panel positions */
.panel-top-left {
    top: 20px;
    left: 20px;
    width: 260px;
    animation-delay: 0.2s;
}

.panel-top-right {
    top: 20px;
    right: 20px;
    width: 240px;
    animation-delay: 0.4s;
}

.panel-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, 70vw);
    max-height: 70vh;
    animation-delay: 0.6s;
    z-index: 20;
}

.panel-center.materialized {
    transform: translate(-50%, -50%);
}

.panel-bottom-left {
    bottom: 20px;
    left: 20px;
    width: 280px;
    animation-delay: 0.8s;
}

.panel-bottom-right {
    bottom: 20px;
    right: 20px;
    width: 300px;
    animation-delay: 1.0s;
}

.panel-left-side {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 220px;
    max-height: 240px;
    animation-delay: 1.2s;
}

.panel-left-side.materialized {
    transform: translateY(-50%);
}

/* --- Panel Header --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #6A5A38;
    background: rgba(26,20,8,0.6);
}

.panel-label {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.7rem;
    color: #8A7848;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.panel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6A5A38;
    animation: indicatorPulse 2s ease-in-out infinite;
}

.panel-indicator.active {
    background: #D8C8A0;
    box-shadow: 0 0 6px rgba(216,200,160,0.5);
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* --- Panel Content --- */
.panel-content {
    padding: 12px;
    position: relative;
}

/* --- Status Lines (Top-Left) --- */
.status-line {
    display: flex;
    gap: 8px;
    padding: 3px 0;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

.status-line .label {
    color: #8A7848;
    min-width: 80px;
}

.status-line .value {
    color: #B8A070;
}

/* --- Timestamp Display (Top-Right) --- */
.timestamp-display {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 1.6rem;
    color: #D8C8A0;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 4px 0;
}

.date-display {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #8A7848;
    text-align: center;
    padding-bottom: 6px;
}

.epoch-display {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.7rem;
    color: #6A5A38;
    text-align: center;
    border-top: 1px solid rgba(106,90,56,0.3);
    padding-top: 6px;
}

.epoch-display .label {
    color: #8A7848;
}

/* --- Center Panel Content --- */
.center-content {
    text-align: center;
    padding: 24px 28px;
}

#main-title {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 400;
    color: #D8C8A0;
    letter-spacing: 0.2em;
    margin-bottom: 16px;
    min-height: 1.2em;
}

.cursor-blink {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #B8A070;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: cursorBlink 500ms step-end infinite;
}

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

.divider {
    width: 60px;
    height: 1px;
    background: #6A5A38;
    margin: 16px auto;
}

#main-description {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.85;
    color: #B8A070;
    max-width: 480px;
    margin: 0 auto 20px;
    min-height: 3.7em;
}

.vault-metadata {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-tag {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.65rem;
    color: #8A7848;
    letter-spacing: 0.2em;
    padding: 4px 10px;
    border: 1px solid rgba(106,90,56,0.4);
}

/* --- Archive Index (Bottom-Left) --- */
.index-entry {
    display: flex;
    gap: 10px;
    padding: 4px 0;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #B8A070;
    border-bottom: 1px solid rgba(106,90,56,0.15);
}

.index-entry:last-child {
    border-bottom: none;
}

.index-num {
    color: #6A5A38;
    min-width: 28px;
}

/* --- Signal Monitor (Bottom-Right) --- */
#signal-canvas {
    width: 100%;
    height: 80px;
    display: block;
    margin-bottom: 8px;
}

.signal-stats {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid rgba(106,90,56,0.3);
    padding-top: 6px;
}

.signal-stats .stat {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.65rem;
    color: #B8A070;
}

.signal-stats .label {
    color: #8A7848;
}

/* --- Transmission Log (Left-Side) --- */
#transmission-log {
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 0.65rem;
    color: #6A5A38;
    line-height: 1.7;
    overflow: hidden;
    max-height: 180px;
}

.log-entry {
    padding: 1px 0;
    opacity: 0;
    animation: logAppear 0.3s ease-out forwards;
}

.log-entry .log-time {
    color: #8A7848;
}

.log-entry .log-msg {
    color: #B8A070;
}

@keyframes logAppear {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 0.8;
        transform: translateX(0);
    }
}

/* --- Typewriter Reveal --- */
.typewriter-reveal {
    position: relative;
}

.typewriter-reveal .tw-cursor {
    display: inline-block;
    width: 1px;
    height: 0.85em;
    background: #B8A070;
    vertical-align: text-bottom;
    animation: cursorBlink 500ms step-end infinite;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .panel-left-side {
        display: none;
    }

    .panel-center {
        width: min(500px, 85vw);
    }

    .panel-top-left,
    .panel-top-right {
        width: 200px;
    }

    .panel-bottom-left {
        width: 220px;
    }

    .panel-bottom-right {
        width: 240px;
    }
}

@media (max-width: 640px) {
    #vault {
        padding: 10px;
    }

    .panel-top-left,
    .panel-top-right,
    .panel-bottom-left,
    .panel-bottom-right,
    .panel-left-side {
        display: none;
    }

    .panel-center {
        width: calc(100% - 20px);
        max-height: 80vh;
    }

    .center-content {
        padding: 16px;
    }

    #main-title {
        font-size: 1.6rem;
        letter-spacing: 0.15em;
    }
}

/* --- Glow Effect for Panels --- */
.vault-panel:hover {
    border-color: #8A7848;
    box-shadow: 0 0 15px rgba(184,160,104,0.06), inset 0 0 20px rgba(184,160,104,0.03);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
