/* ROOT VARIABLES */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --surface: #eaeef2;
  --border: #d0d7de;
  --text: #1f2328;
  --text-muted: #57606a;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-subtle: #ddf4ff;
  --tag-bg: #e8f4fd;
  --tag-text: #0969da;
  --timeline-line: #d0d7de;
  --timeline-dot-work: #0969da;
  --timeline-dot-formation: #1a7f37;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12), 0 8px 32px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --nav-height: 64px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-alt: #161b22;
  --surface: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-subtle: #0d2444;
  --tag-bg: #0d2444;
  --tag-text: #58a6ff;
  --timeline-line: #30363d;
  --timeline-dot-work: #58a6ff;
  --timeline-dot-formation: #3fb950;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* SKIP NAVIGATION LINK */
.skip-nav {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 1000;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 500;
  font-size: 0.9rem;
}

.skip-nav:focus {
  top: 0;
}

/* RESET & BASE */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
ul, ol { list-style: none; }

/* NAVIGATION */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  transition: background var(--transition), border-color var(--transition);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

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

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  min-height: 44px;
  min-width: 44px;
  font-size: 1rem;
  line-height: 1;
  transition: border-color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { background: var(--surface); }

/* HERO SECTION */
.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
  max-width: 1100px;
  margin: 0 auto;
  gap: 3rem;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-text { flex: 1; }

.hero-label {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.hero-title {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 1rem;
}

.hero-desc {
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 1.75rem;
  font-size: 1rem;
}

.hero-quick-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-quick-contacts li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hero-quick-contacts a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.contact-btn-primary {
  background: var(--accent);
  color: #fff !important;
  border: 1px solid var(--accent);
}

.contact-btn-primary:hover {
  background: var(--accent-hover) !important;
  color: #fff !important;
  border-color: var(--accent-hover);
}

.contact-btn-secondary {
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.contact-btn-secondary:hover {
  background: var(--surface) !important;
  color: var(--text) !important;
}

.hero-photo-wrapper {
  flex-shrink: 0;
}

.hero-photo {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--border);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition);
}

.hero-photo:hover { box-shadow: var(--shadow-hover); }

/* SKILLS STRIP */
.hero-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.skill-group { display: flex; flex-direction: column; gap: 0.5rem; }

.skill-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.skill-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* SECTIONS */
.section {
  padding: 5rem 1.5rem;
}

.section-alt {
  background: var(--bg-alt);
  transition: background var(--transition);
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

/* TIMELINE */
.timeline-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  min-height: 44px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-btn:hover {
  background: var(--surface);
  color: var(--text);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--timeline-line);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 2.5rem;
  transition: opacity var(--transition);
}

.timeline-item.hidden {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
  transition: background var(--transition);
}

.timeline-item[data-type="work"] .timeline-dot {
  background: var(--timeline-dot-work);
  box-shadow: 0 0 0 2px var(--timeline-dot-work);
}

.timeline-item[data-type="formation"] .timeline-dot {
  background: var(--timeline-dot-formation);
  box-shadow: 0 0 0 2px var(--timeline-dot-formation);
}

.timeline-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.timeline-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeline-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.timeline-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-bottom: 0.6rem;
}

.badge-work {
  background: var(--accent-subtle);
  color: var(--accent);
}

.badge-formation {
  background: #dcfce7;
  color: #166534;
}

[data-theme="dark"] .badge-formation {
  background: #0f2a1a;
  color: #3fb950;
}

/* PROJECTS GRID */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
}

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

.project-img-wrapper {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface);
}

.project-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-img-wrapper img {
  transform: scale(1.04);
}

.project-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.project-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
  margin-bottom: 1rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.project-tag {
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* CONTACT SECTION */
.contact-container {
  text-align: center;
}

.contact-tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.contact-links-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.contact-links li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text) !important;
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), border-color var(--transition), background var(--transition);
}

.contact-link:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent) !important;
}

.contact-link svg {
  flex-shrink: 0;
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.78rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.pdf-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  filter: saturate(1.08);
}

.pdf-download-icon {
  font-size: 1.05rem;
  line-height: 1;
}

/* FOOTER */
.footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* RESPONSIVE - TABLET */
@media (max-width: 768px) {
  .hero-content {
    flex-direction: column-reverse;
    gap: 2rem;
    text-align: center;
  }

  .hero-desc { margin-left: auto; margin-right: auto; }

  .hero-quick-contacts { justify-content: center; }

  .hero-photo {
    width: 160px;
    height: 160px;
  }

  .hero-skills { justify-content: center; }

  .skill-group { align-items: center; }

  .skill-group-items { justify-content: center; }

  .projects-grid { grid-template-columns: 1fr; }

  .nav-links { display: none; }
}

/* RESPONSIVE - MOBILE */
@media (max-width: 480px) {
  body { font-size: 17px; }
  .hero { padding: 3rem 1rem 2rem; }
  .section { padding: 3rem 1rem; }
  .timeline { padding-left: 1.5rem; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-link { justify-content: center; }
  .pdf-download-btn { width: 100%; }
}