html {
  scroll-behavior: smooth;
}

.down-arrow {
  font-size: 44px;
  color: white;
  margin-top: 10px;
  animation: bounce 2s infinite;
}

/* Bouncing animation */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(8px);
  }
  60% {
    transform: translateY(4px);
  }
}

.hero-button {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: #397BAF;
  color: white;
  font-weight: bold;
  border: none;
  text-decoration: none;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

.hero-button:hover {
  background-color: #CFDA5A;
  color: black;
}

h1 {
  position: relative;
  font-size: 68px;
  font-weight: bold;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typing 3s steps(30, end) infinite alternate, blink 0.7s step-end infinite;
  border-right: 2px solid #556B2F;
  color: #CFDA5A; /* default color */
}

/* Typing animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 28ch;
  }
}

/* Blinking cursor */
@keyframes blink {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: white;
  }
}

/* Optional: change text color every loop using keyframes */
@keyframes colorSwitch {
  0%, 100% {
    color: #CFDA5A;
  }
  50% {
    color: #397BAF;
  }
}

/* Apply colorSwitch on top */
h1 {
  animation:
    typing 3s steps(30, end) infinite alternate,
    blink 0.7s step-end infinite,
    colorSwitch 6s linear infinite; /* 6s matches 2x typing duration */
}
.hero-text {
  display: flex;
  flex-direction: column; /* force l'empilement vertical */
  align-items: center;     /* centrer horizontalement si besoin */
  text-align: center;      /* centrer le texte à l'intérieur */
}
.hero-text p {
  margin-bottom: 10px;
}

.hero-text h4{
  margin-top: 70px;
}

/* RESET GÉNÉRAL */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  background-color: white;
  color: #333;
  line-height: 1.6;
  scroll-behavior: smooth;
  overflow-x: hidden; /* Éviter le scroll horizontal */
}

/* CORRECTION PRINCIPALE POUR .LINAA - IMAGE RESPONSIVE */
.linaa {
  display: block;
  width: 80%;
  max-width: 1200px;
  height: auto;
  margin: 2rem auto;
  object-fit: contain;
}

h2 {
  display: inline-block;
  font-size: 46px;
  background-color: #CFDA5A;
  margin-bottom: 4rem;
}
/* NAVIGATION */
nav {
  display: flex;
  justify-content: flex-end;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.logo {
position: absolute;
width: 40%;
max-width: 520px;
left: -428px;
top: -80px;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 4rem;
}

nav a {
  position: relative;
  color: black;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  border: 1.5px solid black;
  border-width: 3px;
  padding: 5px;

}

nav a:hover {
  color: #CFDA5A;
  
}
nav a::after{
  content:'';
  position: absolute;
  right:0;
  bottom: -4px;
  width: 0%;
  height:2px;
  background-color: #397BAF ;
  transition: width 0.3s ease;
}
nav a:hover::after {
  width :100%;
  left:0;
  right: auto;
}

/* Burger Menu */
.burger-menu {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
}

.burger-line {
  width: 25px;
  height: 3px;
  background-color: black;
  transition: 0.3s;
}

.burger-menu.active .burger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger-menu.active .burger-line:nth-child(2) {
  opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* HERO */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

#bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.hero-text {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.5rem;
  border-radius: 15px;
}

/* SECTIONS */
section {
  padding: 5rem 2rem;
  text-align: center;
}

/* ABOUT */
.about-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

#about img.cv {
  max-width: 600px;
  height: auto;
  margin-bottom: 0;
  object-fit: cover;
 
}

.about-text {
  flex: 1;
  font-weight: bold;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  text-align: left;
  max-width: 600px;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.button-style {
  padding: 0.7rem 1.2rem;
  background-color: black;
  color: white;
  text-decoration: none;
  border: none;
  font-family: monospace;
  transition: background-color 0.3s ease;

}

.button-style:hover {
  background-color: #397BAF;
}

.line {
  width: 80%;
  height: 2px;
  background-color: #333;
  margin: 3rem auto;
}

/* PROJETS - New Layout */
.projects-container {
  max-width: 1200px;
  margin: 0 auto;
}

.project-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.project-thumb {
  cursor: pointer;
  text-align: center;
  transition: transform 0.3s ease;
  border: 3px solid transparent;
  padding: 1rem;
}

.project-thumb:hover {
  transform: scale(1.05);
  border-color: #CFDA5A;
}

.project-thumb.active {
  border-color: #397BAF;
  background-color: #f8f9fa;
}

.project-thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border: 3px solid black;
  margin-bottom: 1rem;
}

.project-thumb p {
  font-weight: bold;
  font-family: 'Courier New', Courier, monospace;
}

/* DÉTAILS PROJETS - New Layout */
.project-detail {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-top: 3rem;
}

