:root {
  --text-base: clamp(1rem, 0.5641rem + 1.641vw, 2rem); /* 16 — 32 */
  --square-size: clamp(6rem, 3.3846rem + 9.8462vw, 12rem); /* 96 — 192 */
  --square-padding: clamp(1rem, 0.7821rem + 0.8205vw, 1.5rem); /* 16 — 24 */
  --modal-padding: clamp(1.5rem, -0.4615rem + 7.3846vw, 6rem); /* 24 — 96 */
  --modal-padding: clamp(1.5rem, 0.8462rem + 2.4615vw, 3rem); /* 24 — 48 */
  /* --modal-padding: 24px; */
}

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

@font-face {
  font-family: 'Graphik';
  src: url('../fonts/Graphik-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

body {
  font-family: "Graphik", sans-serif;
  font-size: var(--text-base);
  line-height: 1.4;
  text-wrap: balance;
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: #fff;
}

button:hover {
  cursor: pointer;
}

img {
  width: 100%;
  height: auto;
  vertical-align: middle;
}

/* loader */

.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 999;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform; 
}

.logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: var(--square-size);
  height: var(--square-size);
  padding: var(--square-padding);
  /*
  width: max(88px, 9vw);
  height: max(88px, 9vw);
  padding: clamp(0.5rem, -0.7157rem + 1.9608vw, 1rem);
  */
  overflow: hidden;
}

.logo-text {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.1;
  color: #000;
}

.logo-background {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  z-index: -1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform; 
}

/* */

.nav-logo {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  padding: var(--square-padding);
  font-size: var(--text-base);
  font-weight: 400;
  color: #000;
  background-color: #fff;
  z-index: 1;
  cursor: pointer;
}

/*
.admin-bar .nav-logo {
  top: calc(1.5rem + 32px);
}
*/

/*
.btn-zoom {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.25rem;
  color: #000;
  background-color: #fff;
  z-index: 1;
  cursor: pointer;
}
*/

@media (hover: hover) and (pointer: fine) {
  .nav-logo:hover,
  .btn-zoom:hover {
    color: #fff;
    background-color: #000;
  }
}

/* */

.container {
  height: 100vh;
  /*
  display: grid;
  place-content: center;
  */
  overflow: hidden;
  transition: opacity 300ms;
  touch-action: none;
}

.container.hide {
  opacity: 0;
}

.grid-container {
  height: 100%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.grid-container:active {
  cursor: grabbing;
}

.grid {
  display: grid;
  grid-auto-flow: dense;
  /* grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); */
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  /* gap: 1vw; */
  gap: 1.5rem;
  padding: 1vw;
  /* will-change: transform; */
  /* background-color: rgba(255, 0, 0, 0.1); */
}

.grid img {
  /* will-change: transform; */
  /*
  transform: translateZ(0);
  backface-visibility: hidden;
  */
  backface-visibility: hidden;
}

#scene {
  perspective: 1000px;
}



/*
.grid-item {
  border: 1px solid red;
}
*/

/*
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(10, 1fr);
  }
}
*/

/* */

/*
.start-1 {
  grid-column: 1 / span 2;
}

.start-2 {
  grid-column: 2 / span 2;
}

.start-3 {
  grid-column: 3 / span 2;
}
*/

/* */

.self-start {
  align-self: start;
}

.self-center {
  align-self: center;
}

.self-end {
  align-self: end;
}

/* */

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 2;
}

.span-4 {
  grid-column: span 4;
}

/* painéis */

.grid-image-container {
  position: relative;
  overflow: hidden;
}

.grid-image-container::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background-color: #ffcc00; */
  transition: top 1000ms, left 1000ms;
}

.grid-image-container.yellow::after {
  background-color: #ffcd05;
}

.grid-image-container.red::after {
  background-color: #d2232a;
}

.grid-image-container.blue::after {
  background-color: #7abccb;
}

.grid-image-container.slide-up::after {
  top: -100%;
}

.grid-image-container.slide-right::after {
  left: 100%;
}

.grid-image-container.slide-down::after {
  top: 100%;
}

.grid-image-container.slide-left::after {
  top: -100%;
}

/* modal */

.modal.active > * {
  z-index: 1;
}

/* modal-container */

.modal-container {
  position: fixed;
  inset: var(--modal-padding); /* 24 — 96 */
  top: calc(var(--nav-height) + var(--modal-padding) + 24px);
  pointer-events: none;
}

/* modal-btn */

.modal-btn {
  display: flex;
  position: absolute;
  width: var(--square-size);
  height: var(--square-size);
  padding: var(--square-padding);
  /*
  width: max(88px, 9vw);
  height: max(88px, 9vw);
  padding: clamp(0.5rem, -0.7157rem + 1.9608vw, 1rem);
  */
  border: none;
  font-size: var(--text-base);
  font-weight: 400;
  text-align: left;
  line-height: 1.1;
  background-color: transparent;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  pointer-events: auto;
}

.modal-btn::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  font-weight: 700;
  text-align: left;
  color: #000;
  background-color: #fff;
  transition: top 500ms;
}

.modal.active .modal-btn::before {
  top: 0;
}

/* modal-background */

