/* ===== Design tokens ===== */
:root {
  --bg: #0f1117;
  --bg-soft: #161a23;
  --bg-card: #1b202c;
  --text: #e8eaf0;
  --text-muted: #9aa3b5;
  --accent: #4f8cff;
  --accent2: #8b6bff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --border: #262c3a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --header-h: 68px;
  --glow-opacity: 0.22;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-soft: #eef1f6;
  --bg-card: #ffffff;
  --text: #1c2230;
  --text-muted: #5b6474;
  --accent: #2563eb;
  --accent2: #7c4dff;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #dfe4ec;
  --shadow: 0 10px 30px rgba(28, 34, 48, 0.08);
  --glow-opacity: 0.14;
  color-scheme: light;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { overflow-x: clip; }

.container {
  width: min(1080px, 100% - 3rem);
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ===== Header / nav ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--text); background: var(--accent-soft); }

/* Language menu */
.lang-menu { position: relative; }

.lang-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

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

.caret { font-size: 0.7rem; opacity: 0.7; }

.lang-list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  list-style: none;
  padding: 0.4rem;
  display: none;
}

.lang-menu.open .lang-list { display: block; }

.lang-list a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.lang-list a:hover { background: var(--accent-soft); }
.lang-list a.is-current { color: var(--accent); font-weight: 600; }

/* Theme toggle icons */
.theme-icon-light { display: none; }
:root[data-theme="light"] .theme-icon-light { display: inline; }
:root[data-theme="light"] .theme-icon-dark { display: none; }

/* Mobile menu button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  transition: transform 0.25s, opacity 0.25s;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: var(--glow-opacity);
  pointer-events: none;
  z-index: -1;
}

.hero::before {
  width: 480px;
  height: 480px;
  top: 12%;
  right: -6%;
  background: var(--accent);
}

.hero::after {
  width: 380px;
  height: 380px;
  bottom: 4%;
  left: -10%;
  background: var(--accent2);
}

.hero-greeting {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  background: linear-gradient(95deg, var(--text) 55%, var(--accent) 90%, var(--accent2) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text);
}

.hero-title {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.hero-tagline {
  max-width: 560px;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions { display: flex; gap: 0.9rem; margin-top: 2.2rem; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 35%, transparent);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

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

/* ===== Sections ===== */
.section { padding: 5.5rem 0 1rem; }

.section-heading {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.section-heading::after {
  content: "";
  flex: 1;
  max-width: 220px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent), var(--accent2), transparent);
}

.about-text { max-width: 720px; display: grid; gap: 1rem; color: var(--text-muted); font-size: 1.05rem; }

/* Timeline */
.timeline {
  list-style: none;
  border-left: 2px solid var(--border);
  margin-left: 0.4rem;
  display: grid;
  gap: 2rem;
}

.timeline-item {
  position: relative;
  padding-left: 1.75rem;
  display: grid;
  gap: 0.2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-period {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.timeline-body h3 { font-size: 1.15rem; }
.timeline-company { color: var(--text-muted); font-weight: 500; margin-bottom: 0.35rem; }
.timeline-body p { color: var(--text-muted); max-width: 640px; }

.timeline-bullets {
  color: var(--text-muted);
  max-width: 680px;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.35rem;
}

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.edu-card h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.edu-card p { color: var(--text-muted); font-size: 0.92rem; }

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

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}

.skill-group h3 { font-size: 1.02rem; margin-bottom: 0.9rem; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.chips-small li { font-size: 0.78rem; padding: 0.2rem 0.65rem; }

/* Project cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.card h3 { font-size: 1.15rem; }
.card p { color: var(--text-muted); flex: 1; }

.card-icon {
  width: 64px;
  height: 64px;
  border-radius: 22.5%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.card-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.card-link:hover { text-decoration: underline; }

/* Contact */
.section-contact { padding-bottom: 6rem; }
.contact-text { max-width: 560px; color: var(--text-muted); font-size: 1.05rem; }
.contact-actions { display: flex; gap: 0.9rem; margin-top: 1.8rem; flex-wrap: wrap; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.8rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: var(--bg-soft);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Mobile ===== */
@media (max-width: 820px) {
  .menu-toggle { display: flex; }

  .nav-right {
    position: fixed;
    top: var(--header-h);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0 0 0 var(--radius);
    padding: 1rem;
    gap: 0.8rem;
    min-width: 230px;
    box-shadow: var(--shadow);
    transform: translateX(110%);
    transition: transform 0.28s ease;
  }

  .nav.open .nav-right { transform: none; }

  .nav.open .menu-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav.open .menu-toggle span:nth-child(2) { opacity: 0; }
  .nav.open .menu-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav-links { flex-direction: column; }
  .lang-list { position: static; box-shadow: none; margin-top: 0.4rem; }
  .hero { min-height: 88vh; }
}
