/* ============================================================
   CYCLOTRONIC THEME — Terminal Phosphor Aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap');

:root {
  --bg:         #0a0c0a;
  --bg-panel:   #0d110d;
  --phosphor:   #39ff14;
  --phosphor-dim: #1a7a08;
  --phosphor-faint: #0d3d04;
  --amber:      #ffb800;
  --red:        #ff2d2d;
  --cyan:       #00ffe1;
  --white:      #c8d8c8;
  --muted:      #4a6b4a;
  --border:     #1e3a1e;
  --scanline:   rgba(0,0,0,0.18);

  --font-mono:  'Share Tech Mono', 'Courier New', monospace;
  --font-crt:   'VT323', monospace;

  --glow:       0 0 8px var(--phosphor), 0 0 20px rgba(57,255,20,0.3);
  --glow-soft:  0 0 6px rgba(57,255,20,0.4);
}

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

html {
  background: var(--bg);
  color: var(--phosphor);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* ── CRT overlay ────────────────────────────────────────── */
body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    var(--scanline) 0px,
    var(--scanline) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.35;
}

body::after {
  content: '';
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.7) 100%);
}

/* ── Layout ─────────────────────────────────────────────── */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Boot Sequence ──────────────────────────────────────── */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: var(--font-crt);
  font-size: 1.4rem;
  color: var(--phosphor);
  animation: boot-fade 0.5s ease 2.8s forwards;
}

@keyframes boot-fade {
  to { opacity: 0; pointer-events: none; }
}

.boot-line {
  opacity: 0;
  animation: appear 0.1s ease forwards;
  white-space: pre;
  text-shadow: var(--glow-soft);
}

.boot-line:nth-child(1)  { animation-delay: 0.1s; }
.boot-line:nth-child(2)  { animation-delay: 0.3s; }
.boot-line:nth-child(3)  { animation-delay: 0.6s; }
.boot-line:nth-child(4)  { animation-delay: 0.9s; }
.boot-line:nth-child(5)  { animation-delay: 1.1s; }
.boot-line:nth-child(6)  { animation-delay: 1.3s; }
.boot-line:nth-child(7)  { animation-delay: 1.6s; }
.boot-line:nth-child(8)  { animation-delay: 1.9s; color: var(--amber); }

@keyframes appear {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.2rem;
  position: relative;
}

.site-header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--phosphor-dim), transparent);
  margin-top: 1.2rem;
  opacity: 0.6;
}

.site-title {
  font-family: var(--font-crt);
  font-size: 3.5rem;
  letter-spacing: 0.12em;
  color: var(--phosphor);
  text-shadow: var(--glow);
  text-decoration: none;
  display: block;
  line-height: 1;
}

.site-title:hover { color: var(--phosphor); text-shadow: var(--glow), 0 0 40px rgba(57,255,20,0.5); }

.site-subtitle {
  font-size: 0.8rem;
  color: var(--phosphor-dim);
  letter-spacing: 0.25em;
  margin-top: 0.25rem;
}

.site-nav {
  margin-top: 1rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  transition: color 0.15s, text-shadow 0.15s;
  position: relative;
}

.site-nav a::before { content: '> '; color: var(--phosphor-faint); }

.site-nav a:hover,
.site-nav a.active {
  color: var(--phosphor);
  text-shadow: var(--glow-soft);
}

/* ── Status bar ─────────────────────────────────────────── */
.status-bar {
  font-size: 0.72rem;
  color: var(--phosphor-dim);
  letter-spacing: 0.1em;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--phosphor-faint);
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.status-bar span::before { content: '['; }
.status-bar span::after  { content: ']'; }

/* ── Post list ──────────────────────────────────────────── */
.post-list {
  list-style: none;
  margin: 2.5rem 0;
}

.post-entry {
  border-bottom: 1px solid var(--phosphor-faint);
  padding: 1.5rem 0;
  position: relative;
}

.post-entry::before {
  content: '// ';
  color: var(--phosphor-faint);
  font-size: 0.9rem;
}

