/* ===== POLICES ===== */
@font-face {
  font-family: 'ESBuildTRIAL';
  src: url('fonts/ESBuildTRIAL-Regular.otf') format('opentype');
  font-weight: 400;
}

@font-face {
  font-family: 'ESBuildTRIAL';
  src: url('fonts/ESBuildTRIAL-Bold.otf') format('opentype');
  font-weight: 700;
}

/* ===== VARIABLES ===== */
:root {
  --primary: #ffffff;
  --secondary: #0C0B0B;
  --accent: #FF4D4D;
  --text-light: rgba(255, 255, 255, 0.8);
  --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --close-animation: all 0.7s cubic-bezier(0.65, 0, 0.35, 1);
  --success: #22C55E;
  --error: #EF4444;
  --success-bg: #F0FDF4;
  --error-bg: #FEF2F2;
}

/* ===== BASE ===== */
body {
  margin: 0;
  font-family: 'Source Sans 3', sans-serif;
  background-color: #000;
  color: var(--primary);
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.1;
}

h2 {
  font-size: 40px;
  margin-bottom: 8px;
}

.info1 {
  display: block;
  .inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  
    a {
      display: inline-block;
      &:hover {
        color:var(--accent) ;
      }     
  
      svg {
        display: inline-block;
      }
    }
  }
}

.info2 {
  display: none;
  .inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  
    a {
      display: inline-block;
  
      svg {
        display: inline-block;
      }
    }
  }
}

/* ===== LAYOUT ===== */
.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 50%;
  padding: 3rem;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.projects {
  width: 50%;
  margin-left: 50%;
  position: relative;
  padding: 3rem 0;
}

/* ===== COMPOSANTS ===== */
.logo {
  font-family: 'ESBuildTRIAL', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.title {
  margin: 80px 0;
}

.title h1 {
  font-family: 'ESBuildTRIAL', sans-serif;
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: 2rem;
}

.title p {
  margin-bottom: 2rem;
  font-size: 1.25rem;
}

button {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 100px;
  transition: var(--transition);
}

button:hover {
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
}

/* ===== PROJETS ===== */
.project {
  background: var(--secondary);
  border-radius: 12px;
  margin: 0 3rem 2rem;
  overflow: hidden;
  position: relative;
  opacity: 0;
  transform: translateY(40px);
  animation: entry 0.6s ease-out forwards;
}

@keyframes entry {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.cover-img {
  width: 100%;
  height: auto;
  display: block;
  transition: var(--transition);
}

.project:hover .cover-img {
  transform: scale(1.02);
}

.description,
.gallery {
  padding: 2rem;
  display: none;
}

.description h2 {
  margin-bottom: 1rem;
}

.description p {
  font-size: 1.12rem;
  margin-bottom: 1rem;
}

.description {
  width: 70%;
}

.tags {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  list-style: none;
  flex-wrap: wrap;
}

.tags li {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 1rem;
  border-radius: 100px;
  font-size: 0.875rem;
}

.gallery {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Sélectionne la dernière image si le nombre total est impair */
.gallery img:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}
/* ===== ÉTAT EXPANDÉ ===== */
.project.expanded {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  margin: 0;
  border-radius: 0;
  overflow-y: auto;
  background: var(--secondary);
  cursor: none !important;
}

.project.expanded * {
  cursor: none !important;
}

.project.expanded .cover-img {
  display: none;
}

.project.expanded .content {
  transform: scale(0.85);
  transition: var(--transition);
}

.project.expanded .description,
.project.expanded .gallery {
  display: block;
}

.project.expanded .gallery {
  display: grid;
}

.project.expanded.closing .content {
  transform: scale(0.6) translateY(-50vh);
  opacity: 0;
  transition: var(--close-animation);
}

#close-btn:hover~.project.expanded:not(.closing) .content {
  transform: scale(0.75) translateY(-10vh);
  opacity: 0.8;
}

/* ===== BOUTON CONTACT ===== */
/* Bouton Contact avec animation infinie et border-radius */
#contact-btn {
  position: relative;
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 96px; /* Border-radius de 96px comme demandé */
  overflow: hidden;
  transition: all 0.4s ease;
  letter-spacing: 2px;
  padding: 1rem 2.5rem;
}

