/* --- Variables: deep blue + amber/teal palette --- */
:root {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --text: #e6edf3;
  --text-muted: #8b9eb5;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --teal: #2dd4bf;
  --purple-ink: #e9e2ff;
  --red-ink: #ffe4e6;
  --red-bg: rgba(248, 113, 113, 0.14);
  --red-border: rgba(248, 113, 113, 0.35);
  --border: #2d3a4a;
  --max-width: 42rem;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", system-ui, sans-serif;
  --radius: 0.5rem;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); margin: 0; }
h2 {
  font-size: 1.25rem;
  color: var(--accent);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--border);
}
h3 { font-size: 1.1rem; margin: 0 0 0.25rem; }
p { margin: 0 0 0.75rem; }
p:last-child { margin-bottom: 0; }
a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
  animation: heroSlide 0.8s ease-out both;
}
.hero__avatar {
  display: block;
  width: 10rem;   /* was 160px */
  height: 10rem;  /* was 160px */
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  box-shadow: var(--shadow);
  animation: heroSlide 0.8s ease-out 0.1s both;
}
.hero__name { animation: heroSlide 0.6s ease-out 0.2s both; }
.hero__tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 32ch;
  margin: 0.5rem auto 1.25rem;
  animation: heroSlide 0.6s ease-out 0.35s both;
}
.hero__links {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: heroSlide 0.6s ease-out 0.4s both;
}
.hero__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hero__links-icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
}
.hero__links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

@keyframes heroSlide {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Sections: staggered reveal --- */
.about { animation: sectionIn 0.6s ease-out 0.5s both; }
.experience { animation: sectionIn 0.6s ease-out 0.6s both; }
.education { animation: sectionIn 0.6s ease-out 0.7s both; }
.projects { animation: sectionIn 0.6s ease-out 0.8s both; }

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- About --- */
.about p { color: var(--text-muted); }

/* --- Experience --- */
.experience__item {
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.experience__item:hover {
  border-color: rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.experience__meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.experience__employer { margin-bottom: 0.5rem; }
.experience__employer a { font-weight: 500; }

/* --- Education --- */
.education__institution { margin-bottom: 0.5rem; }
.education__list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}
.education__list li { margin-bottom: 0.5rem; }

/* --- Projects grid --- */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.project-card {
  display: block;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(45, 212, 191, 0.5);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
}
.project-card__title { color: var(--text); }
.project-card__tech {
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0.2rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.project-card__desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  height: 1.35rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  /* Uniform glow: same geometry + opacity for every badge, tinted per-hue. */
  box-shadow: 0 0 0 1px rgba(var(--glow-rgb, 148, 163, 184), 0.14),
              0 8px 20px rgba(var(--glow-rgb, 148, 163, 184), 0.17);
}
.badge--fun {
  --glow-rgb: 236, 72, 153;
  color: #ffe4f5;
  background: rgba(236, 72, 153, 0.3);
  border-color: rgba(236, 72, 153, 0.7);
}
.badge--lang {
  --glow-rgb: 148, 163, 184;
  color: #e5f0ff;
  background: rgba(148, 163, 184, 0.28);
  border-color: rgba(148, 163, 184, 0.7);
}
.badge--live {
  --glow-rgb: 248, 113, 113;
  color: var(--red-ink);
  background: var(--red-bg);
  border-color: var(--red-border);
}
.badge--ml {
  --glow-rgb: 245, 158, 11;
  color: #fffbeb;
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
}
.badge--audio {
  --glow-rgb: 59, 130, 246;
  color: #e0f2fe;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.55);
}
.badge--cv {
  --glow-rgb: 132, 204, 22;
  color: #ecfeff;
  background: rgba(190, 242, 100, 0.30);
  border-color: rgba(132, 204, 22, 0.85);
}
.badge--emg {
  --glow-rgb: 167, 139, 250;
  color: var(--purple-ink);
  background: rgba(167, 139, 250, 0.24);
  border-color: rgba(167, 139, 250, 0.65);
}
.badge--dataset {
  --glow-rgb: 34, 197, 166;
  color: #ecfeff;
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(34, 197, 166, 0.65);
}
.badge--lego {
  --glow-rgb: 239, 68, 68;
  color: #fef3c7;
  background: rgba(239, 68, 68, 0.26);
  border-color: rgba(239, 68, 68, 0.7);
}
.badge--sdk {
  --glow-rgb: 249, 115, 22;
  color: #ffedd5;
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.6);
}
.badge--android {
  --glow-rgb: 61, 220, 132;
  color: #d7f7e6;
  background: rgba(61, 220, 132, 0.18);
  border-color: rgba(61, 220, 132, 0.6);
}

/* --- Responsive --- */
@media (max-width: 40em) {        /* was 640px */
  main { padding: 1.5rem 1rem 3rem; }
  .hero { padding: 1.5rem 0 2rem; }
  .hero__avatar { width: 7.5rem; height: 7.5rem; margin-bottom: 1rem; } /* was 120px */
  .projects__grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .experience__item { padding: 1rem; }
  h2 { margin-top: 2rem; }
}

@media (min-width: 56.25em) {     /* was 900px */
  main { max-width: 48rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero, .hero__avatar, .hero__name, .hero__tagline, .hero__links,
  .about, .experience, .education, .projects { animation: none; }
}