/* ===================================================================
   PORTFOLIO — style.css
   =================================================================== */

/* ── THEMES ───────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f1117; --bg2: #161b26; --bg3: #1d2435; --bg4: #232b3d;
  --border: rgba(99,130,190,0.12);
  --border-md: rgba(99,130,190,0.22);
  --border-hi: rgba(99,130,190,0.4);
  --text: #e8ecf4; --text2: #8b96b0; --text3: #4a5470;
  --accent: #5b8cf7; --accent2: #38c9b0;
  --accent-dim: rgba(91,140,247,0.1);
  --accent-dim2: rgba(56,201,176,0.1);
  --nav-bg: rgba(15,17,23,0.92);
  --shadow: 0 4px 32px rgba(0,0,0,0.4);
}
[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #ffffff; --bg3: #edf0f9; --bg4: #e2e6f4;
  --border: rgba(60,80,160,0.1);
  --border-md: rgba(60,80,160,0.18);
  --border-hi: rgba(60,80,160,0.35);
  --text: #131722; --text2: #4a5470; --text3: #9098b8;
  --accent: #3b6ef5; --accent2: #19a891;
  --accent-dim: rgba(59,110,245,0.08);
  --accent-dim2: rgba(25,168,145,0.08);
  --nav-bg: rgba(244,246,251,0.92);
  --shadow: 0 4px 24px rgba(60,80,160,0.08);
}

/* ── TOKENS ───────────────────────────────────────────────────────── */
:root {
  --radius: 12px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
}

/* ── RESET ────────────────────────────────────────────────────────── */
*, *::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-body);
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

/* ── SCROLL REVEAL ────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1),
              transform 0.7s cubic-bezier(0.16,1,0.3,1);
}
.reveal.revealed { opacity: 1; transform: none; }
.reveal-children > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1),
              transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.reveal-children.revealed > *:nth-child(1) { opacity:1; transform:none; transition-delay:0s; }
.reveal-children.revealed > *:nth-child(2) { opacity:1; transform:none; transition-delay:0.07s; }
.reveal-children.revealed > *:nth-child(3) { opacity:1; transform:none; transition-delay:0.14s; }
.reveal-children.revealed > *:nth-child(4) { opacity:1; transform:none; transition-delay:0.21s; }
.reveal-children.revealed > *:nth-child(5) { opacity:1; transform:none; transition-delay:0.28s; }
.reveal-children.revealed > *:nth-child(6) { opacity:1; transform:none; transition-delay:0.35s; }

/* ── NAV ──────────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 clamp(1rem,5vw,2rem);
  display: flex; align-items: center;
  height: 56px; gap: 4px;
}
.nav-logo {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--text); text-decoration: none;
  margin-right: auto; display: flex; align-items: center; gap: 10px;
}
.nav-logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border-md); background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--accent);
  transition: background 0.3s;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 2px; }
.nav-link {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text2); background: none; border: none;
  cursor: pointer; padding: 7px 13px; border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.04em; text-decoration: none; display: block;
}
.nav-link:hover { color: var(--text); background: var(--border); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.nav-cta {
  font-family: var(--font-mono); font-size: 12px; color: #fff;
  background: var(--accent); border: none; cursor: pointer;
  padding: 7px 16px; border-radius: 6px;
  transition: opacity 0.2s; margin-left: 8px;
  text-decoration: none; white-space: nowrap;
}
.nav-cta:hover { opacity: 0.85; }

/* Theme toggle */
.theme-toggle {
  display: flex; align-items: center; cursor: pointer;
  margin-left: 8px; padding: 4px; background: none; border: none;
}
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px;
  background: var(--bg3); border: 1px solid var(--border-md);
  position: relative; transition: background 0.3s, border-color 0.3s;
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); transition: transform 0.25s, background 0.3s;
}
[data-theme="light"] .toggle-knob { transform: translateX(18px); }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 6px; margin-left: 4px;
}
.hamburger span { display: block; width: 20px; height: 1.5px; background: var(--text2); border-radius: 2px; }

/* Mobile menu */
.mobile-menu {
  display: none; flex-direction: column; gap: 4px;
  padding: 12px clamp(1rem,5vw,2rem) 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg); transition: background 0.3s;
}
.mobile-menu.open { display: flex; }
.mobile-theme-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 2px;
}
.mobile-theme-label { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }

