:root {
  --bg:        #090b09;
  --fg:        #a9dfb4;
  --fg-bright: #eafff0;
  --fg-dim:    #5f8a6c;
  --fg-faint:  #3a4f3f;
  --hash:      #d99a5b;
  --link:      #f2c879;
  --border:    #1c2b20;
  --meta:      #5f8a6c;
}

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

html, body { height: 100%; }

body {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 17px;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.95;
  overflow: hidden;
}

/* ── Links ───────────────────────────────────────── */
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 200, 121, 0.27);
  transition: border-color 0.15s;
}
a:hover { border-bottom-color: var(--link); }
a:focus-visible {
  outline: 1px solid var(--link);
  outline-offset: 2px;
  border-radius: 1px;
}

/* ── Frame ───────────────────────────────────────── */
.frame {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ─────────────────────────────────────── */
.topbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}

.topbar-title {
  font-size: 15px;
  color: var(--fg-dim);
  letter-spacing: 1px;
}

.topbar nav { display: flex; gap: 34px; }

.navlink {
  color: var(--fg);
  font-size: 15px;
  border-bottom: 1px solid transparent !important;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
.navlink:hover {
  color: var(--fg-bright);
  border-bottom-color: var(--fg) !important;
}

/* ── Scroll pane ─────────────────────────────────── */
.pane {
  flex: 1;
  overflow-y: auto;
  padding: 8px 40px 60px;
  scroll-behavior: smooth;
  background-image: repeating-linear-gradient(
    rgba(255,255,255,0) 0px,
    rgba(255,255,255,0) 2px,
    rgba(0,0,0,0.15) 3px
  );
}

.pane::-webkit-scrollbar { width: 10px; }
.pane::-webkit-scrollbar-track { background: #0c0f0c; }
.pane::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }

/* ── Status bar ──────────────────────────────────── */
.statusbar {
  flex-shrink: 0;
  padding: 10px 40px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--fg-dim);
  border-top: 1px solid var(--border);
  letter-spacing: 0.5px;
  background: var(--bg);
}

.statusbar a {
  color: var(--fg-dim);
  border: none !important;
}
.statusbar a:hover { color: var(--fg); }

.status-end { color: var(--fg); }

/* ── Row ─────────────────────────────────────────── */
.row {
  display: flex;
  align-items: flex-start;
  padding: 2px 0;
}

.ln {
  color: var(--fg-faint);
  display: inline-block;
  width: 42px;
  text-align: right;
  margin-right: 24px;
  user-select: none;
  font-size: 14px;
  flex-shrink: 0;
}

.rc {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.row-sep {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

/* ── Section header ──────────────────────────────── */
.sec {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 38px;
  margin-bottom: 22px;
  scroll-margin-top: 20px;
}

.sec:first-child { margin-top: 20px; }

.sec-prefix {
  color: var(--hash);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.sec-tag {
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--fg-bright);
  font-weight: 600;
  flex-shrink: 0;
}

.rc-bright  { color: var(--fg-bright); }
.rc-banner  { color: var(--fg); letter-spacing: 0; white-space: pre; line-height: 1; }
.row:has(.rc-banner) { padding: 0; }

.sec-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Semantic token colours ──────────────────────── */
.kw   { color: var(--fg-bright); font-weight: 600; }
.hash { color: var(--hash); }
.meta { color: var(--meta); }
.dm   { color: var(--fg-faint); }

/* ── Indentation ─────────────────────────────────── */
.rc-indent { padding-left: 4ch; }

.rc-bq {
  padding-left: 2ch;
  border-left: 2px solid var(--hash);
  color: var(--fg-bright);
  font-style: italic;
}

/* ── Post page ───────────────────────────────────── */
.post-h { color: var(--fg-bright); font-weight: 600; }

/* Inline markdown rendered by marked */
.rc strong { color: var(--fg-bright); font-weight: 600; }
.rc em     { color: var(--meta); font-style: italic; }
.rc code   {
  color: var(--hash);
  background: rgba(255,255,255,0.05);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 0.9em;
}
.rc a { color: var(--link); }

/* ── Blinking cursor ─────────────────────────────── */
.cursor {
  display: inline-block;
  background: var(--fg);
  color: var(--bg);
  padding: 0 1px;
  animation: blink 1s steps(1) infinite;
  user-select: none;
}

@keyframes blink { 50% { opacity: 0; } }

/* ── Mobile ──────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 14px; }

  .topbar { padding: 0 16px; }
  .topbar nav { gap: 16px; }
  .topbar-title { display: none; }
  .navlink { font-size: 13px; }

  .pane { padding: 8px 16px 40px; }

  .ln {
    width: 28px;
    margin-right: 12px;
    font-size: 11px;
  }

  .statusbar {
    padding: 8px 16px;
    font-size: 11px;
  }
}
