:root {
  --golden-color: linear-gradient(to right, #ecc440, #fffa8a, #ddac17, #ffff95);
  --golden-color-reverse: linear-gradient(to left, #ecc440, #fffa8a, #ddac17, #ffff95);
  --semi-gold: linear-gradient(to right, #ecc440, #fffa8a);
  --yellow-golden: #ffff95;
  --white: #eef0fc;
  --timeline-color: orange;
}

html {
  scroll-behavior: smooth;

  &::selection {
    background-color: blueviolet;
    color: var(--white);
  }
}

a {
  color: inherit;
  text-decoration: none;
}

body {
  background: linear-gradient(#101d42, #1d28a0);
  background-attachment: fixed;
  color: var(--white);
  margin: 0;
  font-family: Manrope, sans-serif;
  padding-top: 3.65rem;
}

body::before {
  content: "";
  width: 100%;
  height: 100%;
  bottom: 0;
  top: auto;
  background-image: linear-gradient(#101d42, #1d28a0);
  position: fixed;
  z-index: -1;
}

.overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 10rem;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2;
}

header {
  opacity: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(15px);
  box-shadow: 0 2px 10px black;
  padding: 0.5rem 1.5rem;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: space-between;
  align-items: center;
  z-index: 3;
  transition: opacity 0.3s ease-in-out;

  &.header-active {
    opacity: 1;
  }

  & > a:first-child {
    font-family: "Pacifico", sans-serif;
    font-size: 1.5em;
    width: fit-content;
  }

  & .menu-icon {
    justify-self: end;
    & img {
      width: 1.5rem;
    }
  }

  & nav {
    display: none;

    & a {
      text-decoration: none;
      color: inherit;
    }

    &.nav-active {
      display: flex;
      padding: 1rem 0;
      flex-direction: column;
      gap: 2.5rem;
      grid-column: 1 / span 2;
      width: 100%;
      align-items: center;
      border-top: 3px solid;
    }
  }
}

main,
footer {
  font-size: 1rem;
}

/* Introduction */

#intro {
  display: flex;
  flex-direction: column;
  padding-left: 1rem;
  padding-right: 1rem;
}

.content {
  text-align: center;
  align-self: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;

  &.active {
    opacity: 1;
  }

  & em {
    font-style: normal;
    background-image: var(--golden-color);
    color: transparent;
    background-clip: text;
    font-weight: 600;
  }

  & p:first-child {
    font-weight: 600;
    font-family: Manrope;
    font-size: 2.5em;
    margin: 0;
  }

  & p:nth-child(2) {
    font-family: Manrope;
    font-size: 1.5em;
    font-weight: 200;
  }

  & p:last-child {
    font-size: 1.25em;
    width: 90%;
    margin: auto;
    margin-top: 4rem;
  }
}

.square {
  height: 3rem;
  min-width: 3rem;
  max-width: 3rem;
  border-width: 5px;
  border-style: solid;
  border-image-source: var(--golden-color);
  transition: all 0.6s ease-in-out;
  position: absolute;
}

.sq-left-top {
  border-image-slice: 1 0 0 1;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;

  &.active {
    transform: translate(-100%);
    left: 0;
    top: 0;
  }
}

.sq-right-bottom {
  border-image-slice: 0 1 1 0;
  align-self: flex-end;
  transform: translate(49%, 41.5%);
  right: 50%;
  bottom: 50%;

  &.active {
    transform: translate(100%);
    right: 0;
    bottom: 0;
  }
}

/* General section's settings */
section:not(#intro) {
  opacity: 0;
  transition: opacity 0.5s ease-in;

  &.active {
    opacity: 1;
  }
}

.section-body {
  font-family: "Sora", sans-serif;
  padding: 4rem 1rem 7rem;
}

section-title:has(.section-title) {
  scroll-margin-top: 4rem;
}

.section-title {
  display: flex;
  align-items: center;

  & h1 {
    padding: 0;
    font-family: Manrope;
    font-weight: 700;
    font-size: 2.25em;
    letter-spacing: 0.1em;
  }

  & .line {
    height: 4px;
    flex: 1;
  }

  & .line-left {
    background-image: var(--golden-color);
  }

  & .line-right {
    background-image: var(--golden-color-reverse);
  }

  & .bracket {
    min-width: 30px;
    height: 56px;
    border-bottom: 4px solid var(--yellow-golden);
    border-top: 4px solid var(--yellow-golden);
  }

  & .bracket-left {
    border-left: 4px solid var(--yellow-golden);
  }

  & .bracket-right {
    border-right: 4px solid var(--yellow-golden);
  }
}

/* Career path */

.path-title {
  display: none;
}

.path {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 5fr;
  grid-template-rows: repeat(5, auto);
  row-gap: 9em;
}

.timeline,
.timeline-end,
.timeline-point {
  grid-column: 1;
}

.timeline {
  grid-row: 1 / -1;
  position: relative;
  top: 0.625rem;

  &::after {
    content: "";
    position: absolute;
    width: 0.625em;
    top: 0;
    bottom: 0.625rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--timeline-color);
  }
}

.timeline-point {
  position: relative;

  &::after {
    content: "";
    position: absolute;
    width: 2.25em;
    height: 2.25em;
    background-color: var(--timeline-color);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
  }
}

.timeline-end {
  position: relative;

  &::after {
    content: "";
    position: absolute;
    width: 7.5rem;
    height: 0.625em;
    background-color: var(--timeline-color);
    left: 50%;
    bottom: 0;
  }
}

.step-path {
  & p {
    margin: 0;
    margin-bottom: 10px;
  }

  & .title-step {
    font-family: Manrope, sans-serif;
    font-weight: 700;
    font-size: 1.5em;
  }

  & .location-step {
    font-family: Inter, sans-serif;
    font-weight: 200;
    font-style: italic;
  }

  & .content-step {
    font-size: 1.2em;
    font-weight: 300;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 1.25rem;
    border-radius: 10px;
    width: fit-content;
    margin-top: 1.25rem;
    opacity: 0;
  }
}

step-item:last-of-type {
  padding-bottom: 8em;
}

step-item {
  grid-column: 2;
}

.actual-position {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2rem;
  font: 1.5em Manrope, sans-serif;

  & p {
    margin: 0.7rem 0;

    &:first-child {
      font-weight: 700;
      font-size: 1.15em;
      margin-bottom: 1rem;
      text-align: center;
    }
  }
}

/* Skill's section */
section-title[text="Compétences"] + .section-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 4rem;
}

.skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.7em;
  font-weight: 600;
  width: fit-content;

  & > p {
    margin-top: 0;
    & .rank {
      font-size: 2em;
    }
  }
}

