:root {
  --bg:      #0d1117;
  --bg-2:    #161b22;
  --fg:      #c9d1d9;
  --dim:     #6e7681;
  --accent:  #39c5cf;
  --ok:      #3fb950;
  --warn:    #d29922;
  --bad:     #f85149;
  --rule:    #21262d;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas,
          "DejaVu Sans Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

html.booting body { overflow: hidden; }

.wrap { max-width: 82ch; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.rule {
  height: 1px;
  background: repeating-linear-gradient(
    to right, var(--rule) 0 6px, transparent 6px 9px);
  margin: 32px 0;
  overflow: hidden;
}

header { padding: 56px 0 8px; }
.greet { color: var(--dim); }
.greet .host { color: var(--fg); }

h1 {
  font-size: 15px;
  font-weight: 400;
  margin: 6px 0 0;
  letter-spacing: .02em;
}
h1 .name { color: var(--accent); font-weight: 700; }
.tag { color: var(--dim); margin-top: 10px; }

h2 {
  font-size: 15px;
  font-weight: 400;
  color: var(--accent);
  margin: 40px 0 14px;
}
h2::before { content: "── "; color: var(--rule); }

p { margin: 12px 0; }
.dim { color: var(--dim); }
code {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 13px;
  color: var(--fg);
}

.terminal {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  margin: 16px 0;
  overflow: hidden;
}
.terminal-bar {
  padding: 7px 12px;
  border-bottom: 1px solid var(--rule);
  color: var(--dim);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.terminal-body { padding: 14px 16px; overflow-x: auto; }
.terminal-body pre {
  margin: 0;
  white-space: pre;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.7;
}

.prompt { color: var(--ok); }
.cmd    { color: var(--fg); }
.flag   { color: var(--accent); }
.ok     { color: var(--ok); }
.g-empty { color: var(--rule); }

.copy {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--dim);
  font-family: inherit;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s, border-color .12s;
}
.copy:hover { color: var(--accent); border-color: var(--accent); }
.copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.copy.done { color: var(--ok); border-color: var(--ok); }

.row { display: flex; gap: 14px; padding: 1px 0; }
.row .label { color: var(--dim); min-width: 10ch; flex-shrink: 0; }
.row .val { color: var(--fg); }

.tier { margin: 14px 0; }
.tier .cmd-name { color: var(--accent); }
.tier .what { color: var(--dim); }

.note { padding: 3px 0; }
.note .dot { color: var(--ok); }
.note.warn .dot { color: var(--warn); }

ul { padding-left: 0; list-style: none; margin: 12px 0; }
li { padding: 3px 0; }
li::before { content: "  ● "; color: var(--dim); }

footer { padding: 8px 0 64px; color: var(--dim); font-size: 13px; }

@media (max-width: 640px) {
  body { font-size: 14px; }
  .row { flex-direction: column; gap: 0; }
  .row .label { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .copy { transition: none; }
}

.frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg-2);
  flex-shrink: 0;
  font-size: 12px;
}

.tb-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.tb-dot.r { background: #f85149; }
.tb-dot.y { background: #d29922; }
.tb-dot.g { background: #3fb950; }

.tb-title { color: var(--dim); margin-left: 6px; }
.tb-right { color: var(--dim); margin-left: auto; }

.viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  min-height: 0;
}

.viewport .wrap { padding: 8px 24px 40px; }

.statusbar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 4px;
  border-top: 1px solid var(--rule);
  background: var(--bg-2);
  flex-shrink: 0;
  font-size: 12px;
  overflow-x: auto;
  white-space: nowrap;
}

.sb-item {
  padding: 5px 10px;
  color: var(--dim);
  flex-shrink: 0;
}

.sb-key {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  background: var(--rule);
  color: var(--fg);
  border-radius: 3px;
  padding: 0 4px;
  margin-right: 5px;
  font-size: 11px;
}

.sb-item:first-child { color: var(--accent); }
.sb-item:first-child .sb-key { background: var(--accent); color: var(--bg); }
.sb-spacer { flex: 1; }
.sb-dim { color: var(--dim); opacity: .7; }

.sb-live { color: var(--ok); }
.sb-live .pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

h2 { scroll-margin-top: 12px; }

.copy, .sb-item[href] { cursor: pointer; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  padding: 20px 24px;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.6;
}

.boot.fade { opacity: 0; transition: opacity .34s ease; }
.boot.gone { display: none; }

.bootlog { margin: 0; white-space: pre-wrap; word-break: break-word; }

.bl { opacity: 0; transform: translateY(2px); }
.bl.on { opacity: 1; transform: none; transition: opacity .1s linear, transform .1s linear; }
.bl.hd .bm { color: var(--accent); font-weight: 700; }
.bl.end .bd { color: var(--ok); }

.bt  { color: var(--dim); }
.bok { color: var(--ok); }
.bm  { color: var(--fg); }

.cursor {
  color: var(--ok);
  animation: blink 1.05s step-end infinite;
}

@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

@media (max-width: 640px) {
  .frame { margin: 6px; }
  .viewport .wrap { padding: 6px 14px 32px; }
  .tb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-item { padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .viewport { scroll-behavior: auto; }
  .sb-live .pulse, .cursor { animation: none; }
  .bl.on { transition: none; }
}
