@import url('https://fonts.googleapis.com/css?family=Merriweather:900&display=swap');

:root {
  --color-primary: #ffffff;
  --color-primary2: #1b1b26;
  --color-secondary: #F0F7EE;
  --duration: 1s;
  --nav-duration: calc(var(--duration) / 4);
  --ease: cubic-bezier(0.215, 0.61, 0.355, 1);
  --space: 1rem;
  --font-primary: Orbitron;
  --font-heading: Orbitron;
  --font-size: 1.125rem;
  --line-height: 1.5;
}

/*
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

h1 {
  margin-bottom: calc(var(--space) * 3);
  font-family: var(--font-heading);
  font-size: calc(var(--font-size) + 6vmin);
  line-height: calc(var(--line-height) / 1.25);
}*/

.main-navigation-toggle {
  position: fixed;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
  
  + label {
    position: fixed;
    top: calc(var(--space) * 1.5);
    left: calc(var(--space) * 2);
    cursor: pointer;
    z-index: 12;
  }
}

.icon--menu-toggle {
  --size: calc(2rem + 4vmin);
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(var(--size));
  height: calc(var(--size));
  stroke-width: 6;
  background-color: #1b1b26;
  border-radius: 30px;
  padding: 15px;
}

.icon-group {
  transform: translateX(0);
  transition: transform var(--nav-duration) var(--ease);
}

.icon--menu {
  stroke: var(--color-primary);
}

.icon--close {
  stroke: var(--color-secondary);
  transform: translateX(-100%);
}

.main-navigation {
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 400px;
  height: 100%;
  transform: translateX(-100%);
  transition: transform var(--nav-duration);
  z-index: 1;
  
  &:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-primary2);
    transform-origin: 0 50%;
    z-index: -1;
  }
  
  ul {
    font-size: 1.3em;
    font-family: var(--font-heading);
    width: 100%;
    height: 80%;
    margin-bottom: 5%;
    margin-top: 15%;
   /* display: flex;
    flex-direction: column;
    justify-content: space-around;*/
  }
  
  li {
    --border-size: 3px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    max-width: 370px; /* Limite la largeur des traits blancs */
    
    &:after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      max-width: 370px;
      height: var(--border-size);
      background-color: var(--color-secondary);
      transform-origin: 0 50%;
      transform: translateX(-100%) skew(15deg);
    }
  }
  
  ul a {
    display: inline-block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    color: var(--color-secondary);
    line-height: 1;
    text-decoration: none;
    user-select: none;
    padding: var(--space) calc(var(--space) * 2) calc(var(--space) + var(--border-size) / 2);
    padding-bottom: 15px;
    padding-top: 15px;
    transform: translateY(100%);
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease, text-shadow 0.3s ease; /* Transition pour le survol */
  }

  ul a:hover {
    transform: translateY(0) scale(1.1); /* Effet de zoom au survol */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8), 
                 0 0 10px rgba(255, 255, 255, 0.6);
  }
}

.main-content {
  margin: 6rem auto;
  max-width: 70ch;
  padding: 0 calc(var(--space) * 2);
  transform: translateX(0);
  transition: transform calc(var(--nav-duration) * 2) var(--ease);
  
  > * + * {
    margin-top: calc(var(--space) * var(--line-height));
  }
}

.main-navigation-toggle:checked {
  ~ label .icon--menu-toggle {    
    .icon-group {
      transform: translateX(100%);
    }
  }
  
  ~ .main-content {
    transform: translateX(10%);
  }
  
  ~ .main-navigation {
    transition-duration: 0s;
    transform: translateX(0);
    
    &:after {
      animation: nav-bg var(--nav-duration) var(--ease) forwards;
    }
    
    li:after {
      animation: nav-line var(--duration) var(--ease) forwards;
    }
    
    ul a {
      animation: link-appear calc(var(--duration) * 1.5) var(--ease) forwards;
    }
    
    @for $i from 1 through 4 {
      li:nth-child(#{$i}) {
        &:after, a {
          animation-delay: calc((var(--duration) / 2) * #{$i} * 0.125);
        }
      }
    }
  }
}

@keyframes nav-bg {
  from { transform: translateX(-100%) skewX(-15deg) }
  to { transform: translateX(0) }
}

@keyframes nav-line {
  0%   { transform: scaleX(0); transform-origin: 0 50%; }
  35%  { transform: scaleX(1.001); transform-origin: 0 50%; }
  65%  { transform: scaleX(1.001); transform-origin: 100% 50%; }
  100% { transform: scaleX(0); transform-origin: 100% 50%; }
}

@keyframes link-appear {
  0%, 25%   { transform: translateY(100%); }
  50%, 100% { transform: translateY(0); }
}
  
ul a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 370px;
    height: var(--border-size);
    background-color: var(--color-secondary);
    transform-origin: 0 50%;
    transform: translateX(-100%) skew(15deg);
    animation: nav-line-hover var(--duration) var(--ease) forwards;
    display: none; /* Caché par défaut */
  }
  
  ul a:hover::after {
    display: block; /* Affiche le trait blanc au survol */
  }
  
  @keyframes nav-line-hover {
    0%   { transform: scaleX(0); transform-origin: 0 50%; }
    35%  { transform: scaleX(1.001); transform-origin: 0 50%; }
    65%  { transform: scaleX(1.001); transform-origin: 100% 50%; }
    100% { transform: scaleX(0); transform-origin: 100% 50%; }
  }
  
  .open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Couleur de fond semi-transparente */
    z-index: 10; /* Assure que le filtre est au-dessus du contenu */
  }
  
  .main-navigation {
    z-index: 11; /* Assure que le filtre est au-dessus du contenu */
  }

  #menu-accueil{
    margin-bottom: 25px;
    font-size: 1.5em;
  }

  #menu-sphinx{
    margin-bottom: 20px;
  }