/* =============================================
   VARIABLES & RESET
   ============================================= */
:root {
  --sage: #3D3F8F;
  --rose: #9B9DD4;
  --rouille: #6B6DAE;
  --bone: white;
  --card-shadow: 0 4px 24px rgba(61, 63, 143, 0.10);
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: #fff;
  color: #444;
  overflow-x: hidden;
}

/* =============================================
   LOADER
   ============================================= */
#loader {
  position: fixed;
  inset: 0;
  background: var(--bone);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#loader.hide {
  opacity: 0;
  visibility: hidden;
}

#loader-init {
  font-family: 'Playfair Display', serif;
  font-size: 80px;
  color: var(--rouille);
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#loader-init.show {
  opacity: 1;
  transform: scale(1);
}

#loader-sub {
  font-size: 11px;
  letter-spacing: 8px;
  color: var(--sage);
  text-transform: uppercase;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.5s ease 0.4s;
}

#loader-sub.show {
  opacity: 1;
}

#loader-line {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rouille), var(--rose));
  border-radius: 2px;
  margin-top: 18px;
  transition: width 1s ease 0.7s;
}

#loader-line.show {
  width: 180px;
}

/* =============================================
   HEADER
   ============================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 48px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(155, 157, 212, 0.2);
  z-index: 1000;
  transition: box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 2px 20px rgba(61, 63, 143, 0.08);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--sage);
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.2;
}

.logo span {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 5px;
  color: var(--rose);
  font-weight: 300;
  text-transform: uppercase;
}

nav {
  display: flex;
  gap: 32px;
}

nav a {
  color: var(--sage);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--rose);
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--rouille);
}

nav a:hover::after {
  width: 100%;
}

/* =============================================
   HAMBURGER & MENU MOBILE
   ============================================= */
#hamburger {
  display: none;
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 9999;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

#hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--rouille);
  transition: all 0.3s ease;
}

#hamburger.open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}

#hamburger.open span:nth-child(2) {
  opacity: 0;
}

#hamburger.open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

#menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 260px;
  height: 100%;
  background: #fff;
  border-left: 1px solid rgba(155, 157, 212, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 40px 32px;
  z-index: 999;
  transition: right 0.4s cubic-bezier(0.77, 0, 0.18, 1);
  box-shadow: -8px 0 32px rgba(61, 63, 143, 0.08);
}

#menu.open {
  right: 0;
}

#menu a {
  color: var(--rouille);
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  transition: color 0.3s;
}

#menu a:hover {
  color: var(--sage);
}

/* =============================================
   SECTIONS (base commune)
   ============================================= */
section {
  padding: 96px 48px;
  text-align: center;
}

.section-label {
  font-size: 11px;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 12px;
  display: block;
}

section h2 {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  color: var(--sage);
  margin-bottom: 12px;
  display: inline-block;
  font-weight: 600;
}

.section-line {
  width: 50px;
  height: 2px;
  background: var(--rose);
  margin: 0 auto 60px;
  border-radius: 2px;
}

/* =============================================
   HERO / ACCUEIL
   ============================================= */
#accueil {
  background: var(--bone);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px 60px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-circle {
  position: absolute;
  border-radius: 50%;
  background: var(--sage);
}

.hero-circle:nth-child(1) {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -200px;
  opacity: 0.05;
}

.hero-circle:nth-child(2) {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -100px;
  opacity: 0.03;
}

.hero-tagline {
  font-size: 12px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.2s;
}

#accueil h2 {
  font-family: 'Playfair Display', serif;
  font-size: 58px;
  color: var(--rouille);
  line-height: 1.1;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.4s;
  /* override section h2 */
  display: block;
}

.hero-sub {
  font-size: 16px;
  color: var(--sage);
  letter-spacing: 0.5px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.6s;
  max-width: 480px;
  line-height: 1.7;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards 0.8s;
}

.btn-primary {
  background: var(--rouille);
  color: #fff;
  border: 2px solid var(--rouille);
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-primary:hover {
  background: var(--sage);
  border-color: var(--sage);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--rouille);
  border: 2px solid var(--rouille);
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-outline:hover {
  background: var(--rouille);
  color: #fff;
  transform: translateY(-2px);
}

.scroll-hint {
  position: absolute;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
}

.scroll-hint span {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--sage);
}

.scroll-dot {
  width: 1px;
  height: 40px;
  background: linear-gradient(var(--rouille), transparent);
  animation: scrollDot 1.5s ease-in-out infinite;
}

/* =============================================
   À PROPOS
   ============================================= */
#a-propos {
  background: #fff;
}

