/* Палитра: графит + бирюзово-зелёный акцент + янтарь для предупреждений */
:root {
  color-scheme: dark;
  --bg:#0d1012; --bg-2:#111518; --surface:#151a1d; --surface-2:#1b2125; --surface-3:#222a2f;
  --line:#2a3338; --line-2:#36424a;
  --text:#e9efec; --muted:#9aa8a3; --dim:#6f7d78;
  --accent:#42d6a4; --accent-2:#2bb58a; --accent-ink:#06231a; --accent-soft:#42d6a41f;
  --warn:#f2b45a; --danger:#ef7a6a;
  --mono:"JetBrains Mono","Cascadia Mono",Consolas,ui-monospace,monospace;
  --sans:Inter,"Segoe UI",system-ui,sans-serif;
  --radius:12px;
  background:var(--bg); color:var(--text); font-family:var(--sans);
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
body {
  margin:0; min-height:100vh;
  background:
    radial-gradient(900px 420px at 85% -10%,#42d6a414,transparent 70%),
    radial-gradient(700px 380px at -10% 10%,#f2b45a0d,transparent 70%),
    var(--bg);
}
::selection { background:#42d6a455; }
.shell { width:min(calc(100% - 64px),1380px); margin-inline:auto; }

/* Шапка */
.site-header { position:sticky; top:0; z-index:5; background:#0d1012d9; backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.header-inner { min-height:60px; display:flex; justify-content:space-between; align-items:center; gap:12px; }
.brand { display:flex; align-items:center; white-space:nowrap; font:700 .9rem var(--mono); letter-spacing:.08em; }
.brand-icon { display:grid; place-items:center; width:32px; height:32px; color:var(--accent-ink); background:linear-gradient(145deg,#7cf0c8,var(--accent-2)); border-radius:8px; margin-right:10px; font-weight:800; box-shadow:0 4px 18px #42d6a433; }
.slash { margin-inline:3px; color:var(--accent); }
.header-meta { display:flex; align-items:center; gap:10px; }
.uptime { font:.78rem var(--mono); color:var(--muted); padding:4px 8px; border:1px solid var(--line); border-radius:999px; }
.machine-status { display:flex; align-items:center; gap:8px; font:.8rem var(--mono); color:#c3cfca; padding:5px 11px 5px 9px; border:1px solid var(--line); border-radius:999px; background:var(--bg-2); }
.machine-status i { height:8px; width:8px; flex:none; border-radius:50%; background:#66726e; }
.machine-status[data-phase=working] i { background:var(--accent); box-shadow:0 0 0 3px #42d6a42b; animation:pulse 2.4s infinite; }
.machine-status[data-phase=booting] i,.machine-status[data-phase=preparing] i,.machine-status[data-phase=paused] i,.machine-status[data-phase=closing] i { background:var(--warn); box-shadow:0 0 0 3px #f2b45a2b; animation:pulse 1.2s infinite; }
.machine-status[data-phase=error] i { background:var(--danger); box-shadow:0 0 0 3px #ef7a6a2b; }
@keyframes pulse { 50% { opacity:.45; } }

/* Вступление */
.intro { padding:34px 0 24px; display:flex; align-items:end; justify-content:space-between; gap:18px; }
.eyebrow { margin:0 0 10px; font:600 .74rem var(--mono); letter-spacing:.16em; text-transform:uppercase; color:var(--accent); }
h1 { font-size:clamp(2.3rem,5.4vw,4.4rem); line-height:1; letter-spacing:-.05em; margin:0; font-weight:800; }
h1 span { background:linear-gradient(100deg,var(--accent),#b6f5df); -webkit-background-clip:text; background-clip:text; color:transparent; }
.lead { color:var(--muted); margin:14px 0 0; line-height:1.5; max-width:60ch; }
.release { display:flex; flex-direction:column; align-items:flex-end; gap:2px; border:1px solid var(--line); border-radius:10px; color:#d7e2de; padding:8px 12px; font:600 .9rem var(--mono); white-space:nowrap; background:var(--surface); }
.release small { font-size:.66rem; letter-spacing:.14em; color:var(--dim); }

/* Сетка */
.bench { display:grid; grid-template-columns:minmax(0,1fr) minmax(290px,320px); align-items:start; gap:18px; }

/* Монитор */
.machine { min-width:0; overflow:hidden; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 24px 60px #00000080,0 0 0 1px #ffffff05 inset; }
.monitor-header,.monitor-footer { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 12px; }
.monitor-header { border-bottom:1px solid var(--line); background:var(--bg-2); flex-wrap:wrap; }
.monitor-title,.monitor-actions,.inline-actions { display:flex; align-items:center; gap:8px; }
.monitor-actions { flex-wrap:wrap; justify-content:flex-end; }
.inline-actions { flex-wrap:wrap; }
.monitor-title h2 { margin:0; font-size:.92rem; font-weight:600; color:#d3ddd9; }
.dots { display:flex; gap:6px; }
.dots i { width:10px; height:10px; border-radius:50%; background:var(--surface-3); border:1px solid var(--line-2); }
.dots i:first-child { background:#ef7a6a; border-color:#ef7a6a; }
.dots i:nth-child(2) { background:var(--warn); border-color:var(--warn); }
.dots i:last-child { background:var(--accent); border-color:var(--accent); }

/* Элементы управления */
button,select,input,textarea { font:inherit; }
button,select { padding:7px 11px; border:1px solid var(--line-2); border-radius:8px; background:var(--surface-2); color:#dce6e2; cursor:pointer; transition:background .15s,border-color .15s,color .15s,transform .05s; }
button:hover:not(:disabled), select:hover:not(:disabled) { background:var(--surface-3); border-color:#4f6068; color:#fff; }
button:active:not(:disabled) { transform:translateY(1px); }
button:disabled,select:disabled { opacity:.4; cursor:not-allowed; }
button:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible,#screen:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.monitor-actions button,.inline-actions button { font-size:.84rem; }
.primary { background:linear-gradient(180deg,#5ae3b4,var(--accent-2)); border-color:#6fe9bf; color:var(--accent-ink); font-weight:700; padding:10px 16px; box-shadow:0 6px 20px #42d6a42e; }
.primary:hover:not(:disabled) { background:linear-gradient(180deg,#7cf0c8,#36c596); color:#031a12; border-color:#9df5d6; }
.danger { color:#ffb4a8; border-color:#5a3530; background:#2a1c1a; }
.danger:hover:not(:disabled) { background:#3a2420!important; border-color:#7c4239!important; color:#ffd0c8!important; }

/* Экран */
.display { min-height:300px; aspect-ratio:16/10; position:relative; background:#050607; overflow:hidden; display:grid; place-items:center; }
#screen { position:absolute; inset:0; display:grid; place-items:center; overflow:hidden; touch-action:none; }
#serial-console { position:absolute; inset:0; padding:13px; overflow:hidden; background:#07090a; }
#serial-console .xterm { height:100%; }
#serial-console .xterm-viewport { background-color:#07090a!important; scrollbar-width:thin; scrollbar-color:#36424a transparent; }
#serial-console .xterm-viewport::-webkit-scrollbar { width:8px; height:0; }
#serial-console .xterm-viewport::-webkit-scrollbar-thumb { background:#36424a; border-radius:4px; }
#serial-console .xterm-viewport::-webkit-scrollbar-button { display:none; }
#vga-text { position:absolute; left:50%; top:50%; width:max-content; white-space:pre; transform:translate(-50%,-50%) scale(var(--scale,1)); font:16px/16px var(--mono); color:#e2ece8; }
#vga-canvas { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); max-width:100%; max-height:100%; image-rendering:auto!important; }
.start-layer { position:absolute; inset:0; z-index:2; display:grid; place-items:center;
  background:
    radial-gradient(ellipse at 50% 38%,#42d6a41f 0%,transparent 55%),
    linear-gradient(#ffffff06 1px,transparent 1px) 0 0/100% 28px,
    linear-gradient(90deg,#ffffff06 1px,transparent 1px) 0 0/28px 100%,
    #080a0b; }
.start-layer.black { background:#030404; }
.start-layer.black .arch-icon { display:none; }
.start-card { max-width:min(520px,94%); text-align:center; padding:22px; }
.arch-icon { width:68px; height:68px; margin:0 auto 14px; background:linear-gradient(150deg,#b6f5df,var(--accent-2) 80%); clip-path:polygon(50% 0,64% 34%,56% 29%,70% 43%,100% 98%,65% 80%,60% 56%,50% 52%,40% 56%,35% 80%,0 98%,30% 43%); filter:drop-shadow(0 8px 24px #42d6a455); }
.start-layer:not(.black) .arch-icon { animation:float 5s ease-in-out infinite; }
@keyframes float { 50% { transform:translateY(-5px); } }
.start-card h3 { margin:0; letter-spacing:-.03em; font-size:clamp(1.4rem,3vw,2rem); }
.start-card p { margin:10px 0 18px; color:var(--muted); line-height:1.5; }
.progress { height:4px; width:min(280px,80%); margin:-6px auto 18px; background:var(--surface-3); border-radius:4px; overflow:hidden; }
.progress i { display:block; height:100%; width:40%; background:linear-gradient(90deg,transparent,var(--accent),transparent); animation:slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform:translateX(-100%); } to { transform:translateX(250%); } }
.cover-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:8px; }
code { font-family:var(--mono); font-size:.92em; color:#9ff0d2; background:#42d6a414; padding:1px 5px; border-radius:4px; }

/* Нижняя панель монитора и виртуальные клавиши */
.monitor-footer { min-height:40px; border-top:1px solid var(--line); background:var(--bg-2); color:var(--muted); font:.77rem/1.4 var(--mono); }
kbd { font:inherit; padding:1px 5px; border-radius:5px; border:1px solid var(--line-2); border-bottom-width:2px; background:var(--surface-2); color:#dbe5e1; }
.keys { display:flex; flex-wrap:wrap; min-width:0; border:0; border-top:1px solid var(--line); margin:0; padding:6px 8px; gap:5px; background:var(--bg-2); }
.keys:disabled { display:none; }
.keys button { flex:1 0 auto; min-width:44px; padding:5px 6px; font:.76rem var(--mono); }
.machine:fullscreen { width:100%; height:100%; border:0; border-radius:0; display:grid; grid-template-rows:auto minmax(0,1fr); grid-auto-rows:auto; }
.machine:fullscreen .display { aspect-ratio:auto; min-height:0; }

/* Панели справа */
.controls { display:grid; gap:12px; }
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px; }
.panel h2 { display:flex; align-items:center; gap:8px; margin:0 0 10px; font-size:.98rem; font-weight:650; }
.accent { display:grid; place-items:center; width:24px; height:24px; border-radius:7px; background:var(--accent-soft); color:var(--accent); font:700 .8rem var(--mono); }
.panel p { margin:0 0 11px; color:var(--muted); font-size:.87rem; line-height:1.5; }
.setting { display:flex; align-items:center; justify-content:space-between; gap:8px; border-top:1px solid var(--line); padding:8px 0; min-height:46px; font-size:.88rem; }
.setting small { display:block; color:var(--dim); font-size:.74rem; margin-top:3px; }
.setting select { appearance:none; min-width:110px; padding-right:24px; background-image:linear-gradient(45deg,transparent 50%,#9aa8a3 50%),linear-gradient(135deg,#9aa8a3 50%,transparent 50%); background-position:calc(100% - 13px) 50%,calc(100% - 9px) 50%; background-size:4px 4px; background-repeat:no-repeat; }
.switch { width:42px; height:24px; border-radius:20px; padding:0; position:relative; flex:none; }
.switch::after { content:""; width:16px; height:16px; border-radius:100%; background:#8a9692; position:absolute; left:3px; top:3px; transition:left .15s,background .15s; }
.switch[aria-checked=true] { background:#1d4a3c; border-color:var(--accent-2); }
.switch[aria-checked=true]::after { background:var(--accent); left:21px; }
.wide { width:100%; }
.muted-button { margin-top:6px; font-size:.85rem; }

/* Хранилище */
.storage-list { display:grid; gap:6px; }
.storage-item { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:7px 9px; border:1px solid var(--line); border-radius:8px; background:var(--bg-2); font-size:.82rem; }
.storage-item span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.storage-item small { display:block; color:var(--dim); font:.72rem var(--mono); }
.storage-item button { font-size:.76rem; padding:4px 8px; flex:none; }
.storage-empty { color:var(--dim); font-size:.82rem; }

/* Подвал */
.site-footer { display:flex; gap:12px; justify-content:space-between; align-items:center; padding:18px 0 24px; margin-top:8px; color:var(--dim); font-size:.82rem; line-height:1.45; }
.site-footer p { margin:0; }
.site-footer a { color:#9fbab0; white-space:nowrap; text-decoration:none; border-bottom:1px solid #9fbab044; }
.site-footer a:hover { color:var(--accent); border-color:var(--accent); }
.site-footer div { display:flex; flex-wrap:wrap; gap:14px; }

/* Диалоги */
dialog { background:var(--surface); border:1px solid var(--line-2); border-radius:14px; color:var(--text); max-width:92vw; width:520px; padding:22px; box-shadow:0 30px 80px #000a; }
dialog::backdrop { background:#020303c4; backdrop-filter:blur(3px); }
dialog h2 { margin:0 0 9px; font-size:1.2rem; }
dialog p { color:var(--muted); margin:0 0 13px; line-height:1.45; }
dialog input[type=text],dialog textarea { width:100%; padding:9px 10px; border:1px solid var(--line-2); border-radius:8px; background:var(--bg); color:var(--text); font-family:var(--mono); font-size:.88rem; resize:vertical; }
.dialog-actions { justify-content:end; margin-top:14px; }
.dialog-actions .left { margin-right:auto; }
.iso-option { display:flex; align-items:center; gap:10px; margin:12px 0; }
.iso-option select { margin-left:auto; }
.iso-option input { width:auto; accent-color:var(--accent); }
#local-iso-name { overflow-wrap:anywhere; font-family:var(--mono); color:#cfe0d9; }

/* Адаптивность */
@media(max-width:760px){ .key-hint{display:none} }
@media(max-width:900px){.shell{width:calc(100% - 40px)}.bench{grid-template-columns:minmax(0,1fr) minmax(250px,300px);gap:12px}.monitor-actions{gap:4px}}
@media(max-width:760px){.bench{grid-template-columns:minmax(0,1fr)}.shell{width:calc(100% - 26px)}.intro{padding:22px 0 16px}.release{display:none}.display{min-height:260px}.site-footer{align-items:flex-start;flex-direction:column}.controls{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:480px){.controls{grid-template-columns:1fr}.monitor-actions button{font-size:.74rem;padding-inline:6px}.monitor-title h2{font-size:.82rem}.dots{display:none}.lead{font-size:.92rem}.machine-status{font-size:.72rem}.uptime{display:none}}
@media(prefers-reduced-motion:reduce){ *,*::before,*::after { animation:none!important; transition:none!important; } }
