/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}


/* -------------------------------- */

@font-face {
  font-family: 'Anton';
  src: url("../fonts/Anton-Regular.ttf");
}

@font-face {
  font-family: 'Manrope';
  src: url("../fonts/Manrope-Regular.ttf");
}

@font-face {
  font-family: 'Oswald';
  src: url("../fonts/Oswald-VariableFont_wght.ttf");
}

:root {
  --color-black: #000000;
  --color-white: #ffffff;
  --color-body-dark: #020403;
  --color-body-gray: #e8e8e8;
  --color-header-black: #0d0f0e;
  --color-header-secondary: #257872;
  --color-overlay: rgba(37, 120, 114, 0.22);
  --color-marquee: #f7f7f7;
  --transition: all 0.5s ease;
}

.hgroup-base {
  text-transform: uppercase;
  font-family: 'Anton', 'Oswald', sans-serif;
  text-align: center;
}

.green-header {
  color: var(--color-header-secondary);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.5;
  letter-spacing: 0.15em;
}

.black-header {
  color: var(--color-header-black);
  font-size: 4.5rem;
  text-transform: uppercase;
  font-weight: 500;
  line-height: 1.1em;
  letter-spacing: -0.01em;
}

.white-header {
  color: var(--color-white);
}

.black-paragraph {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.5em;
  font-family: 'Manrope', 'Oswald', sans-serif;
  color: var(--color-header-black);
}

.white-paragraph {
  color: var(--color-white);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img {
  width: 100%;
  border-radius: 4px;
}

.container {
  width: min(95%, 1200px);
  margin: 0 auto;
}

.hero-section {
  background-color: var(--color-body-dark);
  padding: 100px 0 80px;

  hgroup {
    padding-bottom: 25px;
    border-bottom: 1px solid var(--color-white);
    margin-bottom: 60px;

    h1 {
      color: var(--color-white);
      font-size: 6.75rem;
      line-height: 1.1;
      font-weight: 400;
    }

    p {
      margin-bottom: 20px;
    }
  }
}

.hero-photos {
  color: var(--color-white);
  display: grid;
  grid-template-columns: 1fr 1fr 1.15fr;
  gap: 40px;
  padding-bottom: 80px;
  font-weight: 400;

  img {
    transition: var(--transition);

    &:hover {
      transform: scale(1.01);
    }
  }

  & > div {
    display: flex;
    flex-direction: column;
    align-items: center;

    &:nth-child(1) {
      gap: 60px;
    }

    &:nth-child(2) {
      justify-content: center;
    }

    &:nth-child(3) {
      gap: 40px;

      p {
        padding: 0;
        line-height: 1.7em;
      }
    }

    div {
      display: flex;
      justify-content: space-between;
      text-align: center;
    }
  }

  p {
    line-height: 1.2em;
    padding: 15px;
    color: var(--color-white);
  }

  span {
    display: block;
    font-family: 'Anton', 'Oswald', sans-serif;
    line-height: 1.3em;
    font-size: 4rem;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
  }
}

.hero-contact {
  padding: 40px;
  display: flex;
  align-items: center;
  position: relative;
  background-color: var(--color-header-secondary);
  font-family: 'Anton', 'Oswald', sans-serif;
  font-weight: 400;
  border-radius: 4px;

  div {
    z-index: 5;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("../img/background.png");
    background-size: 31% auto;
    opacity: 0.22;
  }

  p {
    z-index: 10;
    width: 60%;
    color: var(--color-white);
    font-size: 3.5rem;
    text-transform: uppercase;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }

  a {
    z-index: 10;
    text-decoration: none;
    color: #000000;
    text-transform: uppercase;
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    margin: 0 40px 0 auto;
    padding: 18px 25px;
    background-color: var(--color-white);
    border-radius: 2px;
    transition: var(--transition);

    &:hover, &:focus {
      color: var(--color-white);
      background-color: var(--color-black);
    }
  }
}

.come-as-you-are {
  background-color: var(--color-white);
  padding: 100px 0 80px;
  position: relative;

  .container {
    display: flex;
    gap: 40px;
    z-index: 5;
    position: relative;

    & > div:nth-of-type(1) {
      padding: 20px 0;
      width: 55%;

      img {
        margin-bottom: 40px;
      }
    }

    & > div:nth-of-type(2) {
      width: 45%;

      p {
        font-family: 'Anton', 'Oswald', sans-serif;
        transform: translateX(-5%);
      }

      img {
        margin-top: 20px;
      }
    }
  }
}

.marquee-container {
  position: absolute;
  bottom: 140px;
  width: 100%;
  overflow: hidden;

  h2 {
    font-size: 10rem;
    font-weight: 400;
    font-family: 'Anton', 'Oswald', sans-serif;
    color: var(--color-marquee);
    animation: marquee 20s infinite;
    text-wrap: nowrap;
  }

}

@keyframes marquee {
  0% {
    transform: translateX(10%);
  }
  50% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(10%);
  }
}

.what-i-do, .my-works, .contacts {
  padding: 100px 0 80px;
  background-color: var(--color-body-gray);

  hgroup {
    margin-bottom: 60px;
  }

  h2 {
    margin-bottom: 40px;
  }
}

