@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap;
  src: url("fonts/jbm-latin-400.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2500-25FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap;
  src: url("fonts/jbm-cyrillic-400.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap;
  src: url("fonts/jbm-latin-700.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2190-21FF, U+2500-25FF; }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; font-display: swap;
  src: url("fonts/jbm-cyrillic-700.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #0d0a14;
  --panel: #15101f;
  --line: #2b2439;
  --text: #dcd6ea;
  --dim: #8279a0;
  --purple: #c59bff;
  --purple-deep: #8f5cf0;
  --amber: #f2c078;
  --green: #7ee2a8;
  --red: #ff7a90;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, ui-monospace, "DejaVu Sans Mono", monospace;
  --w: 54rem;
  --status-h: 1.9rem;
}

* { box-sizing: border-box; }
/* фон и тёмная схема на корне: полосы прокрутки, поля файлов и область за краем страницы тоже тёмные */
html { scroll-behavior: smooth; scroll-padding-top: 4rem; background: var(--bg); color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.65 var(--mono); padding-bottom: calc(var(--status-h) + 2rem);
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere; min-height: 100vh;
}
::selection { background: var(--purple); color: var(--bg); }
a { color: var(--purple); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.dim { color: var(--dim); }

/* ----- шапка ----- */
.top {
  position: sticky; top: 0; z-index: 4; display: flex; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; padding: .7rem max(1rem, calc((100vw - var(--w)) / 2));
  background: rgba(13, 10, 20, .92); border-bottom: 1px dashed var(--line);
}
.brand { color: var(--text); font-weight: 700; text-decoration: none; }
.top nav { display: flex; gap: 1.1rem; }
.top nav a { color: var(--dim); text-decoration: none; }
.top nav a:hover, .top nav a:focus-visible { color: var(--purple); }
.top nav a::before { content: "./"; opacity: .5; }

main { max-width: var(--w); margin: 0 auto; padding: 0 1rem; }

/* ----- секция = команда + её вывод ----- */
.sec { padding: 4rem 0 .6rem; }
.cmd { margin: 0 0 .9rem; font-size: 1rem; font-weight: 400; color: var(--text); }
.ps1 { color: var(--green); user-select: none; }
.typed.typing::after, .cursor {
  content: ""; display: inline-block; width: .6em; height: 1.05em; margin-left: .12em;
  background: var(--purple); vertical-align: text-bottom; animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.comment { margin: 0 0 1rem; color: var(--dim); }

/* вывод «печатается» после того, как команда набрана */
.js .sec:not(.ran) .typed:not(.live) { visibility: hidden; }
.js .sec:not(.ran) .out { visibility: hidden; }
.js .sec.ran .out > *, .js .sec.ran .yl {
  animation: print .01s linear both; animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes print { from { opacity: 0; } to { opacity: 1; } }

/* ----- hero ----- */
.hero { padding-top: 3.5rem; }
h1 {
  margin: 0 0 .6rem; font-size: clamp(1.9rem, 7.4vw, 4.1rem); line-height: 1.08;
  font-weight: 700; letter-spacing: -.04em; color: var(--purple);
}
h1 .cursor { width: .5em; height: .9em; vertical-align: baseline; margin-left: .1em; }
.lead { margin: 0 0 .5rem; max-width: 40rem; font-size: 1.05rem; }
.roles { margin: 0 0 1.4rem; min-height: 1.65em; color: var(--amber); }
.roles::after { content: "_"; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0 0; }

.btn {
  display: inline-block; padding: .38rem .9rem; border: 1px solid var(--line); border-radius: 3px;
  color: var(--text); background: transparent; font: inherit; text-decoration: none; cursor: pointer;
  white-space: nowrap; text-align: center;
}
.btn:hover, .btn:focus-visible { border-color: var(--purple); color: var(--purple); }
.btn.primary { border-color: var(--purple); color: var(--purple); }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--purple); color: var(--bg); }
.btn.dl { min-width: 8.2rem; }

/* ----- строки списка ----- */
.row { border-top: 1px dashed var(--line); padding: 1rem 0; }
.row:last-of-type { border-bottom: 1px dashed var(--line); }
.row-head { display: flex; align-items: center; gap: 1rem; }
.row-toggle {
  flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .2rem .9rem;
  padding: .15rem 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.caret { color: var(--dim); display: inline-block; transition: transform .12s; }
.row.open .caret { transform: rotate(90deg); color: var(--purple); }
.perm, .size { color: var(--dim); }
.size { min-width: 3.6em; text-align: right; }
.name { font-weight: 700; color: #fff; }
.row-toggle:hover .name, .row-toggle:focus-visible .name { color: var(--purple); }
.ver { color: var(--amber); }
.tag { color: var(--dim); }
.soon { color: var(--dim); white-space: nowrap; }
.row-tag { margin: .1rem 0 0 1.55rem; color: var(--dim); }
.row-body { margin: .8rem 0 .3rem 1.55rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.js .row:not(.open) .row-body { display: none; }
.js .row { cursor: pointer; }
.js .row-body { cursor: auto; }
.js .row:not(.open):hover { background: rgba(197, 155, 255, .045); }
.js .row:hover .name { color: var(--purple); }
.js .row:hover .caret { color: var(--purple); }
.desc { margin: 0; white-space: pre-line; max-width: 42rem; }
.shots + .desc { margin-top: 1.1rem; }
.meta { margin: .6rem 0 0; color: var(--dim); font-size: .9rem; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .6rem; }
.shot { display: block; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: var(--panel); aspect-ratio: 16 / 10; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot:hover, .shot:focus-visible { border-color: var(--purple); }
.empty { color: var(--dim); margin: 0; }

.trust { margin: 1.1rem 0 0; padding: .7rem .9rem; border: 1px dashed var(--line); border-radius: 3px; max-width: 42rem; font-size: .9rem; }
.trust p { margin: 0; }
.trust p + p { margin-top: .5rem; }
.trust code { font: inherit; color: var(--green); }
.copy { border: 0; background: none; padding: 0 0 0 .4rem; color: var(--purple); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.copy:hover { color: #fff; }

/* ----- страница одной записи ----- */
.item h1 { font-size: clamp(1.7rem, 5.4vw, 2.9rem); }
.item h1 .ver { font-size: .5em; letter-spacing: 0; font-weight: 400; }
.item .tags { margin: 0; }
.item .actions { margin-bottom: 1.4rem; }
.item .trust { margin: 0 0 1.4rem; }
.item .shots { margin-bottom: 1.4rem; }
.shots.big { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }

.steps { list-style: none; margin: 1rem 0 0; padding: 0; max-width: 42rem; }
.steps li { padding: .2rem 0 .2rem 3.4rem; text-indent: -3.4rem; }
.steps .n { color: var(--green); margin-right: .5rem; }

.row-body .tags { margin: .9rem 0 0; }

/* ----- stack.yml ----- */
.yaml { margin: 0; }
.yl { display: flex; gap: .9rem; padding: .12rem 0; }
.yl dt { color: var(--purple); min-width: 7.2rem; }
.yl dd { margin: 0; color: var(--dim); }
.yl dd span { color: var(--amber); }

/* ----- живая строка ввода ----- */
.shell { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px dashed var(--line); }
.shell-out { white-space: pre-wrap; }
.shell-out .echo { color: var(--dim); }
.shell-out .err { color: var(--red); }
.shell-line { display: flex; gap: .6rem; align-items: baseline; }
.shell-line label { white-space: nowrap; }
.shell-line input {
  flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit;
  caret-color: var(--purple); padding: .2rem 0;
}
.shell-line input:focus { outline: none; }
.shell-line:focus-within { box-shadow: 0 1px 0 var(--purple); }
.shell-line input::placeholder { color: #4b4460; }
.shell .comment { margin-top: .5rem; font-size: .9rem; }

/* ----- статус-строка ----- */
.status {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; height: var(--status-h);
  display: flex; align-items: center; gap: 1rem; padding-right: 1rem;
  background: var(--panel); border-top: 1px solid var(--line); color: var(--dim); font-size: .82rem; white-space: nowrap;
}
.mode { align-self: stretch; display: flex; align-items: center; padding: 0 .8rem; background: var(--purple); color: var(--bg); font-weight: 700; }
.st-grow { flex: 1; }

/* ----- загрузка ----- */
.boot { position: fixed; inset: 0; z-index: 20; background: var(--bg); padding: 1.2rem; transition: opacity .18s; cursor: pointer; }
.boot.off { opacity: 0; }
.boot pre { margin: 0; font: inherit; color: var(--dim); white-space: pre-wrap; }
.boot .ok { color: var(--green); }
.boot .hl { color: var(--purple); }

/* ----- просмотр скриншота ----- */
.lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(8, 6, 13, .96); display: flex; align-items: center; justify-content: center; padding: 4rem 4.5rem 3.2rem; }
.lightbox[hidden], .boot[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border: 1px solid var(--line); user-select: none; }
.lb-btn {
  position: absolute; width: 3rem; height: 3rem; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 3px; background: var(--panel); color: var(--text);
  font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lb-btn:hover, .lb-btn:focus-visible { border-color: var(--purple); color: var(--purple); }
.lb-close { top: .8rem; right: .8rem; font-size: 1.15rem; }
.lb-prev { left: .8rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .8rem; top: 50%; transform: translateY(-50%); }
.lb-btn[hidden] { display: none; }
.lb-count { position: absolute; left: 0; right: 0; bottom: .9rem; margin: 0; text-align: center; color: var(--dim); pointer-events: none; }

/* ----- 404 ----- */
.lost { padding-top: 4rem; }
.lost .err { color: var(--red); }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .perm, .st-opt, .st-file { display: none; }
  .size { min-width: 0; text-align: left; }
  .row-head { flex-wrap: wrap; gap: .5rem; }
  .row-toggle { flex-basis: 100%; }
  .row-head .btn.dl, .row-head .soon { margin-left: 1.55rem; }
  .row-body { margin-left: .3rem; padding-left: .8rem; }
  .yl { flex-direction: column; gap: 0; padding: .3rem 0; }
  .top nav { gap: .8rem; }
  .top nav a::before { content: none; }
  .lightbox { padding: 4rem .6rem 6.2rem; }
  .lb-prev, .lb-next { top: auto; bottom: 2.6rem; transform: none; }
  .lb-prev { left: calc(50% - 3.4rem); }
  .lb-next { right: calc(50% - 3.4rem); }
  .lb-count { bottom: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