.post-meta {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.post-meta .date { color: var(--amber); }
.post-meta .tags { margin-left: 1rem; }
.post-meta .tag {
  color: var(--cyan);
  margin-right: 0.5rem;
}
.post-meta .tag::before { content: '#'; }

.post-title {
  font-family: var(--font-crt);
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0.2rem 0 0.6rem;
}

.post-title a {
  color: var(--phosphor);
  text-decoration: none;
  transition: text-shadow 0.15s, color 0.15s;
}

.post-title a:hover {
  color: #fff;
  text-shadow: var(--glow);
}

.post-summary {
  color: var(--white);
  font-size: 0.88rem;
  max-width: 60ch;
}

.read-more {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--phosphor-dim);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transition: color 0.15s;
}

.read-more:hover { color: var(--phosphor); text-shadow: var(--glow-soft); }
.read-more::after { content: ' >>>'; }

/* ── Single post ────────────────────────────────────────── */
.post-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.post-header h1 {
  font-family: var(--font-crt);
  font-size: 2.6rem;
  color: var(--phosphor);
  text-shadow: var(--glow-soft);
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.post-content {
  color: var(--white);
  font-size: 0.95rem;
  max-width: 70ch;
}

.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--font-crt);
  color: var(--phosphor);
  letter-spacing: 0.05em;
  margin: 2rem 0 0.75rem;
}

.post-content h2 { font-size: 1.8rem; }
.post-content h2::before { content: '## '; color: var(--phosphor-faint); }
.post-content h3 { font-size: 1.4rem; }
.post-content h3::before { content: '### '; color: var(--phosphor-faint); }

.post-content p { margin-bottom: 1.2rem; }

.post-content a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,255,225,0.3);
  transition: color 0.15s, border-color 0.15s;
}

.post-content a:hover {
  color: #fff;
  border-color: var(--cyan);
}

.post-content code {
  background: var(--bg-panel);
  color: var(--amber);
  padding: 0.1em 0.4em;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.87em;
}

.post-content pre {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--phosphor-dim);
  padding: 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

.post-content pre::before {
  content: '$ ';
  color: var(--phosphor-dim);
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--phosphor);
  font-size: 0.88rem;
}

.post-content blockquote {
  border-left: 3px solid var(--amber);
  padding: 0.5rem 1rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: normal;
}

.post-content blockquote::before {
  content: '> ';
  color: var(--amber);
}

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.post-content li { margin-bottom: 0.3rem; }

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

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 2rem 0;
  border-top: 1px solid var(--phosphor-faint);
  font-size: 0.82rem;
}

.pagination a {
  color: var(--phosphor-dim);
  text-decoration: none;
  letter-spacing: 0.1em;
}
.pagination a:hover { color: var(--phosphor); }
.pagination .prev::before { content: '<< '; }
.pagination .next::after  { content: ' >>'; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
  font-size: 0.72rem;
  color: var(--phosphor-faint);
  letter-spacing: 0.12em;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Cursor blink ───────────────────────────────────────── */
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--phosphor);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
  box-shadow: var(--glow-soft);
}

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

/* ── Tags page ──────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.tag-item {
  color: var(--cyan);
  text-decoration: none;
  border: 1px solid rgba(0,255,225,0.25);
  padding: 0.2rem 0.6rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  transition: all 0.15s;
}

.tag-item::before { content: '#'; }
.tag-item:hover {
  background: rgba(0,255,225,0.07);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0,255,225,0.2);
}

/* ── Section header ─────────────────────────────────────── */
.section-heading {
  font-family: var(--font-crt);
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 2rem 0 0.5rem;
}

.section-heading::before { content: '[ '; }
.section-heading::after  { content: ' ]'; }

/* ── 404 ────────────────────────────────────────────────── */
.error-page {
  text-align: center;
  padding: 5rem 0;
  font-family: var(--font-crt);
}

.error-page h1 {
  font-size: 6rem;
  color: var(--red);
  text-shadow: 0 0 20px rgba(255,45,45,0.5);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .site-title { font-size: 2.5rem; }
  .post-header h1 { font-size: 2rem; }
  .site-nav { gap: 1.2rem; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body::before { display: none; }
  #boot-screen { display: none; }
  .cursor { animation: none; }
}
