:root {

/* Fonts */

  --font-primary: 'Aeonik', sans-serif;

/* Font weights */

  --fw-light: 300;
  --fw-regular: 500;
  --fw-bold: 700;

/* Font sizes */

  --fs-xs: 0.6rem;
  --fs-sm: 0.875rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.75rem;

/* Paddings */

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 128px;

/* Radius */

  --radius-pill: 500px;
  --radius-circle: 50%;

/* Transitions */

  --transition-1: 0.25s ease;
  --transition-2: 0.5s ease;
  --transition-3: 1000ms cubic-bezier(0.03, 0.98, 0.52, 0.99) 0s;
  --cubic-in: cubic-bezier(0.51, 0.03, 0.64, 0.28);
  --cubic-out: cubic-bezier(0.05, 0.83, 0.52, 0.97);

/* Colors */

  --bg-primary: #000000;
  --text-primary: #ffffff;
  --text-secondary: #000000;
  --accent-primary: #FFDC12;
  --surface-primary: #1f1f20;
  --surface-overlay: rgba(0, 0, 0, 0.25);
  --surface-shadow: rgba(0, 0, 0, 0.8);

}

 body.light-mode {

    --bg-primary: #ECE9E6;
    --text-primary: #000000;
    --text-secondary: #ffffff;
    --accent-primary: #0023F0;
    --surface-primary: #ffffff;

  }

/*-----------------------------------
  Reset
-----------------------------------*/

  *,
  *::before,
  *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
  }

  li { 
    list-style: none;
  }

  a,
  img,
  span,
  input,
  button,
  textarea { 
    display: block;
  }

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

  img { height: auto; }

  input,
  button,
  textarea {
    background: none;
    border: none;
    font: inherit;
  }

  input,
  textarea { width: 100%; }

  address { font-style: normal; }

  html {
    font-size: 100%;
    scroll-behavior: smooth;
  }

  body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-weight: var(--fw-regular);
    font-size: var(--fs-sm);
    line-height: 1.55;
  }

  h1 {
    font-size: clamp(1rem, 0.818rem + 0.91vw, 1.5rem);
  }

/*-----------------------------------
  Grids
-----------------------------------*/

  .container {
    max-width: 60vw;
    margin: 0 auto;
  }

  .home__grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-flow: dense;
    margin-block: var(--space-sm);
    gap: var(--space-sm);    
  }

  .projects__grid{
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-flow: dense;
    margin-top: var(--space-sm);
    margin-bottom: var(--space-4xl);
    gap: var(--space-sm);    
  }

  .grid__title {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-sm);
    padding-inline: var(--space-xl);
  }

/*-----------------------------------
  Header
-----------------------------------*/

  .header {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    mix-blend-mode: difference;
    padding-top: env(safe-area-inset-top);
    color: white;
  }

  .header__inner {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: var(--space-lg);
  }

  .header__left {
    display: flex;
    align-items: center;
  }

  .header__title {
    display: flex;
    font-size: var(--fs-lg);
  }

  .header__project-title {
    display: none;
  }

  .header__logo {
    margin: 16px;
  }

  .header__nav {
    display: flex;
    gap: 30px;
  }

  .header__toggle {
    width: 32px;
    height: 32px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    grid-template-rows: repeat(2, auto);
    justify-content: center;
    align-content: center;
    gap: 6px;
    background: none;
    border: none;
    transition: gap 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
    margin: 16px;
  }

  .header__toggle:hover {
    gap: 12px;
  }

  .header__toggle span {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    transition: background 0.3s ease;
  }