/* ── LAYOUT ───────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 clamp(1rem,5vw,2rem); }
.divider { border: none; border-top: 1px solid var(--border); }

/* ── TYPOGRAPHY UTILITIES ─────────────────────────────────────────── */
.mono-label {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.1em; color: var(--text3);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.mono-label::before { content:''; display:block; width:18px; height:1px; background: var(--text3); }

/* Availability dot */
.avail-dot { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--accent2); }
.avail-dot::before { content:''; display:block; width:7px; height:7px; border-radius:50%; background:var(--accent2); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ── BUTTONS ──────────────────────────────────────────────────────── */
.btn-primary {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  color: #fff; background: var(--accent); border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 7px;
  transition: opacity 0.2s; text-decoration: none; display: inline-block;
}
.btn-primary:hover { opacity: 0.85; }
.btn-ghost {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text2); background: transparent;
  border: 1px solid var(--border-md); cursor: pointer;
  padding: 10px 22px; border-radius: 7px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  text-decoration: none; display: inline-block;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); background: var(--bg3); }

/* ── TAGS ─────────────────────────────────────────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text3); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 4px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tag:hover { color: var(--accent); border-color: var(--border-hi); background: var(--accent-dim); }

/* ── FILTER CHIPS ─────────────────────────────────────────────────── */
.filter-row { display: flex; gap: 8px; margin: 1.5rem 0; flex-wrap: wrap; }
.filter-chip {
  font-family: var(--font-mono); font-size: 11px;
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--text3);
  cursor: pointer; background: none; transition: all 0.2s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* ── PROJECT STATUS BADGE ─────────────────────────────────────────── */
.proj-status {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--accent2); background: var(--accent-dim2);
  border: 1px solid rgba(56,201,176,0.2);
  padding: 2px 9px; border-radius: 4px;
  display: inline-block;
}

