/* =============================================================
   Minimalist Portfolio Stylesheet
   Design: Clean, understated minimalism inspired by 5pider.net
   Palette: Dark charcoal (#1c1c1d), crisp text (#e8e8e8), slate accent (#58a6ff)
   ============================================================= */

:root {
  --bg:           #1c1c1d;
  --bg-card:      #222428;
  --border:       #2e3238;
  --border-light: #26292e;
  --text:         #e8e8e8;
  --text-muted:   #888888;
  --accent:       #58a6ff;
  --accent-hover: #79b8ff;
  --red:          #f85149;
  --green:        #3fb950;
  --amber:        #d29922;
  --mono:         'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width:    800px;
}

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

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
}

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 26px;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}

h2 {
  font-size: 18px;
  margin: 32px 0 14px;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

p {
  color: var(--text);
  margin-bottom: 14px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #25282e;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  color: #d1d5db;
}

/* ── Container ───────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Top Navigation Bar ──────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(28, 28, 29, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none !important;
}
.nav-brand:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  text-decoration: none !important;
  transition: color 0.15s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}
.nav-links a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-family: var(--mono);
  cursor: pointer;
}

/* ── Page Content ────────────────────────────────────────────── */
.main-content {
  padding-top: 36px;
}

.page-header {
  margin-bottom: 24px;
}

.page-desc {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: -4px;
}

/* ── Simple Text Links Bar (Social/Contact) ───────────────────── */
.link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 28px;
  font-family: var(--mono);
  font-size: 13px;
}
.link-list a {
  color: var(--accent);
}

/* ── Minimalist Projects Grid ────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.project-item {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px 16px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease;
}
.project-item:hover {
  border-color: #444a54;
}

.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.project-title {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
.project-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.project-item p {
  font-size: 13px;
  color: #c0c4cc;
  line-height: 1.55;
  margin-bottom: 10px;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lang-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* ── Minimalist Table / Row for Posts & Advisories ───────────── */
.table-minimal {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.table-minimal tr {
  border-bottom: 1px solid var(--border);
}
.table-minimal td {
  padding: 10px 0;
  vertical-align: top;
  font-size: 14px;
}
.table-minimal td.col-date {
  width: 110px;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.table-minimal td.col-title a {
  color: var(--text);
}
.table-minimal td.col-title a:hover {
  color: var(--accent);
}
.table-minimal td.col-action {
  text-align: right;
  white-space: nowrap;
}

/* ── Minimalist CVE / Advisory Items ─────────────────────────── */
.advisory-item {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px 16px;
  background: var(--bg-card);
  margin-bottom: 12px;
}
.advisory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
}
.advisory-cve {
  font-weight: 600;
  color: var(--accent);
}
.advisory-metric {
  color: var(--text-muted);
  font-size: 11px;
}
.advisory-metric.high { color: var(--red); }
.advisory-metric.medium { color: var(--amber); }
.advisory-metric.low { color: var(--accent); }

.advisory-item h3 {
  font-size: 14.5px;
  margin-bottom: 6px;
  color: var(--text);
}
.advisory-item p {
  font-size: 13px;
  color: #c0c4cc;
  line-height: 1.55;
  margin-bottom: 8px;
}
.advisory-credit {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.advisory-credit strong {
  color: var(--text);
}
.advisory-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
}

/* ── Code Diff Block ─────────────────────────────────────────── */
.diff-box {
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  margin: 10px 0 16px;
  background: #141415;
}
.diff-header {
  padding: 6px 12px;
  background: #1f2125;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
}
.diff-body {
  padding: 8px 0;
  overflow-x: auto;
  line-height: 1.55;
}
.diff-line {
  padding: 0 12px;
  white-space: pre;
}
.diff-add { background: rgba(63, 185, 80, 0.12); color: #4ade80; }
.diff-del { background: rgba(248, 81, 73, 0.12); color: #f87171; }
.diff-ctx { color: #6e7681; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-muted);
}
.footer a {
  color: var(--text-muted);
}
.footer a:hover {
  color: var(--text);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 680px) {
  .project-grid {
    grid-template-columns: 1fr;
  }
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    gap: 12px;
  }
  .nav-links.open {
    display: flex;
  }
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
