/* ==========================================================================
   1. VARIABLES & CORE STYLES
   ========================================================================== */

:root {
  --color-bg: #000000;
  --color-text: #ffffff;
  --font-nav: "Jersey 25", sans-serif;
  --font-left: "Nerko One", cursive;
  --font-right: "Josefin Sans", sans-serif;

  /* Left Side: Anima Artigiana */
  --color-left: #df7b3e;
  --color-left-glow: rgba(223, 123, 62, 0.25);
  --color-btn-left: #a14c1d;

  /* Right Side: Potenza Digitale */
  --color-right: #7ae4e7;
  --color-right-glow: rgba(122, 228, 231, 0.25);
  --color-btn-right: #438f9f;

  /* Process Section Wave */
  --color-wave-start: #0055ff;
  --color-wave: #0099ff;
  --color-wave-end: #00d4ff;
  --wave-stroke: 10px;
}

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

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  font-family: var(--font-right);
}

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

/* Accessibility utility for screen readers and SEO */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Custom Cursor Styles */
.custom-cursor {
  width: 16px;
  height: 16px;
  background-color: #ffffff;
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 99999;
  opacity: 0;
  mix-blend-mode: difference;
  will-change: transform, opacity, background-color;
}

@media (min-width: 769px) {
  body, a, button, .pagination-dot, .btn, .hero-cta-btn, .work-item, .cliccami-text, .instagram-link-wrapper, .contact-button {
    cursor: none !important;
  }
}

@media (max-width: 768px) {
  .custom-cursor {
    display: none !important;
  }
}

/* ==========================================================================
   2. PRELOADER SCREEN
   ========================================================================== */

body.loading {
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000000;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 5rem 6rem;
  box-sizing: border-box;
  overflow: hidden;
}

.preloader-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./Assets/photos/Intro.png');
  background-size: cover;
  background-position: center;
  filter: brightness(0.7) contrast(1.1) grayscale(0.2);
  z-index: 1;
}

/* Mask to hide the baked text on the intro image */
.preloader-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 45%;
  background: linear-gradient(to top, #000000 0%, #000000 35%, rgba(0, 0, 0, 0.8) 65%, transparent 100%);
  z-index: 2;
}

/* Subtle glass/noise overlay */
.preloader-noise {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 3;
  pointer-events: none;
}

.preloader-content {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preloader-text-container {
  position: relative;
  font-family: var(--font-nav);
  font-size: clamp(3rem, 8.5vw, 8.5rem);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: -2px;
  line-height: 0.85;
}

.preloader-text-stroke {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.18);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
}

.preloader-text-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  overflow: hidden;
  white-space: nowrap;
  background: linear-gradient(90deg, #e87a31 0%, #2ce0e6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(232, 122, 49, 0.45)) drop-shadow(0 0 12px rgba(44, 224, 230, 0.45));
  transition: width 0.1s ease-out;
}

.preloader-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  margin-top: 0.5rem;
}

.preloader-subtitle {
  font-family: var(--font-nav);
  font-size: clamp(1.4rem, 2.4vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.4);
}

.preloader-percentage {
  font-family: var(--font-nav);
  font-size: clamp(1.4rem, 2.4vw, 2.6rem);
  color: #2ce0e6;
  letter-spacing: 1px;
  min-width: 4.5rem;
  text-align: right;
}

@media (max-width: 768px) {
  #preloader {
    padding: 3rem 1.5rem;
  }

  .preloader-text-container {
    letter-spacing: -1px;
    white-space: nowrap !important;
    font-size: clamp(1.2rem, 5.8vw, 3rem) !important;
  }

  .preloader-bg::after {
    height: 50%;
    background: linear-gradient(to top, #000000 0%, #000000 45%, rgba(0, 0, 0, 0.85) 75%, transparent 100%);
  }

  .preloader-subtitle {
    font-size: clamp(0.85rem, 2.8vw, 1.4rem);
  }

  .preloader-percentage {
    font-size: clamp(0.85rem, 2.8vw, 1.4rem);
    min-width: 3rem;
  }
}


/* ==========================================================================
   3. HERO MAIN LAYOUT
   ========================================================================== */