.apropos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.card {
  border-radius: 16px;
  padding: 36px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.card-accent {
  background: #fff;
  border: 1px solid rgba(155, 157, 212, 0.2);
  border-top: 3px solid var(--rose);
}

.card-accent h3 {
  font-family: 'Playfair Display', serif;
  color: var(--rouille);
  margin-bottom: 14px;
  font-size: 18px;
}

.card-accent p {
  color: #666;
  line-height: 1.8;
  font-size: 14px;
}

.texte-gris {
  margin-top: 12px;
  color: #999 !important;
}

.card-filled {
  background: var(--sage);
  color: #fff;
  border: none;
}

.card-filled h3 {
  font-family: 'Playfair Display', serif;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 16px;
  font-size: 18px;
}

.card-filled p {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.8;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  background: rgba(155, 157, 212, 0.15);
  color: #dde;
  border: 1px solid rgba(155, 157, 212, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  letter-spacing: 0.5px;
}

/* =============================================
   PROJETS
   ============================================= */
#projets {
  background: var(--bone);
}

.projets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.projet-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(155, 157, 212, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.projet-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(61, 63, 143, 0.12);
}

.projet-banner {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.pb-1 { background: linear-gradient(135deg, #eeedfe, #d0cfef); }
.pb-2 { background: linear-gradient(135deg, #fbeaf0, #f4c0d1); }
.pb-3 { background: linear-gradient(135deg, #e1f5ee, #9fe1cb); }

.projet-body {
  padding: 24px;
}

.projet-body h3 {
  font-family: 'Playfair Display', serif;
  color: var(--rouille);
  font-size: 17px;
  margin-bottom: 8px;
}

.projet-body p {
  color: #777;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}

.projet-link {
  color: var(--sage);
  font-size: 12px;
  letter-spacing: 1px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.projet-link:hover {
  color: var(--rouille);
}

/* =============================================
   EXPÉRIENCE (TIMELINE)
   ============================================= */
#experience {
  background: #fff;
}

.timeline {
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(155, 157, 212, 0.3);
}

.tl-item {
  display: flex;
  gap: 28px;
  margin-bottom: 36px;
  position: relative;
}

.tl-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bone);
  border: 2px solid var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--rose);
  z-index: 1;
}

.tl-content {
  background: #fff;
  border: 1px solid rgba(155, 157, 212, 0.15);
  border-radius: 14px;
  padding: 22px;
  flex: 1;
  transition: box-shadow 0.3s ease;
}

.tl-content:hover {
  box-shadow: var(--card-shadow);
}

.tl-date {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: 6px;
}

.tl-content h3 {
  font-family: 'Playfair Display', serif;
  color: var(--rouille);
  font-size: 17px;
  margin-bottom: 4px;
}

.tl-content .company {
  font-size: 13px;
  color: var(--sage);
  font-weight: 500;
  margin-bottom: 10px;
}

.tl-content p {
  font-size: 13px;
  color: #777;
  line-height: 1.7;
}

/* =============================================
   FORMATION
   ============================================= */
#formation {
  background: var(--bone);
}

.formation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 780px;
  margin: 0 auto;
  text-align: left;
}

.form-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  border: 1px solid rgba(155, 157, 212, 0.15);
  border-left: 3px solid var(--rose);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.form-card .year {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--rose);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-card h3 {
  font-family: 'Playfair Display', serif;
  color: var(--rouille);
  font-size: 16px;
  margin-bottom: 6px;
}

.form-card .etablissement {
  font-size: 13px;
  color: var(--sage);
  font-weight: 500;
}

/* =============================================
   CONTACT
   ============================================= */
#contact {
  background: #fff;
}

.contact-wrap {
  max-width: 560px;
  margin: 0 auto;
  text-align: left;
}

.contact-intro {
  text-align: center;
  color: #777;
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid rgba(155, 157, 212, 0.3);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #444;
  background: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--rouille);
  box-shadow: 0 0 0 3px rgba(107, 109, 174, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background: var(--rouille);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.submit-btn:hover {
  background: var(--sage);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(155, 157, 212, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sage);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: var(--rouille);
  color: #fff;
  border-color: var(--rouille);
  transform: translateY(-2px);
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--sage);
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 32px;
  font-size: 13px;
}

footer strong {
  color: #fff;
}

/* =============================================
   ANIMATIONS & REVEAL AU SCROLL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scrollDot {
  0%, 100% { opacity: 0.3; transform: translateY(-4px); }
  50%       { opacity: 1;   transform: translateY(4px);  }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  header {
    padding: 0 24px;
  }

  nav {
    display: none;
  }

  #hamburger {
    display: flex;
  }

  section {
    padding: 72px 20px;
  }

  #accueil {
    padding: 100px 20px 60px;
  }

  #accueil h2 {
    font-size: 36px;
  }

  .hero-sub {
    font-size: 14px;
    text-align: center;
  }

  .hero-btns {
    flex-direction: column;
    align-items: center;
  }

  .apropos-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 24px;
  }

  .formation-grid {
    grid-template-columns: 1fr;
  }

  .projets-grid {
    grid-template-columns: 1fr;
  }

  section h2 {
    font-size: 28px;
  }

  .timeline::before {
    left: 14px;
  }

  .tl-item {
    gap: 16px;
  }

  .tl-dot {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .tl-content {
    padding: 16px;
  }

  .contact-wrap {
    padding: 0 4px;
  }

  .logo {
    font-size: 18px;
  }

  footer {
    padding: 24px 16px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  #accueil h2 {
    font-size: 28px;
  }

  .btn-primary,
  .btn-outline {
    padding: 12px 24px;
    font-size: 11px;
    width: 100%;
    text-align: center;
  }

  .form-card {
    padding: 20px;
  }

  .projet-body {
    padding: 16px;
  }

  .skill-tags {
    gap: 6px;
  }

  .tag {
    font-size: 11px;
    padding: 3px 10px;
  }
}