:root {
    --primary-color: #CBD9FF;
    --secondary-color: #3F6048;
}

@font-face {
    font-family: 'Pilowlava';
    src: url('../fonts/Pilowlava-Regular.woff2') format('woff2'),
         url('../fonts/Pilowlava-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
  }

header a span {
    font-family: 'Pilowlava', sans-serif;
    font-size: 2rem;
}



a, p {
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: -0.01rem;
    font-weight: 400;
}

a {
    color: inherit;
}

.bg-color-primary {
    background-color: var(--primary-color);
}

.bg-color-secondary {
    background-color: var(--secondary-color);
}


.color-primary {
    color: var(--primary-color);
}

.color-secondary {
    color: var(--secondary-color);
}



.home {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    padding: max(2rem, env(safe-area-inset-top)) max(2rem, env(safe-area-inset-right)) max(2rem, env(safe-area-inset-bottom)) max(2rem, env(safe-area-inset-left));
    overflow: hidden;
}

.internal {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 2rem;
    overflow-x: hidden;
}

/* DVD-style bouncing “hey” (sobre) */
.hey.hey-dvd {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
}

.hey.hey-dvd img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(200px, 28vw);
}

@media (prefers-reduced-motion: reduce) {
    .hey.hey-dvd {
        position: static;
        will-change: auto;
        margin-bottom: 0.5rem;
    }
}

.foto {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 2rem;
    overflow-x: hidden;
}

.project {
    display: flex;
    width: 100%;
    padding: 2rem;
    overflow-x: hidden;
    justify-content: flex-end;
}




header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding-bottom: 1.5rem;
}

.header-links {
    display: flex;
    gap: 1rem;
    text-align: left;
}


header a {
    text-decoration: none;
    transition: opacity 0.3s ease;
    justify-self: end
}

header a.inactive {
    text-decoration: none;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

header a.inactive:hover {
    opacity: 1;
    transition: opacity 0.3s ease;
}




header a:hover {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.reel-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    z-index: -1;
  }

  .reel-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    animation: overlayFadeIn 1400ms ease-out 600ms both;
  }

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

