/* Base */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: #1f2937;
}

/* Header */
#site-header {
  background: rgba(30, 58, 138, 0.95);
  transition: all 0.3s ease;
}
.nav-link {
  position: relative;
  transition: all 0.3s ease;
}
.nav-link.active {
  color: #bfdbfe;
}
.nav-link.active::after,
.nav-link:hover::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 3px;
  background: #3b82f6;
  border-radius: 2px;
}

/* Cards, buttons, effects */
.enhanced-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}
.enhanced-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}
.btn {
  transition: all 0.3s ease;
}
.btn:active {
  transform: translateY(1px);
}

/* Section titles */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 2.5rem;
  color: #111827;
  position: relative;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 4px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 2px;
}

/* Skills bars */
.skill-bar {
  background: #e5e7eb;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.skill-progress {
  height: 100%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
  width: 0;
  transition: width 1.5s ease;
}

/* Timeline vertical (mobile) */
.timeline-vertical {
  position: relative;
}
.timeline-vertical::before {
  content: "";
  position: absolute;
  left: 1.2rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #667eea, #764ba2);
}
.education-item {
  display: flex;
  position: relative;
  margin: 1.25rem 0;
}
.education-item::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 0.6rem;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 4px solid #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.education-year {
  min-width: 110px;
  font-weight: 700;
  color: #4f46e5;
}
.education-title {
  font-weight: 700;
  color: #111827;
}
.education-institution {
  color: #6b7280;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal:not(.hidden) {
  display: flex;
}
.modal-overlay {
  position: absolute;
  inset: 0;
}
.modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  width: 100%;
  max-width: 850px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}
.modal-video .modal-content {
  max-width: 960px;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #374151;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.modal-close:hover {
  background: #e5e7eb;
}

/* Project cards */
.project-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
}
.project-pitch {
  color: #6b7280;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.project-tag {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.project-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}
.project-btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}
.project-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.project-btn-secondary {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  color: #374151;
}
.project-btn-secondary:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}
.project-btn-video {
  background: #dc2626;
  color: #fff;
}
.project-btn-video:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}

/* Utilities */
.fade-in {
  animation: fadeIn 0.8s ease both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 640px) {
  .project-btn {
    flex: 1 1 100%;
    min-width: auto;
  }
}

/* ===== Typing Slogan (local) ===== */
.typewriter {
  position: relative;
  max-width: 90%;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  line-height: 1.4;
}

.typewriter-line {
  display: inline-block;
  font-weight: 700;
  font-size: clamp(1rem, 2.8vw, 1.35rem);
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  /* width controlled by JS via CSS variable --tw-width */
  width: var(--tw-width, 0ch);
  transition: width 0.05s linear;
}

.typewriter-caret {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: #fff;
  margin-left: 4px;
  vertical-align: -2px;
  animation: caretBlink 1s step-start infinite;
}

@keyframes caretBlink {
  50% {
    opacity: 0;
  }
}

/* Optionnel: réduire un peu sur très petit écran */
@media (max-width: 360px) {
  .typewriter-line {
    font-size: 0.95rem;
  }
}