/* Animation infinie corrigée */
#contact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shine 3s infinite;
  z-index: -1;
  border-radius: 96px; /* Même border-radius que le bouton */
}

/* Keyframes pour l'animation */
@keyframes shine {
  100% {
    left: 100%;
  }
}

/* Effet hover */
#contact-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background-color: rgba(255, 255, 255, 0.03);
}

/* Icône */
#contact-btn i {
  margin-right: 12px;
}

/* STYLE DE BASE */
.project-button {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  font-family: 'Source Sans Pro', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

  a {
    color: var(--primary);
  }

  a:hover {
    color: var(--primary);
  }

  &:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: white;
  transform: scaleX(0);
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: right;
  }
  &:hover {
  &:after {
  transform: scaleX(1);
  transform-origin: left;
  }
  }
  }


/* ÉLÉMENT DYNAMIQUE : POINT PULSANT */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse 2s infinite;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ICÔNE FLÈCHE */
.arrow-icon {
  width: 18px;
  height: 18px;
  stroke: white;
  stroke-width: 1;
  stroke-linecap: round;
  transition: transform 0.3s ease;
}


/* ===== BOUTON FERMER ===== */
#close-btn {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1001;
  width: 40px;
  height: 40px;
  border-radius: 96px;
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #000;
  border: none;
  padding: 0;
  transition: var(--transition);
  line-height: 1;
}

#close-btn:hover {
  transform: scale(1.1);
}

#close-btn.active {
  display: flex;
}

/* ===== POPUP CONTACT ===== */
.contact-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 11, 11, 0.95); /* var(--secondary) avec opacité */
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.contact-popup.active {
  opacity: 1;
  visibility: visible;
}

.contact-container {
  background: var(--secondary);
  width: 90%;
  max-width: 500px;
  padding: 3rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(30px);
  transition: var(--transition);
}

.contact-header {
  margin-bottom: 2.5rem;
  text-align: center;
}

.contact-header h2 {
  font-family: 'ESBuildTRIAL', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.contact-header p {
  color: var(--text-light);
  font-size: 1rem;
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2); /* var(--text-light) ajusté */
  border-radius: 8px;
  color: var(--primary);
  font-size: 1rem;
  transition: var(--transition);
}

.form-group textarea {
  min-height: 150px;
  resize: none;
  overflow: auto;
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--primary);
  font-size: 1rem;
  transition: var(--transition);
  /* Empêche le redimensionnement manuel */
  resize: none;
  /* Désactive la poignée de redimensionnement dans certains navigateurs */
  overflow: auto;
}

.form-group {
  position: relative;
  margin-bottom: 2rem;
}

.form-group label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: var(--text-light);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: transparent;
}

/* Animation fluide au focus */
.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* Effet de lumière subtile sur le fond */
.form-group input:focus + label::before,
.form-group textarea:focus + label::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.03),
    transparent
  );
  border-radius: inherit;
  z-index: -1;
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.8rem) scale(0.85);
  color: var(--primary);
  background: rgba(12, 11, 11, 0.9); /* var(--secondary) légèrement assombri */
  padding: 0.1rem 0.8rem;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Style du bouton */
.submit-btn {
  width: 100%;
  padding: 1.2rem;
  background: var(--primary);
  color: var(--secondary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Animation de l'icône SVG */
.send-icon {
  transition: transform 0.3s ease;
}

.submit-btn:hover .send-icon {
  transform: translateX(3px);
}

/* Effet de survol */
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}


/* Animation d'envoi */
.submit-btn:active .send-icon {
  transform: translateX(8px) rotate(-30deg) scale(1.2);
  opacity: 0.8;
}

/* Traînée lumineuse */
.submit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: all 0.6s ease;
}

.submit-btn:hover::after {
  left: 100%;
}

/* Feedback au clic */
.submit-btn:active {
  transform: translateY(0) scale(0.98);
}

.close-contact {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  transition: var(--transition);
  z-index: 1001;
  width: 32px;
  height: 32px;
  font-size: 20px;
  text-align: center;
  background: var(--primary);
  color: #000;
  border: none;
  padding: 0;
  line-height: 1;
}

