/* PORTFOLIO CINEMATIC - IMPACTA HUB */

/* 1. HERO CON LINEE ANIMATE */
.port-hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 0 20px;
}

.port-lines-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: flex;
  justify-content: space-evenly;
  opacity: 0.15;
}

.port-line {
  width: 1px;
  height: 200%;
  background: linear-gradient(to bottom, transparent, #ff5b16, transparent);
  animation: moveLine 8s linear infinite;
}

.port-line:nth-child(2) { animation-delay: -2s; animation-duration: 12s; }
.port-line:nth-child(3) { animation-delay: -5s; animation-duration: 6s; }
.port-line:nth-child(4) { animation-delay: -1s; animation-duration: 9s; }
.port-line:nth-child(5) { animation-delay: -7s; animation-duration: 14s; }

@keyframes moveLine {
  0% { transform: translateY(-50%); }
  100% { transform: translateY(0%); }
}

.port-hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.port-hero-content h1 {
  font-size: clamp(3rem, 5vw, 5rem);
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.port-hero-content p {
  font-size: 1.2rem;
  color: #a1a1aa;
  max-width: 600px;
  margin: 0 auto;
}

/* 2. CINEMATIC SCROLL TEXT */
.port-cinematic-scroll {
  height: 200vh;
  position: relative;
}

.port-sticky-text {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
  overflow: hidden;
}

.port-text-1, .port-text-2 {
  position: absolute;
  max-width: 800px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.port-text-1 {
  opacity: 1;
  transform: translateY(0);
}

.port-text-2 {
  opacity: 0;
  transform: translateY(30px);
  color: #a1a1aa;
}
.port-text-2 span {
  color: #fff;
}



.filter-dropdown {
  position: absolute;
  top: 60px;
  right: 40px;
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 5px;
}

.filter-dropdown.show {
  display: flex;
}

.filter-dropdown button {
  background: none;
  border: none;
  color: #aaa;
  padding: 10px 20px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.filter-dropdown button:hover, .filter-dropdown button.active {
  background: rgba(255, 91, 22, 0.2);
  color: #ff5b16;
}

/* 4. PROGETTI */
.port-projects {
  position: relative;
  padding-bottom: 150px;
}

.port-project {
  position: relative;
  padding: 120px 40px;
  max-width: 1400px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.port-watermark {
  position: absolute;
  top: 50px;
  left: -20px;
  font-size: clamp(10rem, 25vw, 30rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.03);
  z-index: 0;
  line-height: 1;
  pointer-events: none;
}

.port-content {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
}

.port-link-top {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ff5b16;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.port-link-top i {
  width: 8px;
  height: 8px;
  background: #ff5b16;
}

.port-title {
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  line-height: 1.15;
  margin-bottom: 60px;
  letter-spacing: -0.02em;
}

.port-mockups {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  margin-bottom: 60px;
}

/* Mockup Layout: Laptop Left, Phone Right */
.mockup-laptop {
  position: absolute;
  top: 0;
  left: 0;
  width: 75%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  z-index: 1;
}

.mockup-phone {
  position: absolute;
  bottom: -20px;
  right: 5%;
  width: 25%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.7);
  z-index: 2;
}

.port-desc {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.6;
  color: #e2e8f0;
  margin-bottom: 60px;
  font-style: italic;
}

.port-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.port-col h3 {
  font-size: 1.2rem;
  color: #ff5b16;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 91, 22, 0.3);
  padding-bottom: 10px;
}

.port-col p {
  color: #a1a1aa;
  line-height: 1.7;
  font-size: 1rem;
}

.port-actions {
  display: flex;
  gap: 20px;
}

.port-btn {
  padding: 16px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.port-btn.primary {
  background: #ff5b16;
  color: #fff;
}
.port-btn.primary:hover {
  background: #e85718;
}

.port-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.port-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  .port-columns {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .mockup-laptop {
    width: 90%;
  }
  .mockup-phone {
    width: 35%;
    right: 0;
  }
  .port-actions {
    flex-direction: column;
  }
  .port-btn {
    text-align: center;
  }
}

/* CINEMATIC TRACK */
#cinematic-track {
  position: relative;
  width: 100%;
  height: 260vh;
  background-color: #050608;
}

#cinematic-sticky {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c-frame {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  max-width: none !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  padding: 0 20px;
  box-sizing: border-box;
}

.c-frame.active {
  pointer-events: auto;
}

#typewriter-text {
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 auto 24px auto;
  max-width: 950px;
  width: 100%;
  text-align: center !important;
  display: block;
  min-height: 2em; /* Prevent layout jump */
}

.scroll-hint {
  font-size: 1rem;
  color: #ff5b16;
  opacity: 0;
  transition: opacity 1s ease;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.c-text {
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.3;
  color: #e2e8f0;
  margin: 0 auto;
  max-width: 800px;
}

.c-frame-2 {
  max-width: 1200px !important;
}

/* Fix SVG Rail for JS control */
.rail-light-js {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}


/* TYPEWRITER CURSOR */
#typewriter-text::after {
  content: '|';
  display: inline-block;
  opacity: 1;
  animation: blink 0.8s infinite;
  margin-left: 4px;
  color: #ff5b16;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}


/* Rail Media Queries */
@media (min-width: 769px) {
  .mobile-rail { display: none !important; }
}
@media (max-width: 768px) {
  .desktop-rail { display: none !important; }
  .attention-heading { min-height: 300px !important; }
  
  /* Make sure bottom right text stays somewhat visible on mobile */
  #f2-bottom { bottom: -20px !important; }
  
  /* Fix frame 3 positioning for mobile */
  #f3-top { top: 0 !important; }
  #f3-bottom { bottom: 20% !important; }
}


/* 3. FILTRI LIQUID GLASS (Clean Horizontal Centered Bar) */
.liquid-filter-btn {
  background: transparent;
  color: #a1a1aa;
  border: none;
  padding: 10px 24px;
  border-radius: 9999px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.liquid-filter-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}
.liquid-filter-btn.active {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.25);
}

.liquid-glass-card {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.liquid-glass-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
}
