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

:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --border: #242424;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #2854c5;
  --accent-light: #4f76e8;
  --radius: 12px;
  --max-w: 860px;
  --nav-bg: rgba(13, 13, 13, 0.85);
}

html[data-theme="light"] {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e4e4e0;
  --text: #111110;
  --muted: #777772;
  --accent: #2854c5;
  --accent-light: #1e45b0;
  --nav-bg: rgba(247, 247, 245, 0.85);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

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

/* ─── Nav ───────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  transition: color 0.2s;
}

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

.btn-contact {
  background: var(--accent);
  color: #fff !important;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.btn-contact:hover { background: var(--accent-light) !important; }

.nav-contact {
  position: relative;
}

.contact-dropdown::before {
  content: '';
  position: absolute;
  top: -0.75rem;
  left: 0;
  right: 0;
  height: 0.75rem;
}

.contact-dropdown {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem;
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.nav-contact:hover .contact-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ─── Theme Toggle ───────────────────────────────────────────────────────────── */
.btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.btn-theme:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--surface);
}

/* ─── Main ───────────────────────────────────────────────────────────────────── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

section {
  padding-top: 80px;
}

#experience {
  padding-top: 40px;
}

#projects, #community, #education {
  padding-top: 40px;
}

.section-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 2rem;
}

/* ─── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding-top: 80px;
  padding-bottom: 20px;
}

.hero-text { flex: 1; }

.greeting-hello {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.hero-name {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.15rem;
  line-height: 1.1;
}

.hero-tagline {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.tagline-text {
  color: var(--accent-light);
  font-weight: 500;
  transition: opacity 0.4s ease;
}

.tagline-text.fade-out {
  opacity: 0;
}

.hero-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 1.25rem;
}

h1 em {
  font-style: italic;
  color: var(--accent-light);
}

.hero-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 1.5rem;
}

.hero-sub a {
  color: inherit;
  text-decoration: underline;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0 22px;
  height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-light);
  text-decoration: none;
}

.btn-ghost {
  color: var(--muted);
  padding: 0 22px;
  height: 42px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--muted);
  text-decoration: none;
}

mark {
  background: #3d2e0a;
  color: #e8c97a;
  border-radius: 3px;
  padding: 0 3px;
}

html[data-theme="light"] mark {
  background: #fef08a;
  color: #713f12;
}

.hero-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 13px;
  color: var(--muted);
}

.hero-image {
  flex-shrink: 0;
  width: 220px;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: grayscale(20%);
}

/* ─── Experience Cards ───────────────────────────────────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

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

.exp-card .timeline-period {
  display: block;
  margin-bottom: 0.5rem;
}

.exp-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.exp-card h3 a { color: var(--accent-light); }


.timeline-meta {
  padding-top: 2px;
}

.timeline-period {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-content h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.company {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.company-note {
  font-weight: 400;
  opacity: 0.7;
}

.timeline-content ul {
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.timeline-content ul li {
  margin-bottom: 0.5rem;
}

.timeline-content ul li:last-child { margin-bottom: 0; }

.timeline-content strong { color: var(--text); font-weight: 500; }

.timeline-content a { color: var(--accent-light); }

.exp-details { margin-top: 0.5rem; }

.exp-summary {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
}

.exp-toggle {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-light);
  margin-left: 2px;
}

.exp-body {
  padding-left: 1.2em;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  margin-top: 0.75rem;
}

.exp-body li { margin-bottom: 0.5rem; }
.exp-body li:last-child { margin-bottom: 0; }

.role-separator { color: var(--muted); font-weight: 300; }

.timeline-summary {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.timeline-summary:last-child { margin-bottom: 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-header .section-title {
  margin-bottom: 0;
}

/* ─── Skills ────────────────────────────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.skill-group h4 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

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

.tags span {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 6px;
}

/* ─── Projects ─────────────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

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

.project-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.project-link {
  font-size: 13px;
  color: var(--accent-light);
  font-weight: 500;
}

.project-link:hover { text-decoration: none; opacity: 0.8; }

.project-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── Community ────────────────────────────────────────────────────────────── */
.community-rows {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.community-row-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.community-row-item h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.community-row-item > p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.community-row-item strong { color: var(--text); font-weight: 500; }

.community-articles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.article-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.2s;
}

.article-link:hover {
  border-color: var(--accent-light);
  text-decoration: none;
}

.article-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.article-meta {
  font-size: 12px;
  color: var(--muted);
}

/* ─── Education ─────────────────────────────────────────────────────────────── */
.education-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.education-row h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.education-row .timeline-period {
  display: flex;
  align-items: center;
}

.education-row .company {
  margin-bottom: 0;
}

/* ─── Contact ───────────────────────────────────────────────────────────────── */
.contact-row {
  display: inline-flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.fan-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-light);
}

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

.fan-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 16px;
  height: 38px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transition: background 0.2s;
}

.fan-btn:hover {
  background: var(--border);
  text-decoration: none;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  font-size: 13px;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--text); text-decoration: none; }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  nav { padding: 0 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a:not(.btn-contact) { display: none; }

  main { padding: 0 1rem 4rem; }

  .hero {
    flex-direction: column-reverse;
    gap: 2rem;
    padding-top: 2.5rem;
  }

  .hero-image {
    width: 120px;
    height: 140px;
    align-self: center;
  }

  .community-row-item { flex-direction: column; gap: 1rem; }
  .community-row-header { flex: none; }

  .btn-primary, .btn-ghost {
    padding: 8px 14px;
    font-size: 13px;
  }

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

  .education-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .footer-inner { flex-direction: column; gap: 1rem; text-align: center; }
}
