* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
  text-align: center;
  background-color: #ede8d0;
  color: #2b1114;
}

nav ul.menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-direction: row;
  padding-left: 20px;
  background: #ca3504;
}

nav ul.menu li {
  position: relative;
  width: auto;
}

nav a {
  display: block;
  color: white;
  padding: 14px 16px;
  text-decoration: none;
  transition: background-color 0.3s;
}

nav a:hover {
  background-color: #d39a1c;
}

/* Icon + text only for the Accueil link */
nav a.nav-home {
  display: inline-flex; /* overrides nav a { display: block }  */
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

nav a.nav-home .nav-icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  opacity: 0.95;
  transform: translateY(-1px);
}

/* ================= SUBMENU ================= */

.has-submenu {
  position: relative;
}

.submenu-toggle {
  cursor: pointer;
  display: block;
  padding: 14px 16px;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s;
}

.submenu-toggle:hover {
  background-color: #ca3504;
}

/* Submenu - hidden by default */
ul.submenu {
  list-style: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(202, 53, 4, 0.85);
  border-radius: 4px;
  padding: 5px 0;
  min-width: 150px;

  display: none;
  flex-direction: column;
  z-index: 20;
  backdrop-filter: blur(5px);
}

/* Show submenu on hover */
.has-submenu:hover > ul.submenu {
  display: flex;
}

/* Submenu links style */
ul.submenu li a {
  padding: 10px 14px;
  color: #2b1114;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s;
  white-space: nowrap;
}

ul.submenu li a:hover {
  background-color: #ca3504;
  color: #fff;
}

.profile {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: #2b1114;
  flex-direction: column;
}

.logo {
  width: 30vw;
  max-width: 600px;
  height: auto;
  border-radius: 50%;
  display: block;
  transition: transform 0.5s;
  margin: 0 auto;
}

.logo-container {
  display: inline-block;
  perspective: 1000px;
  width: 300px;
  height: 300px;
  margin: 20px auto;
  position: relative;
}

.logo-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  transform-origin: center center;
}

.logo-container:hover .logo-inner {
  transform: rotateY(180deg) scale(0.9);
}

.logo-front,
.logo-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 50%;
  overflow: hidden;
  top: 0;
  left: 0;
}

.logo-front {
  transform: rotateY(0deg);
  z-index: 2;
}

.logo-back {
  transform: rotateY(180deg);
}

.logo-front img,
.logo-back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.about {
  max-width: 900px;
  margin: auto;
  padding: 0 20px;
  text-align: auto;
}

.about-me-title {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.about-me {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 30px;
}
.links {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-bottom: 40px;
}

.icon {
  width: clamp(100px, 20vw, 220px);
  height: auto;
  transition: transform 0.3s ease;
}

.icon:hover {
  animation: bounceTilt 1s cubic-bezier(0.25, 0.8, 0.25, 1);
}

footer {
  background-color: #c5ba9a;
  padding: 15px;
  font-size: 1rem;
  color: #2b1114;
}

a {
  color: inherit;
  text-decoration: underline;
}

a:hover {
  color: inherit;
}

@keyframes bounceTilt {
  0% {
    transform: scale(1) rotate(0deg);
  }
  20% {
    transform: scale(1.1) rotate(-8deg) translate(-5px, -8px);
  }
  40% {
    transform: scale(1.1) rotate(8deg) translate(5px, -8px);
  }
  60% {
    transform: scale(1.05) rotate(-5deg) translate(-3px, 0);
  }
  80% {
    transform: scale(1.05) rotate(5deg) translate(3px, 0);
  }
  100% {
    transform: scale(1) rotate(0deg) translate(0, 0);
  }
}

@media (max-width: 600px) {
  .links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }

  .icon {
    width: clamp(120px, 40vw, 160px);
    height: auto;
  }
}

#courses {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  #courses {
    grid-template-columns: repeat(2, 1fr);
  }
}

.icon {
  width: clamp(100px, 12vw, 200px);
  height: auto;
}

@media (max-width: 600px) {
  #courses {
    grid-template-columns: 1fr;
  }
}
.icon {
  width: clamp(100px, 25vw, 180px);
  height: auto;
}

@media (max-width: 800px) {
  nav ul.menu {
    flex-direction: column;
    text-align: center;
  }

  nav ul.menu li {
    width: 100%;
  }

  .submenu {
    position: static;
    background: rgba(202, 53, 4, 0.95);
    width: 100%;
    text-align: center;
    padding: 10px 0;
  }
  .submenu a {
    padding: 18px;
    font-size: 1.1em;
  }

  .has-submenu > .submenu-toggle::after {
    content: " ▾";
    font-size: 1.2em;
  }

  header h1 {
    font-size: 1.2em;
  }

  header h4 {
    font-size: 1em;
  }
}