/*-----------------------------------
  Menu panel
-----------------------------------*/

  .header__menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background: var(--bg-primary);
    transform: translateY(-150%);
    transition: transform 0.6s cubic-bezier(0.76, 0, 0.24, 1);
    z-index: 90;
  }

  .header__menu-panel.is-open {
    transform: translateY(0);
  }

  .menu-panel__inner {
    width: 100%;
  }

  .menu-panel__inner {
    display: flex;
    width: 100%;
    height: 100%;
    margin: auto;
    padding-bottom: 32px;
    gap: 80px;
    mix-blend-mode: difference;
    justify-content: space-between;
    align-content: space-between ;
  }

  .menu-column {
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: var(--space-sm);
    padding: 16px;
    color: white;
  }

  .menu-button {
    display: flex;
    align-items: end;
    padding: 16px;
  }

  .menu-link {
    display: flex;
    gap: var(--space-xs);
  }

  .menu-link a {
    text-decoration: underline;
  }

  .menu-column h3 {
    font-size: 24px;
    margin-bottom: 12px;
    gap: var(--space-xs);
  }

  .menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface-shadow);
    opacity: 0;
    visibility: hidden;
    transition: 0.4s ease;
    z-index: 80;
  }

  .menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: white;
    height: fit-content;
  }

  .theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: white;
    mix-blend-mode: difference;
  }

/*-----------------------------------
  Hero
-----------------------------------*/

  .hero {
    height: calc(100dvh + 500px);
    position: relative;
  }

  .hero__scroll-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .hero__scroll-wrapper {
    position: sticky;
    top: calc(100dvh - 64px);
    display: flex;
    justify-content: center;
    mix-blend-mode: difference;
  }

  .hero__scroll-indicator {
    animation: float 2s infinite ease-in-out;
  }

  .hero__scroll-indicator svg {
    fill: white;
    width: 28px;
    height: 28px;
    transform: translateX(14px);
  }

  @keyframes float {
    0%,100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
  }

  .hero__media {
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow: hidden;
  }

  .hero__frame {
    width: 100%;
    height: 100dvh;
    margin-inline: auto;
    position: relative;
    overflow: hidden;
  }

  .hero__frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
  }

  .hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

/*-----------------------------------
  Project info (desktop)
-----------------------------------*/

  .project__info {
    position: fixed;
    top: 0px;
    left: 0px;
    width: calc((100vw - 60vw) / 2);
    height: 100%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 16px;
    padding-top: var(--space-4xl);
    padding-bottom: var(--space-md);
    padding-inline: var(--space-md);
    color: white;
    mix-blend-mode: difference;
  }

  .project__info-card {
    display: none;
  }
  
  .project__return {
    display: flex;
    padding: 32px;
    border-radius: 10px;
    background-color: var(--surface-primary);
    color: var(--text-primary);
    aspect-ratio: auto;
  }

  .project__info-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .project__info-title {
    font-size: var(--fs-md);
    line-height: 16px;
  }

  .project__info-description {
    width: 100%;
  }