/* ── HERO ─────────────────────────────────────────────────────────── */
.hero { padding: clamp(4rem,10vw,7rem) 0 clamp(3rem,6vw,5rem); }
.hero-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem,5vw,4rem);
  align-items: center;
}
.hero-content { display: flex; flex-direction: column; gap: 1.25rem; }
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem,6vw,5.2rem);
  font-weight: 700; line-height: 1.05;
  letter-spacing: -0.02em; color: var(--text);
}
.hero-title em { font-style: italic; font-weight: 300; color: var(--accent); }
.hero-sub {
  font-size: clamp(0.95rem,2vw,1.1rem);
  color: var(--text2); font-weight: 300;
  max-width: 480px; line-height: 1.8;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Terminal */
.hero-terminal {
  background: var(--bg2);
  border: 1px solid var(--border-md);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 260px;
}
.terminal-bar {
  background: var(--bg3);
  padding: 10px 14px;
  display: flex; gap: 7px; align-items: center;
  border-bottom: 1px solid var(--border);
}
.t-dot { width: 10px; height: 10px; border-radius: 50%; }
.t-dot:nth-child(1) { background: #ff5f57; }
.t-dot:nth-child(2) { background: #febc2e; }
.t-dot:nth-child(3) { background: #28c840; }
.terminal-body { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.t-line { display: flex; align-items: baseline; gap: 8px; }
.t-prompt { color: var(--accent2); }
.t-cmd { color: var(--text); }
.t-output { color: var(--text2); padding-left: 18px; line-height: 1.8; }
.t-cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* Staggered terminal reveal */
.t-type-1 { opacity:0; animation: t-appear 0.2s ease 0.4s both; }
.t-fade-1  { opacity:0; animation: t-appear 0.3s ease 0.7s both; }
.t-type-2  { opacity:0; animation: t-appear 0.2s ease 1.1s both; }
.t-fade-2  { opacity:0; animation: t-appear 0.3s ease 1.4s both; }
.t-type-3  { opacity:0; animation: t-appear 0.2s ease 1.8s both; }
.t-fade-3  { opacity:0; animation: t-appear 0.3s ease 2.1s both; }
.t-fade-4  { opacity:0; animation: t-appear 0.3s ease 2.5s both; }
@keyframes t-appear { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ── STATS ────────────────────────────────────────────────────────── */
.stats-section {
  padding: clamp(2rem,5vw,3.5rem) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat-cell {
  background: var(--bg2);
  padding: clamp(1rem,3vw,1.5rem);
  transition: background 0.2s;
}
.stat-cell:hover { background: var(--bg3); }
/* Visual anchor on first cell */
.stat-cell:first-child { background: var(--bg3); }
.stat-cell:first-child .stat-num { font-size: clamp(2.2rem,5vw,3.4rem); }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem,4vw,2.8rem);
  font-weight: 900; color: var(--text);
  line-height: 1; margin-bottom: 6px;
}
.stat-accent { color: var(--accent); }
.stat-desc { font-size: 12px; color: var(--text3); line-height: 1.4; }

/* ── ABOUT ────────────────────────────────────────────────────────── */
.about-section { padding: clamp(3rem,6vw,5rem) 0; }
.two-col {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem,5vw,4rem); align-items: start;
}
.about-text { font-size: 15px; color: var(--text2); line-height: 1.8; }
.about-text p + p { margin-top: 1rem; }
.skills-group + .skills-group { margin-top: 1.25rem; }
.skills-group-label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 8px;
}
.skills-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── SECTION HEADERS ──────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem,3vw,2rem); font-weight: 700; color: var(--text);
}
.projects-section, .blog-section { padding: clamp(3rem,6vw,5rem) 0; }

/* ── FEATURED PROJECT CARD ────────────────────────────────────────── */
.project-card-featured {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.project-card-featured:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.project-card-img {
  background: var(--bg3); padding: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  min-height: 160px;
}
.pipeline-viz {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: center;
}
.pv-node {
  background: var(--bg4); border: 1px solid var(--border-md);
  border-radius: 6px; padding: 8px 14px;
  font-family: var(--font-mono); font-size: 10px; color: var(--text3);
  white-space: nowrap;
}
.pv-node.hl { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.pv-arrow { color: var(--text3); font-size: 12px; flex-shrink: 0; }
.project-card-body { padding: 1.25rem 1.5rem; }
.project-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
.project-card-title { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.project-card-desc { font-size: 13px; color: var(--text2); line-height: 1.65; margin-bottom: 1rem; }
.project-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── HOME PROJECTS 2-COL ──────────────────────────────────────────── */
.home-two-col {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 1rem; margin-top: 1rem;
}

/* ── GENERIC CARD ─────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg2);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; cursor: pointer;
}
.card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-img { width: 100%; height: 180px; object-fit: cover; display: block; background: var(--bg3); }
.card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }
.card-desc { font-size: 13px; color: var(--text2); line-height: 1.65; flex: 1; }

/* ── ARTICLES FEATURED (horizontal — home + blog) ─────────────────── */
.articles-featured-link { text-decoration: none; color: inherit; display: block; margin-bottom: 1rem; }
.articles-featured {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.articles-featured:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.af-img {
  background: var(--bg3); min-height: 300px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.af-img img {
  width: 100%; height: 100%; object-fit: cover;
  position: absolute; inset: 0;
}
/* Art grid placeholder (fallback when no cover image) */
.art-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; opacity: 0.3; padding: 2rem; }
.art-cell { border-radius: 3px; aspect-ratio: 1; }
.af-body { padding: 2rem; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.af-eyebrow { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent2); }
.af-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.af-meta-item { font-family: var(--font-mono); font-size: 11px; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.af-title { font-family: var(--font-display); font-size: clamp(1.1rem,2.5vw,1.45rem); font-weight: 700; color: var(--text); line-height: 1.25; }
.af-excerpt { font-size: 13px; color: var(--text2); line-height: 1.7; }
.af-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.af-read {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; background: none; border: none; padding: 0;
  transition: gap 0.2s; text-decoration: none;
}
.af-read:hover { gap: 10px; }

/* ── ARTICLES GRID (2-col — home + blog) ─────────────────────────── */
.articles-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.ag-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg2);
  cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.ag-card:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.ag-img { min-height: 180px; background: var(--bg3); display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.ag-img img { width:100%; height:100%; object-fit:cover; position:absolute; inset:0; }
.ag-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ag-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ag-title { font-family: var(--font-display); font-size: clamp(0.95rem,2vw,1.1rem); font-weight: 700; color: var(--text); line-height: 1.3; }
.ag-excerpt { font-size: 13px; color: var(--text2); line-height: 1.65; flex: 1; }
.ag-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 6px; }

/* Cover image placeholders */
.cover-no-img { background: linear-gradient(135deg, var(--bg) 0%, var(--bg3) 100%); }
.cover-database, .cover-architecture, .cover-tutorial { background: linear-gradient(135deg, var(--bg) 0%, #1a2840 100%); }
.cover-streaming, .cover-kafka, .cover-data, .cover-dataengineering { background: linear-gradient(135deg, var(--bg) 0%, #1a2d2a 100%); }
.cover-cloud, .cover-gcp, .cover-aws { background: linear-gradient(135deg, var(--bg) 0%, #1a1f35 100%); }
.cover-placeholder-icon { opacity: 0.12; }

/* ── CTA SECTION ──────────────────────────────────────────────────── */
.cta-section {
  margin: clamp(2rem,5vw,3rem) 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(2rem,5vw,3.5rem);
  text-align: center; transition: background 0.3s;
}
.cta-title { font-family: var(--font-display); font-size: clamp(1.6rem,4vw,2.5rem); font-weight: 700; color: var(--text); margin-bottom: 0.75rem; }
.cta-sub { font-size: 14px; color: var(--text2); margin-bottom: 1.75rem; }
.cta-links { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── FOOTER ───────────────────────────────────────────────────────── */
footer { padding: 2rem 0; border-top: 1px solid var(--border); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-copy { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }

/* ── PAGE HERO (blog + projects) ──────────────────────────────────── */
.page-hero { padding: clamp(3rem,7vw,5rem) 0 clamp(2rem,4vw,3rem); border-bottom: 1px solid var(--border); }
.page-hero-title { font-family: var(--font-display); font-size: clamp(2rem,5vw,3.5rem); font-weight: 700; color: var(--text); margin: 1rem 0 0.75rem; }
.page-hero-title em { font-style: italic; color: var(--accent); }
.page-hero-sub { font-size: 14px; color: var(--text2); max-width: 480px; line-height: 1.75; }

/* Search */
.search-wrap { position: relative; max-width: 400px; margin-top: 1.5rem; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); }
.search-input {
  width: 100%; padding: 10px 14px 10px 38px;
  background: var(--bg2); border: 1px solid var(--border-md);
  border-radius: 8px; color: var(--text);
  font-family: var(--font-mono); font-size: 12px; outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text3); }

/* ── BLOG CARDS GRID ──────────────────────────────────────────────── */
.blog-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.blog-card {
  background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: var(--shadow); }
.blog-card-img {
  width: 100%; aspect-ratio: 16/9; overflow: hidden;
  background: var(--bg3); flex-shrink: 0; position: relative;
}
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-img-placeholder {
  width: 100%; height: 100%; min-height: 160px;
  display: flex; align-items: center; justify-content: center;
}
.blog-card-body {
  padding: 1.1rem 1.25rem 1.25rem; flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}
.blog-card-meta {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text3);
}
.blog-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.blog-card-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.45; }
.blog-card-excerpt { font-size: 12px; color: var(--text2); line-height: 1.65; flex: 1; }
.blog-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.blog-card-read {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  margin-top: 4px; text-decoration: none;
}
.blog-card:hover .blog-card-read { text-decoration: underline; }

/* ── NEWSLETTER STRIP ─────────────────────────────────────────────── */
.newsletter-strip {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem;
  transition: background 0.3s;
}
.nl-text h3 { font-size: 15px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.nl-text p { font-size: 13px; color: var(--text2); }
.nl-form { display: flex; gap: 8px; flex-wrap: wrap; }
.nl-input {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  background: var(--bg3); border: 1px solid var(--border-md);
  border-radius: 7px; padding: 9px 14px; outline: none;
  transition: border-color 0.2s; min-width: 200px;
}
.nl-input::placeholder { color: var(--text3); }
.nl-input:focus { border-color: var(--accent); }

/* ── PROJECT CARDS ────────────────────────────────────────────────── */
.pcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.pcard {
  background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  position: relative; /* needed for overlay */
  color: inherit;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.pcard:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: var(--shadow); }
/* Stretched link overlay — makes the whole card clickable without nesting <a> inside <a> */
.pcard-overlay {
  position: absolute; inset: 0; z-index: 1;
}
/* GitHub / Live links sit above the overlay so they capture their own clicks */
.pcard-icon,
.pcard-ext-link { position: relative; z-index: 2; }
.pcard-img {
  width: 100%; height: 180px; flex-shrink: 0;
  overflow: hidden; background: var(--bg3); position: relative;
}
.pcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.bar-viz { display: flex; gap: 5px; align-items: flex-end; }
.bar { border-radius: 3px 3px 0 0; width: 9px; background: var(--border-md); transition: background 0.3s; }
.pcard:hover .bar { background: var(--accent); opacity: 0.6; }
.pcard-body { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.pcard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pcard-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.3; }
.pcard-icon { color: var(--text3); flex-shrink: 0; display: flex; align-items: center; transition: color 0.2s; }
.pcard:hover .pcard-icon { color: var(--text2); }
.pcard-desc { font-size: 12px; color: var(--text2); line-height: 1.65; flex: 1; }
.pcard-link {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent);
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
}
.pcard:hover .pcard-link { text-decoration: underline; }

/* ── READING PROGRESS BAR ─────────────────────────────────────────── */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent); width: 0; z-index: 200;
  transition: width 0.1s linear;
}

/* ── BLOG POST / PROJECT DETAIL ───────────────────────────────────── */
.post-wrap { max-width: 800px; margin: 0 auto; padding: clamp(1.5rem,4vw,3rem) clamp(1rem,5vw,3rem) 5rem; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--accent); text-decoration: none; margin-bottom: 2rem; text-transform: uppercase; }
.back-link:hover { text-decoration: underline; }
.post-hero { width: 100%; max-height: 480px; object-fit: cover; border-radius: var(--radius); display: block; margin-bottom: 2rem; }
.post-title { font-family: var(--font-display); font-size: clamp(1.8rem,5vw,3rem); font-weight: 700; line-height: 1.1; margin-bottom: 1.25rem; color: var(--text); }
.post-meta { display: flex; align-items: center; gap: 20px; color: var(--text3); font-family: var(--font-mono); font-size: 11px; margin-bottom: 1.25rem; }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2.5rem; }
.post-tag { font-family: var(--font-mono); font-size: 11px; color: var(--text3); border: 1px solid var(--border); border-radius: 4px; padding: 3px 10px; display: inline-flex; align-items: center; gap: 5px; }
.post-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding-top: 2rem; }

.project-summary { color: var(--text2); font-size: 1rem; line-height: 1.8; margin-bottom: 2rem; }
.project-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); text-decoration: none; font-family: var(--font-mono); font-size: 12px; }
.project-link:hover { text-decoration: underline; }

.post-content h2        { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--text); }
.post-content h3        { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--accent); margin: 2rem 0 0.75rem; }
.post-content p         { color: var(--text2); line-height: 1.85; margin-bottom: 1.25rem; font-size: 15px; }
.post-content ul,
.post-content ol        { color: var(--text2); line-height: 1.8; margin: 0 0 1.25rem 1.5rem; font-size: 15px; }
.post-content li        { margin-bottom: 6px; }
.post-content li strong { color: var(--text); font-weight: 600; }
.post-content pre       { background: var(--bg2); border: 1px solid var(--border-md); border-left: 3px solid var(--accent); border-radius: 8px; padding: 1.25rem; overflow-x: auto; margin-bottom: 1.25rem; }
.post-content code      { font-family: var(--font-mono); font-size: 13px; color: var(--accent2); }
.post-content blockquote { border-left: 3px solid var(--accent); padding: 12px 20px; margin: 1.5rem 0; color: var(--text2); font-style: italic; background: var(--bg2); border-radius: 0 8px 8px 0; }
.post-content hr        { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.post-content a         { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content img       { max-width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.post-content strong    { color: var(--text); font-weight: 600; }

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-layout { grid-template-columns: 1fr; }
  .hero-terminal { display: none; }
  .articles-featured { grid-template-columns: 1fr; }
  .af-img { min-height: 220px; max-height: 280px; }
  .articles-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .hamburger { display: flex; }
  .home-two-col { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .blog-cards, .pcard-grid { grid-template-columns: 1fr; }
  .newsletter-strip { flex-direction: column; align-items: flex-start; }
  .nl-input { min-width: 100%; }
}
