/*=============================================
=            PORTFOLIO V3.0 STYLES            =
=============================================*/

/*===== IMPORTS & VARIABLES =====*/
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;700&family=Poppins:wght@400;600;700&display=swap');

:root {
  --header-height: 3.5rem;
  --font-body: 'Poppins', sans-serif;
  --font-code: 'Fira Code', monospace;

  /* Colors */
  --first-color: #00f5c3;
  --first-color-alt: #00d9ac;
  --title-color: #ccd6f6;
  --text-color: #8892b0;
  --body-color: #0a192f;
  --container-color: #112240;
  --border-color: rgba(0, 245, 195, 0.2);
  --shadow-color: rgba(2, 12, 27, 0.7);
}

/*===== BASE & LAYOUT =====*/
*, ::before, ::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: var(--header-height) 0 0 0;
  font-family: var(--font-body);
  font-size: .938rem;
  background-color: var(--body-color);
  color: var(--text-color);
  cursor: none; /* Curseur personnalisé activé par défaut */
}

h1, h2, h3, ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.bd-container {
  max-width: 1024px;
  width: calc(100% - 3rem);
  margin-left: auto;
  margin-right: auto;
}

.bd-grid {
  display: grid;
  gap: 1.5rem;
}

.section {
  padding: 4rem 0 3rem;
}

.section-title {
  position: relative;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  color: var(--title-color);
  margin-bottom: 3rem;
  font-family: var(--font-code);
  display: flex;
  align-items: center;
}
.section-title::before {
  content: "// ";
  color: var(--first-color);
  margin-right: 0.5rem;
}
.section-title::after {
  content: '';
  width: 70px;
  height: 1px;
  background-color: var(--container-color);
  margin-left: 1rem;
}

/*===== CURSOR & SCANNER =====*/
.cursor-dot, .cursor-circle {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 9999;
  pointer-events: none;
  transition: transform .15s ease-out, opacity .2s ease-out;
}
.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--first-color);
}
.cursor-circle {
  width: 40px;
  height: 40px;
  border: 2px solid var(--first-color);
  opacity: .5;
}
.cursor-grow {
  transform: translate(-50%, -50%) scale(2.5);
  opacity: 0;
}
.scanner-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 195, .5), transparent);
  animation: scan 7s linear infinite;
  z-index: 100;
  pointer-events: none;
}
@keyframes scan {
  0% { top: 0; }
  100% { top: 100vh; }
}

/*===== HEADER & NAVIGATION =====*/
.l-header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: rgba(10, 25, 47, .85);
  backdrop-filter: blur(10px);
}
.nav {
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav__logo {
  color: var(--title-color);
  font-family: var(--font-code);
  font-weight: 700;
  font-size: 1.5rem;
  position: relative;
}
.nav__logo:hover {
  color: var(--first-color);
}
.nav__list {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav__link {
  font-family: var(--font-code);
  color: var(--text-color);
  transition: .3s;
}
.nav__link:hover, .active-link {
  color: var(--first-color);
}
.nav__toggle {
  display: none; /* Caché par défaut sur desktop */
  color: var(--first-color);
  font-size: 1.5rem;
  cursor: pointer;
}
.button-cv {
  border: 1px solid var(--first-color);
  padding: .5rem 1rem;
  border-radius: .25rem;
  color: var(--first-color) !important;
}
.button-cv:hover {
  background-color: rgba(0, 245, 195, .1);
}

/*===== GLITCH EFFECT =====*/
[data-glitch] {
  position: relative;
  display: inline-block;
}
[data-glitch]:hover::before, [data-glitch]:hover::after {
  content: attr(data-glitch);
  position: absolute;
  top: 0;
  left: 0;
  opacity: .8;
}
[data-glitch]:hover::before {
  animation: glitch .3s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: var(--first-color);
  z-index: -1;
}
[data-glitch]:hover::after {
  animation: glitch .3s cubic-bezier(.25, .46, .45, .94) reverse both infinite;
  color: #ff005d; /* Changed red to a more cyber color */
  z-index: -2;
}
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-3px, 3px); }
  40% { transform: translate(-3px, -3px); }
  60% { transform: translate(3px, 3px); }
  80% { transform: translate(3px, -3px); }
  100% { transform: translate(0); }
}

