/* ==========================================
   FRANCO PROGETTI - UNIQUE CUSTOM STYLES
   Additional Unique Features & Animations
   ========================================== */

/* ==========================================
   CUSTOM CURSOR (UNIQUE FEATURE)
   ========================================== */

body {
  cursor: none !important;
}

.custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary-color, #2563eb);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  transition: all 0.1s ease;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.cursor-follower {
  width: 40px;
  height: 40px;
  border: 1px solid var(--primary-color, #2563eb);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 9997;
  transition: all 0.3s ease;
  transform: translate(-50%, -50%);
  opacity: 0.5;
}

/* Cursor hover effects */
a:hover ~ .custom-cursor,
button:hover ~ .custom-cursor {
  transform: translate(-50%, -50%) scale(2);
  background-color: rgba(37, 99, 235, 0.3);
}

/* Show default cursor on mobile */
@media (max-width: 768px) {
  body {
    cursor: auto !important;
  }
  .custom-cursor,
  .cursor-follower {
    display: none !important;
  }
}

/* ==========================================
   LOADING SCREEN (UNIQUE FEATURE)
   ========================================== */

#preloader {
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

#preloader.hidden,
#preloader[data-disabled] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Preloader Logo */
.preloader-logo-wrap {
  position: relative;
  display: inline-block;
}

.preloader-logo {
  width: min(320px, 70vw);
  height: auto;
  animation:
    preloaderFadeIn 0.8s ease-out forwards,
    preloaderFloat 3s ease-in-out infinite;
}

@keyframes preloaderFadeIn {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes preloaderFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes preloaderGlow {
  from {
    opacity: 0.5;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

.blueprint-rect,
.blueprint-line,
.blueprint-circle {
  animation: blueprintDraw 2s ease-out forwards;
}

@keyframes blueprintDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.blueprint-line:nth-child(2) {
  animation-delay: 0.3s;
}

.blueprint-line:nth-child(3) {
  animation-delay: 0.6s;
}

.blueprint-circle {
  animation-delay: 0.9s;
}

.loading-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #3b82f6);
  animation: loadingProgress 2s ease-out forwards;
  box-shadow: 0 0 10px #60a5fa;
}

@keyframes loadingProgress {
  to {
    width: 100%;
  }
}

/* ==========================================
   SURVEY BACKGROUND (GEOMETRA THEME)
   ========================================== */

.survey-background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(147, 197, 253, 0.16),
      transparent 42%
    ),
    radial-gradient(
      circle at 80% 75%,
      rgba(59, 130, 246, 0.14),
      transparent 48%
    ),
    linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.22));
}

.survey-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(147, 197, 253, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(147, 197, 253, 0.1) 1px, transparent 1px);
  background-size:
    120px 120px,
    120px 120px,
    24px 24px,
    24px 24px;
  animation: surveyGridPan 24s linear infinite;
}

.survey-background::after {
  content: '';
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(
    120deg,
    rgba(191, 219, 254, 0.08) 0px,
    rgba(191, 219, 254, 0.08) 2px,
    transparent 2px,
    transparent 44px
  );
  animation: surveyContourDrift 26s linear infinite;
}

.survey-diagonal {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      148deg,
      transparent 0 58%,
      rgba(125, 211, 252, 0.2) 58.2% 58.7%,
      transparent 59%
    ),
    linear-gradient(
      34deg,
      transparent 0 36%,
      rgba(56, 189, 248, 0.16) 36.2% 36.8%,
      transparent 37%
    );
  animation: surveySweep 9s ease-in-out infinite;
}

.survey-points {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(224, 242, 254, 0.45) 1.3px,
    transparent 1.4px
  );
  background-size: 56px 56px;
  opacity: 0.6;
  animation: surveyPointShift 18s linear infinite;
}

.survey-axis {
  position: absolute;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(186, 230, 253, 0.55),
    transparent
  );
  box-shadow: 0 0 12px rgba(186, 230, 253, 0.35);
  opacity: 0.7;
  animation: surveyAxisPulse 5s ease-in-out infinite;
}

.survey-axis-x {
  left: 9%;
  right: 12%;
  top: 64%;
  height: 2px;
}

.survey-axis-y {
  top: 14%;
  bottom: 12%;
  left: 72%;
  width: 2px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(186, 230, 253, 0.55),
    transparent
  );
}

.survey-quote-label {
  position: absolute;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(224, 242, 254, 0.78);
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(186, 230, 253, 0.34);
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(1px);
  animation: surveyLabelFlicker 7s ease-in-out infinite;
}

.survey-quote-a {
  top: 20%;
  left: 8%;
}