.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  list-style: none;

  h3 {
    color: var(--color-header-black);
    font-size: 2.125rem;
    font-weight: 500;
    font-family: 'Anton', 'Oswald', sans-serif;
    text-transform: uppercase;
    line-height: 1.2em;
    text-align: center;
  }

  p {
    text-align: center;
  }

  img {
    transition: var(--transition);

    &:hover {
      transform: scale(1.01);
    }
  }

  li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;

    &:nth-child(even) {
      margin-top: 20px;
    }
  }
}

.my-works {
  margin: 0 auto;
  padding: 100px 80px 80px;
  background-color: var(--color-white);
  display: flex;
  justify-content: space-between;
  gap: 40px;

  hgroup {
    text-align: start;
  }
}

.text-wrapper {
  width: 640px;
  flex-shrink: 0;

  p:last-of-type {
    margin-bottom: 60px;
  }

  a {
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Anton', 'Oswald', sans-serif;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.125em;
    letter-spacing: 0.035em;
    color: var(--color-header-black);
    transition: var(--transition);

    span {
      transition: var(--transition);
      display: inline-block;
    }

    &:hover {
      color: var(--color-header-secondary);

      span {
        transform: translateX(50%);
      }
    }
  }
}

.carousel-wrapper {
  overflow: hidden;

  &:hover .carousel {
    animation-play-state: paused;
  }
}

.carousel {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 20px;
  animation: carousel 30s infinite linear;

  li {
    list-style: none;
  }

  img {
    height: 600px;
    width: auto;
  }
}

@keyframes carousel {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 10px));
  }
}

.contacts {
  background-color: var(--color-body-dark);

  .container {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    text-align: end;
  }

  img {
    width: 40%;
    height: 100%;
  }

  hgroup {
    color: var(--color-white);
    text-align: end;
  }

  svg {
    color: var(--color-header-secondary);
    width: 44px;
    height: 44px;

    use {
      width: 100%;
      height: 100%;
    }
  }
}

.contact-icons {
  margin-top: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-style: normal;

  div {
    display: flex;
    align-items: center;
    gap: 10px;

    a {
      text-decoration: none;

      &:hover {
        text-decoration: underline;
      }
    }
  }

  svg {
    width: 33px;
    height: 33px;
  }
}

.contact-icons-group {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  a {
    transition: var(--transition);

    &:hover {
      transform: scale(1.1);
    }
  }

  svg {
    width: 44px;
    height: 44px;
  }
}

.copyrights {
  font-size: 1.125rem;
  padding: 0 10px 40px;
  text-align: center;
  background-color: var(--color-body-dark);

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

    &:hover {
      text-decoration: underline;
    }
  }
}

#cookie-banner {
  font-family: 'Manrope', sans-serif;
  position: fixed;
  z-index: 100;
  bottom: 0;
  background-color: var(--color-body-gray);
  padding: 20px 80px;
  border-top: 1px solid var(--color-body-dark);

  a {
    text-decoration: underline;
  }

  .cookie-header {
    text-align: center;
    color: var(--color-header-black);
    font-size: 2.125rem;
    font-weight: normal;
    line-height: unset;
    margin: 20px auto;
  }

  p {
    color: var(--color-body-dark);
    line-height: 160%;
    margin-bottom: 20px;
    text-align: center;
  }

  .cookie-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;

    button {
      padding: 16px 24px;
      border: 1px solid var(--color-body-dark);
      color: var(--color-header-black);
      font-size: 1.5rem;
      font-weight: 500;
      border-radius: 9999px;
      background-color: var(--color-white);
      cursor: pointer;
      transition: var(--transition);

      &:hover {
        color: var(--color-white);
        background-color: var(--color-header-black);
        border-color: var(--color-body-dark);
      }
    }
  }
}

#btn-up, #lang-nav {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  background-color: transparent;
  border-radius: 10px;
  font-family: 'Anton', 'Oswald', sans-serif;
  font-size: 1rem;
  z-index: 10;
  cursor: pointer;
  display: none;
  border: 3px solid var(--color-header-secondary);
  transition: var(--transition);

  &:hover, &:focus {
    background-color: var(--color-overlay);
  }
}

#lang-nav {
  right: unset;
  left: 22px;
  display: block;
  overflow: hidden;

  &:hover, &:focus, &:focus-within, &.is-open {
    overflow: unset;
    height: max-content;
  }
}

#lang-menu {
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--color-header-secondary);
  text-decoration: none;
  list-style: none;
  flex-direction: column;
  justify-content: start;

  li {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    transition: var(--transition);

    @media (hover: hover) and (pointer: fine) {
      &:hover, &:focus, &:focus-within {
        color: var(--color-white);
      }
    }

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

  }
}

#btn-up {

  &::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border-top: 3px solid var(--color-header-secondary);
    border-left: 3px solid var(--color-header-secondary);
    top: 40%;
    right: 26%;
    transform: rotate(45deg);
  }

  &:hover, &:focus {
    &::after {
      border-top-color: var(--color-white);
      border-left-color: var(--color-white);
    }
  }

}

