/* ═══════════════════════════════════════════════════════════════════
   dev-knowledge-base · style.css
   ═══════════════════════════════════════════════════════════════════ */

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

/* ─── Dark theme (default) ──────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --bg-card:     #161b22;
  --bg-card-h:   #1c2330;
  --bg-header:   #0d1117ee;
  --border:      #30363d;
  --border-h:    #58a6ff;
  --text:        #e6edf3;
  --text-body:   #cdd9e5;
  --text-muted:  #8b949e;
  --text-dim:    #6e7681;
  --accent:      #58a6ff;
  --accent-soft: #1f3a5f;
  --green:       #3fb950;
  --green-soft:  #1a3a25;
  --purple:      #bc8cff;
  --purple-soft: #2a1f4a;
  --orange:      #e3b341;
  --orange-soft: #3d2e0f;
  --red:         #f85149;
  --red-soft:    #3d1515;
  --code-inline-bg:    #1c2330;
  --code-inline-color: #e3b341;
  --code-lang-bg:      rgba(48,54,61,0.9);
  --blockquote-bg:     #1f3a5f;
  --error-border:      #7a2020;
  --error-text:        #f09090;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
  --radius:      10px;
  --transition:  0.2s ease;
}

/* ─── Light theme ───────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f6f8fa;
  --bg-card:     #ffffff;
  --bg-card-h:   #f0f3f6;
  --bg-header:   #ffffffee;
  --border:      #d0d7de;
  --border-h:    #0969da;
  --text:        #1f2328;
  --text-body:   #24292f;
  --text-muted:  #57606a;
  --text-dim:    #8c959f;
  --accent:      #0969da;
  --accent-soft: #dbeafe;
  --green:       #1a7f37;
  --green-soft:  #d1fae5;
  --purple:      #8250df;
  --purple-soft: #ede9fe;
  --orange:      #9a6700;
  --orange-soft: #fef3c7;
  --red:         #cf222e;
  --red-soft:    #fee2e2;
  --code-inline-bg:    #f0f3f6;
  --code-inline-color: #953800;
  --code-lang-bg:      rgba(208,215,222,0.9);
  --blockquote-bg:     #dbeafe;
  --error-border:      #fca5a5;
  --error-text:        #991b1b;
  --shadow:      0 4px 24px rgba(0,0,0,0.08);
}

/* Badge border overrides for light mode */
[data-theme="light"] .badge-networking   { border-color: #93c5fd; }
[data-theme="light"] .badge-devops       { border-color: #6ee7b7; }
[data-theme="light"] .badge-system       { border-color: #c4b5fd; }
[data-theme="light"] .badge-tools        { border-color: #fde68a; }
[data-theme="light"] .badge-security     { border-color: #fca5a5; }
[data-theme="light"] .badge-fundamentals { background: #e0f7fa; color: #00838f; border-color: #80deea; }

/* ─── Base ──────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

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

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

/* ─── Header ────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  transition: background var(--transition), border-color var(--transition);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--accent); }

.header-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: none;
  flex: 1;
}

@media (min-width: 600px) { .header-tagline { display: block; } }

/* ─── Theme Toggle Button ───────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all var(--transition);
  line-height: 1;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* show correct icon per theme */
.theme-toggle .icon-moon { display: inline; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun  { display: inline; }

/* ─── Language Toggle Button ────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  gap: 0.4rem;
  white-space: nowrap;
}

.lang-toggle:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-soft);
}

[data-lang="am"] .lang-toggle {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--purple-soft);
}

.lang-toggle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

/* ─── Header controls group ─────────────────────────────────────── */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ─── Page transitions ──────────────────────────────────────────── */
.page { display: none; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Hero ──────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--text) 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  letter-spacing: -1px;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ─── Filter Bar ────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.5rem 1.5rem 0;
  max-width: 1200px;
  margin: 0 auto;
}

.filter-btn {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

/* ─── Posts Grid ────────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 4rem 0;
  font-size: 1rem;
}

/* ─── Post Card ─────────────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity var(--transition);
}

.post-card:hover {
  background: var(--bg-card-h);
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-card:hover::before { opacity: 1; }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

/* ─── Badges ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-networking    { background: var(--accent-soft);  color: var(--accent);  border: 1px solid #2a5a9f; }
.badge-devops        { background: var(--green-soft);   color: var(--green);   border: 1px solid #1f5c2a; }
.badge-system        { background: var(--purple-soft);  color: var(--purple);  border: 1px solid #5a3a9f; }
.badge-tools         { background: var(--orange-soft);  color: var(--orange);  border: 1px solid #7a5f0f; }
.badge-security      { background: var(--red-soft);     color: var(--red);     border: 1px solid #7a1515; }
.badge-fundamentals  { background: #1a2f3a;             color: #56c8d8;        border: 1px solid #1f5a68; }
.badge-default       { background: var(--bg-card-h);    color: var(--text-muted); border: 1px solid var(--border); }

.card-description {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.25rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.read-more-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ─── Post View ─────────────────────────────────────────────────── */
.post-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

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

.post-title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.5px;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* ─── Markdown Body ─────────────────────────────────────────────── */
.post-body {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-body);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.3px;
}

.post-body h1 { font-size: 1.8rem;  border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.post-body h2 { font-size: 1.4rem;  border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.post-body h3 { font-size: 1.15rem; }
.post-body h4 { font-size: 1rem;    color: var(--text-muted); }

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

.post-body a { color: var(--accent); }
.post-body a:hover { text-decoration: underline; }

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

.post-body ul,
.post-body ol { margin: 0.75rem 0 1.2rem 1.5rem; }

.post-body li { margin-bottom: 0.4rem; }
.post-body li::marker { color: var(--accent); }

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--blockquote-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

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

/* ─── Tables ────────────────────────────────────────────────────── */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-body th {
  background: var(--bg-card-h);
  color: var(--text);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.post-body td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.post-body tr:last-child td { border-bottom: none; }
.post-body tr:hover td { background: var(--bg-card-h); }

/* ─── Inline Code ───────────────────────────────────────────────── */
.post-body code:not(pre code) {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83em;
  background: var(--code-inline-bg);
  border: 1px solid var(--border);
  color: var(--code-inline-color);
  padding: 0.15em 0.45em;
  border-radius: 4px;
}

/* ─── Code Blocks ───────────────────────────────────────────────── */
.post-body pre {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.code-block-wrapper { position: relative; }

.code-lang-label {
  position: absolute;
  top: 0; right: 0;
  background: var(--code-lang-bg);
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  border-bottom-left-radius: 6px;
  z-index: 1;
}

.copy-btn {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition);
  font-family: inherit;
  z-index: 2;
}

.code-block-wrapper:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--green); border-color: var(--green); }

.post-body pre code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  display: block;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  line-height: 1.65;
}

/* ─── Checkboxes ────────────────────────────────────────────────── */
.post-body input[type="checkbox"] {
  accent-color: var(--accent);
  margin-right: 0.4rem;
}

/* ─── Loading spinner ───────────────────────────────────────────── */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 5rem 0;
  color: var(--text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Error box ─────────────────────────────────────────────────── */
.error-box {
  background: var(--red-soft);
  border: 1px solid var(--error-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: var(--error-text);
  text-align: center;
  margin: 2rem 0;
}

.error-box h3 { color: var(--red); margin-bottom: 0.5rem; }

.error-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(0,0,0,0.15);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ─── Footer ────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ─── Reading progress bar ──────────────────────────────────────── */
.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  z-index: 200;
  transition: width 0.1s linear;
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .posts-grid     { grid-template-columns: 1fr; padding: 1rem; }
  .filter-bar     { padding: 1rem; }
  .post-container { padding: 1.5rem 1rem 3rem; }
  .hero           { padding: 2rem 1rem 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   PORTFOLIO — Navigation, Sections, Cards, Contact, Footer
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Site Nav ──────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.nav-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  color: var(--text);
  background: var(--bg-card);
  border-color: var(--border);
}

.nav-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--border-h);
}

/* ─── Portfolio shared ──────────────────────────────────────────── */
.pf-section {
  padding: 5rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.pf-section:last-of-type { border-bottom: none; }

.pf-section-alt {
  background: var(--bg-card);
}

.pf-container {
  max-width: 1100px;
  margin: 0 auto;
}

.sec-header {
  text-align: center;
  margin-bottom: 3rem;
}

.sec-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

.sec-sub {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ─── About section ─────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (max-width: 680px) {
  .about-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  .about-actions { justify-content: center; }
  .skill-pills   { justify-content: center; }
}

.avatar-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
  margin: 0 auto;
}

.avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -2px;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--border);
}

.avatar-photo {
  object-fit: cover;
  object-position: center top;
  background: none;
  font-size: 0;
}

.avatar-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.35;
  animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.35; }
  50%       { transform: scale(1.05); opacity: 0.6;  }
}

.about-greeting {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
}

.about-name {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.about-role {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.role-chip {
  display: inline-block;
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple);
  border-radius: 20px;
  padding: 0.25rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.about-bio {
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.about-bio p {
  margin-bottom: 0.85rem;
}

.about-bio p:last-child { margin-bottom: 0; }

.about-bio strong { color: var(--text); font-weight: 600; }

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.skill-pill {
  padding: 0.3rem 0.75rem;
  background: var(--bg-card-h);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  transition: all var(--transition);
}

.skill-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #3d8fe8;
  border-color: #3d8fe8;
  color: #fff;
}

/* ─── Projects ──────────────────────────────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.proj-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity var(--transition);
}

.proj-card:hover {
  border-color: var(--border-h);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  background: var(--bg-card-h);
}

.proj-card:hover::before { opacity: 1; }

.proj-card-dim { opacity: 0.65; }
.proj-card-dim:hover { opacity: 1; }

.proj-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.proj-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.proj-links {
  display: flex;
  gap: 0.5rem;
}

.proj-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  transition: all var(--transition);
  text-decoration: none;
}

.proj-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.proj-link-live {
  color: var(--green);
  border-color: var(--green-soft);
}

.proj-link-live:hover {
  color: var(--green);
  border-color: var(--green);
  background: var(--green-soft);
}

.proj-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.proj-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.65;
  flex: 1;
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.proj-tag {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #2a5a9f;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

[data-theme="light"] .proj-tag { border-color: #93c5fd; }

/* ─── Contact ───────────────────────────────────────────────────── */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: start;
}

@media (max-width: 720px) {
  .contact-wrap { grid-template-columns: 1fr; gap: 2.5rem; }
}

.contact-heading {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
}

.contact-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.65rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all var(--transition);
}

.contact-row:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.contact-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-card-h);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row { display: flex; flex-direction: column; }

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
  resize: none;
}

.form-input::placeholder { color: var(--text-dim); }

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-submit {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  align-self: flex-start;
}

.form-submit:hover { background: #3d8fe8; transform: translateY(-1px); }
.form-submit:active { transform: translateY(0); }

.form-note {
  font-size: 0.8rem;
  color: var(--green);
  min-height: 1.2em;
}

/* ─── Portfolio Footer ──────────────────────────────────────────── */
.pf-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  text-align: center;
}

.pf-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.pf-footer-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.5px;
}