.survey-quote-b {
  top: 59%;
  right: 15%;
  animation-delay: 1.1s;
}

.survey-quote-c {
  bottom: 12%;
  left: 24%;
  animation-delay: 2.2s;
}

@keyframes surveyGridPan {
  from {
    background-position:
      0 0,
      0 0,
      0 0,
      0 0;
  }
  to {
    background-position:
      120px 120px,
      120px 120px,
      24px 24px,
      24px 24px;
  }
}

@keyframes surveyContourDrift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(140px);
  }
}

@keyframes surveySweep {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}

@keyframes surveyPointShift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 56px -56px;
  }
}

@keyframes surveyAxisPulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes surveyLabelFlicker {
  0%,
  100% {
    opacity: 0.65;
    transform: translateY(0);
  }
  48% {
    opacity: 0.82;
  }
  50% {
    opacity: 0.35;
    transform: translateY(-1px);
  }
  52% {
    opacity: 0.78;
  }
}

/* ==========================================
   GLITCH TEXT EFFECT (UNIQUE FEATURE)
   ========================================== */

.glitch-text {
  position: relative;
  animation: glitchSkew 3s infinite ease-in-out;
}

.glitch-logo-title {
  display: inline-block;
  line-height: 0;
}

.glitch-logo {
  display: block;
  width: min(680px, 90vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

.glitch-logo-layer {
  overflow: hidden;
}

.glitch-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  opacity: 0.8;
}

.glitch-layer:nth-child(2) {
  mix-blend-mode: screen;
  animation: glitch1 2.5s infinite;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.glitch-layer:nth-child(2) .glitch-logo {
  filter: hue-rotate(285deg) saturate(1.8) brightness(1.05);
}

.glitch-layer:nth-child(3) {
  mix-blend-mode: screen;
  animation: glitch2 2.5s infinite;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

.glitch-layer:nth-child(3) .glitch-logo {
  filter: hue-rotate(145deg) saturate(1.7) brightness(1.05);
}

@keyframes glitch1 {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, 2px);
  }
  40% {
    transform: translate(-3px, -2px);
  }
  60% {
    transform: translate(3px, 2px);
  }
  80% {
    transform: translate(3px, -2px);
  }
}

@keyframes glitch2 {
  0%,
  100% {
    transform: translate(0);
  }
  20% {
    transform: translate(3px, -2px);
  }
  40% {
    transform: translate(3px, 2px);
  }
  60% {
    transform: translate(-3px, -2px);
  }
  80% {
    transform: translate(-3px, 2px);
  }
}

@keyframes glitchSkew {
  0%,
  100% {
    transform: skew(0deg);
  }
  10% {
    transform: skew(0.5deg);
  }
  20% {
    transform: skew(-0.5deg);
  }
  30% {
    transform: skew(0deg);
  }
}

/* ==========================================
   BLUEPRINT GRID (UNIQUE FEATURE)
   ========================================== */

.blueprint-grid {
  background-color: transparent;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.3) 2px, transparent 2px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.3) 2px, transparent 2px),
    linear-gradient(rgba(37, 99, 235, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
  background-size:
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px;
  background-position:
    -2px -2px,
    -2px -2px,
    -1px -1px,
    -1px -1px;
  animation: blueprintScroll 20s linear infinite;
}

@keyframes blueprintScroll {
  0% {
    background-position:
      -2px -2px,
      -2px -2px,
      -1px -1px,
      -1px -1px;
  }
  100% {
    background-position:
      98px 98px,
      98px 98px,
      19px 19px,
      19px 19px;
  }
}

/* ==========================================
   MEASUREMENT LINES (UNIQUE FEATURE)
   ========================================== */

.measurement-lines {
  pointer-events: none;
  z-index: 0;
}

.measure-line {
  position: absolute;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(37, 99, 235, 0.4),
    transparent
  );
  animation: measureSlide 8s ease-in-out infinite;
}

.measure-horizontal {
  width: 100%;
  height: 2px;
  left: 0;
}

.measure-vertical {
  width: 2px;
  height: 100%;
  top: 0;
}

.measure-horizontal::before,
.measure-horizontal::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: rgba(37, 99, 235, 0.6);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.8);
}

.measure-horizontal::before {
  left: 10%;
}

.measure-horizontal::after {
  right: 10%;
}

@keyframes measureSlide {
  0%,
  100% {
    opacity: 0;
    transform: translateX(-100%);
  }
  50% {
    opacity: 1;
    transform: translateX(0);
  }
}

.measure-vertical {
  animation: measureSlideVertical 10s ease-in-out infinite;
}

