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

:root {
  --bg:           #ffffff;
  --bg-soft:      #f8fafc;
  --bg-hover:     #f1f5f9;
  --text:         #0f172a;
  --text-mid:     #475569;
  --text-light:   #94a3b8;
  --text-xlight:  #cbd5e1;
  --accent:       #e84118;
  --accent-soft:  #fff1ee;
  --accent-mid:   #fca58f;
  --border:       #e2e8f0;
  --border-soft:  #f1f5f9;
  --shadow-sm:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:    0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 8px 28px rgba(15, 23, 42, 0.10), 0 3px 10px rgba(15, 23, 42, 0.05);
  --radius:       12px;
  --radius-sm:    8px;
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --nav-h:        58px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── NAV ────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 720px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.accent { color: var(--accent); }

.nav-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.tab-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-mid);
  background: none;
  border: none;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); background: var(--bg-hover); }

.tab-btn.active {
  color: var(--accent);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
}

/* ─── MAIN ───────────────────────────────────────────────── */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 72px 24px 100px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp 0.35s ease both; }

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

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 72px;
}

/* Avatar */
.avatar-wrap {
  position: relative;
  width: 108px;
  height: 108px;
  margin-bottom: 28px;
  animation: heroFadeIn 0.6s ease both;
}

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

.avatar-initials,
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 3px solid var(--bg);
  outline: 2px solid var(--accent-mid);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  object-fit: cover;
}


/* Name & title */
.hero-name {
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 8px;
  animation: heroFadeIn 0.6s 0.1s ease both;
}

.hero-title {
  font-size: 0.97rem;
  font-weight: 400;
  color: var(--text-mid);
  margin-bottom: 10px;
  animation: heroFadeIn 0.6s 0.18s ease both;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 32px;
  animation: heroFadeIn 0.6s 0.24s ease both;
}

.hero-location .icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Social Links */
.social-links {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
  animation: heroFadeIn 0.6s 0.3s ease both;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.social-link svg { width: 17px; height: 17px; }

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent-mid);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Bio */
.bio {
  max-width: 520px;
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 28px;
  animation: heroFadeIn 0.6s 0.36s ease both;
}

/* Skill Cloud */
.skill-cloud-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  align-content: flex-start;
  gap: 8px 14px;
  width: 100%;
  max-width: 560px;
  padding: 4px 0;
  animation: heroFadeIn 0.6s 0.42s ease both;
}

.skill-cloud-wrap span {
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  transition: transform 0.22s ease, color 0.22s ease, opacity 0.22s ease;
  transform-origin: center center;
}

.skill-cloud-wrap span:hover {
  transform: scale(1.12);
  color: #e84118;
  opacity: 1 !important;
}

.skill-cloud-wrap:has(span:hover) span:not(:hover) {
  opacity: 0.28;
}

.tag:hover {
  background: var(--accent-soft);
  border-color: var(--accent-mid);
  color: var(--accent);
}

/* ─── SKILL POPUP ────────────────────────────────────────── */
.skill-popup {
  position: fixed;
  z-index: 500;
  width: 288px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 16px 18px 18px;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.skill-popup.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.skill-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  font-family: var(--font);
}

.skill-popup-close:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.skill-popup-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  padding-right: 22px;
}

.skill-popup-text {
  font-size: 0.83rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin: 0;
}

/* ─── RECENT POSTS (About tab) ──────────────────────────── */
.recent-posts-section {
  margin-bottom: 72px;
}

.recent-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 680px) {
  .recent-posts-grid { grid-template-columns: 1fr; }
}

.recent-post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.recent-post-card:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.recent-post-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.recent-post-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.recent-post-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 8px 0 4px;
}

