/* ========== Theme Variables ========== */
:root {
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.1);
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --nav-bg: rgba(248, 250, 252, 0.85);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --surface: #1e293b;
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(15, 23, 42, 0.85);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

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

ul { list-style: none; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* ========== Navigation ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s, background 0.3s;
}

.nav.scrolled { box-shadow: var(--shadow); }

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-menu a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

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

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 2.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}

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

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

.btn-outline {
  border: 2px solid var(--border);
  color: var(--text);
  background: transparent;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-full { width: 100%; justify-content: center; }

/* ========== Sections ========== */
.section { padding: 5rem 0; }
.section-alt { background: var(--bg-alt); transition: background 0.3s; }

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin-top: 0.5rem;
}

/* About */
.about-content { max-width: 720px; }
.about-content p { margin-bottom: 1rem; color: var(--text-secondary); }
.about-content strong { color: var(--text); }

/* ========== Timeline ========== */
.timeline { position: relative; padding-left: 2rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 2.5rem; }

.timeline-marker {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-5px);
}

.timeline-content {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.timeline-header h3 { font-size: 1.15rem; font-weight: 600; }
.timeline-role { color: var(--text-secondary); font-size: 0.9rem; font-style: italic; }

.timeline-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.timeline-content ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.timeline-content li { margin-bottom: 0.25rem; }
.timeline-content li strong { color: var(--text); }

/* ========== Cards ========== */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.cards-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.card-header h3 { font-size: 1.15rem; font-weight: 600; }
.card-role { color: var(--text-secondary); font-size: 0.9rem; font-style: italic; }

.card-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.card ul {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card li { margin-bottom: 0.25rem; }
.card li strong { color: var(--text); }

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

.skill-group h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
}

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

.tag {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid transparent;
}

.tag small { font-weight: 400; opacity: 0.8; }

.tag-accent {
  background: transparent;
  border-color: var(--accent);
}

.tag-muted {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ========== Blog ========== */
.blog-page { padding-top: 7rem; min-height: 80vh; }

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.page-subtitle { color: var(--text-secondary); margin-bottom: 3rem; font-size: 1.1rem; }

.blog-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-secondary);
}

.blog-empty svg { margin-bottom: 1.5rem; opacity: 0.4; }
.blog-empty h3 { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--text); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.blog-card {
  display: block;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s;
  color: var(--text);
}

.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); color: var(--text); }
.blog-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.blog-card p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1rem; }

.blog-date { font-size: 0.8rem; color: var(--accent); font-weight: 500; }
.blog-read-more { font-size: 0.9rem; color: var(--accent); font-weight: 500; }

.blog-view-all { text-align: center; margin-top: 2.5rem; }

/* ========== Contact ========== */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 400px; }

.contact-links { display: flex; flex-direction: column; gap: 0.75rem; }

.contact-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.contact-links a:hover { color: var(--accent); }

.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, background 0.3s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ========== Footer ========== */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ========== Scroll Reveal ========== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .timeline { padding-left: 1.5rem; }

  .timeline-header { flex-direction: column; }
  .timeline-meta { text-align: left; flex-direction: row; gap: 0.5rem; }

  .card-header { flex-direction: column; }
  .card-meta { text-align: left; flex-direction: row; gap: 0.5rem; }

  .cards-grid-2 { grid-template-columns: 1fr; }

  .contact-wrapper { grid-template-columns: 1fr; gap: 2rem; }

  .hero-name { font-size: 2.2rem; }
}