/*===== HOME =====*/
.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
}
.home__container {
  padding-top: 2rem;
}
.home__greeting {
  font-family: var(--font-code);
  color: var(--first-color);
  font-size: 1rem;
  margin-bottom: 1rem;
  display: block;
}
.home__name {
  font-size: clamp(40px, 8vw, 80px);
  color: var(--title-color);
  margin-bottom: .5rem;
  font-weight: 700;
}
.home__profession {
  font-size: clamp(25px, 5vw, 50px);
  color: var(--text-color);
  font-weight: 600;
  margin-bottom: 2.5rem;
}
#typing-effect {
  color: var(--first-color);
  font-weight: 700;
}
.home__social {
  position: fixed;
  left: 1.5rem;
  bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.home__social-link {
  font-size: 1.5rem;
  color: var(--text-color);
  transition: .3s;
}
.home__social-link:hover {
  color: var(--first-color);
  transform: translateY(-5px);
}

/*===== BUTTONS =====*/
.button {
  display: inline-block;
  background-color: transparent;
  color: var(--first-color);
  padding: 1rem 1.75rem;
  border-radius: .5rem;
  font-family: var(--font-code);
  font-weight: 600;
  border: 1px solid var(--first-color);
  transition: .3s;
}
.button:hover {
  background-color: rgba(0, 245, 195, .1);
}

/*===== ABOUT (TIMELINE) & PHILOSOPHY =====*/
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--container-color);
}
.timeline__item {
  position: relative;
  margin-bottom: 2.5rem;
  width: 50%;
}
.timeline__item:nth-child(odd) {
  padding-right: 2rem;
  text-align: right;
  left: 0;
}
.timeline__item:nth-child(even) {
  padding-left: 2rem;
  left: 50%;
}
.timeline__item::before {
  content: '';
  position: absolute;
  top: .25rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--body-color);
  border: 2px solid var(--first-color);
  transition: .3s;
}
.timeline__item:nth-child(odd)::before {
  right: -10px;
  transform: translateX(50%);
}
.timeline__item:nth-child(even)::before {
  left: -10px;
  transform: translateX(-50%);
}
.timeline__item:hover::before {
  background-color: var(--first-color);
}
.timeline__content {
  background-color: var(--container-color);
  padding: 1.5rem;
  border-radius: .5rem;
}
.timeline__title {
  color: var(--title-color);
  font-size: 1.2rem;
  margin-bottom: .5rem;
}
.timeline__description strong {
  color: var(--first-color);
}

.philosophy__container {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.philosophy__card {
    background-color: var(--container-color);
    padding: 2rem 1.5rem;
    border-radius: .5rem;
    text-align: center;
    border: 1px solid transparent;
    transition: .3s;
}
.philosophy__card:hover {
    transform: translateY(-8px);
    border-color: var(--border-color);
}
.philosophy__icon {
    font-size: 3rem;
    color: var(--first-color);
    margin-bottom: 1rem;
}
.philosophy__title {
    font-size: 1.25rem;
    color: var(--title-color);
    margin-bottom: .5rem;
}

/*===== WORK & FILTERS =====*/
.work__filters {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: 1.5rem;
  margin-bottom: 2rem;
  font-family: var(--font-code);
}
.work__filter-item {
  cursor: pointer;
  color: var(--text-color);
  transition: .3s;
}
.work__filter-item:hover, .active-filter {
  color: var(--first-color);
}
.active-filter {
  font-weight: 700;
}
.work__container {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.work__card {
  background-color: var(--container-color);
  border-radius: .5rem;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.work__card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px -15px var(--shadow-color);
}
.work__card-content {
  padding: 1.5rem;
}
.work__title {
  color: var(--title-color);
  font-size: 1.2rem;
  margin-bottom: .5rem;
}
.work__description {
  font-size: .9rem;
  margin-bottom: 1.5rem;
}
.work__button {
  color: var(--first-color);
  font-family: var(--font-code);
  font-size: .8rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  cursor: pointer;
}
.work__button-icon {
  transition: .3s;
}
.work__card:hover .work__button-icon {
  transform: translateX(5px);
}
.work__data-hidden {
  display: none;
}

/*===== PROJECT MODAL =====*/
.project__modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(10, 25, 47, .9);
  z-index: 101;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: .3s;
}
.modal-active {
  opacity: 1;
  visibility: visible;
}
.project__modal-content {
  position: relative;
  background-color: var(--body-color);
  padding: 2.5rem;
  border-radius: .5rem;
  max-width: 700px;
  width: 100%;
  border: 1px solid var(--border-color);
  max-height: 90vh;
  overflow-y: auto;
}
.project__modal-content::-webkit-scrollbar {
  width: 8px;
}
.project__modal-content::-webkit-scrollbar-thumb {
  background-color: var(--container-color);
  border-radius: 8px;
}
.project__modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: var(--first-color);
  cursor: pointer;
  z-index: 5;
}
.project__modal-img-container {
  width: 100%;
  max-height: 350px;
  margin-bottom: 1.5rem;
  border-radius: .5rem;
  background-color: #061221;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.project__modal-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.project__modal-title {
  color: var(--title-color);
  font-size: 1.5rem;
  margin-bottom: .5rem;
}
.project__modal-description {
  margin-bottom: 1.5rem;
}
.project__modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-code);
  font-size: .75rem;
}
.project__modal-tags span {
  background-color: var(--container-color);
  color: var(--first-color);
  padding: .25rem .5rem;
  border-radius: .25rem;
}
.project__modal-links {
  display: flex;
  gap: 1.5rem;
}
.project__modal-links a {
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: .3s;
}
.project__modal-links a:hover {
  color: var(--first-color);
}