.name {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.name h1 {
    margin: 0;
    white-space: nowrap;
    line-height: 1;
    font-size: 10.2vw;
    font-family: 'Pilowlava', sans-serif;
    letter-spacing: -0.6rem;
}

.home header,
.home .name {
    position: relative;
    z-index: 2;
}

.home header {
    animation: headerSlideIn 900ms cubic-bezier(0.22, 1, 0.36, 1) 800ms both;
}

.home .name {
    margin-top: auto;
    animation: nameSlideIn 1000ms cubic-bezier(0.22, 1, 0.36, 1) 900ms both;
}

@keyframes homeNameIntro {
    from {
        transform: translateY(130%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes headerSlideIn {
    from {
        transform: translateY(-130%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes nameSlideIn {
    from {
        transform: translateY(130%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}



footer {
    display: flex;
    justify-content: space-between;
}

footer .links {
    display: flex;
    gap: 1rem;
}

footer .links a {
    text-decoration: underline;
    color: var(--primary-color);
}

footer .links a:hover {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}






/* video */

.grid-container {
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    column-gap: 2rem;
    row-gap: 2rem;
    margin-bottom: 2rem;
}

.grid-container .video {
    position: relative;
    display: grid;
    border-radius: 1rem;
    overflow: hidden;
    isolation: isolate;
}

.grid-container a {
    opacity: 0;
    text-decoration: none;
    animation: videoCardFadeIn 700ms ease-out forwards;
}

.grid-container > a:nth-child(1) { animation-delay: 80ms; }
.grid-container > a:nth-child(2) { animation-delay: 160ms; }
.grid-container > a:nth-child(3) { animation-delay: 240ms; }
.grid-container > a:nth-child(4) { animation-delay: 320ms; }
.grid-container > a:nth-child(5) { animation-delay: 400ms; }

@keyframes videoCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-container .video > * {
    grid-area: 1 / 1;
}

.grid-container .video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grid-container a .client {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 1;
    color: var(--primary-color);
    padding: 2rem;
    background-color: #00000081;
    border-radius: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.grid-container a .client h2 {
    font-size: 2rem;
    font-weight: 400;
    transform: translateY(0.3rem);
    opacity: 0;
    transition: all 0.5 cubic-bezier(0.165, 0.84, 0.44, 1);
}

.grid-container a .client p {
    font-size: 1rem;
    font-weight: 400;
}

.grid-container a .client .client-project {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.grid-container a .client .client-project h2 span {
    opacity: 0.6;
}

.grid-container a:hover .video img {
    transform: scale(1.06);
}

.grid-container a:active .video img {
    transform: scale(1.03);
}

.grid-container a:hover .client {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.grid-container a:hover .client h2 {
    opacity: 1;
    transform: translateY(-0.3rem);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: 100ms;
}


/* foto */

.grid-container-foto {
    height: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 2rem;
    row-gap: 2rem;
    margin-bottom: 2rem;
}

.grid-container-foto a {
    aspect-ratio: 3 / 3.1;
    opacity: 0;
    text-decoration: none;
    animation: fotoCardFadeIn 700ms ease-out forwards;
}

.grid-container-foto .client h2 span {
    opacity: 0.6;
    margin-top: 0.2rem;
}

@media (hover: hover) {
    .grid-container-foto a,
    .grid-container a {
        cursor: none;
    }
}

.grid-container-foto > a:nth-child(1) { animation-delay: 80ms; }
.grid-container-foto > a:nth-child(2) { animation-delay: 160ms; }
.grid-container-foto > a:nth-child(3) { animation-delay: 240ms; }
.grid-container-foto > a:nth-child(4) { animation-delay: 320ms; }
.grid-container-foto > a:nth-child(5) { animation-delay: 400ms; }
.grid-container-foto > a:nth-child(6) { animation-delay: 480ms; }
.grid-container-foto > a:nth-child(7) { animation-delay: 560ms; }

@keyframes fotoCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-container-foto .imagem {
    position: relative;
    display: grid;
    overflow: hidden;
    border-radius: 1rem;
    height: 100%;
    isolation: isolate;
}

.grid-container-foto .imagem > * {
    grid-area: 1 / 1;
}

.grid-container-foto .imagem img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 0;
    transform: scale(1);
    transform-origin: center center;
    transition: transform 3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grid-container-foto a .client {
    z-index: 1;
    color: var(--primary-color);
    padding: 2rem;
    background-color: #00000099;
    border-radius: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.grid-container-foto a .client h2 {
    font-size: 2rem;
    font-weight: 400;
    transform: translateY(0.3rem);
    opacity: 0;
    transition: all 0.5 cubic-bezier(0.165, 0.84, 0.44, 1);
}

.grid-container-foto a .client p {
    font-size: 1rem;
    font-weight: 400;
}

.grid-container-foto a:hover .imagem img {
    transform: scale(1.06);
}

.grid-container-foto a:active .imagem img {
    transform: scale(1.03);
}

.grid-container-foto a:hover .client {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.grid-container-foto a:hover .client h2 {
    opacity: 1;
    transform: translateY(-0.3rem);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: 100ms;
}



/* sobre */

.content {
    display: flex;
    flex-direction: column; 
    width: 50vw;
    padding-top: 20vh;  
    gap: 2rem; 
    padding-bottom: 2rem;
    animation: homeNameIntro 1100ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

.content h1 {
    font-size: 14rem;
    font-family: 'Pilowlava', sans-serif;
    letter-spacing: -0.3rem;
}


.content p {
    text-align: justify;
    font-size: 3.6rem;
    letter-spacing: -0.1rem;
    font-weight: 400;
    line-height: 4.2rem;
}

.contact-info {
    position: fixed;
    bottom: 4rem;
    right: 4rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contact-info a {
    text-decoration: underline;
    font-size: 3.6rem;
    letter-spacing: -0.1rem;
    font-weight: 400;
    transition: opacity 0.3s ease;
}

.contact-info a:hover {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.hover-img {
    position: fixed;
    left: 0;
    top: 0;
    width: 115px;
    height: 115px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%);
}

.hover-img.is-active {
    opacity: 1;
    visibility: visible;
}

.hover-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    transform: translate(-50%, -50%);
}

.hover-img .star {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    animation: spin 8s linear infinite;
}

.contact-info img {
    max-width: 15rem;
    border-radius: 1rem;
    opacity: 0.95;
}


/* projeto */


.project-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 25%;
    height: calc(100vh - 4rem);
    overflow-y: hidden;
    position: fixed;
    top: 2rem;
    left: 2rem;
}

.project-intro {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 2rem;
}

.project-intro h1 {
    font-size: 2rem;
    letter-spacing: -0.1rem;
    font-weight: 400;
    line-height: 2.4rem;
}

.project-intro h2 {
    font-size: 2rem;
    letter-spacing: -0.1rem;
    font-weight: 400;
    line-height: 2.4rem;
    opacity: 0.6;
}

.project-intro p {
    font-size: 1rem;
    letter-spacing: -0.02rem;
    font-weight: 400;
    line-height: 1.2rem;
    margin-top: 1rem;
}

.back-floating {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 10;
}

.back a {
    text-decoration: none;
}

.back a:hover {
    opacity: 0.4;
    transition: opacity 0.3s ease;

}

.project-info {
    display: flex;
    gap: 1rem;
    flex-direction: column;
    text-align: justify;
}

.project-info li {
    opacity: 1;
    line-height: 1.5rem;
}

.project-info li ul {
    opacity: 1;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-contact-info .links {
    flex-wrap: wrap;
    width: auto;
}

.project-contact-info .links {
    display: flex;
    gap: 1rem;
}

.project-contact-info .links a {
    text-decoration: underline;
}

.project-contact-info .links a:hover {
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.project-grid {
    width: 65%;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    margin-top: 3.7rem;
}

.project-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 1rem;
}

.image-grid {
    width: 100%;
    column-count: 5;
    column-gap: 1rem;
    row-gap: 1rem;
    margin-top: 3.7rem;
}

.image-grid button {
    display: block;
    width: 100%;
    margin: 0 0 1rem;
    padding: 0;
    border: none;
    background: none;
    break-inside: avoid;
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
}

.image-grid img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1rem;
    transition: transform 3s cubic-bezier(0.22, 1, 0.36, 1);
}

.image-grid button:hover img {
    transform: scale(1.03);
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: rgba(0, 0, 0, 0);
    visibility: hidden;
    pointer-events: none;
}

.lightbox.is-active {
    background: rgba(0, 0, 0, 0.85);
    pointer-events: auto;
}

.lightbox img {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 0.5rem;
    transform-origin: top left;
    will-change: transform;
}

.lightbox-close {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.project-video {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 1rem;
    overflow: hidden;
}

.project-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.vertical {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 100%;
    overflow: hidden;
}

.vertical-video {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    width: 100%;
}

.vertical-video .project-video {
    flex: 0.5625 1 0%;
    min-width: 0;
    aspect-ratio: 9 / 16;
}

.vertical-video .project-video.wide {
    flex: 1.7778 1 0%;
    aspect-ratio: 16 / 9;
}

.vertical img {
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
}

/* random palette swap between primary and secondary on project pages */
html[data-palette="b"] body.project.bg-color-primary {
    background-color: var(--secondary-color);
}

html[data-palette="b"] body.project .color-secondary {
    color: var(--primary-color);
}






/* responsive */

@media screen and (max-width: 600px) {
    .name h1 {
        letter-spacing: -0.2rem;
        font-size: 19.9vw;
        white-space: wrap;
        text-align: center;
    }

    .internal {
        padding: 1rem;
    }

    .home {
        padding: 1rem;
    }

    header {
        padding-bottom: 1rem;
    }


    .grid-container {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: repeat(1, 1fr);
        column-gap: 2rem;
        row-gap: 2rem;
    }

    .grid-container-foto {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: repeat(1, 1fr);
        column-gap: 2rem;
        row-gap: 2rem;
    }

    .contact-info {
        position: inherit;
        bottom: 4rem;
        right: 1rem;
    }

    .content {
        width: 100%;
    }

    .content h1 {
        font-size: 8rem;
        font-family: 'Pilowlava', sans-serif;
        letter-spacing: -0.1rem;
    }
    
    
    .content p {
        text-align: justify;
        font-size: 2rem;
        letter-spacing: -0.1rem;
        font-weight: 400;
        line-height: 2.2rem;
    }

    .contact-info a {
        font-size: 2rem;
        letter-spacing: -0.1rem;


    }

    .project {
        flex-direction: column;
        padding: 1rem;
    }

    .project-container {
        position: inherit;
        width: 100%;
        height: auto;
        justify-content:flex-start;
    }

    .project-grid {
        width: 100%;
        gap: 1rem;
        margin-top: 2rem;
    }

    .image-grid {
        width: 100%;
        column-count: 2;
        column-gap: 1rem;
        margin-top: 2rem;
    }

    .image-grid button {
        margin-bottom: 1rem;
    }

    .lightbox {
        padding: 2rem 1rem;
    }

    .lightbox-close {
        top: 1rem;
        right: 1rem;
    }

    .back-floating {
        top: 1rem;
        left: 1rem;
    }

    .vertical {
        flex-direction: column;
    }

    .vertical-video {
        flex-direction: column;
    }

    .vertical img {
        height: auto;
    }

    .project-contact-info {
        display: none;
    }

    .foto {
        padding: 1rem
    }

    footer {
        flex-direction: column;
        justify-content: flex-end;
        gap: 1rem;
        
    }

    header p {
        opacity: 0;
    }

    header .name-rest {
        display: none;
    }

    header a span {
        font-size: 1.2rem;
    }

}


body {
    opacity: 0;
    transition: background-color 600ms cubic-bezier(0.22, 1, 0.36, 1);
    animation: pageFadeIn 800ms ease-in-out forwards;
  }
  /* when leaving page */
  body.is-leaving {
    animation: pageFadeOut 450ms ease-in-out forwards;
  }
  @keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  @keyframes pageFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
  }

  @media (prefers-reduced-motion: reduce) {
    .intro-overlay {
      display: none !important;
    }

    .home header,
    .home .name,
    .grid-container a,
    .grid-container-foto a,
    body {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }

    .grid-container-foto a,
    .grid-container a {
      cursor: pointer !important;
    }

    .lightbox,
    .lightbox img {
      transition: none !important;
    }

    .lightbox img {
      transform: none !important;
    }

    .grid-container a:hover .video img,
    .grid-container-foto a:hover .imagem img {
      transform: none;
    }

    .hover-img {
      display: none !important;
    }
  }


  @keyframes spin {
    from {
      transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
      transform: translate(-50%, -50%) rotate(360deg);
    }
  }