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

:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f6;
  --text: #111111;
  --text-muted: #6b6b6b;
  --text-hint: #999999;
  --border: rgba(0,0,0,0.1);
  --border-hover: rgba(0,0,0,0.2);
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --accent-text: #1d4ed8;
  --purple-bg: #f3f0ff;
  --purple-text: #5b21b6;
  --green-bg: #f0fdf4;
  --green-text: #166534;
  --amber-bg: #fffbeb;
  --amber-text: #92400e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --max-width: 820px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
body.dark-mode {
  --bg: #0f172a;
  --bg-alt: #111827;
  --text: #f3f4f6;
  --text-muted: #cbd5e1;
  --text-hint: #94a3b8;
  --border: rgba(148,163,184,0.2);
  --border-hover: rgba(148,163,184,0.45);
  --accent: #60a5fa;
  --accent-bg: rgba(96,165,250,0.16);
  --accent-text: #bfdbfe;
  --purple-bg: rgba(167,139,250,0.18);
  --purple-text: #ddd6fe;
  --green-bg: rgba(34,197,94,0.16);
  --green-text: #bbf7d0;
  --amber-bg: rgba(251,191,36,0.18);
  --amber-text: #fde68a;
  --shadow-card: 0 8px 18px rgba(2,6,23,0.35);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* =====================
   LAYOUT
   ===================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =====================
   NAV
   ===================== */
nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
body.dark-mode nav {
  background: rgba(15,23,42,0.92);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
}

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

.nav-links {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

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

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: 0.2s;
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-social-link {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  background: var(--bg-alt);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
  text-decoration: none;
}

.theme-toggle {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

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

/* =====================
   HERO
   ===================== */
.hero {
  padding: 64px 0 56px;
  border-bottom: 1px solid var(--border);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--text);
}

.hero-role {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 100%;
  line-height: 1.7;
  margin-bottom: 28px;
  text-align: justify;
}

.hero-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn:hover { text-decoration: none; }

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

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border-hover);
}
.btn-outline:hover { background: var(--bg-alt); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--text); }

/* =====================
   SECTIONS
   ===================== */
.section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

.section-alt { background: var(--bg-alt); }

.section-header {
  margin-bottom: 24px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  line-height: 1;
  color: var(--text);
}

/* =====================
   SKILLS
   ===================== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
}

.skill-group h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-hint);
  margin-bottom: 10px;
}

.skill-group,
.project-card,
.exp-card,
.edu-card,
.contact-card {
  position: relative;
}

.skill-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.skill-group:hover,
.project-card:hover,
.exp-card:hover,
.edu-card:hover,
.contact-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(37,99,235,0.12);
  transform: translateY(-2px);
}

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

.chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg);
  font-weight: 400;
}

.chip-blue {
  background: var(--accent-bg);
  color: var(--accent-text);
  border-color: transparent;
  font-weight: 500;
}

.chip-purple {
  background: var(--purple-bg);
  color: var(--purple-text);
  border-color: transparent;
  font-weight: 500;
}

.chip-green {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: transparent;
  font-weight: 500;
}

.chip-gold {
  background: #fff7d6;
  color: #8a5a00;
  border-color: #f2d27a;
  font-weight: 600;
  text-decoration: none;
}

.chip-gold:hover {
  background: #ffefb3;
  color: #6f4700;
  border-color: #e7bd54;
  text-decoration: none;
}

body.dark-mode .chip-gold {
  background: rgba(250, 204, 21, 0.18);
  color: #fde68a;
  border-color: rgba(250, 204, 21, 0.4);
}

body.dark-mode .chip-gold:hover {
  background: rgba(250, 204, 21, 0.26);
  color: #fef3c7;
}

/* =====================
   PROJECTS
   ===================== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-card);
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 4px;
}

.badge-blue { background: var(--accent-bg); color: var(--accent-text); }
.badge-purple { background: var(--purple-bg); color: var(--purple-text); }
.badge-amber { background: var(--amber-bg); color: var(--amber-text); }

.github-icon {
  color: var(--text-hint);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.github-icon:hover { color: var(--text); text-decoration: none; }

.project-card h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.project-card p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.project-stack span {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-hint);
  background: var(--bg-alt);
}

/* =====================
   EXPERIENCE
   ===================== */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exp-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-left: 24px;
}