.close-contact:hover {
  transform: scale(1.1);
}

.form-message {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  width: 90%;
  max-width: 500px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-message.visible {
  bottom: 30px;
  opacity: 1;
  visibility: visible;
  animation: messageEntrance 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes messageEntrance {
  0% {
    transform: translate(-50%, 20px) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
}

.message-content {
  background: var(--primary);
  color: var(--secondary);
  padding: 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

* Style succès */
.form-message.success .message-content {
  background: var(--success-bg);
  color: var(--success);
  border-left: 4px solid var(--success);
}

/* Style erreur */
.form-message.error .message-content {
  background: var(--error-bg);
  color: var(--error);
  border-left: 4px solid var(--error);
}

.message-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.form-message.success .message-icon {
  fill: var(--success);
}

.form-message.error .message-icon {
  fill: var(--error);
}

/* Couleurs des icônes */
.form-message.success .message-icon path {
  fill: var(--success) !important;
}

.form-message.error .message-icon path {
  fill: var(--error) !important;
}

/* Animation pour l'icône */
.message-icon {
  transition: fill 0.3s ease;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.message-text {
  font-family: 'ESBuildTRIAL', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
}


/* Animation de sortie */
.form-message.hiding {
  animation: messageExit 0.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes messageExit {
  100% {
    transform: translate(-50%, 50px);
    opacity: 0;
  }
}

/* Animation d'entrée */
@keyframes slideIn {
  0% {
    transform: translate(-50%, 20px);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

/* ===== DESKTOP ===== */

@media (min-width: 1025px) {
  body {
    cursor: none;
  }
  
  .cursor, .cursor-dot {
    display: block;
  }
}


/* ===== MOBILE ===== */
@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 2rem;
  }

  .projects {
    width: 100%;
    margin-left: 0;
    padding: 2rem;
  }

  .project {
    margin: 0 0 1.5rem 0;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  #close-btn {
    top: 1rem;
    right: 1rem;
  }

  .contact-container {
    padding: 2rem;
    margin: 0 1rem;
    border-radius: 12px;
  }
  
  .contact-header h2 {
    font-size: 1.5rem;
  }

  .description {
    width: 100%;
  }

  .cursor, .cursor-dot {
    display: none !important;
  }

  .info1 {
    display: none;
  }
  
  .info2 {
    display: block;
  }

  .project.expanded *,.project.expanded {
    cursor: default !important;
  }

  a {
    cursor: pointer;
  }
  
}

/* =====
  SCROLLBAR
===== */

/* Firefox */
* {
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

/* Chrome, Edge, and Safari */
*::-webkit-scrollbar {
  width: 8px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

*::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  ;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}


/* =====
  END SCROLLBAR
===== */

/* ===== CURSOR ===== */

.cursor {
  position: fixed;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 77, 77, 0.3);
  border: 2px solid rgba(255, 77, 77, 0.8);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: 
    width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    height 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    background 0.3s ease,
    transform 0.1s ease;
  z-index: 9999;
  mix-blend-mode: normal;
}

.cursor-dot {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #FF4D4D;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  transition: opacity 0.3s ease;
}

/* Cache le point central sur les éléments interactifs */
button:hover ~ .cursor-dot,
a:hover ~ .cursor-dot,
input:hover ~ .cursor-dot,
textarea:hover ~ .cursor-dot {
  opacity: 0;
}

/* Agrandit le curseur sur les éléments interactifs */
button:hover ~ .cursor,
a:hover ~ .cursor,
input:hover ~ .cursor,
textarea:hover ~ .cursor {
  width: 40px;
  height: 40px;
  background: rgba(255, 77, 77, 0.2);
}

/* Style pour le nouveau bouton */
.view-project-btn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.5);
  color: rgba(0, 0, 0, 0.836);
  border: none;
  padding: 16px 24px;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  width: 80%;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.view-project-btn:hover {
  transform: translateX(-50%) scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-text {
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 8px;
  display: block;
}

.btn-action {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
}

/* Cache le bouton quand le projet est ouvert */
.project.expanded .view-project-btn {
  display: none;
}

/* Positionnement relatif pour le conteneur parent */
.project .content {
  position: relative;
}