.project-preview {
  flex: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel-container {
  position: relative;
  width: 100%;
  max-width: 600px;
}

.carousel-container img {
  width: auto;
  height: 400px;
  object-fit: cover;
  border: 5px solid black;
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-70%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  font-size: 3rem;
  cursor: pointer;
  padding: 1rem;
  transition: background-color 0.3s ease;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

.nav-btn:first-of-type {
  left: -100px;
}

.nav-btn:last-of-type {
  right: -100px;
}

.dots {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #bbb;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: #397BAF;
}

.project-description {
  flex: 1;
  text-align: left;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  padding: 1rem;
  background-color: #f8f8f8;
  border: 3px solid black;
}

.project-description h3 {
  margin-bottom: 1rem;
  color: #397BAF;
}

/* CONTACT - New Layout */
.contact-container {
  display: flex;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

.contact-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-text {
  text-align: left;
  margin-bottom: 2rem;
}

.contact-text h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contact-text p {
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Courier New', Courier, monospace;
}

.pictogram {
  width: 300px;
  height: auto;
  max-width: 100%;
}

.contact-right {
  flex: 1;
}

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

.input-row {
  display: flex;
  gap: 1rem;
}

.input-row input {
  flex: 1;
}

input, textarea {
  font-family: 'Courier New', Courier, monospace;
  padding: 0.75rem;
  border: 4px solid black;
  font-size: 1rem;
  outline: none;
  width: 100%;
}

textarea {
  height: 150px;
  resize: vertical;
}

button {
  background-color: black;
  color: white;
  border: none;
  padding: 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: 'Courier New', Courier, monospace;
  transition: background-color 0.3s ease;
  border-radius: 4px;
}

button:hover {
  background-color: #CFDA5A;
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 55px;
  font-size: 28px;
  background-color: #397BAF;
  color: white;
  padding: 12px 25px;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.back-to-top:hover {
  background-color: #CFDA5A;
  color: black;
}

/* Visible state */
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

/* ================================== */
/* RESPONSIVE - AMÉLIORATIONS COMPLÈTES */
/* ================================== */

/* TRÈS GRANDES TAILLES (Desktop XL) */
@media (min-width: 1441px) {
  .hero-text {
    font-size: 1.8rem;
  }
  
  h1 {
    font-size: 80px;
  }
  
  .carousel-container img {
    height: 500px;
  }
  
  .linaa {
    width: 85%;
    max-width: 1400px;
  }
}

/* DESKTOP LARGE */
@media (max-width: 1440px) {
  .logo {
    left: -350px;
    max-width: 450px;
  }
  
  nav ul {
    gap: 3rem;
  }
  
  .linaa {
    width: 82%;
    max-width: 1200px;
  }
}

/* DESKTOP MOYEN */
@media (max-width: 1200px) {
  .logo {
    left: -280px;
    max-width: 400px;
  }
  
  nav ul {
    gap: 2.5rem;
  }
  
  nav {
    font-size: 1.3rem;
  }
  
  .about-container {
    gap: 2rem;
  }
  
  #about img.cv {
    max-width: 500px;
  }
  
  .nav-btn:first-of-type {
    left: -80px;
  }
  
  .nav-btn:last-of-type {
    right: -80px;
  }
  
  .linaa {
    width: 80%;
    max-width: 1000px;
  }
}

/* TABLETTE LARGE */
@media (max-width: 1024px) {
  .logo {
    left: -200px;
    max-width: 350px;
    top: -60px;
  }
  
  nav ul {
    gap: 2rem;
  }
  
  nav {
    font-size: 1.2rem;
    padding: 1rem 1.5rem;
  }
  
  h1 {
    font-size: 55px;
  }
  
  .hero-text {
    font-size: 1.3rem;
    padding: 1.5rem;
  }
  
  h2 {
    font-size: 40px;
  }
  
  section {
    padding: 4rem 1.5rem;
  }
  
  .about-container {
    gap: 2rem;
  }
  
  #about img.cv {
    max-width: 450px;
  }
  
  .project-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
  }
  
  .project-thumb img {
    height: 180px;
  }
  
  .carousel-container img {
    height: 350px;
  }
  
  .nav-btn:first-of-type {
    left: -60px;
  }
  
  .nav-btn:last-of-type {
    right: -60px;
  }
  
  .contact-container {
    gap: 2rem;
  }
  
  .pictogram {
    width: 250px;
  }
  
  .linaa {
    width: 75%;
    max-width: 800px;
  }
}

/* TABLETTE */
@media (max-width: 768px) {
  /* Navigation mobile */
  nav ul {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transition: left 0.3s ease;
  }

  nav ul.active {
    left: 0;
  }

  .burger-menu {
    display: flex;
  }
  
  .logo {
    left: -150px;
    max-width: 280px;
    top: -50px;
  }
  
  /* Hero section */
  h1 {
    font-size: 45px;
  }
  
  .hero-text {
    font-size: 1.2rem;
    padding: 1rem;
  }
  
  .hero-text h4 {
    margin-top: 50px;
    font-size: 1rem;
  }
  
  .down-arrow {
    font-size: 35px;
  }
  
  /* Sections générales */
  h2 {
    font-size: 35px;
  }
  
  section {
    padding: 3rem 1rem;
  }

  /* About section */
  .about-container {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .about-text {
    text-align: center;
    max-width: 100%;
  }
  
  #about img.cv {
    max-width: 400px;
    width: 100%;
  }
  
  .button-group {
    justify-content: center;
  }

  /* Projects section */
  .project-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
  }
  
  .project-thumb img {
    height: 160px;
  }

  .project-detail {
    flex-direction: column;
    gap: 2rem;
  }
  
  .carousel-container img {
    height: 300px;
    width: 100%;
  }

  .nav-btn {
    display: none;
  }

  /* Contact section */
  .contact-container {
    flex-direction: column;
    gap: 2rem;
  }

  .input-row {
    flex-direction: column;
  }
  
  .pictogram {
    width: 200px;
  }
  
  /* CORRECTION LINAA POUR TABLETTE */
  .linaa {
    width: 70%;
    max-width: 500px;
    margin: 1.5rem auto;
  }
  
  /* Back to top button */
  .back-to-top {
    bottom: 20px;
    right: 30px;
    font-size: 24px;
    padding: 10px 20px;
  }
}