/*===== CONTACT & FOOTER =====*/
.contact__container {
  text-align: center;
  padding: 3rem 0;
}
.contact__title {
  font-size: 2.5rem;
  color: var(--title-color);
  margin-bottom: 1rem;
}
.contact__description {
  max-width: 600px;
  margin: 0 auto 2rem auto;
}
.footer {
  text-align: center;
  padding: 2rem 0;
}
.footer__text {
  font-family: var(--font-code);
  font-size: .8rem;
}


@media screen and (max-width: 992px) {
    .bd-container {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
    .home__name {
        font-size: 3.5rem;
    }
    .home__social {
        left: 1rem;
    }
    .philosophy__container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Pour les mobiles - jusqu'à 768px */
@media screen and (max-width: 768px) {
    body {
        margin: 0;
        cursor: default;
    }
    .cursor-dot, .cursor-circle, .scanner-line {
        display: none;
    }

    /* ===== NAVIGATION MOBILE (MODIFIÉE) ===== */
    .nav__menu {
        position: fixed;
        /* Le menu est maintenant positionné hors de l'écran à droite */
        top: 0;
        right: -100%; 
        width: 70%; /* Ne prend qu'une partie de l'écran */
        max-width: 280px;
        height: 100vh;
        padding: 6rem 2rem 3rem; /* Plus de padding en haut */
        background-color: var(--body-color); /* Fond opaque */
        box-shadow: -5px 0 15px rgba(0,0,0,0.2); /* Ombre pour donner de la profondeur */
        transition: right .4s ease-in-out; /* Animation sur la propriété 'right' */
        z-index: 99;
    }
    .nav__list {
        flex-direction: column;
        align-items: flex-start; /* Aligne les liens à gauche */
        gap: 2.5rem; /* Augmente l'écart entre les liens */
    }
    .nav__item {
        margin-bottom: 0; /* Plus besoin de margin-bottom ici */
    }
    .nav__link {
        font-size: 1.25rem;
    }
    .nav__toggle {
        display: block;
        z-index: 101; /* Doit être au-dessus de tout */
    }
    /* Fait glisser le menu dans l'écran */
    .show-menu {
        right: 0;
    }

    /* ===== SECTIONS GÉNÉRALES ===== */
    .section {
        padding: 3rem 0 2rem;
    }
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

    /* ===== ACCUEIL (HOME) ===== */
    .home__container {
        grid-template-columns: 1fr;
        text-align: center;
        padding-top: 3rem;
        min-height: 90vh;
    }
    .home__data {
        margin-bottom: 2rem;
    }
    .home__name {
        font-size: 2.5rem;
    }
    .home__profession {
        font-size: 1.2rem;
    }
    .home__social {
        position: initial;
        flex-direction: row;
        justify-content: center;
        gap: 2rem;
        margin-top: 3rem;
    }
    .home__social-link {
        font-size: 2rem;
    }
    .home__social-link:hover {
        transform: translateY(0);
    }

    /* ===== PARCOURS (TIMELINE) ===== */
    .timeline {
        padding-left: 1rem;
        max-width: 100%;
    }
    .timeline::before {
        left: 10px;
        transform: translateX(0);
    }
    .timeline__item {
        width: 100%;
        padding-left: 40px;
        padding-right: 0;
        text-align: left;
        left: 0 !important;
    }
    .timeline__item:nth-child(odd) .timeline__content,
    .timeline__item:nth-child(even) .timeline__content {
        text-align: left;
    }
    .timeline__item::before {
        left: 2px !important;
        right: auto !important;
        transform: translateX(0) !important;
    }

    /* ===== PHILOSOPHIE ===== */
    .philosophy__container {
        grid-template-columns: 1fr;
    }
    
    /* ===== PROJETS (WORK) ===== */
    .work__container {
        grid-template-columns: 1fr;
    }
    .work__filters {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem 1rem;
    }
    
    /* ===== MODALE DE PROJET ===== */
    .project__modal-content {
        width: 90%;
        padding: 1.5rem;
    }

    /* ===== CONTACT ===== */
    .contact__title {
        font-size: 2rem;
    }
}

/* Ajustements pour les très petits écrans (moins de 360px) */
@media screen and (max-width: 360px) {
    .bd-container {
        margin-left: 1rem;
        margin-right: 1rem;
    }
    .home__name {
        font-size: 2.2rem;
    }
    .home__profession {
        font-size: 1rem;
    }
    .work__card {
        padding: 1.2rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
}