/* === DARK MODE TOKENS (default) === */
:root {
  --bg:        #0d0f14;
  --surface:   #161b27;
  --surface2:  #1e2436;
  --border:    #2a3148;
  --accent:    #5eead4;
  --accent2:   #a5b4fc;
  --text:      #f0f4ff;        /* brighter — was e2e8f0 */
  --body:      #c8d0e8;        /* body text — replaces muted for paragraphs */
  --muted:     #7e8fad;        /* still used for meta/dates, but lighter */
  --tag-bg:    #1e2436;
  --tag-text:  #a0aec0;
  --radius:    6px;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
  --sans:      'Inter', system-ui, sans-serif;
  --max-w:     740px;          /* tighter — better line length for reading */
}

/* === LIGHT MODE TOKENS === */
[data-theme="light"] {
  --bg:        #f8f9fc;
  --surface:   #ffffff;
  --surface2:  #f0f2f8;
  --border:    #dde2ef;
  --accent:    #0d9488;        /* darker teal — readable on white */
  --accent2:   #6366f1;
  --text:      #0f172a;
  --body:      #334155;
  --muted:     #64748b;
  --tag-bg:    #f0f2f8;
  --tag-text:  #475569;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* === LAYOUT === */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;          /* more breathing room */
}

/* === THEME TOGGLE === */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-dark { display: inline; }
.theme-toggle .icon-light { display: none; }
[data-theme="light"] .theme-toggle .icon-dark { display: none; }
[data-theme="light"] .theme-toggle .icon-light { display: inline; }

