/* ---- Base ---- */
:root {
  --bg: #0b0f1a;
  --bg-alt: #10151f;
  --card: #141a27;
  --card-hover: #171e2d;
  --border: #232b3d;
  --text: #eef1f6;
  --text-dim: #97a1b5;
  --accent: #2dd4bf;
  --accent-strong: #14b8a6;
  --accent-2: #60a5fa;
  --nav-bg: rgba(11, 15, 26, 0.82);
  --shadow: rgba(0, 0, 0, 0.35);
  --max: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
}

:root[data-theme="light"] {
  --bg: #f8f9fb;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --card-hover: #f5f7fa;
  --border: #e2e6ed;
  --text: #171b26;
  --text-dim: #5b6478;
  --accent: #0d9488;
  --accent-strong: #0f766e;
  --accent-2: #2563eb;
  --nav-bg: rgba(255, 255, 255, 0.82);
  --shadow: rgba(15, 23, 42, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background 0.25s, color 0.25s;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

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

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 16px;
  height: 16px;
  flex: none;
  vertical-align: -3px;
  color: currentColor;
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px circle at 12% 8%, rgba(45, 212, 191, 0.08), transparent 60%),
    radial-gradient(620px circle at 88% 24%, rgba(96, 165, 250, 0.08), transparent 60%),
    var(--bg);
}

/* ---- Nav ---- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: #06231f;
  font-size: 0.95rem;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links li { display: flex; align-items: center; }

.nav-links > li > a:not(.btn-nav) {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.nav-links > li > a:not(.btn-nav):hover {
  color: var(--text);
  background: var(--card);
}

.btn-nav {
  background: var(--accent);
  color: #06231f !important;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  margin-left: 8px;
  transition: background 0.2s, transform 0.2s;
}
.btn-nav:hover { background: var(--accent-strong); color: #06231f !important; transform: translateY(-1px); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 6px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--card); }
.theme-toggle .icon { width: 17px; height: 17px; }

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

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  display: block;
  border-radius: 2px;
}

/* ---- Hero ---- */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  padding-top: 96px;
  padding-bottom: 96px;
  flex-wrap: wrap;
}

.hero-text { flex: 1 1 480px; }

.eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.role {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 18px;
}

.tagline {
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 32px;
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #06231f;
}
.btn-primary:hover { background: var(--accent-strong); box-shadow: 0 8px 20px -6px rgba(45, 212, 191, 0.35); }

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

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta a:hover { color: var(--accent); }

.hero-photo { flex: 0 0 auto; }

.photo-ring {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  padding: 4px;
  background: var(--border);
  box-shadow: 0 24px 48px -16px var(--shadow);
}

.photo-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
}

/* ---- Sections ---- */
.section {
  padding: 88px 24px;
  scroll-margin-top: 72px;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-title .num {
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
  font-family: monospace;
}

.about-text {
  color: var(--text-dim);
  max-width: 760px;
  font-size: 1rem;
}

.highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.highlight-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.highlight-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--card-hover);
}
.highlight-card h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.highlight-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
}

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

.skill-group h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

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

.tags span {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--text);
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 26px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -31px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--border);
}

.timeline-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  justify-content: space-between;
}

.timeline-head h3 {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-date {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.timeline-org {
  color: var(--text-dim);
  font-weight: 600;
  margin: 3px 0 12px;
  font-size: 0.9rem;
}

.timeline-note {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
  margin: -4px 0 14px;
}

.timeline-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.timeline-content li {
  color: var(--text-dim);
  font-size: 0.9rem;
  padding-left: 16px;
  position: relative;
}
.timeline-content li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.timeline-content li strong { color: var(--text); }

/* ---- Projects ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--card-hover);
}
.project-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-card h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}
.project-role {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}
.project-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
}
.project-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}
.project-points li {
  color: var(--text-dim);
  font-size: 0.86rem;
  padding-left: 15px;
  position: relative;
}
.project-points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.project-card .tags span {
  font-size: 0.74rem;
  padding: 4px 10px;
  background: var(--bg-alt);
}

.project-link,
.project-link-row {
  display: inline-flex;
}
.project-link-row {
  gap: 16px;
  flex-wrap: wrap;
}
.project-link {
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
}
.project-link:hover { color: var(--accent-strong); }
.project-link .icon { width: 13px; height: 13px; }

/* ---- Education ---- */
.edu-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.edu-lang-grid p { color: var(--text-dim); font-size: 0.88rem; }

/* ---- Contact ---- */
.contact-section { text-align: left; }
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 28px 24px;
  color: var(--text-dim);
  font-size: 0.83rem;
  border-top: 1px solid var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    gap: 4px;
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: 0 16px 24px -12px var(--shadow);
  }
  .nav-links.open { transform: translateY(0); opacity: 1; }
  .nav-links li { width: 100%; }
  .nav-links > li > a:not(.btn-nav) { width: 100%; padding: 12px 10px; }
  .nav-links .btn-nav { margin-left: 0; text-align: center; width: 100%; }
  .nav-toggle { display: flex; }

  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 40px;
    padding-bottom: 56px;
    gap: 32px;
  }
  .hero-text { text-align: center; }
  .tagline { margin: 0 auto 28px; }
  .hero-actions, .hero-meta { justify-content: center; }
  .photo-ring { width: 180px; height: 180px; }

  .section { padding: 56px 20px; }

  .timeline-head { flex-direction: column; align-items: flex-start; }
}
