/* ═══════════════════════════════════════════════════════════════════
   PHOSPHOR TERMINAL — geek aesthetic layered on Hux/Bootstrap
   Fonts: VT323 (hero display) · Share Tech Mono (UI) · Fira Code (body)
═══════════════════════════════════════════════════════════════════ */

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

/* ── Design tokens ───────────────────────────────────────────────── */
:root {
  --bg:             #06090a;
  --bg-surface:     #0b1014;
  --bg-card:        #0e1519;
  --phosphor:       #00e676;
  --phosphor-glow:  rgba(0, 230, 118, 0.55);
  --phosphor-soft:  #00b85a;
  --text:           #a8d8b8;
  --text-dim:       #6fa77e;
  --text-muted:     #5c8f6f;
  --border:         #162820;
  --border-active:  #00e676;
  --amber:          #ffb300;
}

/* ── Scanlines (subtle CRT effect) ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  pointer-events: none;
  z-index: 10000;
}

/* Subtle screen flicker */
@keyframes crt-flicker {
  0%, 97%, 100% { opacity: 1; }
  98%           { opacity: 0.96; }
  99%           { opacity: 1; }
}

body { animation: crt-flicker 12s infinite; }

/* ── Base ───────────────────────────────────────────────────────── */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.75;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text);
}

a {
  color: var(--phosphor-soft);
  transition: color 0.15s, text-shadow 0.15s;
}
a:hover, a:focus {
  color: var(--phosphor);
  text-decoration: none;
  text-shadow: 0 0 10px var(--phosphor-glow);
}

hr { border-color: var(--border) !important; }

::selection {
  background: rgba(0, 230, 118, 0.18);
  color: var(--phosphor);
}

/* ── Cursor blink ────────────────────────────────────────────────── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.cursor::after {
  content: '█';
  color: var(--phosphor);
  animation: blink 1.1s step-end infinite;
  font-size: 0.75em;
  margin-left: 3px;
  vertical-align: middle;
}

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar-custom {
  background-color: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.navbar-custom .navbar-brand {
  font-family: 'VT323', monospace;
  font-size: 26px !important;
  color: var(--phosphor) !important;
  letter-spacing: 3px;
  text-shadow: 0 0 14px var(--phosphor-glow);
}

/* Blinking cursor after brand name */
.navbar-custom .navbar-brand::after {
  content: '█';
  animation: blink 1.1s step-end infinite;
  margin-left: 3px;
  font-size: 0.7em;
}

.navbar-custom .nav > li > a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--text-dim) !important;
  letter-spacing: 1px;
  transition: color 0.15s;
  padding-left: 0;
}

/* ./ prefix on every nav link */
.navbar-custom .nav > li > a::before {
  content: './';
  color: var(--text-muted);
  transition: color 0.15s;
}

.navbar-custom .nav > li > a:hover::before,
.navbar-custom .nav > li > a:focus::before {
  color: var(--phosphor);
}

.navbar-custom .nav > li > a:hover,
.navbar-custom .nav > li > a:focus {
  color: var(--phosphor) !important;
  background-color: transparent !important;
  text-shadow: 0 0 8px var(--phosphor-glow);
}

@media (max-width: 767px) {
  .navbar-custom .navbar-collapse {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.45);
  }

  .navbar-custom .nav > li > a {
    color: var(--text) !important;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
  }

  .navbar-custom .nav > li:last-child > a {
    border-bottom: 0;
  }
}

/* ── Hero / intro-header ─────────────────────────────────────────── */
.intro-header {
  background: var(--bg-surface) !important;
  background-image: none !important;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Dot-grid terminal background */
.intro-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,230,118,0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Ambient phosphor glow from bottom */
.intro-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--phosphor), transparent);
  box-shadow: 0 0 40px 10px rgba(0, 230, 118, 0.12);
}

/* Site heading (home hero) */
.intro-header .site-heading h1 {
  font-family: 'VT323', monospace;
  font-size: clamp(52px, 8vw, 88px);
  color: var(--phosphor) !important;
  text-shadow:
    0 0 20px var(--phosphor-glow),
    0 0 50px rgba(0, 230, 118, 0.2);
  letter-spacing: 5px;
  text-transform: uppercase;
  line-height: 1;
}

.intro-header .site-heading h1::before {
  content: '> ';
  color: var(--text-dim);
  font-size: 0.55em;
  letter-spacing: 2px;
  vertical-align: middle;
}

.intro-header .site-heading .subheading {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-dim) !important;
  font-size: 13px;
  letter-spacing: 3px;
  text-shadow: none;
}

/* Post hero heading */
.intro-header .post-heading h1 {
  font-family: 'VT323', monospace;
  font-size: clamp(38px, 6vw, 60px);
  color: var(--phosphor) !important;
  text-shadow: 0 0 16px var(--phosphor-glow);
  letter-spacing: 2px;
  line-height: 1.1;
}

