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

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

:root {
  --bg:       #0d0d0d;
  --bg-alt:   #111111;
  --surface:  #1a1a1a;
  --border:   #282828;
  --text:     #e8e8e8;
  --muted:    #888;
  --accent:   #7c6df6;
  --accent-2: #5b50d4;
  --radius:   10px;
  --nav-h:    64px;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: inline-block; }

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

/* Navigation */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--surface);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

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

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger svg { width: 24px; height: 24px; }

@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    z-index: 99;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
}

/* Sections */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-alt); }

.section-heading {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.section-heading::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0.6rem auto 3rem;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  margin-top: -2.25rem;
  margin-bottom: 3rem;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Hero */
.hero {
  min-height: 100vh;
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: var(--bg);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
}

.hero::after {
  content: '';
  position: absolute;
  top: -20%; left: 50%;
  transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,109,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  max-width: 1100px;
  width: 100%;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

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

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-name span { color: var(--accent); }

.hero-role {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.hero-desc {
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-badge {
  width: 200px; height: 200px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-badge svg {
  width: 80px; height: 80px;
  color: var(--accent);
  stroke-width: 1.5;
}

.scroll-down {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  animation: bounce 2s infinite;
  z-index: 1;
}

.scroll-down svg { width: 24px; height: 24px; }

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

@media (max-width: 768px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-desc  { margin: 0 auto 2rem; }
  .hero-actions { justify-content: center; }
  .hero-badge { width: 120px; height: 120px; }
  .hero-badge svg { width: 48px; height: 48px; }
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: center;
}

.about-text p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.stats-row {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.stat-box { display: flex; flex-direction: column; }

.stat-box strong {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-box span {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.about-visual {
  width: 280px; height: 280px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-visual svg {
  width: 96px; height: 96px;
  color: var(--accent);
  stroke-width: 1.5;
}

@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-visual { display: none; }
}

/* Skills */
.skills-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skills-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.skills-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.skills-group h3 svg {
  width: 16px; height: 16px;
  color: var(--accent);
}

.skill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.skill-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--text);
}

.skill-list img {
  width: 18px; height: 18px;
  object-fit: contain;
}

.invert-icon { filter: invert(1); }

@media (max-width: 900px) {
  .skills-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
  .skills-cols { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px; top: 0; bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-item {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
  position: relative;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-dot {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tl-dot svg { width: 16px; height: 16px; color: var(--muted); }

.tl-dot--current { background: var(--accent); border-color: var(--accent); }
.tl-dot--current svg { color: #fff; }
.tl-dot--future { border-style: dashed; }

.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  flex: 1;
}

.tl-date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 600;
}

.tl-card h3 { margin: 0.4rem 0 0.2rem; font-size: 1.05rem; }

.tl-card h4 {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.tl-card p { font-size: 0.875rem; color: var(--muted); }
.tl-detail { margin-top: 0.5rem; }
.tl-item--future .tl-card { opacity: 0.6; }

.badge-current {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
  background: rgba(124,109,246,0.15);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
}

.badge-current svg { width: 12px; height: 12px; }

/* BUT Competences */
.but-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.but-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.but-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.but-icon {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--card-color) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.but-icon svg { width: 18px; height: 18px; color: var(--card-color); }

.but-card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.but-card-header p { font-size: 0.75rem; color: var(--muted); }

.but-level {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.level-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.level-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.but-level span { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }

.ac-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
  width: 100%;
}

.ac-toggle:hover { border-color: var(--accent); color: var(--accent); }

.ac-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
.ac-toggle.open svg { transform: rotate(180deg); }

.ac-list {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.ac-list.open { display: flex; }

.ac-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.ac-code {
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.72rem;
}

.ac-lvl {
  margin-left: auto;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 600;
  padding-left: 0.5rem;
  flex-shrink: 0;
}

.ac-lvl[data-level="1"] { color: #ef4444; }
.ac-lvl[data-level="2"] { color: #f59e0b; }
.ac-lvl[data-level="3"] { color: #3b82f6; }
.ac-lvl[data-level="4"] { color: #22c55e; }

@media (max-width: 900px) {
  .but-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 580px) {
  .but-grid { grid-template-columns: 1fr; }
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* 5 cartes : centrer la dernière rangée de 2 */
.projects-grid .project-card:last-child:nth-child(3n - 1) {
  grid-column: 2 / 3;
}
.projects-grid .project-card:last-child:nth-child(3n - 2) {
  grid-column: 1 / span 2;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

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

.project-icon {
  background: rgba(124,109,246,0.08);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.project-icon svg {
  width: 40px; height: 40px;
  color: var(--accent);
  stroke-width: 1.5;
}

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

.project-body h3 { font-size: 0.95rem; font-weight: 600; }

.project-body p {
  font-size: 0.825rem;
  color: var(--muted);
  line-height: 1.6;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}

.project-tags span {
  font-size: 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 0.25rem;
  transition: gap 0.2s;
}

.project-link:hover { gap: 0.55rem; }
.project-link svg { width: 14px; height: 14px; }

.project-wip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.project-wip svg { width: 14px; height: 14px; }

@media (max-width: 768px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.contact-info > p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.contact-list svg {
  width: 16px; height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-list a { color: var(--muted); transition: color 0.2s; }
.contact-list a:hover { color: var(--accent); }

.socials { display: flex; gap: 0.75rem; }

.socials a {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s;
}

.socials a:hover { border-color: var(--accent); color: var(--accent); }
.socials svg { width: 16px; height: 16px; }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-field label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.form-field input,
.form-field textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #444;
}

.form-field input:focus,
.form-field textarea:focus { border-color: var(--accent); }

.form-field textarea { resize: vertical; }

@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
}

/* Project Modal */
.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.project-modal.open {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.project-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.project-modal-content {
  position: relative;
  z-index: 201;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.project-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.2s;
  z-index: 202;
}

.project-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.project-modal-close svg {
  width: 18px;
  height: 18px;
}

.project-modal-inner {
  padding: 2rem;
}

.project-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.project-modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(124, 109, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-modal-icon svg {
  width: 30px;
  height: 30px;
  color: var(--accent);
}

.project-modal-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

.project-modal-tags span {
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.project-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.modal-section h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.modal-section p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.9rem;
}

.modal-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-section li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  padding-left: 1.5rem;
  position: relative;
}

.modal-section li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.modal-actions .btn {
  flex: 1;
  justify-content: center;
}

.modal-actions .btn-ghost {
  flex: 1;
}

@media (max-width: 768px) {
  .project-modal {
    padding: 1rem;
  }

  .project-modal-content {
    max-width: 100%;
    max-height: 95vh;
  }

  .project-modal-inner {
    padding: 1.5rem;
  }

  .project-modal-header {
    flex-direction: column;
    gap: 1rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: var(--bg);
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer p { font-size: 0.8rem; color: var(--muted); }

/* Fade-up animations */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
