:root {
  scroll-behavior: smooth;

  --red: rgb(227, 6, 20);
  --blue: rgb(62, 87, 140);
  --black: rgb(22, 22, 21);
  --text-blue: rgb(72, 88, 102);
  --color-primary: color-mix(in oklch, --text-blue, black 0%);
  font-family: Helvetica, Arial, sans-serif;

  --font-color: var(--text-blue);
}

@font-face {
  font-family: "whitenice";
  src: url("/static/Whitenice.ttf");
}

h3 {
  color: var(--black);
}

p {
  color: var(--text-blue);
  line-height: 100%;
}

nav {
  padding: 1rem;
}

@keyframes showTitle {
  from {
    display: none;
    opacity: 0;
  }

  to {
    display: inline-block;
    opacity: 1;
  }
}

#hero-container {
  overflow-x: hidden;
  background-image: url(/static/Background-main.svg);
  background-repeat: no-repeat;
  background-size: 100% 20rem;
  background-position: bottom;
  height: 40rem;
  position: relative;

  & > div {
    height: 100%;
    & > div {
      height: 100%;
    }
  }
}

#train {
  position: absolute;
  height: 5rem;
  bottom: 3rem;
  right: -100%;
  animation: 8s linear 2s normal infinite train-animation;
}

.train {
  right: 100%;
  animation: 8s linear 1s normal forwards train-animation;
}

.train.reverse {
  animation: 8s linear 1s normal forwards train-animation-reverse;
}

.train-block {
  .after-train {
    opacity: 0;
  }

  &:is(:not(.hidden)) .after-train {
    position: relative;
    z-index: 11;
    animation: 1s linear 3.5s normal forwards fade-in;

    span {
      display: inline-block;
      background-color: white;
      box-shadow: 0 0 20px 20px white;
    }
  }

  &:is(:not(.hidden)) .train-track {
    animation: 1.5s linear 3.25s reverse forwards fade-in;
    opacity: 1;
  }
}

.train-block.hidden {
  visibility: visible;

  .train {
    animation: none;
  }
}

@keyframes train-animation {
  0% {
    right: -100%;
  }
  40%,
  100% {
    right: 100%;
  }
}

@keyframes train-animation-reverse {
  0% {
    right: 100%;
  }
  40%,
  100% {
    right: -100%;
  }
}

h1#hero {
  padding: 1rem;
  text-align: center;
  height: 100%;
  position: relative;
  margin-bottom: 0;
  margin-top: 0;

  a.title-show {
    opacity: 1;
    display: inline-block;
    animation: showTitle 1s;
  }

  a {
    position: absolute;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    rotate: -3deg;

    font-size: calc(5rem * 1.2);
    font-weight: semi-bold;
    font-family: "Whitenice";
    line-height: 0.8;
    color: var(--blue);

    text-decoration: none;
    display: none;
    opacity: 0;
    animation: showTitle 1s reverse;
  }

  a.helvetica {
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1;
    font-weight: 800;
    font-size: calc(3.5rem * 1.2);
    text-align: center;
    color: var(--red);
    rotate: 0deg;
  }
}

h2,
#bien-vivre-a-avry {
  color: var(--red);
  font-weight: 800;
  font-size: 5rem;
  text-align: center;
  padding: 5rem 0;
  margin-top: 0;

  line-height: 1;
}

h3 {
  font-weight: 600;
}

#participer {
  font-size: 3rem;
  padding-bottom: 0rem;
  margin-bottom: 1.25rem;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  opacity: 0;
  --delay-base: 1s;
  --delay: var(--delay-base);
  animation: 1s ease var(--delay) 1 forwards fade-in;
}

.fade-in.fast {
  opacity: 0;
  --delay: calc(var(--delay-base) * 0.75);
}

.fade-in[data-delay="0"] {
  --delay-base: 0s;
}
.fade-in[data-delay="1"] {
  --delay-base: 1s;
}
.fade-in[data-delay="2"] {
  --delay-base: 2s;
}
.fade-in[data-delay="3"] {
  --delay-base: 3s;
}
.fade-in[data-delay="4"] {
  --delay-base: 4s;
}
.fade-in[data-delay="5"] {
  --delay-base: 5s;
}
.fade-in[data-delay="6"] {
  --delay-base: 6s;
}
.fade-in[data-delay="7"] {
  --delay-base: 7s;
}
.fade-in[data-delay="8"] {
  --delay-base: 8s;
}
.fade-in[data-delay="9"] {
  --delay-base: 9s;
}
.fade-in[data-delay="10"] {
  --delay-base: 10s;
}

.hidden {
  visibility: hidden;
  animation: none;

  .fade-in,
  .fade-in.fast {
    animation: none;
  }
}

.red {
  color: red;
}

section {
  padding: 2rem 0;
}

h4.handwritten {
  rotate: -3deg;

  font-size: calc(5rem * 1);
  font-weight: semi-bold;
  font-family: "Whitenice";
  line-height: 0.8;
  color: var(--blue);
}

#table-of-contents {
  display: none;
  position: sticky;
  top: 0;
}

#particeper-section {
  text-align: center;

  .row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;

    a {
      flex: 0 0 15rem;
      div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100%;
        padding: 1rem;

        border: 3px solid var(--blue);
        border-radius: 1rem;
      }
    }
  }
}
