/* ============================================
   ASCII TERMINAL THEME
   Retro terminal meets modern tech blog
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --bg-code: #0d1117;
  --bg-hover: #1a1a1a;
  --text: #c9d1d9;
  --text-muted: #6b7280;
  --text-bright: #e6edf3;
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-glow: rgba(0, 255, 65, 0.15);
  --amber: #ffb000;
  --amber-dim: #cc8d00;
  --cyan: #00d4ff;
  --red: #ff4444;
  --border: #21262d;
  --border-bright: #30363d;
  --link: #00ff41;
  --link-hover: #00cc33;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
  --max-width: 760px;
  --content-padding: 1.5rem;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Scanline overlay — subtle */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
  width: 100%;
}

/* ---- HEADER ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.5rem;
}

.ascii-logo {
  color: var(--green);
  font-size: 0.55rem;
  line-height: 1.15;
  white-space: pre;
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px var(--green-glow);
  overflow-x: auto;
}

.site-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.site-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

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

.site-nav a::before {
  content: "~/";
  color: var(--green-dim);
  opacity: 0.5;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--green);
}

.site-nav a:hover::before,
.site-nav a.active::before {
  opacity: 1;
}

/* ---- MAIN ---- */
main {
  flex: 1;
  padding: 2.5rem 0;
}

/* ---- POST LIST ---- */
.post-list {
  list-style: none;
}

.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px dashed var(--border);
}

.post-item:last-child {
  border-bottom: none;
}

.post-date {
  color: var(--amber);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.post-title {
  margin: 0.25rem 0 0.5rem;
}

.post-title a {
  color: var(--text-bright);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--green);
}

.post-summary {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.post-tags {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  color: var(--cyan);
  font-size: 0.75rem;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.tag::before {
  content: "#";
}

.tag:hover {
  opacity: 1;
}

/* Section heading */
.section-title {
  color: var(--green);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-title::before {
  content: "$ ";
  color: var(--amber);
}

/* ---- SINGLE POST ---- */
.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-header .post-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-meta .author { color: var(--green-dim); }
.post-meta .date { color: var(--amber); }
.post-meta .reading-time { color: var(--text-muted); }

/* Article content */
.post-content {
  font-size: 0.92rem;
  line-height: 1.8;
}

.post-content h2 {
  color: var(--green);
  font-size: 1.2rem;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--border);
}

.post-content h2::before {
  content: "## ";
  color: var(--amber);
  opacity: 0.6;
}

.post-content h3 {
  color: var(--text-bright);
  font-size: 1.05rem;
  margin: 2rem 0 0.75rem;
}

.post-content h3::before {
  content: "### ";
  color: var(--amber);
  opacity: 0.4;
}

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

.post-content a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 255, 65, 0.3);
  transition: text-decoration-color 0.2s;
}

.post-content a:hover {
  text-decoration-color: var(--green);
}

.post-content strong {
  color: var(--text-bright);
  font-weight: 600;
}

.post-content em {
  color: var(--amber-dim);
  font-style: italic;
}

.post-content ul, .post-content ol {
  margin: 1rem 0 1.2rem 1.5rem;
}

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

.post-content li::marker {
  color: var(--green-dim);
}

.post-content blockquote {
  border-left: 3px solid var(--green-dim);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 0 4px 4px 0;
}

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

.post-content img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1.5rem 0;
}

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

/* Code blocks */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-code);
  color: var(--amber);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

.post-content pre::before {
  content: "┌─────────────────────────────────────────┐";
  display: block;
  color: var(--border-bright);
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.6;
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.82rem;
  overflow-x: auto;
  display: block;
}

.post-content thead {
  border-bottom: 2px solid var(--green-dim);
}

.post-content th {
  color: var(--green);
  font-weight: 600;
  text-align: left;
  padding: 0.6rem 0.8rem;
  white-space: nowrap;
}

.post-content td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.post-content tr:hover td {
  background: var(--bg-hover);
}

/* IOC box */
.ioc-box {
  background: var(--bg-code);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.ioc-box h4 {
  color: var(--red);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.ioc-box code {
  color: var(--amber);
}

/* ---- FOOTER ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--green);
}

.footer-ascii {
  color: var(--border-bright);
  font-size: 0.65rem;
  margin-top: 0.75rem;
  white-space: pre;
}

/* Cursor blink */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

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

/* ---- ABOUT PAGE ---- */
.about-content {
  font-size: 0.92rem;
  line-height: 1.8;
}

.about-content h2 {
  color: var(--green);
  font-size: 1.1rem;
  margin: 2rem 0 0.75rem;
}

.about-content h2::before {
  content: "> ";
  color: var(--amber);
}

/* ---- TAG PAGE ---- */
.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-list li a {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  transition: all 0.2s;
}

.tag-list li a:hover {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.05);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  :root {
    --content-padding: 1rem;
  }

  .ascii-logo {
    font-size: 0.35rem;
  }

  .post-header .post-title {
    font-size: 1.25rem;
  }

  .post-content {
    font-size: 0.87rem;
  }

  .post-content pre {
    padding: 0.75rem;
    font-size: 0.75rem;
    border-radius: 0;
    margin-left: calc(-1 * var(--content-padding));
    margin-right: calc(-1 * var(--content-padding));
  }

  .post-content pre::before {
    display: none;
  }

  .post-content table {
    font-size: 0.75rem;
  }

  .post-meta {
    flex-direction: column;
    gap: 0.25rem;
  }
}

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

.chroma {
  background: var(--bg-code) !important;
}

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