@font-face {
  font-family: "Space mono";
  src: url(links/SpaceMono-Bold.ttf) format("truetype"),
       url(links/SpaceMono-Regular.ttf) format("truetype");
}

@font-face {
  font-family: "Plain";
  src: url(links/Plain-Regular.otf) format("opentype"),
       url(links/Plain-RegularItalic.otf) format("opentype");
}

@font-face {
  font-family: "Graphik";
  src: url(links/GraphikRegular.otf) format("opentype");
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none;
  /*height: auto;
  overflow-y: auto;*/
}

#header-container {
  pointer-events: auto;
}

header {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  padding: 1rem;
  z-index: 50;
  display: flex;
  pointer-events: none;
}

#about-container {
  pointer-events: auto;
  position: relative;
}

/* BOTÃO ABOUT */
#about-button {
  color: #000000;
  border: 1.5px solid #00ff18;
  background-color:#00ff18;
  font-size: clamp(0.6rem, 1vw, 1.2rem);
  font-family: "Plain", sans-serif;
  position: fixed;
  top: 0.5rem;
  right: 1rem;
  z-index: 100;
  cursor: default;
  text-align: right;
  line-height: 1.3;
  text-transform: uppercase;
  pointer-events: auto; /* Importante para o hover funcionar */
}

#about-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 40%;
  height: 100vh;
  background: #00ff18;
  box-shadow: -6px 0 16px rgba(0, 0, 0, 0.2);
  padding: 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.5s ease;
  z-index: 9999;
  will-change: transform; 
  font-family: "Plain", sans-serif;
}

#about-panel p {
  font-size: clamp(0.8rem, 1vw, 1.2rem);
  padding-top: 1rem;
}

#about-panel h2 {
  font-size: clamp(0.6rem, 0.8vw, 1rem);
  padding-bottom: 0.3vw;
  font-family: "Plain", sans-serif;
  font-weight: normal;
}

#about-panel p + h2 {
  margin-top: 3vw;
}

#about-container.hovered #about-panel {
  transform: translateX(0);
}

.container {
  display: flex;
  /*height: 100vh;*/
  /*overflow: visible !important;*/
}

#aside {
  position: fixed;
  top: 0;
  /*left: 0;*/
  width: 30%;
  height: 100vh;
  padding: 2rem 1rem;
  /*z-index: 100;
  overflow-y: auto;*/
}

#content {
  width: 70%;
  margin-left: 30%;
  overflow-y: visible;
  position: relative;
  overflow-x: hidden;
  /*z-index: 1;*/
}

#definition {
  height: 100%;
  display: inline-block;
}

/* ======== BOTÕES DE TAG ======== */
.tag-container {
  margin-top: 5%; /* espaço em cima dos botoes */

}

.tag-button {
  display: block;
  /*position: relative;*/
  overflow: visible;
  z-index: 10;
  max-width: none;
  margin-top: 10px;
  border: 1.5px solid black;
  background-color: black;
  color: white;
  font-family: "Plain", sans-serif;
  font-size: clamp(0.6rem, 1vw, 1.2rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.75, 0, 0.25, 1);
  transform: scale(1);
  white-space: nowrap;
}

.tag-button:hover {
  background-color: black;
  /*z-index: 100;
  position: relative;*/
  color: white;
  letter-spacing: 0.8em;
  /*overflow: visible;*/
}

.tag-button.active {
  background-color: black;
  color: #00ff18;
  transform: scale(1);
}

#definition-box {
  display: flex;
  flex-direction: column;
  margin-top: 2%;
  margin-bottom: 2%;
  gap: 3vh; /* espaçamento fixo entre as .tag-definition visíveis */
}

.tag-definition {
  display: none;
  margin-bottom: 1,5vh;
  padding: 1.5vh 5% 1.5vh 0; 
  font-size: clamp(0.8rem, 1.2vw, 1.4rem);
  max-width: 70%;
  font-weight: normal;
  will-change: transform, width, opacity;
  opacity: 0;
  transform: translateX(0) scaleX(0.8);
  width: 40%;
  transition: transform 1s ease, width 1s ease, opacity 1s ease;
  font-family: "space mono", monospace;
}

.tag-definition h3 ~ p {
  margin-top: 3vw;
}

.tag-definition h3 {
  font-family: "space mono", monospace;
  font-size: clamp(0.8rem, 1.2vw, 1.4rem);
  font-weight: normal;
  color: #656565;
}

.tag-definition.active {
  display: block;
}

.word.hidden {
  visibility: hidden;
  transition: visibility 0s linear 0s;
}

.word.highlight {
  /*background: #00ff18;*/
  text-shadow: 1px 1px 1px #00ff18;
  /*background: black;
  color: white;*/
}

/* ======== RESULTADOS (EXAMPLES) ======== */
.example {
  font-family: "Graphik", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.6rem);
  color: #00ff18;
  font-weight: lighter;
  position: fixed;
  z-index: 10;
  display: none;            /* só mostra quando a classe .active for aplicada */
  pointer-events: auto;
  padding: 0.2em 0.5em;
  /*background: rgba(255, 255, 255, 0.8);*/
  background-color: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.3s ease;
  z-index: 20;
  /*mix-blend-mode: difference;*/
  /*filter: invert(1);*/
}

