/* rtembedded.dev — modern dark terminal theme */

:root {
  --bg: #0e1116;
  --bg-panel: #151a21;
  --bg-elevated: #1a2029;
  --border: #262d38;
  --border-soft: #1f2630;
  --fg: #d7dee8;
  --fg-muted: #8b96a5;
  --fg-faint: #5c6675;
  --accent: #4ade80;
  --accent-soft: #2dd4bf;
  --link: #60a5fa;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 10px;
  --mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, "DejaVu Sans Mono", monospace;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
}

.crt { display: none; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 22px 64px;
}

/* ===== header ===== */
.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 16px;
  margin-bottom: 28px;
}
.topbar-title { white-space: nowrap; font-size: 0.95em; }
.accent { color: var(--accent); }
.path { color: var(--accent-soft); }
.dim { color: var(--fg-muted); }

.nav { display: flex; gap: 10px; }
.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.nav-link:hover {
  color: var(--fg);
  border-color: var(--fg-faint);
  background: var(--bg-elevated);
}
.nav-link.active {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.08);
}

/* ===== banner ===== */
.banner {
  color: var(--accent);
  font-size: clamp(4px, 1.28vw, 12px);
  line-height: 1.15;
  margin: 12px 0 0;
  overflow-x: auto;
  opacity: 0.95;
}
.tagline {
  margin-top: 6px;
  letter-spacing: 1px;
  font-size: 0.92em;
}

/* ===== terminal window ===== */
.term-window {
  margin-top: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.term-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; }
.term-dot.red { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green { background: #28c840; }
.term-titlebar-label {
  margin-left: 8px;
  color: var(--fg-faint);
  font-size: 0.85em;
}

.terminal, .term-static {
  padding: 20px 22px;
  min-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.term-line { margin: 2px 0; white-space: pre-wrap; }
.prompt { color: var(--accent); font-weight: 600; }
.prompt-host { color: var(--accent-soft); }
.term-out { color: var(--fg); }
.term-out a { color: var(--link); }
.error { color: var(--red); }

.cursor {
  display: inline-block;
  animation: blink 1s steps(1) infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

/* ===== blog list ===== */
.post-list { list-style: none; padding: 0; margin: 20px 0; }
.post-item {
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  transition: border-color .15s ease, transform .15s ease;
}
.post-item:hover { border-color: var(--fg-faint); }
.post-date { color: var(--fg-muted); margin-right: 12px; font-size: 0.9em; }
.post-link {
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}
.post-link:hover { color: var(--accent); }
.post-desc {
  margin-top: 6px;
  font-size: 0.92em;
}
.tags { margin-left: 10px; }
.tag {
  color: var(--accent-soft);
  margin-right: 8px;
  font-size: 0.82em;
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 999px;
  padding: 1px 9px;
}

/* ===== post ===== */
.post-title {
  color: var(--fg);
  font-family: var(--sans);
  font-size: 2em;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 20px 0 8px;
}
.post-meta { margin-bottom: 26px; font-size: 0.9em; }
.post-meta .tag { margin-left: 8px; }

.post-body {
  font-family: var(--sans);
  font-size: 1.04em;
  color: #c9d2dd;
}
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  color: var(--fg);
  font-weight: 650;
  letter-spacing: -0.3px;
  margin-top: 1.8em;
}
.post-body h2 { border-bottom: 1px solid var(--border-soft); padding-bottom: 6px; }
.post-body a { color: var(--link); text-decoration: none; }
.post-body a:hover { text-decoration: underline; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2em 0;
  padding: 6px 18px;
  color: var(--fg-muted);
  background: var(--bg-panel);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-body code {
  font-family: var(--mono);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--accent-soft);
  font-size: 0.88em;
}
.post-body pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.55;
}
.post-body pre code {
  display: block;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 1em;
}
.post-body table { border-collapse: collapse; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 6px 14px; }
.post-body img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.post-body hr { border: none; border-top: 1px solid var(--border-soft); }

/* ===== YouTube embed ===== */
.yt-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.2em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.yt-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== footer ===== */
.footer {
  margin-top: 56px;
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
  color: var(--fg-faint);
  font-size: 0.9em;
}

::selection { background: var(--accent); color: var(--bg); }

@media (max-width: 640px) {
  html, body { font-size: 13.5px; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
