@import url('https://fonts.googleapis.com/css?family=Barlow:400,500,700');

:root {
  --white: #fff;
  --black: #232323;
  --gray: #8d8d8d;
  --red: #e83f43;
  --md: 768px; /* Example value, adjust as needed */
}

/* Reset box-sizing for all elements */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Barlow', sans-serif;
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--gray);
  background: var(--white);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: var(--gray);
  text-decoration: none;
}

a:hover {
  color: var(--black);
}

nav {
  position: relative;
  z-index: 2;
  padding: 1.25rem 0;
}

nav ul {
  line-height: 2.2;
  display: flex;
  justify-content: flex-start;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav ul li {
  margin: 0.325rem 0;
}

#logo {
  color: var(--black);
  font-weight: 700;
  font-size: 1.125rem;
}

#highlight {
  color: var(--red);
}

img {
  width: 100%;
  height: 43vh;
  object-fit: cover;
}

.vertical {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.intro {
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 0.8s 0.4s ease forwards;
}

.intro .title {
  display: inline-block;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: underline;
  color: var(--red);
}

.intro .title .underline {
  color: var(--black);
}

.description {
  position: relative;
  z-index: 1;
  margin: 1rem 0 1.5rem;
  font-size: 1rem;
  opacity: 0;
  animation: fadeIn 0.8s 0.6s ease forwards;
}

.slider-item {
  display: none;
}

.slider-item.active {
  display: block;
}

.slider-item.active .hide-mobile {
  display: none;
}

.slider-item.active .show-mobile {
  display: block;
  margin: 1rem 0;
}

button {
  position: relative;
  display: inline-block;
  cursor: pointer;
  outline: none;
  border: 0;
  vertical-align: middle;
  text-decoration: none;
  background: transparent;
  margin: 0;
  padding: 0;
  font-size: 100%;
  font: inherit;
  width: 55px;
  height: 55px;
}

.controls {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 0.25rem 0;
}

.controls .previous {
  border: 1px solid var(--black);
}

.controls .next {
  border-top: 1px solid var(--black);
  border-right: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
}

.controls .icon {
  position: relative;
  margin: auto;
  width: 20px;
  height: 1px;
  background-color: currentColor;
}

.controls .icon.arrow-left::before {
  content: '';
  position: absolute;
  left: 1px;
  top: -4px;
  width: 9px;
  height: 9px;
  border-top: solid 1px currentColor;
  border-right: solid 1px currentColor;
  transform: rotate(-135deg);
}

.controls .icon.arrow-right::before {
  content: '';
  position: absolute;
  right: 1px;
  top: -4px;
  width: 9px;
  height: 9px;
  border-top: solid 1px currentColor;
  border-right: solid 1px currentColor;
  transform: rotate(45deg);
}

.previous,
.next {
  display: flex;
  align-content: center;
  justify-content: center;
  flex-basis: 15%;
  font-size: 2rem;
  color: var(--black);
}

.previous:hover .icon,
.next:hover .icon {
  transform: scale(1.5);
}

.previous .icon,
.next .icon {
  transition: transform 0.1s ease;
}

.active .image-holder::before {
  position: absolute;
  content: '';
  z-index: 1;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--white);
  transform-origin: 100% 50%;
  animation: revealRight 1s cubic-bezier(0.23, 1, 0.75, 1) forwards;
}

@keyframes revealRight {
  0% {
    transform: scaleX(1);
  }

  100% {
    transform: scaleX(0);
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(20%);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.toggle-nav {
  display: flex;
  justify-content: flex-end;
  font-size: 1rem;
  line-height: 1.9;
}

.toggle-nav i {
  font-size: 1.5rem;
  line-height: 1.3;
  margin-left: 0.5rem;
}

.flex-nav ul {
  position: absolute;
  z-index: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-wrap: wrap;
  flex-direction: column;
  width: 100%;
  left: 0;
  padding: 1rem;
  background: var(--white);
  text-align: center;
}

.flex-nav ul.active {
  display: flex;
}

/* Media Queries */
@media (min-width: 768px) {
  nav ul {
    justify-content: flex-end;
  }

  #logo {
    font-size: 1.25rem;
  }

  .controls {
    padding: 1.75rem 0;
  }

  .intro {
    animation: fadeInLeft 0.8s 0.4s ease forwards;
  }

  .intro .title {
    font-size: 4.25rem;
    padding: 2.5rem;
    background: var(--white);
  }

  img {
    height: 60vh;
  }

  .description {
    font-size: 1.25rem;
    margin-top: 1rem;
  }

  .previous,
  .next {
    flex-basis: 8.33%;
  }

  .slider-item.active .hide-mobile {
    display: block;
  }

  .slider-item.active .show-mobile {
    display: none;
  }

  .toggle-nav {
    display: none;
  }

  .flex-nav ul {
    display: flex;
    flex-direction: row;
    position: relative;
    padding: 0;
    justify-content: flex-end;
  }

  nav {
    padding: 1.75rem 0;
  }

  nav ul li {
    font-size: 1rem;
    text-transform: uppercase;
    margin: 0 2rem 0 0;
  }

  nav ul li:nth-child(3) {
    margin-right: 0;
  }
}

.visually-hidden {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