/*-----------------------------------
  Card
-----------------------------------*/

  .card{
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    grid-column: span 2;
    grid-row: span 2;
  }

  .card.auto{
    aspect-ratio: auto;
  }

  .card.wide {
    grid-column: span 4;
    grid-row: span 2;
    aspect-ratio: auto;
    object-fit: fill;
  }

  .card.large {
    grid-column: span 4;
    grid-row: span 4;
  }

  .card.full {
    grid-column: span 6;
    grid-row: span 6;
  }

  .card--text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: var(--space-xl);
    background-color: var(--surface-primary);
  }

  .card__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .reachout{
    white-space: nowrap;
    display: inline;
    color: var(--accent-primary);
    text-decoration: underline;
  }

  .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    overflow: hidden;
  }

  .card-overlay{
    position: absolute;
    padding: 20px;
    top: 0px;
    background: var(--surface-overlay);
    backdrop-filter: blur(20px);
    border-radius: 10px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s;
  }

  .card-pill{
    position: absolute;
    padding: var(--space-md);
    top: 0px;
    z-index: 10;
    pointer-events: none;
  }

  .card-hover-title {
    color:white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
  }

  .card:hover .card-overlay{
    opacity: 1;
  }

  .card--footer {
    background: var(--surface-primary);
    border-radius: 10px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 48px;
  }

  .footer__top {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .footer__bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

/*-----------------------------------
  Utilities
-----------------------------------*/

/* Preloader */

  .preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    box-shadow: inset 55vw 0 0 0 var(--bg-primary),
                inset -55vw 0 0 0 var(--bg-primary);
    display: grid;
    place-items: center;
    z-index: 50;
  }

  .preloader.loaded {
    transition: 0.6s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .preloader.loaded .line {
    animation: loaded 500ms ease forwards;
  }

  @keyframes loading {
  0% { transform: scaleY(0); }
  100% { transform: scaleY(0.3); }
  }

  .preloader.loaded .line { animation: loaded 500ms ease forwards; }

  @keyframes loaded {
  0% { transform: scaleY(0.3); }

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

/* Pill */

  .pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: var(--accent-primary);
    color:var(--text-secondary);
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 500;
    width: fit-content;
  }

  .pill-list {
    display: flex;
    gap: 8px;
    padding-bottom: var(--space-md);
    mix-blend-mode: difference;
  }

  .pill-outline {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border: white 1px solid;
    color:white;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 500;
    width: fit-content;
  }

/* Custom cursor */

  .cursor-dot,
  .cursor-outline {
    display: block;
    position: fixed;
    top: -60px;
    left: -60px;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-circle);
    z-index: 200;
    transition-property: opacity, transform;
    transition-duration: 300ms;
    transition-timing-function: ease-in-out;
    pointer-events: none;
  }

  .cursor-dot {
    width: 50px;
    height: 50px;
    background-color: white;
    transform: translate(-50%, -50%) scale(0.1);
    mix-blend-mode: difference;
  }

  .cursor-dot.hovered {
    background-color: white;
    transform: translate(-50%, -50%) scale(1);
    mix-blend-mode: difference;
  }

  .cursor-outline {
    width: 20px;
    height: 20px;
    border: 2px solid white;
    opacity: 1;
    transition-duration: 100ms;
    mix-blend-mode: difference;
  }

  .cursor-outline.hovered { opacity: 0; }

/* Lightbox */

  .lightbox {
    position: fixed;
    inset: 0;
    background: var(--surface-shadow);

    display: flex;
    justify-content: center;
    align-items: center;

    opacity: 0;
    visibility: hidden;

    transition: 0.3s ease;
    z-index: 9999;
  }

  .lightbox.active {
    opacity: 1;
    visibility: visible;
  }

  .lightbox__image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    object-fit: contain;

    transform: scale(0.95);
    transition: 0.3s ease;
  }

  .lightbox.active .lightbox__image {
    transform: scale(1);
  }

/*-----------------------------------
  Media Queries
-----------------------------------*/

@media (max-width:1600px) {

    h1{
    font-size: var(--fs-md);
    }
}

@media (max-width:900px) {

    h1{
      font-size: var(--fs-sm);
    }

    .container {
      max-width: 90vw;
    }

    .menu-panel__inner {
      width: 90%;
    }

    .header__inner {
      width: 90%;
      margin: 0 auto;
    }

    .header__title {
      font-size: var(--fs-md);
    }

    .header__project-title {
      display: flex;
      font-size: var(--fs-md);
      color: white;
    }

    .home__grid{
      grid-template-columns: repeat(4, 1fr);   
    }

    .card--text {
      grid-column: span 4;
      grid-row: span 2;
      aspect-ratio: auto;
    }
    
    .project__info {
      display: none;
    }

    .project__info-card {
      display: grid;
      padding: 32px;
      border-radius: 10px;
      background-color: var(--surface-primary);
      color: var(--text-primary);
      grid-column: span 6;
      aspect-ratio: auto;
    }

    .project__return {
      display: none;
    }

    .hero__frame {
      width: 80vw;
      margin-inline: auto;
      border-radius: 10px;
    }

    .card{
      border-radius: 8px;
    }

    .cursor-dot,
    .cursor-dot.hovered,
    .cursor-outline,
    .cursor-outline.hovered{
      display: none;
    }
}

@media (hover: none) {
  .card:hover .card-overlay {
    opacity: 0;
  }
  .custom-cursor {
    display: none;
  }
}
