:root {
    --glitch-val: 0;
}

@keyframes micro-glitch {
    0% {
        transform: translate(0, 0);
    }

    10% {
        transform: translate(calc(var(--glitch-val) * 0.02px), calc(var(--glitch-val) * -0.01px));
    }

    30% {
        transform: translate(calc(var(--glitch-val) * -0.02px), calc(var(--glitch-val) * 0.02px));
    }

    50% {
        transform: translate(calc(var(--glitch-val) * 0.01px), 0);
    }

    70% {
        transform: translate(calc(var(--glitch-val) * -0.01px), calc(var(--glitch-val) * -0.02px));
    }

    90% {
        transform: translate(calc(var(--glitch-val) * 0.02px), calc(var(--glitch-val) * 0.01px));
    }

    100% {
        transform: translate(0, 0);
    }
}

.glitch-active {
    animation: micro-glitch 0.1s steps(2) infinite;
}

.bento-container.vortex-active {
    filter: url(#chromatic-aberration);
}

.bento-container {
    display: grid;
    gap: 16px;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 600px;
    grid-template-columns: 1.5fr 0.8fr 0.7fr;
    grid-template-rows: auto 1.5fr 0.8fr;

    grid-template-areas:
        "main main lead"
        "terminal canvas lead"
        "terminal canvas effects";
}

.bento-item {
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
}

.main {
    grid-area: main;
    display: flex;
    align-items: center;
}

.lead {
    grid-area: lead;
}

.terminal {
    grid-area: terminal;
}

.canvas {
    grid-area: canvas;
}

.effects {
    grid-area: effects;
}


.main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    padding: 24px;
}

.hero-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hero-content h1 {
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.1;
    text-align: left;
}

.hero-content p {
    margin: 0;
    padding: 0;
    max-width: 80%;
}



.stat-group {
    white-space: nowrap;
}

.stat-group .value {
    color: var(--color-main);
    font-weight: bold;
    margin-left: 4px;
}

.stat-sep {
    opacity: 0.3;
    color: var(--color-main);
}

.hero-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin-top: auto;
    align-items: flex-start;
    justify-content: flex-start;
}

.btn-wrapper {
    width: auto;
}

.btn-base {
    width: auto;
    white-space: nowrap;
    padding: 10px 20px;
}

.lead {
    display: flex;
    flex-direction: column;
    overflow: hidden;

}

.lead-image-wrapper {
    flex-grow: 1;
    background: #000;
    overflow: hidden;
}

.lead-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lead-link {
    padding: 16px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text-muted);
}

.support-link {
    padding: 16px;
    text-decoration: none;
}

/* Canvas */
.bento-item.canvas {
    padding: 0;
    background: #000;
    position: relative;
    overflow: hidden;
}

#warp-canvas {
    display: block;
    width: 100%;
    height: 100%;
    filter: contrast(1.1) brightness(1.1);
}

.effects {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    gap: 16px;

}

.slider-control {
    margin-bottom: 0;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.val-display {
    font-family: monospace;
    min-width: 30px;
    text-align: right;
}

/* TERMINAL */
.greeting-msg {
    color: #00ff41 !important;
    font-weight: bold;
    margin: 0px 0;
}

.log-entry {
    color: #ccc;
    font-size: 0.85rem;
    font-weight: normal;
}

.system-msg {
    opacity: 0.9;
}

.terminal {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--color-main);
    background-color: var(--bg-main);
    min-height: 0;
}

.terminal-output {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.terminal-input-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 12px 12px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 52, 255, 0.05);
}

.prompt {
    color: var(--color-main);
    margin-right: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

#term-input {
    background: transparent;
    border: none;
    color: var(--color-main);
    outline: none;
    width: 100%;


    padding: 0;
    margin: 0;
}

#term-input::placeholder {
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .bento-container {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "main main"
            "terminal lead"
            "canvas effects";
        height: auto;
    }
}


@media (max-width: 700px) {
    .bento-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "terminal"
            "main"
            "canvas"
            "effects"
            "lead"
        ;

        height: auto;
        min-height: auto;
        gap: 12px;
    }

    .terminal {
        min-height: 350px;
    }

    .canvas {
        min-height: 300px;
    }

    .main {
        min-height: 250px;
    }

    .hero-content p {
        max-width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-base {
        width: 100%;
        text-align: center;
    }
}