.level {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.star {
  width: 2rem;
  height: 1rem;
  border: 3px solid;
  transform: skew(-20deg);
  border-image-source: var(--semi-gold);
  border-image-slice: 1;
}

.star-completed {
  background-image: var(--semi-gold);
}

.star-not-completed {
  box-sizing: border-box;
  background-color: transparent;
}

/* Projects */

section-title[text="Projets"] + .section-body {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  row-gap: 5em;
}

.project {
  width: 15em;
  height: 15em;
  background-size: contain;
  background-repeat: no-repeat;
  background-position-y: center;
  border-radius: 25px;
  overflow: hidden;
  transition: box-shadow 0.4s ease-in-out;

  &.project-active {
    box-shadow: 0px 0px 1rem 10px var(--white);
  }

  & div {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.9);
    transition: opacity 0.5s ease-in-out;
    padding: 0 1.1em;

    &.project-active {
      pointer-events: auto;
      opacity: 1;
    }

    & p {
      font-size: 1.25em;
      text-align: center;
      margin: 0;
    }

    & button {
      cursor: pointer;
      font-family: Manrope, sans-serif;
      font-size: inherit;
      border: 3px solid var(--white);
      background-color: transparent;
      color: inherit;
      padding: 0.5rem 1.8rem;
      border-radius: 25px;
      transition-property: color, background-color;
      transition-duration: 0.3s;
      transition-timing-function: ease-in-out;

      &:active {
        background-color: var(--white);
        color: black;
      }
    }
  }
}

/* Contact */

section-title[text="Contact"] + div {
  font-size: 1.1em;

  & ul {
    padding-left: 1.5rem;
  }
}

.link-linkedin {
  color: inherit;
}

#download-btn {
  padding: 1rem;
  color: transparent;
  font-family: Manrope, sans-serif;
  font-size: inherit;
  font-weight: 500;
  border: 3px solid;
  border-image: var(--golden-color);
  border-image-slice: 1;
  background-image: var(--golden-color);
  background-clip: text;
  cursor: pointer;
  transition: color 0.3s ease-out;
}

#download-btn:active {
  color: #101d42;
  background-clip: border-box;
}

/* Citations*/

.quote-section {
  background-color: var(--white);
  color: #101d42;
  padding: 2rem 0;
}

.quote-title {
  text-align: center;
  font-family: "Caveat", sans-serif;
  font-weight: 700;

  & h1 {
    margin: 0;
    font-size: 2em;
  }
}

.carousel {
  margin-top: 3rem;
  overflow: hidden;
}

.quote-nav {
  text-align: center;

  & button {
    cursor: pointer;
    height: 15px;
    width: 15px;
    padding: 0;
    border-radius: 50%;
    background-color: transparent;
    border: 3px solid #232ed1;
    transition: background-color 0.5s ease;
  }

  & button:first-child {
    background-color: #232ed1;
  }
}

