*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --fg: #aaaaaa;
  --bright: #ffffff;
  --cyan: #55ffff;
  --blue-bg: #0000aa;
  --highlight-bg: #55ffff;
  --highlight-fg: #000000;
  --border: #55ffff;
  --dim: #555555;
  --yellow: #ffff55;
  --green: #55ff55;
  --red: #ff5555;
  --font: "Courier New", Courier, monospace;
}

html, body {
  height: 100%;
  width: 100%;
  background: #111111;
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
  cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8'><rect width='8' height='8' fill='%2355ff55'/></svg>") 4 4, auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#screen {
  width: 100%;
  height: 100%;
  max-width: 1024px;
  max-height: 768px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
}

/* ── Header bar ────────────────────────────────────── */
#header {
  display: flex;
  justify-content: space-between;
  background: var(--blue-bg);
  color: var(--bright);
  padding: 2px 8px;
  margin-bottom: 4px;
  font-weight: bold;
  flex-shrink: 0;
}

#header .left  { color: var(--cyan); }
#header .right { color: var(--yellow); }

/* ── System info panel ─────────────────────────────── */
#sysinfo {
  border: 1px solid var(--border);
  padding: 6px 12px;
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 32px;
  flex-shrink: 0;
}

#sysinfo .label { color: var(--cyan); }
#sysinfo .value { color: var(--bright); }
#sysinfo .row   { display: contents; }

/* ── Main layout ───────────────────────────────────── */
#main {
  display: flex;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

/* ── Menu panel ────────────────────────────────────── */
#menu-panel {
  width: 28%;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

#menu-title {
  background: var(--blue-bg);
  color: var(--bright);
  text-align: center;
  padding: 3px;
  font-weight: bold;
  border-bottom: 1px solid var(--border);
  letter-spacing: 2px;
}

#menu-list {
  list-style: none;
  padding: 4px 0;
  flex: 1;
  overflow: auto;
}

#menu-list li {
  padding: 4px 12px;
  color: var(--fg);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

#menu-list li .arrow {
  color: var(--dim);
  width: 12px;
  display: inline-block;
}

#menu-list li.active {
  background: var(--highlight-bg);
  color: var(--highlight-fg);
}

#menu-list li.active .arrow {
  color: var(--highlight-fg);
}

/* ── Content panel ─────────────────────────────────── */
#content-panel {
  flex: 1;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#content-title {
  background: var(--blue-bg);
  color: var(--bright);
  text-align: center;
  padding: 3px;
  font-weight: bold;
  border-bottom: 1px solid var(--border);
  letter-spacing: 2px;
}

#content-body {
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
  line-height: 1.6;
}

/* ── Content sections ──────────────────────────────── */
.section { display: none; }
.section.visible { display: block; }

.section h2 {
  color: var(--cyan);
  border-bottom: 1px solid var(--dim);
  padding-bottom: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 1em;
}

.section h3 {
  color: var(--yellow);
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 1em;
}

.section p {
  color: var(--fg);
  margin-bottom: 8px;
}

.section ul {
  list-style: none;
  margin-bottom: 12px;
}

.section ul li::before {
  content: "» ";
  color: var(--cyan);
}

.section ul li {
  color: var(--fg);
  margin-bottom: 3px;
}

.tag {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--cyan);
  border: 1px solid var(--cyan);
  padding: 0px 6px;
  margin: 2px;
  font-size: 0.85em;
}

.entry {
  border-left: 2px solid var(--dim);
  padding-left: 10px;
  margin-bottom: 16px;
}

.entry .meta {
  color: var(--green);
  font-size: 0.9em;
  margin-bottom: 4px;
}

.contact-line {
  display: flex;
  gap: 16px;
  align-items: baseline;
  margin-bottom: 8px;
}

.contact-line .key  { color: var(--cyan); width: 100px; flex-shrink: 0; }
.contact-line .val  { color: var(--bright); }
.contact-line .val a { color: var(--bright); text-decoration: none; }
.contact-line .val a:hover { color: var(--yellow); }

/* ── Status / footer bar ───────────────────────────── */
#statusbar {
  display: flex;
  justify-content: space-between;
  background: var(--blue-bg);
  color: var(--bright);
  padding: 2px 8px;
  margin-top: 4px;
  flex-shrink: 0;
  font-size: 0.9em;
  flex-wrap: wrap;
  gap: 4px;
}

#statusbar .hint { color: var(--cyan); }
#statusbar .hint span { color: var(--yellow); }

/* ── Blinking cursor ───────────────────────────────── */
@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--bright);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* ── POST animation ────────────────────────────────── */
#post-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: 1024px;
  max-height: 768px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  padding: 20px 24px 20px calc(36px + 7ch);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

#post-overlay.hidden { display: none; }

#post-ribbon {
  position: absolute;
  top: 20px;
  left: 24px;
  color: var(--cyan);
  line-height: 1.4;
  user-select: none;
}

#post-logo {
  position: absolute;
  top: 20px;
  right: 24px;
  color: var(--cyan);
  line-height: 1.4;
  user-select: none;
}

#post-overlay .post-line { opacity: 0; }
#post-overlay .post-line.show { opacity: 1; }

#post-setup-prompt {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--bright);
  animation: blink 1s step-end infinite;
}

.post-line a { color: inherit; text-decoration: underline; }

.ok   { color: var(--green); }
.warn { color: var(--yellow); }
.err  { color: var(--red); }
.hi   { color: var(--cyan); }
.bold { font-weight: bold; }

/* ── Scrollbar styling ─────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dim); }
::-webkit-scrollbar-thumb:hover { background: var(--fg); }

/* ── Mobile layout ─────────────────────────────────── */
@media (max-width: 640px) {
  #post-overlay {
    padding: 20px 16px;
  }

  #post-ribbon {
    display: none;
  }

  #post-logo {
    color: #444444;
  }
}