.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.glow {
  position: absolute;
  width: 30vw;
  height: 50vh;
  top: 25vh;
  border-radius: 50%;
  filter: blur(100px);
}

.glow-left {
  left: 5vw;
  background: radial-gradient(circle, var(--color-left-glow) 0%, rgba(0, 0, 0, 0) 70%);
}

.glow-right {
  right: 5vw;
  background: radial-gradient(circle, var(--color-right-glow) 0%, rgba(0, 0, 0, 0) 70%);
}


/* ==========================================================================
   4. NAVIGATION BAR
   ========================================================================== */

.navbar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  font-family: var(--font-nav);
  font-size: 1.5rem;
  letter-spacing: 1px;
}

.nav-left {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-left a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.nav-left a:hover {
  transform: scale(1.1);
}

.nav-left .icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

.nav-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.2rem;
  letter-spacing: 2px;
  white-space: nowrap;
}

.nav-right {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  transition: opacity 0.3s ease;
}

.nav-link:hover {
  opacity: 0.7;
}

@media (max-width: 768px) {
  .navbar {
    padding: 1rem 1rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .nav-left {
    display: none !important;
  }

  .nav-center {
    position: static !important;
    transform: none !important;
    font-size: 1.35rem;
    letter-spacing: 1px;
  }

  .nav-right {
    gap: 0.8rem !important;
    font-size: 1.05rem !important;
  }
}


/* ==========================================================================
   5. HERO CONTENT & CTA
   ========================================================================== */

.hero-content {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
}

.hero-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}

.left-side {
  align-items: flex-start;
}

.right-side {
  align-items: flex-end;
  text-align: right;
}

.text-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.text-left-wrapper {
  align-items: center;
}

.text-right-wrapper {
  align-items: center;
}

.title-left {
  font-family: var(--font-left);
  color: var(--color-left);
  font-size: clamp(3rem, 6vw, 6rem);
  line-height: 1.1;
  text-transform: uppercase;
  text-align: center;
}

.title-right {
  font-family: var(--font-right);
  color: var(--color-right);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  text-align: center;
}

/* Button UI styling */
.btn {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  border-radius: 50px;
  border: none;
  font-family: var(--font-right);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.btn-left {
  background-color: var(--color-btn-left);
  box-shadow: 0 4px 15px rgba(161, 76, 29, 0.4);
}

.btn-left:hover {
  background-color: var(--color-left);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(223, 123, 62, 0.5);
}

.btn-right {
  background-color: var(--color-btn-right);
  box-shadow: 0 4px 15px rgba(67, 143, 159, 0.4);
}

.btn-right:hover {
  background-color: var(--color-right);
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122, 228, 231, 0.5);
}

/* Center Interactive Video Object */
.hero-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 78vw;
  max-width: 1400px;
  height: auto;
  z-index: 1;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-video {
  width: 100%;
  height: auto;
  object-fit: contain;
  will-change: transform;
  transform: translateZ(0);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  position: relative;
  z-index: 2;
}

/* Glares behind the brain hemispheres */
.brain-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.95;
  mix-blend-mode: screen;
  filter: blur(80px);
  will-change: transform, opacity;
}

.brain-glow-left {
  width: 36%;
  height: 56%;
  left: 18%;
  top: 22%;
  background: radial-gradient(circle, rgba(223, 123, 62, 1.0) 0%, rgba(223, 123, 62, 0.45) 50%, rgba(0, 0, 0, 0) 80%);
  transform-origin: center center;
}

.brain-glow-right {
  width: 36%;
  height: 56%;
  right: 18%;
  top: 22%;
  background: radial-gradient(circle, rgba(122, 228, 231, 1.0) 0%, rgba(122, 228, 231, 0.45) 50%, rgba(0, 0, 0, 0) 80%);
  transform-origin: center center;
}

/* Floating contact prompt button */
.hero-cta-btn {
  position: absolute;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 2.2rem;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 50px;
  color: #ffffff;
  font-family: var(--font-right);
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
}

.hero-cta-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-cta-btn:hover {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.2);
}

.hero-cta-btn:hover svg {
  transform: translateY(4px);
}