.pf-footer-name span { color: var(--accent); }

.pf-footer-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.pf-footer-meta a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.pf-footer-meta a:hover { color: var(--accent); text-decoration: none; }

.pf-footer-sep { color: var(--border); }

/* ═══════════════════════════════════════════════════════════════════
   RESUME / CV PAGE
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Actions bar (above the doc) ──────────────────────────────── */
.cv-actions {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cv-actions-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cv-actions-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Document wrapper ──────────────────────────────────────────── */
.cv-page-wrap {
  min-height: 100vh;
}

.cv-doc {
  max-width: 860px;
  margin: 2.5rem auto 4rem;
  padding: 3rem 3.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

@media (max-width: 720px) {
  .cv-doc { margin: 1rem; padding: 2rem 1.5rem; }
}

/* ─── Header ────────────────────────────────────────────────────── */
.cv-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.cv-name {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -1px;
  margin-bottom: 0.3rem;
  line-height: 1.1;
}

.cv-title-line {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cv-title-sep {
  color: var(--accent);
  margin: 0 0.3rem;
}

.cv-contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .cv-header { flex-direction: column; gap: 1.25rem; }
  .cv-contact-list { align-items: flex-start; }
}

.cv-contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.cv-contact-link:hover { color: var(--accent); text-decoration: none; }

.cv-ci {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--bg-card-h);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ─── Sections ──────────────────────────────────────────────────── */
.cv-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.cv-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 1.25rem;
}

/* ─── Summary ───────────────────────────────────────────────────── */
.cv-summary {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.75;
}

/* ─── Skills ────────────────────────────────────────────────────── */
.cv-skills {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cv-skill-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.cv-skill-cat {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  min-width: 110px;
  flex-shrink: 0;
}

.cv-skill-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cv-skill-tag {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  background: var(--bg-card-h);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ─── Experience ────────────────────────────────────────────────── */
.cv-exp-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.cv-exp-item {
  padding-left: 1rem;
  border-left: 2px solid var(--border);
  transition: border-color var(--transition);
}

.cv-exp-item:hover { border-left-color: var(--accent); }

.cv-exp-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.cv-exp-left {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.cv-exp-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.cv-exp-at {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin: 0 0.1rem;
}

.cv-exp-company {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.cv-exp-company:hover { text-decoration: underline; }

.cv-exp-type {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 20px;
  margin-left: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

[data-theme="light"] .cv-exp-type { border-color: #6ee7b7; }

.cv-exp-period {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-exp-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}

.cv-achievements {
  margin: 0 0 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cv-achievements li {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.55;
  list-style: disc;
}

.cv-achievements li::marker { color: var(--accent); }

/* ─── Tech tags (shared: exp + proj) ───────────────────────────── */
.cv-tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.cv-tech-tag {
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #2a5a9f;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

[data-theme="light"] .cv-tech-tag { border-color: #93c5fd; }

/* ─── Projects ──────────────────────────────────────────────────── */
.cv-proj-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cv-proj-item {
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition);
}

.cv-proj-item:hover { border-color: var(--accent); }

.cv-proj-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.cv-proj-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cv-proj-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}

.cv-proj-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cv-proj-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 5px;
  transition: all var(--transition);
}

.cv-proj-link:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.cv-proj-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

/* ─── Education ─────────────────────────────────────────────────── */
.cv-edu-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cv-edu-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cv-edu-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.cv-edu-degree {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.cv-edu-year {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

.cv-edu-institution {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ─── Print styles ──────────────────────────────────────────────── */
@media print {
  .no-print,
  .site-header,
  .reading-progress {
    display: none !important;
  }

  body { background: #fff !important; color: #000 !important; }

  .cv-doc {
    margin: 0;
    padding: 1.5rem 2rem;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    max-width: 100%;
  }

  .cv-name  { color: #000; }
  .cv-title-line { color: #444; }
  .cv-section-title { color: #0969da; }
  .cv-contact-link  { color: #444; }
  .cv-exp-role, .cv-edu-degree, .cv-proj-name { color: #000; }
  .cv-exp-company { color: #0969da; }
  .cv-skill-cat { color: #444; }
  .cv-skill-tag, .cv-tech-tag { background: #f0f0f0; border-color: #ccc; color: #333; }
  .cv-proj-item, .cv-exp-item { border-color: #ddd; }
  .cv-section { border-top-color: #ddd; }
  .cv-header { border-bottom-color: #0969da; }

  a { color: inherit !important; text-decoration: none !important; }
  .cv-exp-type { background: #e6f4ea; color: #1a7f37; border-color: #a8d5b5; }
  .cv-ci { background: #f0f0f0; border-color: #ccc; color: #444; }
  .cv-proj-link { border-color: #0969da; color: #0969da; }
}
