:root {
    color-scheme: dark;
    --bg: #080d11;
    --panel: #000000;
    --panel-raised: #101c22;
    --line: #20333b;
    --line-soft: #192a31;
    --text: #dbe8e6;
    --muted: #89a29f;
    --dim: #647b7b;
    --green: #a5f3c1;
    --mint: #67d6ba;
    --amber: #efbf82;
    --font: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 0; overflow-x: hidden; color: var(--text); background: var(--bg); font-family: var(--font); font-size: 14px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--green); text-decoration-color: #6caa91; text-underline-offset: 4px; }
a:hover { color: #d2ffe0; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
::selection { color: #05130d; background: var(--green); }

.page-glow { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 12%, #17372f 0, #0b1919 28%, transparent 64%); opacity: .82; }
.page-glow::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(#28413a22 1px, transparent 1px), linear-gradient(90deg, #28413a22 1px, transparent 1px); background-size: 64px 64px; mask-image: linear-gradient(to bottom, #0008, transparent 70%); }
.workspace { position: relative; z-index: 1; width: min(1360px, calc(100% - 64px)); margin: 32px auto 0; }
.terminal { display: flex; flex-direction: column; min-width: 0; height: calc(100vh - 82px); height: calc(100dvh - 82px); min-height: 570px; overflow: hidden; border: 1px solid #2b4548; border-radius: 13px; background: var(--panel); box-shadow: 0 30px 100px #0009, 0 0 0 1px #66ccaa0b, inset 0 1px #ffffff0b; }
.terminal-bar { display: flex; align-items: center; height: 48px; flex: 0 0 48px; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--panel); }
.window-controls { display: flex; gap: 8px; width: 145px; }
.window-controls span { width: 10px; height: 10px; border: 1px solid #d6dbcf55; border-radius: 50%; background: #91a197; }
.window-controls span:first-child { background: #db887c; border-color: #efada2; }
.window-controls span:nth-child(2) { background: #e2bc79; border-color: #f2d7a4; }
.window-controls span:last-child { background: #8fcb9a; border-color: #bae6c1; }
.window-title { flex: 1; text-align: center; color: #adbfba; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-icon { color: var(--mint); font-weight: bold; }
.window-status { width: 145px; text-align: right; font-size: 10px; letter-spacing: .12em; color: var(--green); }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; background: var(--green); box-shadow: 0 0 10px #80e3aa99; }
.terminal-toolbar { display: flex; align-items: center; gap: 9px; min-height: 54px; padding: 8px 28px; border-bottom: 1px solid var(--line-soft); background: var(--panel); }
.toolbar-label { margin-right: 12px; color: var(--dim); font-size: 10px; letter-spacing: .13em; white-space: nowrap; }
.terminal-toolbar button { min-height: 29px; padding: 5px 12px; color: #adc6bf; background: #142229; border: 1px solid #2a4146; border-radius: 4px; font-size: 11px; }
.terminal-toolbar button:hover { color: var(--green); border-color: #73c8a8; background: #1b332f; }

.terminal-screen { position: relative; flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 26px clamp(24px, 4vw, 58px) 60px; scrollbar-color: #355a55 transparent; scrollbar-width: thin; }
.terminal-screen.is-booting { overflow: hidden; }
.terminal-screen::-webkit-scrollbar { width: 8px; }
.terminal-screen::-webkit-scrollbar-thumb { border: 2px solid var(--panel); border-radius: 6px; background: #41635e; }
.boot-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 19px; border-bottom: 1px solid var(--line-soft); color: var(--dim); font-size: 10px; letter-spacing: .13em; }
.boot-version { color: #92b5a9; }
.boot-version strong { color: var(--green); font-weight: 500; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 380px); gap: 28px; align-items: center; padding: 46px 0 50px; border-bottom: 1px solid var(--line-soft); }
.ready-status { color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: 0; line-height: 1.5; }
.hero-status { margin: 0 0 24px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; color: #effbf4; font-size: clamp(28px, 3.5vw, 50px); line-height: 1.16; letter-spacing: -.055em; font-weight: 600; }
h1 span { color: var(--green); text-shadow: 0 0 30px #83df9f33; }
.hero-description { max-width: 700px; margin: 25px 0 0; color: #b4c7c1; font-size: 13px; line-height: 1.85; }
.hero-instruction { margin: 24px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.hero-instruction code { padding: 2px 5px; color: var(--green); background: #183028; border: 1px solid #325f4b; border-radius: 3px; font-size: inherit; }
.hero-logo { display: block; width: min(100%, 340px); height: auto; aspect-ratio: 1; object-fit: contain; justify-self: end; background: radial-gradient(circle, #303030 0%, #1b1b1b 43%, #000 73%); }

.no-js-content { padding: 26px 0; }
.no-js-content h2 { margin: 20px 0 12px; color: var(--green); font-size: 15px; }
.no-js-content h3 { margin: 18px 0 6px; color: var(--text); font-size: 12px; }
.no-js-content p { max-width: 950px; margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.8; }

.terminal-output { border-top: 1px solid var(--line-soft); padding-top: 22px; color: #c4d8d0; font-size: 12px; line-height: 1.65; }
.terminal-output:empty { display: none; }
.command-echo { display: flex; flex-wrap: wrap; margin: 16px 0 9px; overflow-wrap: anywhere; }
.command-echo:first-child { margin-top: 0; }
.echo-prompt { color: var(--green); white-space: nowrap; }
.echo-command { white-space: pre-wrap; overflow-wrap: anywhere; }
.output-line { min-height: 1.5em; white-space: pre-wrap; overflow-wrap: anywhere; }
.output-error { color: #e7a895; }
.output-accent { color: var(--green); }
.output-muted { color: var(--dim); }
.output-link { margin: 4px 0; }
.file-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 3px 0 13px; }
.file-entry { display: inline-flex; gap: 7px; align-items: center; min-height: 32px; padding: 5px 9px; border: 1px solid #34504b; border-radius: 3px; background: #14231f; color: #d9e6dd; font-size: 11px; }
.file-entry span:first-child { color: var(--mint); }
.file-entry.is-directory { color: var(--green); }
.file-entry:hover { border-color: var(--green); background: #203b2e; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 24px; max-width: 850px; margin: 8px 0; }
.help-grid > div { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; gap: 10px; }
.help-grid code { color: var(--green); }
.help-grid span { color: var(--muted); }
.ascii-art { width: max-content; max-width: 100%; overflow: auto; margin: 2px 0 12px; color: var(--green); line-height: 1.15; font: inherit; }
.is-cleared > .boot-heading, .is-cleared > .hero { display: none; }
.is-cleared > .terminal-output { padding-top: 0; border-top: 0; }

.terminal-footer { flex: 0 0 auto; border-top: 1px solid #365049; background: var(--panel); }
.command-line { display: flex; align-items: center; min-height: 55px; gap: 8px; padding: 6px clamp(24px, 4vw, 58px); }
.prompt { display: flex; max-width: 52%; overflow: hidden; white-space: nowrap; font-size: 12px; cursor: text; }
.prompt-user { color: var(--green); flex-shrink: 0; }
.prompt-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--mint); }
.prompt-symbol { margin-left: 1px; color: var(--green); }
.command-line input { min-width: 0; flex: 1; padding: 8px 0; border: 0; outline: 0; background: transparent; color: #f4fff5; caret-color: var(--green); font-size: 13px; }
.command-line input::placeholder { color: #617b77; opacity: 1; }
.command-line:focus-within { box-shadow: inset 0 2px #a5f3c144; }
.run-button { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #365d4e; border-radius: 3px; background: #1a362e; color: var(--green); font-size: 10px; }
.run-button:hover { background: #27513e; }
.run-button span:first-child { font-size: 18px; line-height: 12px; }
.outside-note { margin: 15px 0 0; color: #6e8880; font-size: 9px; letter-spacing: .12em; text-align: center; }

.boot-overlay { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 40px clamp(24px, 4vw, 58px); background: var(--panel); color: #91aa9c; font-size: 12px; }
.boot-lines { display: flex; flex-direction: column; gap: 12px; }
.boot-lines > span, .boot-lines > strong { display: block; }
.boot-progress { width: min(460px, 100%); height: 3px; margin-top: 22px; overflow: hidden; background: #193028; border-radius: 3px; }
.boot-progress::after { content: ""; display: block; width: 100%; height: 100%; background: var(--green); transform-origin: left; animation: boot-progress 5s linear both; }
.boot-overlay small { margin-top: auto; color: var(--dim); font-size: 10px; }
@keyframes boot-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 950px) {
    .workspace { width: calc(100% - 28px); margin-top: 14px; }
    .terminal { height: calc(100vh - 48px); height: var(--terminal-viewport-height, calc(100dvh - 48px)); min-height: 0; }
    .hero { grid-template-columns: minmax(0, 1fr) 230px; }
}

@media (max-width: 650px) {
    .workspace { width: 100%; margin: 0; }
    .terminal { height: 100vh; height: var(--terminal-viewport-height, 100dvh); min-height: 0; border: 0; border-radius: 0; }
    .terminal-bar { height: 43px; flex-basis: 43px; padding: 0 14px; }
    .window-controls { width: 64px; gap: 5px; }.window-controls span { width: 8px; height: 8px; }
    .window-title { font-size: 10px; }.window-status { width: 64px; font-size: 0; }.status-dot { width: 7px; height: 7px; }
    .terminal-toolbar { gap: 6px; min-height: 47px; padding: 7px 12px; overflow-x: auto; scrollbar-width: none; }
    .terminal-toolbar::-webkit-scrollbar { display: none; }
    .toolbar-label { display: none; }
    .terminal-toolbar button { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; font-size: 11px; }
    .terminal-screen { padding: 17px 18px 32px; }
    .boot-heading { font-size: 9px; }
    .hero { display: block; padding: 31px 0 34px; }
    .hero-logo { display: none; }
    .hero-status { margin-bottom: 18px; }
    h1 { font-size: clamp(27px, 8vw, 42px); }
    .hero-description { margin-top: 18px; font-size: 12px; }
    .hero-instruction { margin-top: 17px; font-size: 11px; }
    .terminal-output { font-size: 12px; }
    .help-grid { grid-template-columns: 1fr; }
    .command-line { min-height: 58px; padding: 6px 12px max(6px, env(safe-area-inset-bottom)); }
    .prompt { max-width: 44%; font-size: 11px; }
    .command-line input { font-size: 16px; }
    .run-button { min-width: 34px; min-height: 34px; justify-content: center; padding: 7px; }
    .run-button span:last-child { display: none; }
    .outside-note { display: none; }
}

@media (max-width: 380px) {
    .boot-version { display: none; }
    .terminal-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .terminal-toolbar button { min-width: 0; width: 100%; text-align: center; }
    .prompt { max-width: 42%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .boot-progress { display: none; }
}