@keyframes measureSlideVertical {
  0%,
  100% {
    opacity: 0;
    transform: translateY(-100%);
  }
  50% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   REVEAL TEXT ANIMATION (UNIQUE FEATURE)
   ========================================== */

.reveal-text {
  position: relative;
  overflow: hidden;
}

.reveal-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.3),
    transparent
  );
  animation: revealSweep 2s ease-out 0.5s;
  z-index: 1;
}

@keyframes revealSweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ==========================================
   TIMELINE STYLES (UNIQUE FEATURE)
   ========================================== */

.timeline-line {
  opacity: 0;
  animation: timelineGrow 2s ease-out 0.5s forwards;
}

@keyframes timelineGrow {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    height: 100%;
    opacity: 1;
  }
}

.timeline-dot {
  transform: scale(0) translateX(-50%);
  animation: dotPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.8);
}

.timeline-item:nth-child(1) .timeline-dot {
  animation-delay: 0.8s;
}

.timeline-item:nth-child(2) .timeline-dot {
  animation-delay: 1.2s;
}

.timeline-item:nth-child(3) .timeline-dot {
  animation-delay: 1.6s;
}

.timeline-item:nth-child(4) .timeline-dot {
  animation-delay: 2s;
}

.timeline-item:nth-child(5) .timeline-dot {
  animation-delay: 2.4s;
}

@keyframes dotPop {
  0% {
    transform: scale(0) translateX(-50%);
  }
  50% {
    transform: scale(1.2) translateX(-50%);
  }
  100% {
    transform: scale(1) translateX(-50%);
  }
}

.timeline-content {
  transform: translateX(-30px);
  opacity: 0;
  transition: all 0.5s ease;
}

.timeline-item[data-aos='fade-right'].aos-animate .timeline-content {
  transform: translateX(0);
  opacity: 1;
}

.timeline-item[data-aos='fade-left'].aos-animate .timeline-content {
  transform: translateX(0);
  opacity: 1;
}

.timeline-item:hover .timeline-content {
  transform: translateX(0) scale(1.05);
  box-shadow: 0 10px 40px rgba(37, 99, 235, 0.4);
}

.timeline-dot:hover {
  transform: scale(1.3) translateX(-50%);
  box-shadow: 0 0 30px rgba(37, 99, 235, 1);
}

/* Mobile Timeline */
.timeline-mobile-item {
  position: relative;
  padding-left: 20px;
}

.timeline-mobile-item::before {
  content: '';
  position: absolute;
  left: 24px;
  top: 50px;
  bottom: -30px;
  width: 2px;
  background: linear-gradient(180deg, #3b82f6, transparent);
}

.timeline-mobile-item:last-child::before {
  display: none;
}

/* ==========================================
   3D TILT CARDS (UNIQUE FEATURE)
   ========================================== */

.service-card-tilt {
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
  background: white;
}

.service-card-tilt:hover {
  z-index: 20;
  transform: scale(1.02);
}

/* ==========================================
   PARTICLES CONTAINER
   ========================================== */

#particles-js {
  width: 100%;
  height: 100%;
  z-index: 0;
}

#particles-js canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
}

/* ==========================================
   BLUEPRINT BACKGROUND PATTERN
   ========================================== */

.blueprint-bg {
  background-color: #1e3a8a;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 2px, transparent 2px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size:
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px;
  background-position:
    -2px -2px,
    -2px -2px,
    -1px -1px,
    -1px -1px;
}

/* ==========================================
   FLOATING ANIMATION FOR ICONS
   ========================================== */

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.service-card-tilt:hover i {
  animation: float 2s ease-in-out infinite;
}

/* ==========================================
   PULSE GLOW EFFECT
   ========================================== */

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
  }
  50% {
    box-shadow: 0 0 40px rgba(37, 99, 235, 1);
  }
}

.timeline-dot {
  animation:
    dotPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
    pulseGlow 2s ease-in-out infinite;
}

/* ==========================================
   RESPONSIVE ADJUSTMENTS
   ========================================== */

@media (max-width: 768px) {
  .glitch-text {
    animation: none;
  }

  .survey-quote-label {
    display: none;
  }

  .survey-axis {
    opacity: 0.35;
  }

  .glitch-layer {
    display: none;
  }

  .measure-line {
    display: none;
  }

  .blueprint-grid {
    animation: none;
  }
}

/* ==========================================
   PRINT OPTIMIZATIONS
   ========================================== */

@media print {
  #preloader,
  .custom-cursor,
  .cursor-follower,
  #particles-js,
  .measurement-lines,
  .glitch-layer {
    display: none !important;
  }
}

/* ==========================================
   END OF UNIQUE FEATURES STYLESHEET
   ========================================== */