.modal-background {
  position: absolute;
  width: var(--square-size);
  height: var(--square-size);
  background-color: #000;
  transition: top 500ms, right 500ms, bottom 500ms, left 500ms, width 500ms, height 500ms;
}

/* modal-content */

.modal-content {
  position: absolute;
  width: 100%;
  height: 100%;
  margin-top: var(--modal-padding);
  padding: var(--modal-padding);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: margin 250ms, opacity 250ms;
  overflow-y: auto;
}

.modal.active.show-content .modal-content {
  margin-top: 0;
  opacity: 1;
  pointer-events: auto;
  user-select: auto;
}

.modal-content p {
  margin-bottom: 1.5rem;
}

@media (min-width: 1200px) {
  .modal-content p:last-child {
    margin-bottom: 0;
  }
}

.modal-content hr {
  height: 4px;
  margin-bottom: 1.5rem;
  background-color: #fff;
}

.modal-content::selection {
  background: #fff;
  color: #000;
}


/* MODAL-GRID */

.modal-grid {
  display: grid;
  row-gap: 96px;
}

.modal-grid.left {
  padding-right: calc(var(--square-size) + var(--modal-padding));
}

.modal-grid.right {
  padding-left: calc(var(--square-size) + var(--modal-padding));
}

@media (min-width: 768px) {
  .modal-grid {
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: var(--modal-padding);
  }

  .modal-grid.left {
    padding-right: 0;
  }

  .modal-grid.right {
    padding-left: 0;
  }

  /* GRID FICHA */

  .modal[data-modal="ficha"] .modal-grid {
    /* background-color: red; */
    grid-template-areas:
      "a b ."
      "c d .";
  }

  .modal[data-modal="ficha"] .modal-grid .col:nth-child(1) { 
    grid-area: a;
  }

  .modal[data-modal="ficha"] .modal-grid .col:nth-child(2) { 
    grid-area: b;
  }

  .modal[data-modal="ficha"] .modal-grid .col:nth-child(3) { 
    grid-area: c;
  }

  .modal[data-modal="ficha"] .modal-grid .col:nth-child(4) { 
    grid-area: d;
  }

  /* GRID SOBRE */

  .modal[data-modal="sobre"] .modal-grid {
    /* background-color: green; */
    grid-template-areas: ". a a";
  }

  .modal[data-modal="sobre"] .modal-grid .col:nth-child(1) { 
    grid-area: a;
  }

  /* GRID LINKS */

  .modal[data-modal="links"] .modal-grid {
    /* background-color: blue; */
    grid-template-areas: ". a b";
  }

  .modal[data-modal="links"] .modal-grid .col:nth-child(1) { 
    grid-area: a;
  }

  .modal[data-modal="links"] .modal-grid .col:nth-child(2) { 
    grid-area: b;
  }
}

/* modal sobre */

.modal[data-modal="sobre"] .modal-btn,
.modal[data-modal="sobre"] .modal-background {
  top: var(--modal-padding);
  left: var(--modal-padding);
}

.modal.active[data-modal="sobre"] .modal-background {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* modal ficha */

.modal[data-modal="ficha"] .modal-btn,
.modal[data-modal="ficha"] .modal-background {
  top: 40%;
  right: var(--modal-padding);
}

.modal.active[data-modal="ficha"] .modal-background {
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
}

/* modal links */

.modal[data-modal="links"] .modal-btn,
.modal[data-modal="links"] .modal-background {
  bottom: var(--modal-padding);
  left: 25vw;
}

.modal.active[data-modal="links"] .modal-background {
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media screen and (max-aspect-ratio: 1/1) {
  .modal[data-modal="sobre"] .modal-btn,
  .modal[data-modal="sobre"] .modal-background {
    top: 20vw;
    left: 5vw;
  }

  .modal[data-modal="links"] .modal-btn,
  .modal[data-modal="links"] .modal-background {
    /*bottom: 20vw;*/
    left: 25vw;
  }
}

/* modal-close */

.modal-close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--square-padding);
  border: none;
  font-size: var(--text-base);
  background-color: #000;
  color: #fff;
  clip-path: polygon(0 100%, 100% 100%, 100% 100%, 0 100%);
  transition: clip-path 300ms;
  pointer-events: all;
}

.modal.active .modal-close {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* */

.modal-grid li {
  margin-bottom: 1.5rem;
}

.modal-grid li:last-child {
  margin-bottom: 0;
}

.modal[data-modal="links"] li {
  margin-bottom: 0;
}

/* CAPTION */

.caption {
  position: sticky;
  top: var(--modal-padding);
  left: 0;
  width: 100%;
  text-align: right;
  line-height: 1;
  /*
  margin-top: var(--modal-padding);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  transition: margin 250ms, opacity 250ms;
  */
}

/*
.modal.active.show-content .caption {
  margin-top: 0;
  opacity: 1;
  pointer-events: auto;
  user-select: auto;
}
*/

/* SCROLLBAR */

.simplebar-scrollbar::before {
  border-radius: 0;
  background-color: #fff;
  opacity: 1 !important;
}

/* LINK MODAL */

.modal a {
  transition: opacity 300ms;
}

@media (hover: hover) and (pointer: fine) {
  .modal a:hover {
    opacity: 0.75;
  }
}

/* LISTA FICHA */

.modal[data-modal="ficha"] ul li {
  text-wrap: initial;
}