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

:root {
  --bg: #fbfafb;
  --card: #fffefe;
  --ink: #111111;
  --muted: #6b6863;
  --link: #4a90d9;
  --link-hover: #2563b0;
  --border: rgba(0, 0, 0, 0.07);
  --tag-bg: #ece9e2;
  --tag-border: #d9d4cb;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --col: 600px;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

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

/* ── Nav ────────────────────────────────────────────────── */
nav {
  padding: 22px 0 18px;
  display: flex;
  gap: 18px;
  font-size: 14px;
}

nav a {
  color: var(--muted);
  transition: color 0.15s;
}

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

nav a.active {
  font-weight: 500;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  padding: 12px 0 32px;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.hero-name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.hero-tagline {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.hero-bio {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.7;
}

/* ── Sections ───────────────────────────────────────────── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.2px;
  margin-bottom: 16px;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}

.card:last-child {
  margin-bottom: 0;
}

.card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

/* Card icons */
.card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* ensures the img respects border-radius */
  background: var(--tag-border);
  /* subtle background for missing images */
}

.card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-icon.purple {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
}

.card-icon.blue {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.card-icon.teal {
  background: linear-gradient(135deg, #34d399, #059669);
}

.card-icon.orange {
  background: linear-gradient(135deg, #fb923c, #ea580c);
}

.card-icon.pink {
  background: linear-gradient(135deg, #f472b6, #db2777);
}

.card-icon.slate {
  background: linear-gradient(135deg, #94a3b8, #475569);
}

.card-icon.amber {
  background: linear-gradient(135deg, #fbbf24, #d97706);
}

.card-icon.red {
  background: linear-gradient(135deg, #f87171, #dc2626);
}

.card-icon.indigo {
  background: linear-gradient(135deg, #818cf8, #4f46e5);
}

.card-icon.cyan {
  background: linear-gradient(135deg, #22d3ee, #0891b2);
}

.card-icon svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-meta {
  flex: 1;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.card-title a {
  color: var(--link);
  font-weight: 500;
}

.card-date {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* Bullet lists inside cards */
.card ul {
  padding-left: 16px;
  margin-top: 4px;
}

.card li {
  font-size: 14px;
  color: #333;
  line-height: 1.65;
  margin-bottom: 6px;
}

.card li:last-child {
  margin-bottom: 0;
}

/* ── Tech tags ──────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  font-size: 12px;
  color: #444;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  padding: 3px 8px;
  line-height: 1.5;
}

/* ── Prose / text blocks ────────────────────────────────── */
.prose {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.75;
}

.connect-text {
  font-size: 15px;
  color: var(--ink);
  line-height: 1.65;
  margin-bottom: 12px;
}

.connect-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.connect-links a {
  color: var(--link);
  text-decoration: underline;
  font-weight: 500;
  font-size: 15px;
}

.connect-links a:hover {
  color: var(--link-hover);
}

/* ── Posts tab ──────────────────────────────────────────── */
.posts-header {
  padding: 8px 0 28px;
}

.post-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s ease;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.post-item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.post-item:last-child {
  margin-bottom: 0;
}

.post-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.post-body {
  flex: 1;
}

.post-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--link);
  line-height: 1.4;
  display: block;
}

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

.post-date {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── View switching ─────────────────────────────────────── */
#view-home,
#view-projects,
#view-posts {
  display: none;
}

#view-home.active,
#view-projects.active,
#view-posts.active {
  display: block;
}

/* ── Scroll fade-in ─────────────────────────────────────── */
.fade {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade.in {
  opacity: 1;
  transform: translateY(0);
}

/* ── Footer ─────────────────────────────────────────────── */
.footer-space {
  height: 60px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero-name {
    font-size: 19px;
  }

  .card {
    padding: 16px 18px;
  }
}