/* Quando a tag-filtragem deixa o exemplo “ativo” */
.example.active {
  display: block;
}

/* ======== EXEMPLO FLUTUANTE ======== */
.floating-example {
  /* a animação é aplicada via JS definindo animation-duration dinamicamente */
  animation-name: floatMovement;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

/* Keyframes para fazer um leve “bob” vertical e deslocar um pouco na horizontal */
@keyframes floatMovement {
  0% {
    transform: translate(0px, 0px);
  }
  25% {
    transform: translate(10px, -8px);
  }
  50% {
    transform: translate(0px, -16px);
  }
  75% {
    transform: translate(-10px, -8px);
  }
  100% {
    transform: translate(0px, 0px);
  }
}

/* ======== HOVER IMAGE ======== */
.hover-image {
  position: fixed;
  top: 50%;
  right: -10%;
  z-index: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}

.hover-image img {
  max-width: 400px;
  height: auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

/* ======== MODAL POPUP ======== */
.modal {
  display: none; /* começa escondido */
  position: fixed;
  inset: 0; /* top, right, bottom, left = 0 */
  z-index: 1000;
  /*background: transparent; /* nenhuma cor sólida */
  backdrop-filter: blur(6px); /* <-- este é o blur do fundo da página */
  /*-webkit-backdrop-filter: blur(4px); /* compatibilidade Safari */
}

.modal-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 40%;
  height: 100vh;
  background-color: rgba(0, 255, 24, 0.8); /* verde translúcido */
  box-shadow:
    -20px 0px 60px rgba(0, 255, 24, 0.3),
    -60px 0px 120px rgba(0, 255, 24, 0.2),
    -120px 0px 240px rgba(0, 255, 24, 0.1),
    -200px 0px 320px rgba(0, 255, 24, 0.06),
    -300px 0px 400px rgba(0, 255, 24, 0.04);
  backdrop-filter: blur(8px);
 /* backdrop-filter: blur(12px); /* opcional: mantém o conteúdo limpo */
  /*box-shadow: -60px 0px 100px -20px #00ff18;  /* sombra na borda esquerda */
  padding: 2rem;
  overflow-y: auto;
  scrollbar-width: none;
}

.modal-content a {
  margin-top: 2%;
  margin-bottom: 2vw;
  font-family: "Plain", sans-serif;
  font-size: clamp(1.8rem, 2vw, 2.1rem);
  text-decoration: underline;
  text-transform: uppercase;
  color: black;
}

.modal-content a[target="_blank"]::after {
  content: " ↗";
  font-size: clamp(1rem, 1.2vw, 1.4rem); /* ligeiramente menor que o texto principal */
  display: inline-block;
  transform: translateY(-0.5em); /* afina o alinhamento vertical */
  margin: 0.5rem;
}

.modal-content h2 {
  font-family: "Plain", sans-serif;
  font-weight: normal;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
}

.modal-content p {
  font-family: "Plain", sans-serif;
  font-weight: normal;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
}

.modal-content p.description {
  font-family: "Plain", sans-serif;
  font-weight: normal;
  font-size: clamp(0.8rem, 1vw, 1.2rem);
  margin-left: 1.5rem;
}

.modal-content p.project {
  font-family: "Plain", sans-serif;
  font-weight: normal;
  font-size: clamp(0.6rem, 0.8vw, 1rem);
  text-align: end;
  color: #656565;
}

.modal-content p + p {
  margin-top: 2rem;
}

.modal-content p.description + p.project {
  margin-top: 0.5rem;
}

body.modal-open {
  overflow: hidden;
  height: 100vh;
  position: fixed;
  width: 100%;
}

.close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: black;
}

.close:hover,
.close:focus {
  color: #000;
}

.footer-note {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  font-size: clamp(0.5rem, 0.7vw, 0.9rem);
  font-family: "Plain", sans-serif;
  color: rgb(117, 117, 117);
  opacity: 0.4;
  pointer-events: none;
  /*z-index: 9999;*/
}

.mobile-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  font-family: "Plain", sans-serif;
  font-size: clamp(0.9rem, 1.2vw, 1rem);
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  max-width: 80%;
}

.mobile-modal-content button {
  margin-top: 1rem;
  padding: 0.5rem 1.2rem;
  background-color: #00ff18;
  border-radius: 8px;
  color: black;
  border: none;
  font-weight: bold;
  font-family: "Plain", sans-serif;
  cursor: pointer;
}

/* Garante que não aparece em ecrãs grandes */
@media screen and (min-width: 769px) {
  #mobile-warning-modal {
    display: none !important;
  }
}

/* Janela com menos de 768px (tablet ou telemóvel em horizontal) */
@media screen and (max-width: 768px) {
  #about-panel {
    width: 80%;
  }

  .modal-content {
    width: 100%;
  }

  #content {
  margin-left: 40%;}
}