:root {
    color-scheme: dark;
    --void: #020305;
    --panel: rgba(7, 10, 14, 0.96);
    --panel-2: #0b1015;
    --line: rgba(188, 226, 221, 0.13);
    --muted: #63727a;
    --text: #c4d4d4;
    --cyan: #55f6e7;
    --green: #9dff6d;
    --pink: #ff4fb8;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 45%, rgba(11, 115, 111, 0.14), transparent 34%),
        radial-gradient(circle at 10% 90%, rgba(255, 42, 169, 0.07), transparent 27%),
        var(--void);
    color: var(--text);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: 0.24;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black, transparent 82%);
}

.ambient {
    position: fixed;
    inset: -25%;
    background: conic-gradient(from 0deg at 50% 50%, transparent, rgba(57, 255, 224, .035), transparent 28%, rgba(255, 43, 171, .03), transparent 65%);
    animation: rotate-ambient 26s linear infinite;
    will-change: transform;
    pointer-events: none;
}

.stage {
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: clamp(16px, 4vw, 56px);
    position: relative;
}

.terminal {
    width: min(1180px, 100%);
    height: min(760px, calc(100svh - 88px));
    min-height: 430px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(190, 229, 225, .19);
    border-radius: 12px;
    background: var(--panel);
    box-shadow:
        0 34px 100px rgba(0, 0, 0, .72),
        0 0 0 1px rgba(0, 0, 0, .9),
        0 0 72px rgba(33, 238, 209, .06),
        inset 0 1px rgba(255, 255, 255, .05);
    animation: terminal-arrive 900ms cubic-bezier(.2,.8,.2,1) both;
}

.terminal-bar {
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    align-items: center;
    padding: 0 15px;
    background: linear-gradient(#1b2025, #12171b);
    border-bottom: 1px solid #050708;
    box-shadow: inset 0 1px rgba(255,255,255,.055);
    user-select: none;
}

.window-actions { display: flex; gap: 8px; }
.window-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 -1px 1px rgba(0,0,0,.3); }
.window-dot.close { background: #ff5f57; }
.window-dot.minimize { background: #febc2e; }
.window-dot.maximize { background: #28c840; }

.terminal-title {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aeb7ba;
    font: 500 11px/1 system-ui, sans-serif;
    letter-spacing: .02em;
}

.terminal-title svg { width: 14px; fill: none; stroke: #7d8a8d; stroke-width: 1.4; }
.terminal-menu { justify-self: end; display: flex; gap: 4px; }
.terminal-menu span { width: 3px; height: 3px; border-radius: 50%; background: #697378; }

.tab-bar {
    height: 35px;
    flex: 0 0 35px;
    display: flex;
    align-items: stretch;
    background: #090c0f;
    border-bottom: 1px solid #1c2429;
}

.tab {
    width: 180px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    gap: 8px;
    color: #8e9a9e;
    font-size: 11px;
    background: #0d1216;
    border-right: 1px solid #1b2429;
}

.tab.active { color: #c9d4d5; border-top: 1px solid var(--cyan); }
.tab-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 9px var(--cyan); }
.tab-close { margin-left: auto; color: #566267; font-size: 15px; }
.new-tab { display: grid; place-items: center; width: 38px; color: #59666b; }

.terminal-screen {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #05080a;
}

.command-line {
    flex: 0 0 45px;
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 18px;
    color: #afbabc;
    font-size: clamp(10px, 1.15vw, 13px);
    border-bottom: 1px solid rgba(126, 157, 158, .08);
}

.prompt-user { color: var(--green); font-weight: 600; }
.prompt-separator { color: #607077; }
.prompt-path { color: #6caeff; }
.prompt-symbol { color: var(--pink); margin: 0 9px 0 6px; }
.typed-command { color: #d5dcdc; }
.cursor { width: 7px; height: 15px; margin-left: 3px; background: var(--cyan); animation: blink 1s steps(1) infinite; box-shadow: 0 0 8px rgba(85,246,231,.5); }

.render-area {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    contain: strict;
}
#ascii-field {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(0,0,0,.7) 4px);
}

.vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 90px 28px rgba(0, 0, 0, .7);
}

.wordmark {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(-1%);
    pointer-events: none;
}

.wordmark::before {
    content: "";
    position: absolute;
    width: min(720px, 76%);
    aspect-ratio: 2.8;
    background: radial-gradient(ellipse, rgba(2, 13, 15, .96) 0 33%, rgba(2, 12, 13, .62) 52%, transparent 75%);
    filter: blur(8px);
}

.wordmark pre {
    position: relative;
    margin: 0;
    color: #dcfffb;
    font-size: clamp(8px, 1.43vw, 17px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: .03em;
    text-shadow: 0 0 4px #fff, 0 0 14px var(--cyan), 0 0 40px rgba(18, 255, 221, .45);
    animation: glow-breathe 4s ease-in-out infinite;
    will-change: opacity;
}

.signal-label {
    position: relative;
    width: min(460px, 70%);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    color: rgba(133, 255, 235, .72);
    font-size: clamp(7px, .75vw, 10px);
    letter-spacing: .28em;
    white-space: nowrap;
}

.signal-label span { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, rgba(85,246,231,.55)); }
.signal-label span:last-child { transform: rotate(180deg); }

.status-bar {
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 12px;
    border-top: 1px solid #172126;
    background: #0a0f12;
    color: #69777b;
    font-size: 9px;
    letter-spacing: .09em;
}

.status-bar > div { display: flex; align-items: center; gap: 7px; }
.status-led { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); animation: blink-soft 2s ease-in-out infinite; }
.status-copy span { color: #9babad; }
.status-stats { justify-self: end; gap: 17px !important; }

.outside-label {
    position: absolute;
    bottom: 18px;
    margin: 0;
    color: #303a3e;
    font-size: 8px;
    letter-spacing: .28em;
}

noscript { position: fixed; bottom: 8px; left: 8px; font-size: 12px; }

@keyframes terminal-arrive { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rotate-ambient { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 48% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes blink-soft { 50% { opacity: .35; } }
@keyframes glow-breathe { 50% { opacity: .82; } }

@media (max-width: 680px) {
    .stage { padding: 10px; }
    .terminal { height: calc(100svh - 38px); min-height: 360px; border-radius: 8px; }
    .terminal-bar { grid-template-columns: 80px 1fr 80px; }
    .terminal-title span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tab { width: 145px; }
    .status-copy { display: none !important; }
    .status-bar { grid-template-columns: 1fr 1fr; }
    .status-stats span:first-child { display: none; }
    .outside-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ambient, .terminal, .wordmark pre, .cursor, .status-led { animation: none; }
}