.quote {
  font-style: italic;
  font-family: Inter, sans-serif;
  font-size: 1.25em;
  padding: 0 1.5rem;
  flex: 0 1 100%;
  font-weight: 300;
  display: flex;
  justify-content: center;

  & p:first-child {
    font-weight: 600;
  }
}

.quote-wrapper {
  display: flex;
  width: 200%;
  transition: transform 0.5s ease;
}

/* Footer */
footer {
  display: flex;
  flex-direction: column;
  row-gap: 1rem;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #101d42;
}

.links {
  display: flex;
  column-gap: 1.2rem;
  & img {
    width: 1.8rem;
    height: auto;
  }

  & a {
    display: inline-flex;
  }
}

/* Responsive Design */

@media screen and (max-width: 599px) {
  main,
  footer {
    font-size: 0.8rem;
  }

  #intro .content {
    font-size: 0.8rem;
  }

  .section-title {
    & h1 {
      font-size: 1.8em;
    }

    & .line {
      height: 3px;
    }

    & .bracket {
      border-width: 3px;
    }
  }

  .step-path {
    font-size: 0.75rem;
  }
}

@media screen and (min-width: 600px) {
  section-title[text="Contact"] + div {
    font-size: 1.25em;

    & ul {
      padding-left: revert;
    }
  }
}

@media screen and (min-width: 768px) {
  header {
    opacity: 1;
    & .menu-icon {
      display: none;
    }
    & nav {
      display: flex;
      gap: 2.5rem;
      justify-self: end;
    }
  }

  #intro {
    flex-direction: row;
    justify-content: space-between;
    height: 28rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .section-title h1 {
    padding: 0 2rem;
  }

  .square {
    position: relative;
    height: 3.5rem;
    min-width: 3.5rem;

    &.active {
      transform: translate(0%, 0%);
    }
  }

  .sq-right-bottom {
    transform: translate(49%, 42.5%);
  }

  .quote-title h1 {
    font-size: 2.5em;
  }

  .quote {
    padding: 0 4rem;
  }

  footer {
    flex-direction: row-reverse;
    justify-content: space-between;
  }
}

@media screen and (min-width: 992px) {
  #intro {
    padding-left: 6rem;
    padding-right: 6rem;
  }

  .square {
    height: 7rem;
    min-width: 7rem;
  }

  .sq-right-bottom {
    transform: translate(50%, 46%);
  }

  .section-body {
    padding: 4rem 6rem 7rem;
  }

  #parcours + .section-body {
    padding: 4rem 4rem 7rem;
  }

  .path-title {
    display: flex;
    justify-content: space-around;
    font-size: 1.75em;

    & p {
      flex: 1;
      text-align: center;
      position: relative;

      &::after {
        content: "";
        display: inline-block;
        background-size: contain;
        background-repeat: no-repeat;
        width: 2.8rem;
        height: 2.8rem;
        position: relative;
        left: 1rem;
      }

      &:first-child::after {
        background-image: url("./assets/Cap.svg");
        height: 2rem;
        vertical-align: top;
      }

      &:last-child::after {
        background-image: url("./assets/Suitcase\ work.svg");
        height: 2.6rem;
        vertical-align: bottom;
      }
    }
  }

  .path {
    grid-template-columns: 2fr 1fr 2fr;
  }

  .timeline,
  .timeline-end,
  .timeline-point {
    grid-column: 2;
  }

  .timeline-end::after {
    width: 15rem;
    transform: translate(-50%, 50%);
  }

  .step-path .content-step {
    margin-left: 0.625rem;
  }

  .training-item {
    grid-column: 1;
  }

  .job-item {
    grid-column: 3;
  }

  .actual-position {
    font-size: 1.3em;

    & p:first-child {
      font-size: 1.4em;
    }
  }

  section-title[text="Compétences"] + .section-body {
    flex-direction: row;
    padding: 4rem 4rem 7rem;
    justify-content: space-between;
  }
}

@media screen and (min-width: 1200px) {
  #intro .content p:last-child {
    width: 80%;
  }

  #parcours + .section-body {
    padding: 4rem 6rem 7rem;
  }

  section-title[text="Compétences"] + .section-body {
    flex-direction: row;
    justify-content: space-around;
  }
}

@media (hover: hover) and (pointer: fine) {
  #download-btn:hover {
    color: #101d42;
    background-clip: border-box;
  }

  .project {
    &:hover {
      box-shadow: 0px 0px 1rem 10px var(--white);
    }

    & div {
      pointer-events: auto;
      & button:hover {
        background-color: var(--white);
        color: black;
      }
      &:hover {
        opacity: 1;
      }
    }
  }
}

@media (pointer: coarse) {
  .quote-nav button {
    height: 20px;
    width: 20px;

    &:first-child {
      margin-right: 0.5rem;
    }
  }
}
