@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap');

:root {
  --bg:           #0C0C14;
  --bg-secondary: #141420;
  --bg-highlight: #1E1E30;
  --border:       #2A2A40;
  --text:         #CCCCCC;
  --text-dim:     #555577;
  --green:        #33FF33;
  --amber:        #FFB000;
  --cyan:         #00CCCC;
  --magenta:      #DD00DD;
  --red:          #DD4444;
}

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

html {
  font-size: clamp(12px, 1.4vw, 16px);
  scroll-behavior: smooth;
}

body {
  font-family: 'IBM Plex Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  line-height: 1.6;
}

/* ── Scanline overlay ─────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.06) 0px,
    rgba(0, 0, 0, 0.06) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* ── Main screen container ────────────────────── */
.screen {
  max-width: 80ch;
  width: 100%;
  border-radius: 8px;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(12, 12, 20, 0.8);
  padding: 0 0 1rem;
  position: relative;
  background: var(--bg);
}

.screen-content {
  padding: 0 3ch;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow: hidden;
}

/* ── Box-drawing header bar ───────────────────── */
.screen-header {
  color: var(--cyan);
  margin-bottom: 1em;
  overflow: hidden;
}

.screen-header a {
  color: var(--cyan);
  text-decoration: none;
}

.screen-header a:hover {
  color: var(--cyan);
  text-shadow: 0 0 6px rgba(0, 204, 204, 0.4);
}

pre {
  font-family: inherit;
  line-height: 1.3;
  overflow-x: auto;
  margin: 0;
}

/* ── Section dividers ─────────────────────────── */
.divider,
.divider-bottom,
.section-underline {
  color: var(--text-dim);
  white-space: pre;
  overflow: hidden;
  max-width: 100%;
}

.divider {
  margin: 1.5rem 0 0.5rem;
}

.divider-bottom {
  margin: 0.5rem 0 0;
}

/* ── Welcome section ──────────────────────────── */
.welcome {
  margin-bottom: 1rem;
  text-align: center;
}

.welcome .tagline {
  color: var(--text);
  margin: 0.25rem 0;
}

/* ── Section styling ──────────────────────────── */
.section-title {
  color: var(--green);
  font-weight: 700;
  text-shadow: 0 0 3px rgba(51, 255, 51, 0.3);
}

.section {
  margin-bottom: 1.5rem;
}

/* ── Links ────────────────────────────────────── */
a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
}

a:hover {
  color: var(--green);
  text-shadow: 0 0 6px rgba(51, 255, 51, 0.4);
}

.arrow {
  color: var(--amber);
}

/* ── Post listing ─────────────────────────────── */
.post-item {
  margin: 0.4rem 0;
}

.post-date {
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Post navigation ──────────────────────────── */
.post-nav {
  margin-bottom: 0.5rem;
}

/* ── Post meta ────────────────────────────────── */
.post-meta {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.85rem;
}

/* ── Post body (rendered markdown) ────────────── */
.post-body {
  margin-top: 1rem;
}

.post-body p {
  margin: 0.75rem 0;
}

.post-body h2 {
  color: var(--green);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  text-shadow: 0 0 3px rgba(51, 255, 51, 0.3);
}

.post-body h3 {
  color: var(--cyan);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}

.post-body ul,
.post-body ol {
  margin: 0.5rem 0 0.5rem 2ch;
}

.post-body li {
  margin: 0.25rem 0;
}

.post-body code {
  color: var(--amber);
  background: var(--bg-secondary);
  padding: 0.1em 0.3em;
  border-radius: 2px;
  font-size: 0.95em;
}

.post-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 0.75rem 0;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.post-body blockquote {
  border-left: 2px solid var(--amber);
  padding-left: 1.5ch;
  color: var(--text-dim);
  margin: 0.75rem 0;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 0.75rem 0;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ── Status bar ───────────────────────────────── */
.status-bar {
  margin-top: 1.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.status-bar .label {
  color: var(--cyan);
}

.status-bar .sep {
  color: var(--border);
  margin: 0 0.5ch;
}

.footer-line {
  margin-top: 0.25rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ── Selection color ──────────────────────────── */
::selection {
  background: var(--green);
  color: var(--bg);
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 720px) {
  .screen {
    padding: 1rem 0;
  }
  .screen-content {
    padding: 0 2ch;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 12px;
  }
  .screen {
    border-radius: 0;
    box-shadow: none;
    padding: 0.5rem 0;
  }
  .screen-content {
    padding: 0 1ch;
  }
  .screen-header .header-full {
    display: none;
  }
  .screen-header .header-mini {
    display: block;
    text-align: center;
  }
}

@media (min-width: 481px) {
  .screen-header .header-mini {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
