/* =========================
   RESET & BASE STYLES
   ========================= */
body {
  background: black;
  margin: 0;
  padding: 0;
}

body.modal-open {
  overflow: hidden;
}

body.art1 {
  padding-top: 20px;
}
/* =========================
   TYPOGRAPHY & FONTS
   ========================= */
@font-face {
  font-family: 'Visual Wizard';
  src: url('./assets/visual_wizard_font.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* =========================
   LAYOUT: HEADER & NAVBAR
   ========================= */
header {
  align-items: center;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2vw;
}

.logo {
  width: clamp(100px, 20vw, 200px);
  height: auto;
  transition: all 0.3s ease;
  filter: brightness(1);
}

.logo:hover {
  transform: scale(1.05);
  filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  cursor: pointer;
}

.navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(10px, 4vw, 60px);
  margin-top: 20px;
  margin-bottom: 0;
}

.menu-icon {
  display: block;
}

/* =========================
   NAV LINKS
   ========================= */
.nav-link {
  position: relative;
  color: #fff;
  text-decoration: none;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  letter-spacing: 1px;
  transition: color 0.2s;
  padding: 8px 22px;
  z-index: 1;
}

.project-logo{
display: block;
margin: 0 auto;
width: 12vw;
}

.project-logo-sogni{
  display: block;
  margin: 0 auto;
  width: 6vw;
  padding: 8px;
  margin-bottom: 20px;
  }
.nav-link::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scaleX(0.7) scaleY(0.7);
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  opacity: 0;
  transition: all 0.3s cubic-bezier(.4,1.5,.5,1);
  z-index: -1;
}

.nav-link.active::before {
  opacity: 1;
  transform: translate(-50%, -50%) scaleX(1) scaleY(1);
  background: #fff;
}

.nav-link.active {
  color: #111;
  text-shadow: none;
}

.nav-link:hover:not(.active)::before {
  opacity: 1;
  transform: translate(-50%, -50%) scaleX(1) scaleY(1);
  background: rgba(255,255,255,0.18);
}

.nav-link:hover:not(.active) {
  color: #fff;
  text-shadow: 0 0 8px #fff2;
}

/* =========================
   HOME SECTION
   ========================= */
.intro-text {
  color: #fff;
  font-size: 2rem;
  font-family: 'Fira Mono', 'Consolas', monospace;
  margin-top: 2rem;
  text-align: center;
}

.intro-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content:flex-start;
  padding-top: clamp(20px, 4vw, 60px);
  gap: 0.5rem;
}

.intro-greeting {
  color: #fff;
  font-size: clamp(1rem, 4vw, 3rem);
  font-family: 'Fira Mono', 'Consolas', monospace;
  text-align: center;
  padding-right: 60px;
  padding-left: 60px;
}

.intro-name {
  font-weight: bold;
  letter-spacing: 1px;
}

.intro-roles {
  color: #fff;
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 900;
  font-family: 'Fira Mono', 'Consolas', monospace;
  text-align: center;
  line-height: 1.1;
}

.intro-role {
  display: inline-block;
  margin: 0 0.2em;
}

.intro-location {
  color: #fff;
  font-size: clamp(0.5rem, 3vw, 1.2rem);
  font-family: 'Fira Mono', 'Consolas', monospace;
  text-align: center;
  opacity: 0.8;
}

.intro-image-wrapper{
  width:  clamp(200px, 60vw, 400px);
  height:  clamp(200px, 60vw, 400px);
  overflow: hidden;
  position: relative;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 3;
  border: 2px solid #fff;
  transition: all 0.5s ease;
}

.intro-image {
  width: 100%;
  height: auto;
  transform: translateY(-15%);
  opacity: 1;
  visibility: visible;
  transition: all 0.5s ease;
}

.intro-image.hide {
  opacity: 0;
  visibility: hidden;
}

.intro-image-wrapper.zoom {
  border-radius: 5%;
  transform: scale(2);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border: 3px solid #fff;
}

#balls-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

#balls-canvas.show {
  opacity: 1;
  visibility: visible;
}

.overlay-2{
  background: rgba(0, 0, 0, 0.5);
  position: fixed;
  inset: 0;
  display: none;
  z-index: 3;
}

.overlay-2.show{
  display: block;
}

/* =========================
   SKILLS SECTION
   ========================= */
