/* =========================================
   MHx1 Blog — style.css
   ========================================= */

:root {
  --bg: #0d0d0d;
  --bg-secondary: #141414;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --text: #e8e8e8;
  --text-secondary: #888;
  --text-muted: #555;
  --accent: #e8e8e8;
  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, 0.08);
  --green-border: rgba(74, 222, 128, 0.25);
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-sans: 'Inter', system-ui, sans-serif;
  --radius: 4px;
  --max-w: 760px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── NAV ─────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,13,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 52px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: opacity 0.15s;
}
.nav-brand:hover { opacity: 0.75; }

.brand-icon {
  width: 24px;
  height: 24px;
  background: var(--text);
  color: var(--bg);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-icon svg { width: 13px; height: 13px; }

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--text);
  transition: all 0.2s;
}

/* ── CONTAINER ───────────────────────────── */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

/* ── HERO ────────────────────────────────── */

.hero { margin-bottom: 2.5rem; }

.hero-handle {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.hero-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.hero-sub {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 520px;
  line-height: 1.75;
}
.hero-sub strong {
  color: var(--text);
  font-weight: 500;
}

/* ── STATS ───────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 140px));
  gap: 10px;
  margin-bottom: 2.5rem;
}

.stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
}

.stat-val {
  display: block;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.stat-lbl {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── TAGS ────────────────────────────────── */

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 2.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  background: none;
  cursor: pointer;
  transition: all 0.15s;
}
.tag:hover { border-color: var(--border-hover); color: var(--text); }
.tag.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── SECTION LABEL ───────────────────────── */

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

/* ── POST LIST ───────────────────────────── */

.posts { display: flex; flex-direction: column; }

.post-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.post-item:last-child { border-bottom: 1px solid var(--border); }
.post-item:hover .post-item-title { color: var(--text-secondary); }

.post-item-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.post-item-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
  transition: color 0.15s;
}

.post-item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 6px;
}

.post-item-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  display: inline-block;
}
.post-item-badge.new {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}

.post-item-meta {
  text-align: right;
  white-space: nowrap;
  padding-top: 2px;
}

.post-item-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.post-item-read {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.post-item.hidden { display: none; }

/* ── ABOUT PAGE ──────────────────────────── */

.about p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 580px;
  margin-bottom: 1.25rem;
}
.about p strong { color: var(--text); font-weight: 500; }

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

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin-bottom: 1rem;
}

.about-list {
  list-style: none;
  margin-top: 0.25rem;
}
.about-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 0;
  font-family: var(--font-mono);
}
.about-list li::before {
  content: "→ ";
  color: var(--text-muted);
}

.social-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 0.5rem; }

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 14px;
  transition: all 0.15s;
}
.social-btn:hover {
  color: var(--text);
  border-color: var(--border-hover);
}

/* ── POST ARTICLE ────────────────────────── */

.post-container { max-width: 720px; }

.back-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  display: inline-block;
  margin-bottom: 2rem;
  transition: color 0.15s;
}
.back-link:hover { color: var(--text); }

.post-header { margin-bottom: 2rem; }

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.post-date,
.post-read {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.post-date::before,
.post-read::before { content: "· "; }

.post-title {
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.post-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 580px;
}

/* ── POST BODY ───────────────────────────── */

.post-body { color: var(--text-secondary); }

.post-body h2 {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  margin: 2rem 0 0.75rem;
}

.post-body h3 {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

.post-body p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.post-body a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.post-body a:hover { opacity: 0.75; }

.post-body ul,
.post-body ol {
  margin: 0.75rem 0 1rem 1.25rem;
}
.post-body li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  line-height: 1.7;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: rgba(255,255,255,0.06);
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--text);
}

.post-body pre {
  background: #111;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.post-body pre code {
  background: none;
  padding: 0;
  font-size: 12.5px;
  color: #cdd6f4;
  line-height: 1.7;
}

.callout {
  border-left: 2px solid var(--border-hover);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout-info { border-left-color: #3b82f6; }
.callout strong { color: var(--text); font-weight: 500; }

/* ── TIMELINE ────────────────────────────── */

.timeline { margin: 1rem 0; display: flex; flex-direction: column; gap: 8px; }
.tl-item {
  display: flex;
  gap: 1rem;
  font-size: 13px;
  align-items: baseline;
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 90px;
}

/* ── FOOTER ──────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.footer-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-links a:hover { color: var(--text); }

/* ── MOBILE ──────────────────────────────── */

@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
  .nav-toggle { display: flex; }

  .hero-handle { font-size: 22px; }
  .post-item { grid-template-columns: 1fr; }
  .post-item-meta { text-align: left; display: flex; gap: 12px; }
  .post-item-read::before { content: "· "; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
}