/* MOBILE LARGE */
@media (max-width: 600px) {
  .logo {
    left: -100px;
    max-width: 220px;
    top: -40px;
  }
  
  nav {
    padding: 0.8rem 1rem;
  }
  
  h1 {
    font-size: 35px;
  }
  
  .hero-text {
    font-size: 1.1rem;
  }
  
  .hero-text h4 {
    margin-top: 30px;
    font-size: 0.9rem;
  }
  
  h2 {
    font-size: 28px;
  }
  
  section {
    padding: 2.5rem 1rem;
  }
  
  #about img.cv {
    max-width: 350px;
  }
  
  .project-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }
  
  .project-thumb img {
    height: 140px;
  }
  
  .carousel-container img {
    height: 250px;
  }
  
  .pictogram {
    width: 180px;
  }
  
  /* CORRECTION LINAA POUR MOBILE LARGE */
  .linaa {
    width: 65%;
    max-width: 400px;
    margin: 1rem auto;
  }
}

/* MOBILE */
@media (max-width: 480px) {
  .logo {
    left: -80px;
    max-width: 180px;
    top: -30px;
  }
  
  nav {
    font-size: 1rem;
    padding: 0.5rem;
  }
  
  h1 {
    font-size: 28px;
  }
  
  .hero-text {
    font-size: 1rem;
    padding: 0.8rem;
  }
  
  .hero-text h4 {
    margin-top: 20px;
    font-size: 0.8rem;
  }
  
  .down-arrow {
    font-size: 30px;
  }
  
  h2 {
    font-size: 24px;
  }
  
  section {
    padding: 2rem 0.8rem;
  }
  
  #about img.cv {
    max-width: 300px;
  }
  
  .about-text {
    font-size: 0.9rem;
  }
  
  .button-style {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .project-thumbnails {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .project-thumb {
    padding: 0.8rem;
  }
  
  .project-thumb img {
    height: 120px;
  }
  
  .carousel-container img {
    height: 200px;
  }
  
  .project-description {
    font-size: 0.9rem;
    padding: 0.8rem;
  }
  
  .contact-text p {
    font-size: 0.9rem;
  }
  
  input, textarea {
    padding: 0.6rem;
    font-size: 0.9rem;
  }
  
  button {
    padding: 0.8rem;
    font-size: 1rem;
  }
  
  .pictogram {
    width: 150px;
  }
  
  /* CORRECTION LINAA POUR MOBILE */
  .linaa {
    width: 60%;
    max-width: 300px;
    margin: 0.8rem auto;
  }
  
  .back-to-top {
    bottom: 15px;
    right: 20px;
    font-size: 20px;
    padding: 8px 15px;
  }
}

/* TRÈS PETIT MOBILE */
@media (max-width: 360px) {
  .logo {
    left: -60px;
    max-width: 150px;
    top: -25px;
  }
  
  h1 {
    font-size: 24px;
  }
  
  .hero-text {
    font-size: 0.9rem;
  }
  
  .hero-text h4 {
    font-size: 0.75rem;
  }
  
  h2 {
    font-size: 20px;
  }
  
  section {
    padding: 1.5rem 0.5rem;
  }
  
  #about img.cv {
    max-width: 250px;
  }
  
  .project-thumb img {
    height: 100px;
  }
  
  .carousel-container img {
    height: 180px;
  }
  
  .pictogram {
    width: 120px;
  }
  
  /* CORRECTION LINAA POUR TRÈS PETIT MOBILE */
  .linaa {
    width: 55%;
    max-width: 250px;
    margin: 0.5rem auto;
  }
}

footer {
  color: #666;
  text-align: center;
  font-size: 0.9rem;
}