/* --- INTEGRATED NAVBAR STYLES FROM LANDING PAGE --- */
:root {
  /* Variabili prese dalla Landing Page */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --nav-bg: rgba(15, 23, 42, 0.8);

  --font-main: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --bg-body: #0f172a;
  --navbar-height: 80px;
}

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

body {
  font-family: var(--font-main);
  color: var(--text-main);
  background-color: var(--bg-body);
  overflow-x: hidden;
  padding-top: var(--navbar-height);
}

a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }

/* --- NAVBAR EXACT STYLE --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.5rem 0;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar-containter {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo span { color: var(--primary); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
}

.nav-link:hover, .nav-link.active { color: white; }

/* Linea animata sotto i link */
.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* --- BUTTONS ANIMATIONS (SWIPE EFFECT) --- */
.swipe-hover-effect {
  position: relative;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(231, 235, 252, 0.5);
  overflow: hidden;
  transition: border-color 0.3s;
  z-index: 1;
}

.swipe-hover-effect::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid var(--primary);
  box-sizing: border-box;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: -1;
}

.swipe-hover-effect:hover { border-color: transparent; }
.swipe-hover-effect:hover::before { clip-path: inset(0 0 0 0); }

.lang-btn {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.8rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600;
  color: rgb(231, 235, 252); cursor: pointer;
}
.lang-btn::before { border-radius: 4px; }

/* Mobile Toggle */
.menu-toggle { display: none; cursor: pointer; z-index: 1100;}
.menu-toggle span { display: block; width: 25px; height: 2px; background: white; margin: 6px 0; transition: 0.3s; }

/* Animazione X hamburger */
.menu-toggle.active span:nth-child(1) { transform: rotate(-45deg) translate(-6px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(45deg) translate(-6px, -5px); }

@media (max-width: 768px) {
  .nav-menu {
    position: fixed; top: 0; right: 0; width: 100%; height: 100vh;
    background: #0f172a; flex-direction: column; justify-content: center;
    transform: translateX(100%); transition: 0.4s ease-in-out;
  }
  .nav-menu.active { transform: translateX(0); }
  .menu-toggle { display: block; }
}

/* --- ORIGINAL PAGE STYLES (SCROLLYTELLING) --- */
.sticky-container { position: relative; display: flex; }

.content-col {
  width: 100%; position: relative; z-index: 10;
  padding-top: 5vh; padding-bottom: 20vh;
}

.visual-col {
  display: none; width: 50%; height: 100vh;
  position: sticky; top: var(--navbar-height);
  right: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .content-col { width: 50%; padding-left: 4rem; padding-right: 4rem; }
  .visual-col { display: flex; }
}

/* Central Progress & Visual Card Styles */
.central-progress-container {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%); z-index: 30; display: none;
}
@media (min-width: 1024px) { .central-progress-container { display: block; } }

.progress-line-bg {
  position: absolute; top: 0; bottom: 0; left: 0; width: 100%;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.03) 10%, rgba(255, 255, 255, 0.03) 90%, transparent);
}

.progress-pill {
  position: fixed; left: 50%; width: 16px; height: 45px;
  background: rgba(15, 23, 42, 0.2); border: 2px solid var(--primary);
  border-radius: 25px; transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8), inset 0 0 10px rgba(59, 130, 246, 0.2);
  pointer-events: none; opacity: 0; transition: opacity 0.2s ease, transform 0.1s linear;
  z-index: 40;
}
.progress-pill::after {
  content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 15px; background: white; border-radius: 2px; box-shadow: 0 0 10px white;
}

.visual-card-wrapper {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.9);
  width: 80%; max-width: 600px; aspect-ratio: 16/9; border-radius: 16px;
  overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.5); opacity: 0;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255,255,255,0.1);
}
.visual-card-wrapper.active { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.visual-img { width: 100%; height: 100%; object-fit: cover; }
.visual-col { background-color: #0f172a; }

.project-step {
  min-height: 80vh; display: flex; flex-direction: column; justify-content: center;
  opacity: 0.3; transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(20px); padding: 4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.project-step.active { opacity: 1; transform: translateY(0); }

/* Divider */
.period-divider {
  position: sticky; top: 80px;
  background: rgba(15, 23, 42, 0.98); backdrop-filter: blur(10px);
  z-index: 20; padding: 2rem 0; border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  margin-bottom: 4rem; display: flex; align-items: center; width: 100%; transition: top 0.3s;
}

.jb-mono { font-family: 'JetBrains Mono', monospace; }

/* --- FLASHLIGHT CARD EFFECT --- */
.card-extra {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
  /* CSS Variables for mouse position */
  --x: 50%;
  --y: 50%;
}

.card-extra:hover {
  transform: translateY(-5px);
  border-color: rgba(59, 130, 246, 0.3); /* Leggero bordo blu all'hover */
}

/* L'effetto Torcia (Glow) */
.card-extra::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  /* Gradiente radiale centrato sul mouse */
  background: radial-gradient(400px circle at var(--x) var(--y), rgba(59, 130, 246, 0.15), transparent 40%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none; /* Lascia passare i click */
  z-index: 0;
}

.card-extra:hover::after {
  opacity: 1;
}

/* Assicura che il contenuto sia sopra il glow */
.card-extra > * {
  position: relative;
  z-index: 10;
}

.text-gradient-animated {
  background: linear-gradient(-45deg, #60a5fa, #3b82f6, #a78bfa, #2dd4bf);
  background-size: 300% 300%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: gradientTextAnim 6s ease infinite;
}
@keyframes gradientTextAnim {
  0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; }
}

@media (max-width: 1024px) {
  .sticky-container { flex-direction: column; }
  .visual-col { display: none; }
  .mobile-visual { display: block; width: 100%; height: 250px; margin-bottom: 1.5rem; border-radius: 12px; overflow: hidden; object-fit: cover; }
  .project-step { opacity: 1; min-height: auto; margin-bottom: 6rem; transform: none; }
  .period-divider { top: 80px; padding: 1.5rem 0; }
}
@media (min-width: 1024px) { .mobile-visual { display: none; } }
@keyframes heroFadeIn { to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { opacity: 0; transform: translateY(30px); animation: heroFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