.intro-header .post-heading .subheading {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  color: var(--text-dim) !important;
  text-shadow: none;
  font-weight: 300;
}

.intro-header .post-heading .meta,
.intro-header .post-heading .meta a {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted) !important;
  letter-spacing: 1px;
}

.intro-header .post-heading .meta::before {
  content: '$ ';
  color: var(--text-muted);
}

/* Tags in post hero */
.intro-header .tags a {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--phosphor-soft) !important;
  background: rgba(0, 230, 118, 0.06);
  border: 1px solid var(--border);
  padding: 1px 8px;
  border-radius: 0;
  letter-spacing: 1px;
}

/* Page heading */
.intro-header .page-heading h1 {
  font-family: 'VT323', monospace;
  font-size: clamp(44px, 6vw, 64px);
  color: var(--phosphor) !important;
  text-shadow: 0 0 16px var(--phosphor-glow);
  letter-spacing: 3px;
}

.intro-header .page-heading .subheading {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-dim) !important;
  font-size: 13px;
  letter-spacing: 2px;
  text-shadow: none;
}

/* ── Post list ───────────────────────────────────────────────────── */
.post-preview {
  padding: 24px 0;
  border-bottom: 1px solid var(--border) !important;
  background: transparent;
  position: relative;
}

.post-preview > a > .post-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 19px;
  color: var(--phosphor) !important;
  letter-spacing: 0.5px;
  transition: text-shadow 0.2s;
}

.post-preview > a:hover > .post-title {
  text-shadow: 0 0 14px var(--phosphor-glow);
  color: var(--phosphor) !important;
  text-decoration: none;
}

.post-preview > a > .post-subtitle {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  color: var(--text-dim) !important;
  font-weight: 300;
}

.post-preview .post-content-preview {
  font-family: 'Fira Code', monospace;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
}

.post-meta {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted) !important;
  letter-spacing: 0.5px;
}

.post-meta a,
.post-meta a:hover {
  color: var(--text-muted) !important;
}

/* Restore post-meta sizing after the .post-container p rule increases specificity */
.post-container .post-meta {
  font-size: 11px;
  line-height: 1.5;
}

/* ── Post content ────────────────────────────────────────────────── */
.post-container {
  color: var(--text);
}

.post-container p,
.post-container li {
  font-family: 'Fira Code', monospace;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
}

.post-container ul,
.post-container ol {
  padding-left: 22px;
}

.post-container h2,
.post-container h3,
.post-container h4 {
  font-family: 'Share Tech Mono', monospace;
  color: var(--phosphor-soft);
}

.post-container h2 { font-size: 20px; margin-top: 36px; margin-bottom: 12px; }
.post-container h3 { font-size: 16px; margin-top: 28px; margin-bottom: 10px; }
.post-container h4 { font-size: 14px; margin-top: 20px; margin-bottom: 8px; }

.post-container .anchorjs-link {
  color: var(--text-muted);
}

blockquote {
  border-left: 3px solid var(--phosphor);
  background: var(--bg-card);
  color: var(--text-dim);
  padding: 14px 20px;
  margin: 20px 0;
  font-style: normal;
  font-size: 13px;
  line-height: 1.75;
}

blockquote p:last-child { margin-bottom: 0; }

/* ── Post diagrams ───────────────────────────────────────────────── */
.post-diagram {
  margin: 30px 0 34px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(0, 230, 118, 0.035), transparent 45%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--phosphor-soft);
  box-shadow: inset 0 0 0 1px rgba(0, 230, 118, 0.02);
}

.post-diagram figcaption {
  margin: 0 0 16px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.diagram-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.diagram-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}

.diagram-panel-warn {
  border-color: rgba(255, 179, 0, 0.35);
}

.diagram-title {
  margin-bottom: 10px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  color: var(--phosphor);
  letter-spacing: 1px;
}

.diagram-title::before {
  content: '$ ';
  color: var(--text-muted);
}

.post-container .post-diagram ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-container .post-diagram li {
  position: relative;
  padding-left: 15px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-dim);
}

.post-container .post-diagram li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.diagram-arrow {
  align-self: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 18px;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 179, 0, 0.25);
}

.tail-bar {
  display: grid;
  grid-template-columns: 4fr 1fr;
  min-height: 86px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.tail-main,
.tail-edge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
}

.tail-main {
  background: rgba(0, 230, 118, 0.07);
}

.tail-edge {
  border-left: 1px solid rgba(255, 179, 0, 0.45);
  background: rgba(255, 179, 0, 0.08);
}

.tail-main span,
.tail-edge span {
  font-family: 'VT323', monospace;
  font-size: 34px;
  line-height: 1;
  color: var(--phosphor);
}

.tail-edge span {
  color: var(--amber);
}

.tail-main small,
.tail-edge small {
  margin-top: 6px;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim);
}

.tail-stack {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.tail-stack span {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--border);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-muted);
  text-align: center;
  background: rgba(0, 0, 0, 0.16);
}