/* === PROFILE === */
.profile-section {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.profile-avatar {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 24px rgba(94,234,212,0.12);
}

.profile-avatar-placeholder {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  line-height: 1.4;
  padding: 0.5rem;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
  font-family: var(--mono);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.profile-name .cursor {
  display: inline-block;
  width: 2px;
  height: 1.35em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1.2s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.profile-tagline {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0.35rem 0 1rem;
  letter-spacing: 0.03em;
}

.profile-bio {
  font-size: 1rem;             /* up from 0.95 */
  color: var(--body);          /* was muted — now readable */
  line-height: 1.8;
}

/* === SOCIAL LINKS === */
.social-links {
  display: flex;
  gap: 0.65rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--tag-text);
  font-size: 0.8rem;
  font-family: var(--mono);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface2);
  text-decoration: none;
}
.social-link svg { width: 14px; height: 14px; fill: currentColor; }

/* === SKILLS === */
.skills-section {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.skills-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; }

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}
.skill-chip:hover { border-color: var(--accent2); transform: translateY(-1px); }
.skill-chip .skill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.skill-chip.lang  .skill-dot { background: #5eead4; }
.skill-chip.infra .skill-dot { background: #818cf8; }
.skill-chip.fw    .skill-dot { background: #fb923c; }
[data-theme="light"] .skill-chip.lang  .skill-dot { background: #0d9488; }
[data-theme="light"] .skill-chip.infra .skill-dot { background: #6366f1; }
[data-theme="light"] .skill-chip.fw    .skill-dot { background: #ea580c; }

/* === TAB NAV === */
.tab-nav {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-top: 2.25rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* === TAB PANELS === */
.tab-panel { display: none; padding: 2rem 0; }
.tab-panel.active { display: block; }

/* === SEARCH BAR === */
.search-bar { position: relative; margin-bottom: 1.25rem; }

.search-bar input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem 0.65rem 2.4rem;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.search-bar input::placeholder { color: var(--muted); }
.search-bar input:focus { border-color: var(--accent); }

.search-bar .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* === TAG FILTERS === */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.75rem;
}

.tag-filter {
  padding: 0.25rem 0.75rem;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.73rem;
  font-family: var(--mono);
  color: var(--tag-text);
  cursor: pointer;
  transition: all 0.15s;
}
.tag-filter:hover, .tag-filter.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* === POST CARDS === */
.post-list { display: flex; flex-direction: column; gap: 0.85rem; }

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  transition: border-color 0.2s, transform 0.15s;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.post-card-meta {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.post-card-title {
  font-size: 1.05rem;          /* slightly larger */
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }

.post-card-excerpt {
  font-size: 0.9rem;           /* up from 0.875 */
  color: var(--body);          /* was muted */
  line-height: 1.7;
  margin-bottom: 0.85rem;
}

.post-card-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.post-tag {
  padding: 0.15rem 0.55rem;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--tag-text);
}

.post-card.hidden { display: none; }

/* === RESUME === */
.resume-section { margin-bottom: 2.25rem; }

.resume-section h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.resume-item { margin-bottom: 1.35rem; }

.resume-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.resume-item-title { font-weight: 600; font-size: 0.95rem; color: var(--text); }
.resume-item-sub { font-family: var(--mono); font-size: 0.78rem; color: var(--accent2); }
.resume-item-date { font-family: var(--mono); font-size: 0.73rem; color: var(--muted); }

.resume-item p {
  font-size: 0.9rem;
  color: var(--body);          /* was muted */
  margin-top: 0.35rem;
  line-height: 1.7;
}

/* === FULL POST PAGE === */
.post-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.post-hero-tags { display: flex; gap: 0.4rem; margin-bottom: 1rem; flex-wrap: wrap; }

.post-hero-tag {
  padding: 0.2rem 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--accent);
}

.post-hero-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.post-hero-meta { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }

.post-content { max-width: 660px; }

.post-content h1, .post-content h2, .post-content h3 {
  color: var(--text);
  margin: 2.25rem 0 0.75rem;
  line-height: 1.3;
}
.post-content h2 {
  font-size: 1.3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.post-content h3 { font-size: 1.05rem; color: var(--accent2); }

.post-content p {
  margin-bottom: 1.35rem;
  color: var(--body);          /* was muted — much more readable */
  font-size: 1rem;             /* up from 0.95 */
  line-height: 1.85;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.83em;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--accent);
}

.post-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  overflow-x: auto;
  margin-bottom: 1.75rem;
}
.post-content pre code {
  background: none; border: none; padding: 0;
  color: var(--text); font-size: 0.875rem;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.75rem 0;
  color: var(--body);
  font-style: italic;
}

.post-content ul, .post-content ol {
  margin-bottom: 1.35rem;
  padding-left: 1.5rem;
  color: var(--body);
  font-size: 1rem;
}
.post-content li { margin-bottom: 0.4rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.75rem;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

/* === FOOTER === */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--muted);
}

/* === NO RESULTS === */
.no-results {
  text-align: center;
  padding: 3rem 0;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  display: none;
}

/* === RESPONSIVE === */

/* Tablet: comfortable padding, no layout breaks */
@media (max-width: 768px) {
  .site-wrapper { padding: 0 1.5rem; }
  .tab-btn { padding: 0.65rem 1.1rem; }
}

/* Mobile: stack profile, tighten everything */
@media (max-width: 560px) {
  .site-wrapper { padding: 0 1.1rem; }
  .profile-section { flex-direction: column; gap: 1.25rem; padding: 2.5rem 0 2rem; }
  .profile-name { font-size: 1.35rem; }
  .profile-avatar, .profile-avatar-placeholder { width: 84px; height: 84px; }
  .profile-bio { font-size: 0.95rem; }
  .post-hero-title { font-size: 1.5rem; }
  .tab-btn { padding: 0.6rem 0.9rem; font-size: 0.78rem; }
  .post-card { padding: 1.1rem 1.15rem; }
  .post-content p { font-size: 0.95rem; }
  .theme-toggle { top: 0.85rem; right: 0.85rem; padding: 0.35rem 0.65rem; font-size: 0.72rem; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .profile-name .cursor { animation: none; opacity: 1; }
  * { transition: none !important; }
}

.resume-download {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  transition: background 0.2s, color 0.2s;
}
.resume-download:hover {
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
}