@media (max-width: 1279px) {
  .hero-section {
    padding: 50px 0;

    hgroup {
      margin-bottom: 30px;

      h1 {
        font-size: 5.5rem;
      }

      p {
        margin-bottom: 20px;
      }
    }
  }

  .hero-contact {
    p {
      font-size: 2.5rem;
    }

    a {
      padding: 12px 18px;
    }
  }

  .hero-photos {
    padding-bottom: 40px;

    span {
      font-size: 3rem;
    }
  }

  .come-as-you-are {
    padding: 50px 0;

    .container > div:nth-of-type(2) p {
      font-size: 3.5rem;
    }
  }

  .marquee-container h2 {
    font-size: 7.5rem;
  }

  .black-header {
    font-size: 3.5rem;
  }

  .what-i-do, .my-works, .contacts {
    padding: 50px 0;

    hgroup {
      margin-bottom: 30px;
    }

    h2 {
      margin-bottom: 20px;
    }
  }

  .services h3 {
    font-size: 1.5rem;
  }

  .my-works {
    width: 95%;
    flex-direction: column;
  }

  .text-wrapper p:last-of-type {
    margin-bottom: 30px;
  }

  .carousel img {
    height: 480px;
  }

  .contacts .container {
    gap: 20px;
  }

  .my-works a, .contact-icons > div > a, .copyrights a {
    text-decoration: underline;
  }
}

@media (max-width: 1023px) {
  .hero-photos {
    p {
      padding: unset;
    }

    span {
      margin-bottom: unset;
    }

    div {
      flex-direction: column;
      gap: 20px;

      &:nth-child(1), &:nth-child(3) {
        gap: 20px;
      }
    }
  }

  .come-as-you-are .container > div:nth-of-type(2) p {
    font-size: 2.5rem;
  }

  .marquee-container {
    bottom: 80px;
  }
}

@media (max-width: 799px) {
  .hero-section hgroup h1 {
    font-size: 3.75rem;
  }

  .hero-contact {
    flex-direction: column;
    padding: 30px;

    p {
      font-size: 2rem;
      width: unset;
      margin-bottom: 20px;
    }

    a {
      margin: 0 auto;
    }
  }

  .marquee-container {
    bottom: unset;
    top: 320px;

    h2 {
      font-size: 5rem;
    }
  }

  @keyframes marquee {
    0% {
      transform: translateX(60%);
    }
    50% {
      transform: translateX(-150%);
    }
    100% {
      transform: translateX(60%);
    }
  }

  .contacts .container {
    flex-direction: column;
    text-align: center;

    hgroup {
      text-align: inherit;
    }
  }

  .contact-icons {
    margin-top: 30px;
  }

  .hero-photos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;

    & div:nth-of-type(1) img, & div:nth-of-type(3) img {
      display: none;
    }

    & div:nth-of-type(2) {
      /*----???----*/
      order: -1;

      img {
        height: 480px;
        width: auto;
      }
    }
  }

  .come-as-you-are .container {
    flex-direction: column-reverse;
    align-items: center;

    & > div:nth-of-type(1) {
      width: min(75%, 640px);
      padding: unset;
      text-align: end;

      img {
        margin: 0 0 20px auto;
        width: 90%;
      }
    }

    & > div:nth-of-type(2) {
      width: min(75%, 640px);

      p {
        transform: translateX(0);
      }

      img {
        margin-top: 20px;
        height: 480px;
        width: auto;
      }
    }
  }

  .services {
    margin: 0 auto;
    width: min(75%, 640px);
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .text-wrapper {
    width: min(95%, 640px);
  }

  #cookie-banner {
    padding: 10px;
  }
}

@media (max-width: 639px) {
  .hero-section hgroup h1 {
    font-size: 3rem;
  }

  .hero-photos, .hero-contact {
    text-align: center;

    span {
      font-size: 2.5rem;
    }
  }

  .come-as-you-are {
    padding: 50px 0 100px;

    .container {

      & > div:nth-of-type(1) {
        width: min(95%, 640px);

        img {
          margin: 0 0 20px auto;
          width: 90%;
        }
      }

      & > div:nth-of-type(2) {
        width: min(95%, 640px);

        img {
          margin: 20px 20px 0 0;
          width: min(95%, 320px);
          height: auto;
        }
      }
    }
  }

  .marquee-container {
    top: unset;
    bottom: 5px;
  }

  @keyframes marquee {
    0% {
      transform: translateX(10%);
    }
    50% {
      transform: translateX(-250%);
    }
    100% {
      transform: translateX(10%);
    }
  }

  .black-header {
    font-size: 2.5rem;
  }

  .services {
    width: 95%;
  }

  .contacts img {
    width: 75%;
    height: auto;
  }
}

@media (max-width: 399px) {
  .services {
    grid-template-columns: 1fr;
    gap: 30px;

    div {
      gap: 10px;
    }

    img {
      width: 75%;
    }
  }

  .carousel img {
    height: 360px;
  }

  .hero-photos {

    & div:nth-of-type(2) {

      img {
        height: auto;
        width: 95%;
      }
    }
  }
}