.recent-post-date {
  font-size: 0.7rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.recent-post-excerpt {
  font-size: 0.79rem;
  color: var(--text-mid);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-posts-footer {
  margin-top: 20px;
  text-align: center;
}

.see-all-btn {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 22px;
  cursor: pointer;
  transition: all 0.18s ease;
}

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

/* ─── SECTION TITLE ──────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 36px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── TIMELINE ───────────────────────────────────────────── */
.timeline-section { animation: heroFadeIn 0.6s 0.5s ease both; }

.timeline {
  display: flex;
  overflow-x: auto;
  position: relative;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scroll-snap-type: x proximity;
}

.timeline::-webkit-scrollbar { height: 3px; }
.timeline::-webkit-scrollbar-track { background: transparent; }
.timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Horizontal connector line — sits at tl-date height (44px) + half dot (6px) = 50px */
.timeline::before {
  content: '';
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, var(--accent-mid) 0%, var(--border) 65%, transparent 100%);
  z-index: 0;
}

/* Timeline Item */
.tl-item {
  flex: 0 0 240px;
  min-width: 0;
  padding-right: 28px;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.tl-item:last-child { padding-right: 0; }

.tl-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.tl-item:nth-child(1) { transition-delay: 0.05s; }
.tl-item:nth-child(2) { transition-delay: 0.13s; }
.tl-item:nth-child(3) { transition-delay: 0.21s; }
.tl-item:nth-child(4) { transition-delay: 0.29s; }
.tl-item:nth-child(5) { transition-delay: 0.37s; }

/* Date sits above the dot */
.tl-date {
  height: 44px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 10px;
  font-size: 0.71rem;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
}

/* Dot sits on the horizontal line */
.tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.tl-item:hover .tl-dot {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Content below the dot */
.tl-content {
  padding-top: 18px;
  flex: 1;
}

.tl-role {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  line-height: 1.35;
}

.tl-company {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 10px;
}

.tl-desc {
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.65;
  margin-bottom: 12px;
}

.tl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tl-tags span {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-light);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 2px 9px;
  border-radius: 4px;
}

/* ─── WORKS & THOUGHTS ───────────────────────────────────── */

/* Empty state (shown when POSTS is empty) */
.works-empty {
  min-height: calc(100vh - var(--nav-h) - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.works-empty-inner { text-align: center; max-width: 480px; }

.works-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 20px;
}

.works-coming {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
}

.works-sub {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.75;
}

.works-sub code {
  font-size: 0.82rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}

/* Post tag chip (shared between cards and detail) */
.post-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-mid);
  padding: 2px 9px;
  border-radius: 4px;
}

/* ── Post cards grid ─────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 560px) { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  border-color: var(--accent-mid);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.post-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--border);
}

.post-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin: 10px 0 4px;
}

.post-card-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 16px;
}

.post-read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  align-self: flex-start;
}

/* ── Post detail view ────────────────────────────────────── */
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-mid);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  margin-bottom: 32px;
  transition: all 0.18s ease;
}

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

.post-detail-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 28px;
  display: block;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-detail-date {
  font-size: 0.78rem;
  color: var(--text-light);
}

.post-detail-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 32px;
}

/* ── Prose (article body) ────────────────────────────────── */
.prose {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 640px;
}

.prose p       { margin-bottom: 1.2em; }
.prose h2      { font-size: 1.25rem; font-weight: 700; color: var(--text); margin: 2em 0 0.6em; letter-spacing: -0.02em; }
.prose h3      { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: 1.6em 0 0.5em; }
.prose strong  { color: var(--text); font-weight: 600; }
.prose em      { font-style: italic; }
.prose a       { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 1.2em; }
.prose li      { margin-bottom: 0.4em; }
.prose blockquote {
  border-left: 3px solid var(--accent-mid);
  padding: 4px 0 4px 18px;
  color: var(--text-mid);
  font-style: italic;
  margin: 1.4em 0;
}
.prose code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--accent);
}
.prose pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 1.4em;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 28px 24px;
  font-size: 0.78rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.footer-sep { color: var(--text-xlight); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 48px 16px 72px; }
  .tl-header { flex-direction: column; gap: 4px; }
  .nav-tabs .tab-btn { padding: 5px 10px; font-size: 0.76rem; }
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ─── SELECTION ──────────────────────────────────────────── */
::selection { background: var(--accent-soft); color: var(--accent); }
