@layer global, component, utility;

@layer global {
  /* host-grotesk-regular - latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Host Grotesk';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/host-grotesk-v5-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* host-grotesk-500 - latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Host Grotesk';
    font-style: normal;
    font-weight: 500;
    src: url('/fonts/host-grotesk-v5-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  /* host-grotesk-800 - latin */
  @font-face {
    font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
    font-family: 'Host Grotesk';
    font-style: normal;
    font-weight: 800;
    src: url('/fonts/host-grotesk-v5-latin-800.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
  }
  
  /* Fonts */
  :root {
    --fs-70-140: clamp(4.375rem, 3.3306rem + 4.5161vw, 8.75rem); /* H2 */
    --fs-16-18: clamp(1rem, 0.9702rem + 0.129vw, 1.125rem); /* Body */
    --fs-16-24: clamp(1rem, 0.8806rem + 0.5161vw, 1.5rem); /* H4 */
  }
  
  /* Colors */
  :root {
    --c-white: hsl(0, 13%, 91%);
    --c-black: hsl(0, 31%, 5%);
  }

  /* Images */
  :root {
    --img-260-500: clamp(16.25rem, 12.6694rem + 15.4839vw, 31.25rem);
    --img-130-230: clamp(8.125rem, 6.6331rem + 6.4516vw, 14.375rem);
    --img-180-350: clamp(11.25rem, 8.7137rem + 10.9677vw, 21.875rem);
    --img-200-400: clamp(12.5rem, 9.5161rem + 12.9032vw, 25rem);
    --img-150-250: clamp(9.375rem, 7.8831rem + 6.4516vw, 15.625rem);
  }
  
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }
  
  * {
    margin: 0;
  }

  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: 'Host Grotesk', sans-serif;
    background-color: var(--c-white);
    color: var(--c-black);
    font-size: var(--fs-16-18);
    line-height: 18px;
    font-weight: 500;
    overflow: auto;
    scroll-behavior: smooth;
  }
  
  h2 {
    font-size: var(--fs-70-140);
    line-height: 140px;
    font-weight: 800;
    letter-spacing: -3px;
  }
  
  h4 {
    font-size: var(--fs-16-24);
    line-height: 24px;
    font-weight: 500;
    letter-spacing: -3%;
  }
  
  a {
    text-decoration: none;
  }

  ul,ol,li {
    list-style: none;
  }
  
  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }
  
  .wrapper {
    width: min(calc(100% - 40px), calc(1920 / 16 * 1rem));
    margin-inline: auto;
  }

  /* Button */
  .link {
      cursor: pointer;
      position: relative;
      white-space: nowrap;
  }

  .link::before,
  .link::after {
      position: absolute;
      width: 100%;
      height: 1.5px;
      background: currentColor;
      top: 100%;
      left: 0;
      pointer-events: none;
  }

  .link::before {
      content: '';
      /* show by default */
  }

  .link--metis {
      font-family: "Host Grotesk", sans-serif;
      color: var(--c-black);
      font-size: var(--fs-16-18);
      font-weight: 500;
      line-height: 18px;
  }

  .link--metis::before {
      transform-origin: 100% 50%;
      transform: scale3d(0, 1, 1);
      transition: transform 0.3s;
  }

  .link--metis:hover::before {
      transform-origin: 0% 50%;
      transform: scale3d(1, 1, 1);
  }
}