@media (max-width: 1024px) {
  .hero-center {
    width: 85vw;
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    justify-content: center;
    gap: 8vh;
    padding: 0 4vw;
  }

  .hero-side {
    align-items: center !important;
  }

  .title-left {
    font-size: clamp(2rem, 7vw, 3.2rem) !important;
  }

  .title-right {
    font-size: clamp(1.7rem, 6vw, 3rem) !important;
  }

  .btn {
    padding: 0.6rem 1.8rem !important;
    font-size: 1rem !important;
  }

  .hero-center {
    width: 95vw;
    max-width: 600px;
  }

  .glow {
    width: 50vw;
  }

  .glow-left {
    top: 5vh;
    left: 10vw;
  }

  .glow-right {
    bottom: 5vh;
    right: 10vw;
  }

  .hero-cta-btn {
    bottom: 1.5rem;
    padding: 0.6rem 1.6rem;
    font-size: 0.9rem;
  }
}


/* ==========================================================================
   6. DEEP DIVE OVERLAY SYSTEM
   ========================================================================== */

body.deep-dive-active-left,
body.deep-dive-active-right {
  overflow: hidden !important;
  height: 100vh;
  width: 100vw;
}

.deep-dive-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

.deep-dive-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}

.deep-dive-active-left .deep-dive-bg {
  background: linear-gradient(90deg, #4d200c 0%, #260f04 50%, #000000 100%);
}

.deep-dive-active-right .deep-dive-bg {
  background: linear-gradient(270deg, #092131 0%, #030d14 50%, #000000 100%);
}

.deep-dive-slides {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
}

.deep-dive-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  padding: 0 8vw;
  box-sizing: border-box;
  pointer-events: none;
}

.slide-content {
  max-width: 50vw;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

.content-left {
  align-items: flex-start;
}

.content-right {
  align-items: flex-end;
  text-align: right;
  margin-left: auto;
}

.typing-cursor {
  display: inline-block;
  width: 0.08em;
  height: 1.1em;
  background-color: white;
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.font-left {
  font-family: var(--font-left);
}

.font-right {
  font-family: var(--font-right);
}

.deep-title {
  color: #ffffff;
  font-size: clamp(3rem, 7.5vw, 7.5rem);
  line-height: 1.1;
  text-transform: uppercase;
  margin: 0;
}

/* Slide 2 layout items */
.stack-text {
  gap: 1.5rem;
}

.stack-text .line {
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.15;
  white-space: nowrap;
}

/* Center aligned CTA area for Slide 3 */
.cta-content-centered {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  width: auto;
  max-width: none;
  margin: 0;
}

@media (min-width: 769px) {
  .cta-content-centered {
    top: calc(50% - min(22vw, 250px));
  }
}

@media (max-width: 768px) {
  .cta-content-centered {
    top: calc(50% - 38vw);
  }
}

.cliccami-text {
  color: #ffffff;
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.85;
  text-shadow: 0 0 25px rgba(255, 255, 255, 0.3);
  pointer-events: auto;
  text-align: center;
  max-width: 90vw;
}

.cliccami-text:hover {
  opacity: 1;
  transform: scale(1.08);
  text-shadow: 0 0 35px rgba(255, 255, 255, 0.8);
}

/* Deep Dive Pagination Dots */
.deep-dive-pagination {
  position: absolute;
  top: 50%;
  left: 3.2rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  z-index: 10;
  pointer-events: auto;
}

@media (min-width: 769px) {
  .deep-dive-active-right .deep-dive-pagination {
    left: auto;
    right: 3.2rem;
  }
}

.pagination-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.pagination-dot:hover {
  background-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.15);
}

.pagination-dot.active {
  background-color: #ffffff;
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.pagination-dot.active:hover {
  background-color: #ffffff;
  transform: scale(1.25);
}

.deep-dive-active-left .left-side,
.deep-dive-active-left .right-side,
.deep-dive-active-left .glow-left,
.deep-dive-active-left .glow-right,
.deep-dive-active-right .left-side,
.deep-dive-active-right .right-side,
.deep-dive-active-right .glow-left,
.deep-dive-active-right .glow-right {
  pointer-events: none;
}

@media (max-width: 768px) {
  .deep-dive-slide {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 6vw;
  }

  .slide-content {
    max-width: 90vw;
    align-items: center !important;
    text-align: center !important;
  }

  .deep-title {
    font-size: clamp(2.5rem, 6.5vw, 4.5rem);
    text-align: center;
  }

  .stack-text .line {
    font-size: clamp(1.8rem, 4.5vw, 3rem);
    text-align: center;
    white-space: normal;
  }

  .deep-dive-pagination {
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: 2rem;
    flex-direction: row;
    gap: 1rem;
  }

  .pagination-dot {
    position: relative;
  }

  .pagination-dot::after {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
  }
}


/* ==========================================================================
   7. PROCESSO SECTION (SCROLLYTELLING WAVE & CARDS)
   ========================================================================== */

.process-section {
  height: 350vh;
  position: relative;
  background-color: var(--color-bg);
}

.process-container {
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.process-text {
  font-family: var(--font-nav);
  font-size: clamp(4rem, 8vw, 8rem);
  text-align: center;
  color: var(--color-text);
  line-height: 1.1;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-areas: "title";
  place-items: center;
  height: 2.2em;
  width: 100%;
}

.process-top {
  grid-area: title;
  display: inline-block;
  white-space: nowrap;
  transform: translateY(-0.55em);
  will-change: transform;
}

.process-bottom {
  grid-area: title;
  display: inline-block;
  white-space: nowrap;
  transform: translateY(0.55em);
  will-change: transform;
}

.process-wave-wrapper {
  margin-top: 2rem;
  width: 100vw;
  height: 40vh;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 1;
  will-change: width, height, transform;
}

.process-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  will-change: transform;
  filter: drop-shadow(0 0 15px var(--color-wave));
}

.process-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: 340px;
  background: rgba(15, 15, 20, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  overflow: hidden;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  z-index: 10;
  opacity: 0;
  pointer-events: auto;
  will-change: transform, opacity;
}

/* Card Top Border Gradients & Accent Colors */
.process-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  z-index: 5;
}

.process-card-1 {
  --card-accent: #ED7E3A;
}

.process-card-1::before {
  background: linear-gradient(to right, #ED7E3A, #F09C68);
}

.process-card-2 {
  --card-accent: #F09C68;
}

.process-card-2::before {
  background: linear-gradient(to right, #F09C68, #F09C68);
}

.process-card-3 {
  --card-accent: #F7FF80;
}

.process-card-3::before {
  background: linear-gradient(to right, #F7FF80, #A6B206);
}

.process-card-4 {
  --card-accent: #F7FF80;
}

.process-card-4::before {
  background: linear-gradient(to right, #F7FF80, #A6B206);
}

.process-card-5 {
  --card-accent: #A6B206;
}

.process-card-5::before {
  background: linear-gradient(to right, #A6B206, #2F8407);
}

.process-card-6 {
  --card-accent: #2F8407;
}

.process-card-6::before {
  background: linear-gradient(to right, #2F8407, #42DD94);
}

.process-card-7 {
  --card-accent: #42DD94;
}

.process-card-7::before {
  background: linear-gradient(to right, #42DD94, #0099FF);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-right);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--card-accent);
}

.card-number {
  font-family: var(--font-nav);
  font-size: 1.5rem;
}

.card-title {
  font-family: var(--font-nav);
  font-size: 1.85rem;
  font-weight: normal;
  letter-spacing: 1px;
  margin: 0.5rem 0;
  line-height: 1.1;
  color: var(--color-text);
}

.card-desc {
  font-family: var(--font-right);
  font-size: 1.05rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
}

@media (max-width: 768px) {
  .process-section {
    height: 520vh !important; /* Extra scroll room for 7 individual card triggers (ends at ~470vh) */
  }

  .process-wave-wrapper {
    height: 58vh; /* Tall enough to fully contain the centered 290px cards */
  }

  .process-text {
    font-size: clamp(1.8rem, 6vw, 3rem) !important;
    height: 2em;
  }

  .process-card {
    width: 190px !important;
    height: 290px !important;
    padding: 1.2rem !important;
    border-radius: 14px;
  }

  .card-number {
    font-size: 1.3rem !important;
  }

  .card-title {
    font-size: 1.5rem !important;
  }

  .card-desc {
    font-size: 0.9rem !important;
    line-height: 1.35 !important;
  }
}

/* ==========================================================================
   8. PORTFOLIO SHOWCASE
   ========================================================================== */

.work-section {
  width: 100vw;
  min-height: 220vh;
  background-color: var(--color-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  z-index: 10;
  perspective: 1000px;
  padding: 15vh 0;
}

.work-title {
  font-family: var(--font-nav);
  font-size: clamp(6rem, 18vw, 24rem);
  text-align: center;
  line-height: 0.85;
  text-transform: uppercase;
  color: var(--color-text);
  margin: 0;
  display: block;
  font-weight: normal;
  letter-spacing: -2px;
  position: relative;
  z-index: 5;
}

.work-container {
  position: relative;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-showcase {
  position: relative;
  width: 100%;
  height: 140vh;
  margin-top: 5vh;
}

.work-item {
  position: absolute;
  pointer-events: auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  display: block;
}

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

.item-tazzepazze {
  top: -4%;
  left: 5%;
  width: 52.5%;
  max-width: 650px;
  z-index: 12;
  filter: blur(5px);
  opacity: 0.6;
}

.item-hackaton {
  top: 10%;
  right: 8%;
  left: auto;
  width: 21%;
  max-width: 275px;
  z-index: 25;
  filter: blur(3px);
  opacity: 0.5;
}

.item-evanite {
  top: 29%;
  left: 4%;
  width: 47.5%;
  max-width: 775px;
  z-index: 15;
  filter: blur(0px);
  opacity: 0.7;
}

/* Floating Cliccami tooltip that follows the cursor on work item hover */
.hover-click-me {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 10005;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  padding: 0.5rem 1.1rem;
  font-family: var(--font-right);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  will-change: transform, opacity;
}

.hover-click-me.visible {
  opacity: 1;
  transform: scale(1);
}

.item-bottega {
  top: 52%;
  left: 36%;
  width: 57.5%;
  max-width: 775px;
  z-index: 20;
  filter: blur(0px);
  opacity: 1;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.item-bottega:hover {
  border-color: var(--color-wave);
}

@media (max-width: 768px) {
  .work-showcase {
    height: 95vh;
  }

  .item-tazzepazze {
    top: 2%;
    left: -6%;
    width: 60%;
  }

  .item-hackaton {
    top: 12%;
    right: -4%;
    left: auto;
    width: 33%;
  }

  .item-evanite {
    top: 35%;
    left: 2%;
    width: 68%;
  }

  .item-bottega {
    top: 56%;
    left: 14%;
    width: 82%;
  }
}


/* ==========================================================================
   9. INSTAGRAM MARKETING FOOTPRINT
   ========================================================================== */

.instagram-section {
  width: 100vw;
  min-height: 100vh;
  background-color: var(--color-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12vh 0;
  position: relative;
  z-index: 10;
}

.instagram-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 90%;
  max-width: 1200px;
}

.instagram-text-block {
  position: relative;
  display: inline-block;
  margin-bottom: 5rem;
}

.instagram-title {
  font-family: var(--font-nav);
  font-size: clamp(3.5rem, 6.8vw, 7rem);
  line-height: 1.1;
  text-transform: none;
  color: var(--color-text);
  font-weight: normal;
  letter-spacing: 2px;
}

.instagram-underline {
  width: 100%;
  height: 5px;
  background-color: #ffffff;
  margin-top: 1.2rem;
}

.instagram-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.instagram-arrow {
  position: absolute;
  left: -200px;
  top: -10px;
  width: 155px;
  height: auto;
  color: #ffffff;
  animation: wiggle-instagram-arrow 3s infinite ease-in-out;
}

.arrow-path-loop,
.arrow-path-head {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.instagram-link-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2rem;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.instagram-link-wrapper:hover {
  transform: scale(1.06);
}

.instagram-logo-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.instagram-logo-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(214, 41, 118, 0.55) 0%, rgba(150, 47, 191, 0.28) 50%, transparent 75%);
  filter: blur(28px);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: none;
  z-index: -1;
}

.instagram-link-wrapper:hover .instagram-logo-glow {
  opacity: 1;
  transform: scale(1.5);
}

.instagram-large-icon {
  width: clamp(200px, 22vh, 260px);
  height: clamp(200px, 22vh, 260px);
  stroke-width: 2.2;
  stroke: #ffffff;
  fill: none;
  transition: stroke 0.3s ease;
}

.instagram-link-wrapper:hover .instagram-large-icon {
  stroke: url(#instagram-grad);
}

.instagram-handle {
  font-family: var(--font-nav);
  font-size: clamp(2.5rem, 4vw, 3.8rem);
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: color 0.3s ease, background 0.3s ease;
  display: inline-block;
  margin-top: 1rem;
}

.instagram-link-wrapper:hover .instagram-handle {
  background: linear-gradient(45deg, #4f5bd5, #962fbf, #d62976, #fa7e1e, #fcaf45);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

@keyframes wiggle-instagram-arrow {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-10px, 6px) rotate(-5deg);
  }
}

@media (max-width: 768px) {
  .instagram-arrow {
    display: none;
  }

  .instagram-text-block {
    margin-bottom: 3.5rem;
  }

  .instagram-title {
    font-size: clamp(1.8rem, 6vw, 3rem) !important;
    letter-spacing: 1px !important;
  }

  .instagram-large-icon {
    width: 140px;
    height: 140px;
  }

  .instagram-handle {
    font-size: clamp(1.8rem, 5vw, 2.5rem) !important;
  }

  .instagram-section {
    padding: 8vh 0;
    min-height: auto;
  }
}


/* ==========================================================================
   10. CONTACT SECTION
   ========================================================================== */

.contact-section {
  background-color: #000000;
  padding: 12rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 80vh;
  position: relative;
}

.contact-container {
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5rem;
  width: 100%;
}

.contact-title {
  font-family: var(--font-nav);
  font-size: clamp(2.2rem, 6vw, 7rem);
  line-height: 1.1;
  text-transform: none;
  color: #ffffff;
  font-weight: normal;
  letter-spacing: 2px;
}

.contact-title-line {
  display: block;
  white-space: nowrap;
}

.contact-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2rem;
  padding: 1.6rem 4rem;
  border: 4px solid #ffffff;
  border-radius: 28px;
  background-color: transparent;
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.contact-button-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  border-radius: inherit;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: 1;
}

.contact-button:hover .contact-button-bg {
  transform: scaleX(1);
}

.contact-email {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  font-weight: 600;
  color: #ffffff;
  mix-blend-mode: difference;
  z-index: 2;
  position: relative;
  letter-spacing: 0.5px;
}

.contact-arrow {
  width: clamp(2rem, 3.8vw, 3.2rem);
  height: auto;
  color: #ffffff;
  mix-blend-mode: difference;
  z-index: 2;
  position: relative;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.contact-button:hover .contact-arrow {
  transform: translateX(8px);
}

@media (max-width: 768px) {
  .contact-section {
    padding: 6rem 1rem;
    min-height: 55vh;
  }

  .contact-container {
    gap: 2.5rem;
  }

  .contact-title {
    font-size: clamp(1.6rem, 5.5vw, 2.8rem) !important;
  }

  .contact-button {
    padding: 1rem 1.8rem !important;
    border-width: 3px !important;
    gap: 1rem !important;
  }

  .contact-email {
    font-size: clamp(0.95rem, 4.5vw, 1.4rem) !important;
  }

  .contact-arrow {
    width: 1.5rem !important;
  }
}


/* ==========================================================================
   11. FOOTER SECTION WITH VIDEO BG
   ========================================================================== */

.footer-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #000000;
  color: #ffffff;
}

.footer-video-blur {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  filter: blur(55px) brightness(0.45);
  pointer-events: none;
  opacity: 0.85;
}

.footer-video-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100%;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 2;
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.footer-content {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 5rem 6rem;
  box-sizing: border-box;
}

.footer-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.footer-name-left,
.footer-name-right {
  font-family: var(--font-nav);
  font-size: clamp(4rem, 11vw, 11.5rem);
  line-height: 0.82;
  text-transform: uppercase;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  letter-spacing: -2px;
}

.footer-name-left {
  align-items: flex-start;
  text-align: left;
}

.footer-name-right {
  align-items: flex-end;
  text-align: right;
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.footer-bottom-left {
  font-family: var(--font-nav);
  font-size: clamp(1.6rem, 2.6vw, 3rem);
  font-weight: normal;
  line-height: 1.05;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-bottom-right {
  font-family: var(--font-nav);
  font-size: clamp(1.4rem, 2.2vw, 2.6rem);
  font-weight: normal;
  line-height: 1.15;
  color: #ffffff;
  text-align: right;
}

.footer-tech-title {
  font-family: var(--font-nav);
  font-size: clamp(1.4rem, 2.2vw, 2.6rem);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffffff;
  opacity: 1;
  margin-bottom: 0.6rem;
}

.footer-tech-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
  font-size: 0.8em;
}

.footer-tech-list li {
  position: relative;
  padding-left: 0;
  margin-bottom: 0.4rem;
}

.footer-tech-list li:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .footer-content {
    padding: 3rem 2rem;
  }

  .footer-name-left,
  .footer-name-right {
    font-size: clamp(3rem, 12vw, 5.5rem);
    line-height: 0.85;
    letter-spacing: -1px;
  }

  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2.5rem;
  }

  .footer-bottom-right {
    align-self: flex-start;
    text-align: left;
  }
}

/* ==========================================================================
   10. PROJECT DETAIL MODAL SYSTEM
   ========================================================================== */

/* Body class to lock scrolling when modal is active */
body.project-modal-active {
  overflow: hidden !important;
  height: 100vh;
  width: 100vw;
}

.project-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.project-modal-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(10, 15, 25, 0.7) 0%, rgba(0, 0, 0, 0.92) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 1;
}

.modal-card {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 680px;
  background: rgba(22, 28, 38, 0.82);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 2.5rem;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  opacity: 0;
  will-change: transform, opacity;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.modal-close:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  transform: rotate(90deg);
}

.close-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.modal-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.modal-subtitle {
  font-family: var(--font-right);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

.modal-title {
  font-family: var(--font-nav);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: normal;
  letter-spacing: 1.5px;
  line-height: 1.1;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0;
}

.modal-img-container {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
  transition: max-width 0.4s ease, aspect-ratio 0.4s ease;
}

/* Vertical/Mobile screen phone frame styling */
.work-item.is-vertical {
  border: 7px solid #141822;
  border-radius: 24px;
  background-color: #0c0f17;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.6),
    inset 0 0 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.work-item.is-vertical::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 9px;
  background-color: #141822;
  border-radius: 5px;
  z-index: 10;
  pointer-events: none;
}

.modal-img-container.is-vertical {
  aspect-ratio: 9 / 16;
  max-width: 290px;
  margin: 0 auto;
  border: 10px solid #141822;
  border-radius: 36px;
  background-color: #0c0f17;
  overflow: hidden;
  position: relative;
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.75),
    inset 0 0 15px rgba(0, 0, 0, 0.7);
}

.modal-img-container.is-vertical::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 13px;
  background-color: #141822;
  border-radius: 6px;
  z-index: 10;
  pointer-events: none;
}

/* Ensure images fit inside the frame and align with rounded corners */
.work-item.is-vertical img {
  border-radius: 17px;
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.modal-img-container.is-vertical .modal-img {
  border-radius: 26px;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.modal-desc {
  font-family: var(--font-right);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}

/* Floating clone during GSAP zoom transition */
.temp-zoom-clone {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  will-change: transform, width, height, opacity;
  object-fit: cover;
}

@media (max-width: 768px) {
  .modal-card {
    padding: 1.8rem;
    gap: 1.2rem;
    border-radius: 20px;
    max-height: 90vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-card::-webkit-scrollbar {
    width: 4px;
  }

  .modal-card::-webkit-scrollbar-track {
    background: transparent;
  }

  .modal-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
  }

  .close-icon {
    width: 16px;
    height: 16px;
  }

  .modal-img-container.is-vertical {
    max-width: 180px !important;
  }

  .modal-title {
    font-size: clamp(1.5rem, 5vw, 2.2rem) !important;
  }
}