.skill-card {
  width: clamp(150px, 20vw, 250px);
  height: clamp(150px, 20vw, 250px);
  border: 2px solid #fff;
  border-radius: clamp(2px, 4em, 12px);
  font-weight: 200;
  color: #fff;
  font-size: 1.5rem;
  font-family: 'Fira Mono', 'Consolas', monospace;
  justify-content: center;
  align-items: center;
  text-align: center;
  display: flex;
  background-color: #333;
}

.skill-card:hover{
  background-color: #555;
  border-color: #eeff00;
  box-shadow: 0 8px 20px rgba(0, 240, 255, 0.2);
  transform: scale(1.05);
}

.skill-container{
  display: flex;
  flex-wrap: wrap;
  padding: 2rem;
  gap: clamp(5px ,2rem, 20px);
  align-items: center;
  justify-content: center;
}

.creative-skills,
.technical-skills {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: center;
  justify-content: center;
  display: none;
}

.creative-skills.show,
.technical-skills.show {
  display: flex;
}

.skill-logo-container{
  height: fit-content;
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: clamp(8px, 2vw, 20px);
  align-items: center;
  flex-wrap: wrap;
}

.skill-logo{
  color: #eeff00;
  width: clamp(28px, 7vw, 55px);
  height: clamp(28px, 7vw, 55px);
}

.skill-logo img{
  width: 100%;
  height: 100%;
  border: 1px solid #ffffff;
  border-radius: 8px;
  padding: 2px;
  object-fit: contain;
}

.visual-wizard span{
  font-size: clamp(24px, 5vw, 50px);
  font-family: 'Visual Wizard', sans-serif;
  text-transform: uppercase;
  color: #fff;
  animation: zoomup 2s linear infinite;
  animation-delay: calc(200ms * var(--i));
}

.matrix-text {
  color: #0f0;
  font-size: 80px;
  font-family: monospace;
  position: relative;
  text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0;
  z-index: 2;
}

#debug-sage {
  color: #0f0;
  font-size: clamp(24px, 5vw, 50px);
  font-family: monospace;
  text-transform: uppercase;
  text-shadow: 0 0 10px #0f0, 0 0 20px #0f0, 0 0 30px #0f0;
  z-index: 2;
}

#debug-sage::before {
  content: "DEBUG SAGE";
  position: absolute;
  width: 100%;
  height: 100%;
  animation: glitch 2s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  color: rgb(255, 255, 255);
  text-shadow: 0 0 5px #0f0, 0 0 15px #0f0;
}

.skill-name-creative,
.skill-name-technical {
  display: inline-block;
  width: fit-content;
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: 10px;
  padding: clamp(6px, 1vw, 10px) clamp(8px, 0.5vw, 12px);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.skill-name-container{
  height: fit-content;
  gap: 3px;
  justify-content: center;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
}

/* =========================
   WORK SECTION
   ========================= */
.hero-video-wrapper{
  width: 100%;
  padding-top: 5vh;
  justify-items: center;
}

.hero-video{
margin: 0 auto;
  border: 2px solid #fff;
  width: 95vw;
  height: clamp(40vh, 60vh, 60vh);
}

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

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

.grid{
  padding-top: 2vh;
  justify-items: center;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 60px;
  width: 95vw;
  margin: 0 auto;
  /*padding: 20px;*/
}

.thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}


.description-container a {
	color: #ffffff;
	font-weight: 500;
	text-decoration: none;
	border-bottom: 1px dotted #ffffff;
}

.description-container a:hover {
	color: #ffd700;
	border-bottom: 1px solid #ffd700;
}


.grid-box{
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  aspect-ratio: 1 / 1;
  width: 90%;
  background-color: #111;
  color: #ffffff;
  border: 2px solid #fff;
  font-size: 1.2rem;
  border-radius: 8px;
  transition: all 300ms ease;
  position: relative;
  overflow: hidden;
}

.text-overlay {
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 15px 10px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  backdrop-filter: blur(5px);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  transition: all 0.3s ease;
}

.grid-box:hover .text-overlay {
  background: rgba(0, 0, 0, 0.8);
  padding: 18px 10px;
}

.grid-box.visible {
  opacity: 1;
  transform: translateY(0);
}

.grid.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.grid-box:hover{
  transform: scale(1.1);
}

.switch {
  position: fixed;
  font-size: larger;
  font-family: 'Montserrat', Arial, sans-serif;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) scale(1);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(35px);
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.25);
  color: #fff;
  padding: 2em;
  border-radius: 99999px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.switch:hover {
  transform: translateX(-50%) scale(1.1);
}

/* =========================
   PROJECTS & MODAL SECTION
   ========================= */
.close-modal:hover {
  transform: scale(1.2);
}