.exp-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border-hover));
}

.exp-company-header {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.exp-company-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.exp-company-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-bg);
  border-radius: 999px;
  padding: 4px 10px;
}

.exp-company-header h3 {
  font-size: 14px;
  color: var(--text);
}

.exp-company-header p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.exp-card {
  display: block;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.exp-card::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.exp-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(37,99,235,0.08);
}

.exp-card:hover::before {
  background: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent);
}

.exp-avatar {
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  white-space: nowrap;
}

.exp-right { flex: 1; }

.exp-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.exp-company {
  font-size: 12px;
  color: var(--text-muted);
}

.exp-badge {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-hint);
}

.exp-right h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.exp-right p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 10px;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.exp-tags span {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-hint);
  background: var(--bg-alt);
}

.exp-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.exp-expand-hint {
  font-size: 11px;
  color: var(--text-hint);
  opacity: 0;
  transition: opacity 0.2s;
}

.exp-expand-arrow {
  display: flex;
  justify-content: center;
  color: var(--text-hint);
  transition: transform 0.2s, color 0.2s;
}

.exp-card:hover .exp-expand-hint { opacity: 1; }
.exp-card:hover .exp-expand-arrow { transform: translateY(2px); color: var(--accent); }

/* =====================
   EDUCATION
   ===================== */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edu-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.edu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.edu-top h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.edu-year {
  font-size: 11px;
  color: var(--text-hint);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 999px;
  padding: 3px 9px;
}

.edu-school {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.edu-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =====================
   CONTACT
   ===================== */
.contact-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.contact-text h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.contact-text p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  background: var(--bg-alt);
  transition: all 0.15s;
  text-decoration: none;
}

.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
  text-decoration: none;
}

/* =====================
   FOOTER
   ===================== */
footer {
  padding: 20px 0;
  text-align: center;
}

footer p {
  font-size: 12px;
  color: var(--text-hint);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 600px) {
  .exp-timeline {
    padding-left: 18px;
  }

  .exp-timeline::before {
    left: 6px;
  }

  .exp-card::before {
    left: -14px;
  }

  .theme-toggle {
    order: 2;
    margin-left: auto;
  }

  .nav-social {
    order: 1;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 14px;
    z-index: 99;
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  nav { position: relative; }

  .hero h1 { font-size: 28px; }
  .hero-role { font-size: 15px; }

  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }

  .contact-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =====================
   PROJECT CARD INTERACTIVE
   ===================== */
.project-card { cursor: pointer; position: relative; }

.expand-hint {
  font-size: 11px;
  color: var(--text-hint);
  opacity: 0;
  transition: opacity 0.2s;
}
.project-card:hover .expand-hint { opacity: 1; }

.expand-arrow {
  display: flex;
  justify-content: center;
  color: var(--text-hint);
  margin-top: 4px;
  transition: transform 0.2s, color 0.2s;
}
.project-card:hover .expand-arrow { transform: translateY(2px); color: var(--accent); }

/* =====================
   MODAL
   ===================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--bg);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s;
  z-index: 1;
}
.modal-close:hover { background: #e5e5e5; }
body.dark-mode .modal-close:hover { background: rgba(148,163,184,0.18); }

.modal-content { padding: 28px; }

.modal-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 14px;
}

.modal-content h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}

.modal-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.modal-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-hint);
  margin-bottom: 10px;
}

.modal-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.modal-features li {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}
.modal-features li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.modal-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.modal-stack span {
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  background: var(--bg-alt);
}

.modal-actions {
  display: flex;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
