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

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
}

body {
  color: var(--fg);
  font-family: 'Courier New', Courier, monospace;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Terminal container ─────────────────────────────────────────────────── */

#terminal {
  min-height: 100vh;
  padding: 24px 28px;
  cursor: text;
}

#output {
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Input line ─────────────────────────────────────────────────────────── */

#input-line {
  display: flex;
  align-items: center;
  margin-top: 4px;
  white-space: pre;
}

.prompt {
  color: var(--prompt);
  user-select: none;
  flex-shrink: 0;
}

#typed-text {
  color: var(--fg);
}

#cursor {
  color: var(--cursor);
  animation: blink 1s step-end infinite;
  user-select: none;
}

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

#hidden-input {
  position: fixed;
  top: -100px;
  left: -100px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ── Output block types ─────────────────────────────────────────────────── */

.output-block {
  margin-bottom: 1px;
}

/* Colour utility classes (used in innerHTML) */
.o-prompt  { color: var(--prompt); }
.o-cmd     { color: var(--fg); }
.o-accent  { color: var(--accent); }
.o-dim     { color: var(--dim); }
.o-error   { color: var(--error); }

.o-link a {
  color: var(--link);
  text-decoration: none;
}
.o-link a:hover {
  text-decoration: underline;
}

/* ── Neofetch layout ────────────────────────────────────────────────────── */

.neofetch {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.neofetch-art {
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1.4;
}

.neofetch-info {
  flex: 1;
}

/* ── Blog post view ─────────────────────────────────────────────────────── */

.blog-post {
  max-width: 80ch;
}

.blog-post h1,
.blog-post h2,
.blog-post h3 {
  color: var(--accent);
  margin: 1em 0 0.4em;
}

.blog-post p {
  margin-bottom: 0.8em;
}

.blog-post pre,
.blog-post code {
  background: var(--code-bg, rgba(255,255,255,0.06));
  padding: 0.1em 0.3em;
  border-radius: 2px;
  font-family: inherit;
}

.blog-post pre {
  padding: 0.8em 1em;
  overflow-x: auto;
  margin-bottom: 0.8em;
}

.blog-post pre code {
  background: none;
  padding: 0;
}

.blog-post a {
  color: var(--link);
  text-decoration: none;
}
.blog-post a:hover {
  text-decoration: underline;
}

.blog-post blockquote {
  border-left: 3px solid var(--dim);
  padding-left: 1em;
  color: var(--dim);
  margin-bottom: 0.8em;
}

.blog-post ul,
.blog-post ol {
  padding-left: 2em;
  margin-bottom: 0.8em;
}

/* ── Blog list ──────────────────────────────────────────────────────────── */

.blog-list-item {
  display: flex;
  gap: 12px;
}

.blog-list-item .slug {
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Blog images — always responsive ────────────────────────────────────── */

.blog-post img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.8em 0;
}

/* ── Mobile ─────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  #terminal {
    padding: 12px 14px;
    font-size: 13px;
  }

  /* Prevent long unbroken URLs / slugs from overflowing */
  #output {
    overflow-wrap: break-word;
  }

  /* Scrollable code blocks instead of wrapping */
  .blog-post pre {
    white-space: pre;
    overflow-x: auto;
    font-size: 12px;
  }

  /* Blog post body — tighten up spacing */
  .blog-post {
    max-width: 100%;
  }

  .blog-post h1 { font-size: 1.2em; }
  .blog-post h2 { font-size: 1.1em; }

  .neofetch {
    flex-direction: column;
    gap: 8px;
  }

  .blog-list-item {
    flex-direction: column;
    gap: 2px;
  }
}
