:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-hover: #263244;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #6366f1;
  --border: #334155;
}

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

html { scroll-behavior: smooth; }

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

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  color: white;
  padding: 100px 0 90px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.4);
  object-fit: cover;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.15);
}

.hero h1 {
  font-size: 2.8em;
  margin-bottom: 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
}

.tagline {
  font-size: 1.25em;
  opacity: 0.95;
  position: relative;
}

.location {
  color: rgba(255,255,255,0.85);
  margin-top: 12px;
  font-size: 0.95em;
  position: relative;
}

.hero-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.hero-links a {
  color: white;
  text-decoration: none;
  margin: 0 4px;
  padding: 6px 14px;
  font-weight: 600;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  transition: all 0.25s ease;
  font-size: 0.95em;
}

.hero-links a:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
  transform: translateY(-2px);
}

/* ===== Main ===== */
main { padding: 50px 0; }

section {
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h2 {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 1.7em;
  font-weight: 700;
  position: relative;
  padding-bottom: 10px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
}

/* ===== About ===== */
#about p {
  font-size: 1.08em;
  color: var(--text);
  margin-bottom: 14px;
}

#about p:last-child { margin-bottom: 0; }

#about strong { color: var(--accent); font-weight: 600; }

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

.timeline-item {
  position: relative;
  margin-bottom: 36px;
  padding-bottom: 10px;
}

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

.timeline-date {
  color: var(--accent);
  font-size: 0.88em;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.timeline-item h3 {
  font-size: 1.25em;
  margin-bottom: 4px;
  color: var(--text);
}

.timeline-item .company {
  color: var(--muted);
  font-size: 0.95em;
  margin-bottom: 10px;
}

.timeline-item ul {
  list-style: none;
  padding-left: 0;
}

.timeline-item li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  color: var(--text);
}

.timeline-item li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ===== Skills ===== */
.skills-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.skills-grid li {
  background: var(--card);
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  transition: all 0.25s ease;
  font-weight: 500;
}

.skills-grid li:hover {
  background: var(--card-hover);
  transform: translateX(4px);
  border-left-width: 6px;
}

/* ===== Projects ===== */
.project {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  transition: all 0.25s ease;
}

.project:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.project h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
}

.project p {
  color: var(--text);
  margin-bottom: 8px;
}

.project .tech {
  color: var(--muted);
  font-size: 0.88em;
  margin: 10px 0 14px;
  font-family: 'SF Mono', Menlo, Monaco, monospace;
}

.project a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  transition: transform 0.2s ease;
}

.project a:hover {
  transform: translateX(4px);
}

/* ===== Certifications ===== */
#certifications ul { list-style: none; }
#certifications li {
  background: var(--card);
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}
#certifications li:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}
#certifications strong { color: var(--accent); }

/* ===== Links & Footer ===== */
a { color: var(--accent); }
a:hover { color: #7dd3fc; }

footer {
  text-align: center;
  color: var(--muted);
  padding: 30px 0;
  border-top: 1px solid var(--border);
  font-size: 0.9em;
}

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

/* ===== Back to top ===== */
#toTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 1.4em;
  font-weight: 700;
  display: none;
  box-shadow: 0 4px 12px rgba(56,189,248,0.4);
  transition: all 0.25s ease;
  z-index: 100;
}

#toTop:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(56,189,248,0.6);
}

/* ===== Languages ===== */
#languages .skills-grid li {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#languages .level {
  color: var(--accent);
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 8px;
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .hero { padding: 70px 0 60px; }
  .hero h1 { font-size: 2em; }
  .tagline { font-size: 1.05em; }
  .avatar { width: 110px; height: 110px; font-size: 2em; }
  .timeline { padding-left: 20px; }
  .timeline-item::before { left: -27px; }
  #toTop { bottom: 20px; right: 20px; width: 42px; height: 42px; }
  h2 { font-size: 1.4em; }
}