@layer component {
  /* Main */
  .index__main {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100dvh;
  }

  .info__main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  /* Loader */
  .loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    inset: 0;
    background-color: var(--c-white);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .loader__image {
    width: var(--img-260-500);
    height: var(--img-260-500);
    overflow: hidden;
  }

  .loader__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .loader__counter {
    position: absolute;
    bottom: 20px;
    right: 20px;
    font-size: var(--fs-70-140);
    color: var(--c-black);
    font-weight: 800;
    letter-spacing: -5px;
    line-height: 90%;
  }

  /* Header */
  .header__home,
  .header__about,
  .header__gallery {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 20px;
  }

  .header__home,
  .header__about,
  .header__gallery {
    opacity: 0;
    transform: translateY(-30px);
  }

  header,
  .header__mobile-nav {
    opacity: 1;
  }

  .hamburger {
    display: none;
  }

  .logo {
    font-size: var(--fs-16-18);
    font-weight: 500;
    color: var(--c-black);
  }

  .header__text {
    font-size: var(--fs-16-18);
    font-weight: 500;
    color: var(--c-black);
    letter-spacing: -3%;
    max-width: 353px;
  }

  .header__nav-list {
    display: flex;
    gap: 6px;
  }

  .mobile__nav--img,
  .mobile__nav--img-2 {
    display: none;
  }

  /* Header - Phone*/
  @media (max-width: 900px) {
    .hamburger {
      display: block;
      cursor: pointer;
      font-size: var(--fs-16-18);
      font-weight: 500;
      color: var(--c-black);
    }

    .header__nav,
    .contact--link {
      display: none;
    }

    .header__text {
      display: none;
    }

    .header__text--phone {
      display: block !important;
      min-width: 350px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      justify-content: center;
      align-items: center;
      text-align: center;
      height: 10vh;
      margin-top: -100px;
      z-index: 100;
    }

    .header__mobile-nav {
      display: flex;
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      flex-direction: column;
      padding-top: 140px;
      gap: 48px;
      padding-inline: 20px;
      background-color: var(--c-black);
      z-index: 101;
    }

    .header__mobile-nav-list {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 16px;
      padding: 0;
    }

    .link--phone {
      color: var(--c-white);
      font-size: 1.5rem;
      text-transform: uppercase;
      line-height: 32px;
      font-weight: 700;
      display: block;
      width: fit-content;
    }

    .mobile__nav--img {
      display: block;
      width: min(35%, 300px);
      height: auto;
      object-fit: cover;
      opacity: 0.7;
    }

    .mobile-nav__close {
      position: absolute;
      top: 10px;
      right: 15px;
      background: none;
      border: none;
      color: var(--c-white);
      font-size: 24px;
      cursor: pointer;
      padding: 15px;
      transition: transform 0.3s ease;
      z-index: 102;
    }

    .phone__socials {
      display: flex;
      gap: 12px;
    }

    .phone__socials-- {
      font-size: var(--fs-16-18);
      color: var(--c-white);
      font-weight: 500;
    }

    .p__text {
      opacity: 0;
    }

    .p__text--phone {
      opacity: 0;
      transform: translateY(10px);
    }
  }


    
  .header__text--phone {
    display: none;
  }


  .header__mobile-nav {
    display: none;
  }

  /* Slider */
  .slider {
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: 20px;
  }

  .slider .list {
    display: flex;
    width: 100%;
    min-width: calc(var(--width) * var(--quantity));
    position: relative;
    height: 100%;
  }

  .slider .item {
    overflow: hidden;
  }

  .slider .list .item {
    width: var(--width);
    position: absolute;
    left: 100%;
    bottom: 0;
    transition: filter 0.3s;
    /* ensure each item appears immediately at its staggered position
    by using a negative delay so animation is already partway through */
    animation: autoRun 40s linear infinite;
    animation-fill-mode: both;
    animation-delay: calc( (40s / var(--quantity)) * (1 - var(--position)) );
  }

  .item1 {
    height: var(--img-180-350) !important;
  }
  .item2 {
    height: var(--img-130-230) !important;
  }
  .item3 {
    height: var(--img-260-500) !important;
  }
  .item4 {
    height: var(--img-200-400) !important;
  }
  .item5 {
    height: var(--img-150-250) !important;
  }
  .item6 {
    height: var(--img-180-350) !important;
  }
  .item7 {
    height: var(--img-130-230) !important;
  }
  .item8 {
    height: var(--img-260-500) !important;
  }
  .item9 {
    height: var(--img-200-400) !important;
  }
  .item10 {
    height: var(--img-150-250) !important;
  }

  .slider .list .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  @keyframes autoRun {
    from {
      left: 100%;
    }
    to {
      left: calc(var(--width) * -1);
    }
  }

  .slider:hover .item {
    animation-play-state: paused !important;
    filter: grayscale(1);
  }

  .slider .item:hover {
    filter: grayscale(0);
  }

  /* Slider - Phone*/
  @media (max-width: 900px) {
    .slider {
      height: 345px;
    }

    .slider .list .item {
      width: 230px;
    }

    .slider .list {
      min-width: calc(200px * var(--quantity));
    }
  }

  /* Info Image Trail */
  #image-trail-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -100;
  }

  .trail-image {
    position: absolute;
    width: 200px;
    height: auto;
    transform: translate(-50%, -50%);
    will-change: transform, opacity;
  }


  /* Info */
  .info {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    height: calc(100dvh - 74px);
  }

  .info__left {
    display: flex;
    flex-direction: column;
    gap: 72px;
  }

  .info__content-1 {
    max-width: 430px;
  }

  .info__content-2 {
    max-width: 430px;
  }

  .info__content-2 span {
    font-size: var(--fs-16-18);
    opacity: 0.8;
    margin-bottom: 8px;
    display: inline-block;
  }

  .info__right {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .info__socials {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .link__socials {
    width: max-content;
    font-size: var(--fs-16-24);
    line-height: 24px;
    font-weight: 500;
  }

  .info__contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .link__contact {
    width: max-content;
    font-size: var(--fs-16-24);
    line-height: 24px;
    font-weight: 500;
  }

  .info__design {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .link__design {
    width: max-content;
    font-size: var(--fs-16-24);
    line-height: 24px;
    font-weight: 500;
  }

  .split-line {
    overflow: hidden;
    display: block;
  }

  .split-info {
    will-change: transform, opacity;
  }

  /* Info - Phone*/
  @media (max-width: 900px) {
    .info {
      flex-direction: column;
      justify-content: space-evenly;
      align-items: flex-start;
      /* margin-top: 20px; */
    }

    .header__info--c {
      display: none;
    }
  }

  @media (max-width: 475px) {
    .info {
      justify-content: space-evenly;
      height: calc(100dvh - 38px);
    }
    .info__left,
    .info__right {
      gap: 12px;
    }
  }


  /* Archive */
  .archive__content {
    display: flex;
    justify-content: space-between;
    margin-top: 150px;
  }

  .archive__content p {
    font-size: var(--fs-16-18);
    text-transform: uppercase;
  }

  .archive__content span {
    font-size: var(--fs-16-18);
    opacity: 0.8;
  }

  .archive__grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-top: 48px;
    margin-bottom: 250px;
  }

  .archive__item1 {
    grid-column: 1 / span 2;
  }
  .archive__item2 {
    grid-column: 3 / span 2;
  }
  .archive__item3 {
    grid-column: 7 / span 2;
  }
  .archive__item4 {
    grid-column: 11 / span 2;
  }
  .archive__item5 {
    grid-column: 3 / span 2;
    margin-top: 160px;
  }
  .archive__item6 {
    grid-column: 5 / span 2;
    margin-top: 160px;
  }
  .archive__item7 {
    grid-column: 9 / span 2;
    margin-top: 160px;
  }
  .archive__item8 {
    grid-column: 11 / span 2;
    margin-top: 160px;
  }
  .archive__item9 {
    grid-column: 1 / span 2;
    margin-top: 160px;
  }
  .archive__item10 {
    grid-column: 3 / span 2;
    margin-top: 160px;
  }
  .archive__item11 {
    grid-column: 7 / span 2;
    margin-top: 160px;
  }
  .archive__item12 {
    grid-column: 9 / span 2;
    margin-top: 160px;
  }

  .archive__item13 {
    grid-column: 1 / span 2;
    margin-top: 160px;
  }

  .archive__item14 {
    grid-column: 5 / span 2;
    margin-top: 160px;
  }

  .archive__item15 {
    grid-column: 7 / span 2;
    margin-top: 160px;
  }

  .archive__item16 {
    grid-column: 11 / span 2;
    margin-top: 160px;
  }

  .archive__img {
    width: 100%;
  }

  .bran-1 {
    clip-path: polygon(0% 100%, 100% 100%, 100% 100%, 0% 100%);
  }

  .archive__img img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
  }

  .archive__img img {
    cursor: zoom-in;
  }

  .archive__top-btn {
    font-size: var(--fs-16-18);
    font-weight: 500;
    color: var(--c-black);
    display: inline-block;
    line-height: 18px;
  }

  /* .archive__img img:hover {
    transform: scale(1.037);
    transition: all 0.7s ease;
  } */

  /* Archive - Phone*/
  @media (max-width: 900px) {
    .archive__content {
      margin-top: 100px;
    }
    .archive__grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 15px;
      margin-top: -40px;
      margin-bottom: 130px;
    }

    .archive__grid > div {
      grid-column: auto !important;
      margin-top: 80px;
    }
  }


  /* Copyright */
  .archive__footer--container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
  }

  .archive__mail {
    display: flex;
    flex-direction: column;
  }

  .archive__mail a {
    width: fit-content;
  }

  .archive__creator {
    display: flex;
    flex-direction: column;
  }

  .archive__creator a {
    width: fit-content;
  }

  @media (max-width: 900px) {
    .archive__footer--container {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
    }

    .archive__title {
      order:2;
    }

    .archive__socials {
      display: flex;
      flex-direction: column;
      justify-self: end;
      order: 1;
    }

    .archive__mail {
      order: 1;
    }

    .archive__creator {
      order: 3;
      justify-self: end;
    }
  }

  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
  }

  .lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: zoom-out;
    transform: scale(0.96);
    transition: transform 0.3s ease;
  }

  .lightbox.active {
    opacity: 1;
    pointer-events: auto;
  }

  .lightbox.active img {
    transform: scale(1);
  }
}


@layer utility {
  html.lenis,
  html.lenis body {
    height: auto;
  }

  .lenis:not(.lenis-autoToggle).lenis-stopped {
    overflow: clip;
  }

  .lenis [data-lenis-prevent],
  .lenis [data-lenis-prevent-wheel],
  .lenis [data-lenis-prevent-touch] {
    overscroll-behavior: contain;
  }

  .lenis.lenis-smooth iframe {
    pointer-events: none;
  }

  .lenis.lenis-autoToggle {
    transition-property: overflow;
    transition-duration: 1ms;
    transition-behavior: allow-discrete;
  }

  .js-animate {
    opacity: 0;
    visibility: hidden;
  }

  .visually-hidden {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
  }
}