.project-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.project-modal {
  transform: scale(0.85);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: relative;
  justify-content: center;
  text-align: center;
  width: 90vw;
  height: 90vh;
  overflow: auto;
  /*padding: 20px;*/
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid #fff;
  color: #fff;
  backdrop-filter: blur(12px);
  z-index: 1001;
  transition: transform 0.4s ease, opacity 0.4s ease, visibility 0.4s ease;
}

.project-modal.show {
  transform: scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-container{
  position: relative;
}

.project-modal iframe {

  width: 100%;
  height: 100%;
  /*border-radius: 10px;*/
  /*border: 1px solid #fff;*/
}

.close-modal {
  right: 30px;
  top: 30px;
  position: absolute;
  background: transparent;
  border: none;
  font-size: 30px;
  transform: scale(0);
  color: white;
  cursor: pointer;
  z-index: 1002;
  transition: transform 0.5s ease;
}

.close-modal.show{
	transform: scale(1);
}

.project-modal-overlay.show {
  display: flex;
}

.title-container{
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 2.5rem;
  padding: 10px;
  padding-bottom: 10px;
  color: #fff;
  font-family: 'Montserrat', Arial, sans-serif;
}

.description-container{
  font-family: 'Montserrat', Arial, sans-serif;
  justify-items: center;
  align-items: center;
  text-align: center;
  color: #fff;
  margin: 0 auto;
  width: 60vw;
  font-size: clamp(12px, 2.5vw, 18px);
  padding-right: 0.1rem;
  padding-left: 0.1rem;
}

.art1 .logo {
  width: clamp(120px, 20vw, 180px);
  height: auto;
  transition: all 0.3s ease;
  filter: brightness(1);
}

.art1 .logo-container {
justify-content: center;
justify-items: center;
align-items: center;
	padding: 0.5vh;
}

.logo:hover {
  transform: scale(1.05);
  filter: brightness(1.2) drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
  cursor: pointer;
}

.skill-name{
  display: inline-block;
  width: fit-content;
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  font-size: 20px;
  padding: clamp(6px, 1vw, 10px) clamp(8px, 0.5vw, 12px);
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.reels-container{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.gallery-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 100%;
  overflow: hidden;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}

.gallery-container img {
  width: 100%;
  max-width: 300px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

.gif-container {
	width: clamp(300px, 60vw, 600px);
	height: auto;
	border-radius: 10px;
	margin: 0 auto;
	overflow: hidden; /* important to mask the image */
}

.vertical-video {
	display: grid;
  	grid-template-columns: repeat(4, 1fr);
	justify-content: center;
	gap: 5px;
	flex-direction: row;
	/*width: clamp(300px, 60vw, 600px);*/
	/*height: auto;*/
	margin: 0 auto;
	margin-bottom: 20px;
}

.art3 .vertical-video {
	display: grid;
  	grid-template-columns: repeat(3, 1fr);
	justify-content: center;
	gap: 5px;
	flex-direction: row;
	/*width: clamp(300px, 60vw, 600px);*/
	/*height: auto;*/
	margin: 0 auto;
	margin-bottom: 20px;
}

.vertical-video video{
	width: 90%;
	margin: 0 auto;
	border-radius: 10px;
}

.gif-container video {
	display: block; /* remove bottom whitespace */
	width: 100%;
	height: 100%;
	object-fit: cover; /* fills container while keeping aspect ratio */
}

.gif-container iframe {
	width: 100%;
	object-fit: cover; /* fills container while keeping aspect ratio */
}

.powered-by{
  font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
  text-align: center;
  color: #fff;
  font-size: 12px;
}

.iframe-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  justify-items: center;
}

.iframe-container iframe {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 16 / 9;
  border: none;
}

/* =========================
   MEDIA QUERIES
   ========================= */
@media (max-width: 820px) {
	.vertical-video {
		width: 90vw;
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.art3 .vertical-video {
		width: 90vw;
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.vertical-video video{
		width: 90%;
	}

  .intro-image-wrapper.zoom {
    transform: scale(1.6);
  }
}

@media (max-width: 768px) {
  .logo-container{
    padding-bottom: 20px;
  }
  .overlay{
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    inset: 0;
    display: none;
    z-index: 5;
  }
  .overlay.show{
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
  }
  .menu-icon {
    position: absolute;
    right: 16px;
    color: #fff;
    font-size: clamp(20px, 20vw, 40px);
    cursor: pointer;
    display: flex;
  }
  .navbar {
    position: fixed;
    display: flex;
    flex-direction: column;
    padding-right: 16px;
    gap: 20px;
    right: -100%;
    transition: 300ms ease-out;
    z-index: 6;
  }
  .navbar.show {
    right: 0;
  }
  .nav-link {
    text-decoration: none;
    font-family: 'Montserrat', Arial, sans-serif;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: color 0.2s;
    padding: 8px 22px;
    z-index: 1;
  }
  .nav-link::before {
    content: '';
    position: absolute;
    transform: translate(-50%, -50%) scaleX(0.7) scaleY(0.7);
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.12);
    opacity: 0;
    transition: all 0.3s cubic-bezier(.4,1.5,.5,1);
    z-index: -1;
  }
  .nav-link.active::before {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1) scaleY(1);
    background: #fff;
  }
  .nav-link.active {
    color: #111;
    text-shadow: none;
  }
  .nav-link:hover:not(.active)::before {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1) scaleY(1);
    background: rgba(255,255,255,0.18);
  }
  .nav-link:hover:not(.active) {
    color: #fff;
    text-shadow: 0 0 8px #fff2;
  }
  .skill-card {
    font-size: 1rem;
    width: clamp(100px, 30vw, 150px);
    height: clamp(100px, 30vw, 150px);
  }
}

@media (max-width: 700px) {

	.skill-container{
		padding: 1rem;
		gap: clamp(1px ,1rem, 5px);
	  }

	.project-logo{
		width: 30vw;
		}

  .powered-by{
    text-align: center;
    color: #fff;
    font-size: 10px;
  }
    .project-logo-sogni{
      width: 12vw;
      }
	.title-container{
		font-size: 1.7rem;
	  }

  .switch{
    font-size: small;
    padding: 1.2em;
  }
  .hero-video-wrapper{
    padding-top: 0px;
    justify-items: center;
  }
  .hero-video{
    border: 2px solid #ffffff;
    width: 85vw;
    height: 30vh;
  }
  .grid{
	width: 90vw;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-box{
    border-radius: 4px;
  }
  
  .text-overlay {
    padding: 10px 8px;
    font-size: 0.9rem;
  }
  .skill-name {
  font-size: 0.7rem;
  padding: 8px 12px;
  }

  .skill-name-creative,
  .skill-name-technical {
	font-size: clamp(4px, calc(0.3rem + 0.5vw), 6px);
	padding: clamp(4px, calc(0.2rem + 0.3vw), 6px) clamp(4px, calc(0.2rem + 0.3vw), 7px);
  }

  .video-container {
	position: relative;
	width: 100%;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
	overflow: hidden;
	border-radius: 12px; /* optional */
  }

  .video-container iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
  }

  .description-container{
	width: 90vw;
  }
}

/* =========================
   ANIMATIONS & KEYFRAMES
   ========================= */
@keyframes glitch {
  0%, 100% {
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(0);
  }
  33% {
    clip-path: polygon(0 0, 100% 0, 100% 15%, 0 15%);
    transform: translate(-4px, -4px);
  }
  66% {
    clip-path: polygon(0 85%, 100% 85%, 100% 100%, 0 100%);
    transform: translate(4px, 4px);
  }
}

@keyframes zoomup {
  0%,
  100% {
    color: #bcfaf8;
    filter: blur(1px);
    text-shadow: 0 0 10px #00c2ba, 0 0 20px #00c2ba, 0 0 30px #00c2ba,
      0 0 40px #00c2ba, 0 0 60px #00c2ba, 0 0 80px #00c2ba, 0 0 100px #00c2ba,
      0 0 120px #00c2ba;
  }
  5%,
  95% {
    filter: blur(0);
    color: #fff;
    text-shadow: none;
  }
}

@keyframes glitch {
  0% {
    transform: translate(0, 0) skew(0deg, 0deg);
    filter: none;
  }
  10% {
    transform: translate(-2px, 2px) skew(-2deg, 1deg);
    filter: contrast(1.2) brightness(1.1);
  }
  20% {
    transform: translate(2px, -1px) skew(2deg, -1deg);
    filter: hue-rotate(10deg);
  }
  30% {
    transform: translate(-2px, 1px);
    filter: hue-rotate(-10deg);
  }
  40% {
    transform: translate(2px, -2px) scale(1.05);
    filter: invert(0.1);
  }
  50% {
    transform: scale(1) translate(0, 0);
    filter: none;
  }
  100% {
    transform: translate(0, 0);
    filter: none;
  }
}

.glitch-out {
  animation: glitch 0.5s ease-in-out;
}
