:root {
    --bg: #020604;
    --bg-soft: #06110c;
    --panel: #050b08;
    --line: rgba(116, 255, 182, 0.2);
    --text: #d7ffe8;
    --muted: #7aa58e;
    --green: #73ffb6;
    --cyan: #64f1ff;
    --amber: #ffd166;
    --red: #ff7777;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: 2;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(rgba(115, 255, 182, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 50% 30%, rgba(115, 255, 182, 0.06), transparent 42%);
    background-size: 100% 4px, 100% 100%;
    mix-blend-mode: screen;
}

.page-shell {
    position: relative;
    display: grid;
    width: 100%;
    height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(41, 200, 117, 0.1), transparent 26%),
        linear-gradient(180deg, var(--bg-soft), var(--bg));
}

.terminal {
    display: grid;
    grid-template-rows: 44px minmax(0, 1fr);
    width: 100%;
    max-width: 100vw;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--panel);
}

.terminal-top {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: #07120d;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.window-dots {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
}

.window-dots span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: #ff5f57;
}

.window-dots span:nth-child(2) {
    background: #ffbd2e;
}

.window-dots span:nth-child(3) {
    background: #28c840;
}

.terminal-title {
    min-width: 0;
    overflow: hidden;
    color: rgba(215, 255, 232, 0.68);
    font-size: 0.82rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terminal-body {
    min-height: 0;
    overflow: auto;
    overflow-x: hidden;
    padding: clamp(18px, 2.5vw, 34px);
    scrollbar-color: rgba(115, 255, 182, 0.42) transparent;
}

.terminal-body p {
    min-height: 28px;
    margin: 0;
    color: rgba(215, 255, 232, 0.94);
    font-size: clamp(0.86rem, 1.2vw, 1rem);
    overflow-wrap: anywhere;
}

.prompt {
    color: var(--green);
    font-weight: 800;
}

.path {
    color: var(--cyan);
    font-weight: 800;
}

.cursor {
    display: inline-block;
    width: 9px;
    height: 1.18em;
    margin-left: 3px;
    vertical-align: -0.18em;
    background: var(--green);
    animation: blink 1s steps(2, start) infinite;
}

#typedCommand {
    overflow-wrap: anywhere;
}

.log-stack {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-bottom: 28px;
}

.log-line {
    display: flex;
    gap: 10px;
    align-items: baseline;
    min-width: 0;
    color: rgba(215, 255, 232, 0.78);
    font-size: clamp(0.78rem, 1vw, 0.95rem);
}

.log-line .tag {
    flex: 0 0 auto;
    color: var(--green);
    font-weight: 800;
}

.log-line.command .tag,
.log-line.info .tag {
    color: var(--cyan);
}

.log-line.warning .tag {
    color: var(--amber);
}

.log-line.error .tag {
    color: var(--red);
}

.log-line span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-list {
    display: grid;
    gap: 8px;
    width: min(960px, 100%);
    margin: 4px 0 6px 34px;
}

.resource-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) minmax(160px, auto) 84px;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(115, 255, 182, 0.16);
    border-radius: 4px;
    background:
        linear-gradient(90deg, rgba(115, 255, 182, 0.055), rgba(100, 241, 255, 0.025)),
        rgba(255, 255, 255, 0.025);
}

.resource-index {
    color: var(--muted);
}

.resource-name {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-path {
    min-width: 0;
    overflow: hidden;
    color: var(--cyan);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-state {
    justify-self: end;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 900;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@media (max-width: 760px) {
    .terminal-body {
        padding: 14px;
    }

    .terminal-body p,
    .log-line {
        font-size: 0.68rem;
        word-break: break-word;
    }

    .log-line {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: flex-start;
    }

    .log-line span:last-child {
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .resource-list {
        width: 100%;
        margin-left: 0;
    }

    .resource-row {
        grid-template-columns: 30px minmax(0, 1fr);
        gap: 6px 10px;
    }

    .resource-path,
    .resource-state {
        grid-column: 2;
        justify-self: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
