/* --------- RESET & BASICS --------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #0f172a;
  background-image:
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  color: #e2e8f0;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #0f172a;
}

::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* --------- LAYOUT --------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------- HEADER --------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #94a3b8;
  position: relative;
}

.nav-links a:hover {
  color: #f8fafc;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #38bdf8;
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

/* --------- HERO SECTION --------- */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  padding: 4rem 0;
  animation: fadeIn 1s ease-out;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-highlight {
  background: linear-gradient(to right, #38bdf8, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-primary {
  background: #38bdf8;
  color: #0f172a;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  background: #0ea5e9;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: transparent;
  color: #e2e8f0;
  border-color: #334155;
}

.btn-secondary:hover {
  border-color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.hero-photo-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-photo {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.1);
  position: relative;
  z-index: 1;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-photo:hover img {
  transform: scale(1.05);
}

/* --------- SECTIONS GENERAL --------- */
section {
  padding: 5rem 0;
}

h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: #38bdf8;
  margin-top: 0.5rem;
  border-radius: 2px;
}

.section-subtitle {
  color: #94a3b8;
  margin-bottom: 1.5rem;
}

/* --------- A PROPOS --------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  background: rgba(30, 41, 59, 0.4);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.tag {
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

/* --------- PROJETS --------- */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-card p {
  margin-bottom: 0.75rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.project-card ul {
  list-style: disc;
  margin: 0.25rem 0 1rem 1.5rem;
  color: #94a3b8;
  line-height: 2;
}

.project-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  padding: 2rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-5px);
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #f1f5f9;
}

.project-tech {
  font-size: 0.85rem;
  color: #38bdf8;
  margin-bottom: 1rem;
  font-family: monospace;
}

.project-links {
  margin-top: 1.5rem;
}

.project-card p {
  margin-bottom: 0.75rem;
  color: #cbd5e1;
  font-size: 0.95rem;
}

.project-card ul {
  margin: 0.25rem 0 1rem 1.5rem;
  color: #94a3b8;
  line-height: 2;
}

.project-links a {
  display: inline-block;
  font-size: 0.9rem;
  color: #e2e8f0;
  font-weight: 500;
  border-bottom: 1px solid #38bdf8;
  padding-bottom: 2px;
}

.project-links a:hover {
  color: #38bdf8;
}

/* --------- CONTACT --------- */
.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.contact-box {
  background: rgba(30, 41, 59, 0.4);
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  transition: transform 0.3s ease;
}

.contact-box:hover {
  transform: translateY(-3px);
  background: rgba(30, 41, 59, 0.6);
}

.contact-line img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: inline-block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.5));
}

.contact-line a {
  color: #94a3b8;
  font-weight: 500;
}

.contact-line a:hover {
  color: #38bdf8;
}

/* --------- FOOTER --------- */
footer {
  text-align: center;
  padding: 2rem 0;
  color: #64748b;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4rem;
}

/* --------- ANIMATIONS --------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------- RESPONSIVE --------- */
@media (max-width: 900px) {

  /* HERO FIX */
  .hero {
    flex-direction: column-reverse;
    /* Force l'image au-dessus du texte */
    text-align: center;
    padding: 2rem 0;
  }

  .hero-content {
    /* Reset du grid inutile car .hero est flex */
    display: contents;
    /* Permet aux enfants de .hero-content de se comporter comme des enfants directs de .hero si la structure change, mais ici on cible .hero */
  }

  /* Cible directement les enfants de .hero */
  .hero>div:first-child {
    /* Le bloc texte */
    margin-top: 1.5rem;
  }

  .hero-text h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    line-height: 1.2;
    word-wrap: break-word;
  }

  .hero-photo-wrapper {
    /* L'image */
    margin-bottom: 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .hero-photo {
    width: 180px;
    height: 180px;
    margin: 0 auto;
  }

  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* NAV FIX */
  .nav {
    flex-direction: column;
    height: auto;
    padding: 1rem 0;
    gap: 1rem;
  }

  .nav-logo {
    font-size: 1.2rem;
    text-align: center;
  }

  .nav-links {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .projects-grid {}

  .project-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .project-links {
    margin-top: 1.5rem;
  }

  section {
    padding: 3rem 0;
  }

  h2 {
    font-size: 1.5rem;
  }

  .container {
    width: 100%;
    padding: 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.6rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .contact-container {
    grid-template-columns: 1fr;
  }
}