@media (max-width: 640px) {
  .post-diagram {
    margin: 24px 0 28px;
    padding: 14px;
  }

  .diagram-split {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .diagram-arrow {
    justify-self: center;
  }

  .tail-bar {
    grid-template-columns: 1fr;
  }

  .tail-edge {
    border-top: 1px solid rgba(255, 179, 0, 0.45);
    border-left: 0;
  }

  .tail-stack {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Code ────────────────────────────────────────────────────────── */
code {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  background: var(--bg-card);
  color: var(--phosphor-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 0;
}

pre {
  font-family: 'Fira Code', monospace;
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-left: 3px solid var(--phosphor) !important;
  border-radius: 0 !important;
  padding: 18px !important;
  color: var(--text) !important;
}

pre code {
  background: transparent !important;
  border: none !important;
  color: var(--text) !important;
  padding: 0 !important;
  font-size: 13px;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar-container h5 {
  font-family: 'Share Tech Mono', monospace !important;
  font-size: 10px !important;
  color: var(--text-muted) !important;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.sidebar-container h5 a {
  color: var(--text-muted) !important;
}

.sidebar-container h5 a:hover {
  color: var(--phosphor) !important;
}

.sidebar-container .short-about p {
  font-size: 12px;
  color: var(--text-dim);
}

/* Sidebar body text — smaller than page body to sit under the 10px headers */
.sidebar-container p,
.sidebar-container .list-inline,
.sidebar-container .list-inline li,
.sidebar-container .list-inline li a {
  font-size: 12px;
  color: var(--text-dim);
}

.sidebar-container .list-inline li a {
  color: var(--text-dim) !important;
}

.sidebar-container .list-inline li a:hover {
  color: var(--phosphor) !important;
}

.sidebar-container .short-about img {
  border: 1px solid var(--border);
  filter: grayscale(100%) brightness(0.6) sepia(20%);
}

/* ── Tag chips ────────────────────────────────────────────────────── */
.tags a {
  display: inline-block;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--phosphor-soft) !important;
  background: transparent;
  border: 1px solid var(--border);
  padding: 2px 10px;
  margin: 3px 2px;
  border-radius: 0;
  letter-spacing: 1px;
  text-decoration: none !important;
  transition: all 0.15s;
}

.tags a:hover {
  border-color: var(--phosphor);
  color: var(--phosphor) !important;
  background: rgba(0, 230, 118, 0.06);
  text-shadow: 0 0 8px var(--phosphor-glow);
}

/* ── Tags listing page ────────────────────────────────────────────── */
.listing-seperator {
  font-family: 'Share Tech Mono', monospace !important;
  color: var(--phosphor) !important;
  font-size: 14px;
  letter-spacing: 2px;
}

.listing-seperator .tag-text {
  color: var(--phosphor);
}

/* ── Pager / pagination ───────────────────────────────────────────── */
.pager li > a,
.pager li > span {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  background: var(--bg-card);
  border: 1px solid var(--border) !important;
  color: var(--phosphor-soft) !important;
  border-radius: 0 !important;
  padding: 8px 22px;
  letter-spacing: 1px;
  transition: all 0.15s;
}

.pager li > a:hover {
  background: rgba(0, 230, 118, 0.06);
  border-color: var(--phosphor) !important;
  color: var(--phosphor) !important;
}

/* ── Footer ───────────────────────────────────────────────────────── */
footer {
  background: var(--bg-surface) !important;
  border-top: 1px solid var(--border) !important;
}

footer p,
footer .copyright {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted) !important;
  letter-spacing: 0.5px;
}

footer a {
  color: var(--text-muted) !important;
}

footer a:hover {
  color: var(--phosphor) !important;
  text-shadow: 0 0 8px var(--phosphor-glow);
}

/* ── SNS icons in sidebar ─────────────────────────────────────────── */
.sidebar-container .fa-stack .fa-circle {
  color: var(--bg-card);
}

.sidebar-container .fa-stack:hover .fa-circle {
  color: var(--border-active);
}

.sidebar-container .fa-stack .fa-inverse {
  color: var(--phosphor-soft);
}

/* ── Syntax highlighting overrides ───────────────────────────────── */
.highlight { background: var(--bg-card) !important; }

/* ── Posts page ───────────────────────────────────────────────────── */
.post-type-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.post-header h1 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 28px;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 1px;
}

.post-header .post-meta-line {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.post-header .post-meta-line span {
  color: var(--text-dim);
  margin-right: 4px;
}

/* All-posts list rows */
.posts-page .year-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.posts-page .post-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.posts-page .post-item-date {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.posts-page .post-item-title {
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: var(--phosphor-soft);
  transition: color 0.15s, text-shadow 0.15s;
}

.posts-page .post-item-title:hover {
  color: var(--phosphor);
  text-shadow: 0 0 10px var(--phosphor-glow);
  text-decoration: none;
}

/* ── Scrollbar (webkit) ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--phosphor-soft); }
