/* ===========================
   Custom Properties (Tokens)
   =========================== */
:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --max-width: 960px;
  --radius: 10px;
  --transition: 0.2s ease;

  /* Light theme */
  --bg: #ffffff;
  --bg-alt: #f8f9fb;
  --surface: #ffffff;
  --text: #1a1a2e;
  --text-muted: #555770;
  --border: #e2e4ea;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff4ff;
  --highlight: #2563eb;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-alt: #161822;
  --surface: #1c1e2d;
  --text: #e4e5ed;
  --text-muted: #9395a5;
  --border: #2a2c3e;
  --accent: #5b8def;
  --accent-hover: #7ba4f7;
  --accent-subtle: #1a2240;
  --highlight: #5b8def;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1117;
    --bg-alt: #161822;
    --surface: #1c1e2d;
    --text: #e4e5ed;
    --text-muted: #9395a5;
    --border: #2a2c3e;
    --accent: #5b8def;
    --accent-hover: #7ba4f7;
    --accent-subtle: #1a2240;
    --highlight: #5b8def;
  }
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background var(--transition), color var(--transition);
}

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

img { max-width: 100%; height: auto; display: block; }

/* ===========================
   Layout
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

main > :nth-child(even of .section) {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
}

.section-cta {
  margin-top: 2rem;
  color: var(--text-muted);
}
.section-cta a { font-weight: 500; }

/* ===========================
   Navigation
   =========================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); }

/* ===========================
   Theme Toggle
   =========================== */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), border-color var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }

[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
}

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

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text-muted);
}
.btn-secondary:hover {
  border-color: var(--text);
  color: var(--text);
}

/* ===========================
   Hero
   =========================== */
.hero {
  padding: 5rem 0 4rem;
  background: var(--bg-alt);
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text { flex: 1; }

.hero-greeting {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

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

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 500px;
}

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

.hero-image img {
  width: 280px;
  height: 280px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--border);
  transition: border-color var(--transition);
}

/* ===========================
   Cards
   =========================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.08);
}

.card-icon {
  color: var(--accent);
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===========================
   Timeline
   =========================== */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: calc(0.45rem + 5px);
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  position: absolute;
  left: -1.55rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}

.timeline-meta {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.timeline-content p:last-child {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===========================
   Timeline Bullets
   =========================== */
.timeline-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.timeline-bullets li {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-left: 1rem;
  position: relative;
}

.timeline-bullets li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===========================
   Skills
   =========================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

.skill-group-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===========================
   Blog / Posts
   =========================== */
.post-list {
  display: grid;
  gap: 1.25rem;
}

.post-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.post-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
  color: var(--text);
}
.post-card time {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.post-card h3 {
  font-size: 1.15rem;
  margin: 0.35rem 0 0.4rem;
}
.post-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Blog listing page */
.blog-header {
  padding: 3rem 0 1rem;
}
.blog-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Single post */
.post {
  padding: 3rem 0 5rem;
  max-width: 680px;
  margin: 0 auto;
}
.post h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.post-date {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}
.post-body h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.post-body h3 { font-size: 1.25rem; margin: 1.5rem 0 0.5rem; }
.post-body p { margin-bottom: 1.25rem; }
.post-body ul, .post-body ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post-body code {
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-body pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-body pre code {
  background: none;
  padding: 0;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.post-body img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* ===========================
   CTA Section
   =========================== */
.cta-section {
  text-align: center;
}
.cta-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.cta-section p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.cta-section .hero-actions {
  justify-content: center;
}

/* ===========================
   Footer
   =========================== */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  transition: border-color var(--transition);
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.footer-links a:hover { color: var(--text); }

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
  .hero { padding: 3rem 0 2rem; }

  .hero-content {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
  }

  .hero h1 { font-size: 1.85rem; }
  .hero-sub { max-width: 100%; }
  .hero-actions { justify-content: center; }

  .hero-image img { width: 180px; height: 180px; }

  .section { padding: 3.5rem 0; }
  .section-title { font-size: 1.5rem; }

  .footer-inner { flex-direction: column; gap: 0.75rem; }
  .footer-links { flex-wrap: wrap; justify-content: center; }

  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.85rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .nav-links { gap: 0.75rem; }
}
