:root {
  --bg: #0b1120;
  --bg-alt: #111a2e;
  --card: #152038;
  --border: #22314f;
  --text: #e6ebf5;
  --muted: #9aa6bf;
  --accent: #4f9dff;
  --accent-2: #7c5cff;
  --radius: 14px;
  --max: 1080px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

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

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

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

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 17, 32, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-size: 1.4rem; font-weight: 800; color: var(--text); letter-spacing: 1px; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; }

/* Hero */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  min-height: calc(100vh - 64px);
  padding-top: 48px;
  padding-bottom: 48px;
}
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: 1px; }
h1 { font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: 1.1; margin: 6px 0 8px; }
.hero-title {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { color: var(--muted); font-size: 1.1rem; max-width: 560px; margin: 18px 0 28px; }

.hero-photo img,
.avatar-fallback {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: 0 0 0 8px rgba(79, 157, 255, .08), 0 20px 50px rgba(0, 0, 0, .4);
  object-fit: cover;
}
.avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  background: var(--bg-alt);
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--accent); }
.btn.primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: transparent; }

.socials { display: flex; gap: 14px; margin-top: 28px; }
.socials a { color: var(--muted); }
.socials a:hover { color: var(--text); }
.socials svg { width: 26px; height: 26px; fill: currentColor; }

/* Sections */
.section { padding-top: 88px; padding-bottom: 24px; }
.section-title { font-size: 1.9rem; margin-bottom: 8px; }
.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section-intro { color: var(--muted); margin: 18px 0 28px; max-width: 640px; }
.muted { color: var(--muted); }
.center { display: flex; justify-content: center; margin-top: 32px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; margin-top: 28px; }
.about-grid p { color: var(--muted); margin-bottom: 16px; }
.facts { list-style: none; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.facts li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.facts li:last-child { border-bottom: 0; }
.facts span { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 18px; margin-top: 28px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { font-size: 1.05rem; margin-bottom: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .88rem;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(79, 157, 255, .1);
  border: 1px solid rgba(79, 157, 255, .25);
  color: #cfe2ff;
}

/* Experience */
.timeline { position: relative; margin-top: 28px; padding-left: 28px; border-left: 2px solid var(--border); }
.job { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 22px; }
.job::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 28px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 4px var(--bg);
}
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; }
.job-head h3 { font-size: 1.15rem; }
.job-date { color: var(--accent); font-size: .9rem; font-weight: 600; }
.job-company { color: var(--muted); font-size: .95rem; margin: 2px 0 12px; }
.job ul, .project ul:not(.chips) { padding-left: 18px; color: var(--muted); }
.job li, .project li { margin-bottom: 6px; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; margin-top: 28px; }
.project { display: flex; flex-direction: column; }
.project h3 { font-size: 1.15rem; margin-bottom: 10px; }
.project > p { color: var(--muted); margin-bottom: 12px; }
.project ul:not(.chips) { flex: 1; margin-bottom: 16px; }
.subsection-title { font-size: 1.25rem; margin: 48px 0 18px; }

/* Education */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; margin-top: 28px; }
.edu-grid h3 { font-size: 1.1rem; margin-bottom: 4px; }
.edu-grid .job-company { margin-bottom: 4px; }
.edu-grid .job-date { display: block; margin-bottom: 10px; }

.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.repo {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .15s, border-color .15s;
}
.repo:hover { transform: translateY(-3px); border-color: var(--accent); }
.repo h3 { font-size: 1.1rem; margin-bottom: 8px; word-break: break-word; }
.repo h3 a { color: var(--text); }
.repo p { color: var(--muted); font-size: .95rem; flex: 1; margin-bottom: 16px; }
.repo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; font-size: .85rem; color: var(--muted); }
.repo-meta .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.repo-meta a { margin-left: auto; }

/* Contact & footer */
.contact { text-align: center; padding-bottom: 88px; }
.contact .section-title::after { margin-left: auto; margin-right: auto; }
.contact .section-intro { margin-left: auto; margin-right: auto; }
.footer { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--muted); font-size: .9rem; }

/* Mobile */
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; border-top: 1px solid var(--border); }

  .hero { flex-direction: column-reverse; text-align: center; min-height: auto; padding-top: 40px; }
  .lead { margin-left: auto; margin-right: auto; }
  .actions, .socials { justify-content: center; }
  .hero-photo img, .avatar-fallback { width: 170px; height: 170px; }

  .about-grid { grid-template-columns: 1fr; }
  .timeline { padding-left: 20px; }
  .job { padding: 18px; }
  .job::before { left: -29px; }
  .project-grid, .edu-grid { grid-template-columns: 1fr; }
}
