﻿/* styles.css â€” small focused enhancements, complements Tailwind utilities */
:root{
  --glass-bg: rgba(255,255,255,0.6);
  --glass-dark: rgba(15,23,42,0.6);
  
  /* === HEADER & LOGO SCALE FACTORS === */
  --header-scale: 1.5;           /* Header height multiplier (base: 60px) */
  --header-text-scale: 1.6;      /* Logo and navigation text scale */
  --header-base-height: 60px;    /* Base header height */
  
  /* === BRAND COLOR PALETTE (Blue #007BFF + Purple #9B00FF) === */
  --color-blue: #007BFF;
  --color-purple: #9B00FF;
  --accent-a: #007BFF;
  --accent-b: #9B00FF;

  /* Color system */
  --color-primary-start: #007BFF;
  --color-primary-mid: #9B00FF;
  --color-primary-end: #9B00FF;
  --color-gradient: linear-gradient(135deg, #007BFF 0%, #9B00FF 100%);
  --color-surface-light: #f9fafb;
  --color-text-primary-light: #0f172a;
  --color-text-secondary-light: #475569;
  --color-text-tertiary-light: #64748b;
  --card-bg-light: rgba(255,255,255,0.98);
  --card-bg-dark: rgba(15,23,42,0.8);
  --card-border-alpha: 0.20;

  /* Typography */
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 1.75rem;
  --space-8: 2rem;
  --space-9: 2.25rem;
  --space-10: 2.5rem;
  --space-11: 2.75rem;
  --space-12: 3rem;

  /* Border radius */
  --radius-md: 0.375rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark theme variable overrides */
.dark {
  --color-surface-light: #0b1220;
  --color-text-primary-light: #f1f5f9;
  --color-text-secondary-light: #cbd5e1;
  --color-text-tertiary-light: #94a3b8;
  --card-bg-dark: rgba(15,23,42,0.94);
  --card-border-alpha: 0.28;
}

/* Improve base typography for large headings when Tailwind not enough */
h1, h2, h3 { letter-spacing: -0.02em; }

/* Highlighted resource card */
.resource-card{
  background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(31,81,255,0.08), 0 4px 12px rgba(143,0,255,0.06);
  border: 1px solid rgba(143,0,255,0.08);
}

.resource-header{
  display:flex;
  gap:1rem;
  align-items:center;
}

.resource-badge{
  min-width:56px;
  min-height:56px;
  border-radius:12px;
  display:inline-grid;
  place-items:center;
  color:white;
  font-weight:700;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  box-shadow: 0 6px 20px rgba(31,81,255,0.12);
}

/* Responsive embed container maintaining aspect ratio */
.embed-container{
  position:relative;
  width:100%;
  padding-top:56.25%; /* 16:9 */
  border-radius:12px;
  overflow:hidden;
  background: #f8fafc;
  border:1px solid rgba(15,23,42,0.04);
}

.embed-container iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

/* Action links row */
.resource-actions{
  display:flex;
  gap:0.5rem;
  margin-top:0.75rem;
}

/* Base button */
.btn{
  padding:0.6rem 1rem;
  border-radius:12px;
  font-weight:700;
  text-decoration:none;
  transition: box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}

.btn-ghost{
  padding:0.6rem 0.9rem;
  border-radius:9999px;
  border:1px solid rgba(15,23,42,0.06);
  background:transparent;
  color:var(--accent-a);
  text-decoration:none;
  font-weight:600;
}

.btn-primary{
  padding:0.6rem 1rem;
  border-radius:12px;
  background:linear-gradient(135deg,var(--accent-a),var(--accent-b));
  color:white;
  text-decoration:none;
  font-weight:700;
  box-shadow: 0 0 0 2px rgba(143,0,255,0.25), 0 0 22px rgba(31,81,255,0.45);
}

.btn-outline{
  padding:0.6rem 1rem;
  border-radius:12px;
  border:2px solid rgba(143,0,255,0.50);
  color:#1e293b;
  background:rgba(255,255,255,0.5);
  font-weight:700;
  transition: all 0.2s ease;
}
.btn-outline:hover{
  border-color: rgba(143,0,255,0.85);
  background:rgba(255,255,255,0.8);
  box-shadow: 0 0 0 2px rgba(143,0,255,0.25), 0 0 22px rgba(31,81,255,0.45);
  color:#0f172a;
}
@media (prefers-color-scheme: dark){
  .btn-outline{ color:#ffffff; border-color: rgba(143,0,255,0.55); background:rgba(15,23,42,0.3); }
  .btn-outline:hover{ background:rgba(15,23,42,0.5); }
}

@media (prefers-color-scheme: dark){
  .resource-card{ background: linear-gradient(180deg, rgba(15,23,42,0.6), rgba(15,23,42,0.5)); border:1px solid rgba(143,0,255,0.12);} 
  .embed-container{ background: #0b1220; border:1px solid rgba(143,0,255,0.06);} 
  .btn-ghost{ color: #cfe0ff; border-color: rgba(143,0,255,0.08);} 
}

/* Small utility for subtle lift on hover */
.lift-on-hover{ transition: transform 180ms ease, box-shadow 180ms ease; }
.lift-on-hover:hover{ transform: translateY(-6px); box-shadow: 0 20px 40px rgba(15,23,42,0.12); }

/* Glassmorphism card style */
.card-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(31, 41, 55, 0.1);
}
@media (prefers-color-scheme: dark) {
  .card-glass {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Gradient text */
.text-gradient {
  background: var(--color-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Animated gradient background */
.animate-gradient-bg {
  background: var(--color-gradient);
  background-size: 200% 200%;
  animation: gradientShift 8s ease-in-out infinite;
}

/* --- Neon theme enhancements & animations --- */
/* Animated gradient background utility */
.animate-gradient{
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  background-size: 200% 200%;
  animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift{
  0% { background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
  100%{ background-position: 0% 50%; }
}

/* Neon glow ring and border */
.neon-border{
  box-shadow: 0 0 0 2px rgba(143,0,255,0.25), 0 0 28px rgba(31,81,255,0.55), inset 0 0 12px rgba(31,81,255,0.25);
}

.glow-pulse{ animation: glowPulse 2.2s ease-in-out infinite; }
@keyframes glowPulse{
  0%,100%{ box-shadow: 0 0 0 2px rgba(143,0,255,0.25), 0 0 22px rgba(31,81,255,0.45); }
  50%{ box-shadow: 0 0 0 2px rgba(143,0,255,0.4), 0 0 36px rgba(31,81,255,0.75); }
}

/* Dark-mode tuning for glow effects */
.dark .neon-border{
  box-shadow: 0 0 0 2px rgba(143,0,255,0.18), 0 0 18px rgba(31,81,255,0.40), inset 0 0 10px rgba(31,81,255,0.18);
}
.dark .cta-glow{
  box-shadow: 0 0 0 2px rgba(143,0,255,0.22), 0 0 20px rgba(31,81,255,0.55);
}
.dark .cta-glow:hover{
  box-shadow: 0 0 0 2px rgba(143,0,255,0.32), 0 0 26px rgba(31,81,255,0.70);
}

/* Floating blob decoration */
.blob{
  filter: blur(40px);
  opacity: .18;
  animation: floatUpDown 10s ease-in-out infinite;
}
@keyframes floatUpDown{
  0%,100%{ transform: translateY(0) translateX(0) scale(1); }
  50%{ transform: translateY(-18px) translateX(6px) scale(1.04); }
}

/* Scroll reveal */
.reveal{ opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.reveal-in{ opacity: 1; transform: translateY(0); }

/* Base sizing for inline SVG icons replacing emoji */
.icon-svg{ width: 28px; height: 28px; display:inline-block; }
.icon-lg{ width: 48px; height: 48px; }
.icon-xl{ width: 64px; height: 64px; }

/* Improve SVG rendering quality */
.icon-svg, .hero-card-icon {
  shape-rendering: geometricPrecision;
  text-rendering: optimizeLegibility;
  image-rendering: optimizeQuality;
}

/* High-contrast focus ring for accessibility on dark bg */
.focus-ring{ outline: 2px solid var(--accent-b); outline-offset: 2px; }

/* --- 3D Tilt Cards --- */
.tilt{ perspective: 1000px; }
.tilt-inner{
  position: relative;
  transform-style: preserve-3d;
  transition: transform 200ms ease, box-shadow 200ms ease;
  will-change: transform;
  /* Gradient border matching hero palette */
  background: linear-gradient(#ffffff, #ffffff) padding-box,
              linear-gradient(145deg, rgba(31,81,255,0.12), rgba(143,0,255,0.12)) border-box;
  border: 1px solid transparent;
}
.dark .tilt-inner{
  background: linear-gradient(#0f172a, #0f172a) padding-box,
              linear-gradient(145deg, rgba(31,81,255,0.25), rgba(143,0,255,0.25)) border-box;
  border: 1px solid transparent;
}
.card-feature{
  background: linear-gradient(#ffffff, #ffffff) padding-box,
              linear-gradient(145deg, rgba(31,81,255,0.18), rgba(143,0,255,0.18)) border-box;
  border: 1px solid transparent;
  border-radius: 1.5rem;
  box-shadow: 0 12px 28px rgba(31,81,255,0.12), 0 6px 14px rgba(15,23,42,0.10), 0 2px 6px rgba(0,0,0,0.06);
}
.dark .card-feature{
  background: linear-gradient(#0f172a, #0f172a) padding-box,
              linear-gradient(145deg, rgba(31,81,255,0.30), rgba(143,0,255,0.30)) border-box;
  box-shadow: 0 14px 30px rgba(143,0,255,0.14), 0 6px 16px rgba(0,0,0,0.35);
}
.card-feature:hover{
  box-shadow: 0 18px 44px rgba(31,81,255,0.18), 0 10px 20px rgba(15,23,42,0.14), 0 3px 8px rgba(0,0,0,0.08);
}
.card-feature::after{
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  opacity: 0.12;
  filter: blur(12px);
  animation: breatheGlowFeature 3.5s ease-in-out infinite;
  z-index: -1;
}
.dark .card-feature::after{ opacity: 0.18; }
.card-feature:hover::after{ opacity: 0.22; filter: blur(16px); animation: breatheGlowHover 2s ease-in-out infinite; }

@keyframes breatheGlowFeature{
  0%, 100%{ opacity: 0.12; filter: blur(12px); }
  50%{ opacity: 0.18; filter: blur(15px); }
}
.tilt:hover .tilt-inner{ box-shadow: 0 18px 40px rgba(31,81,255,0.18), 0 6px 16px rgba(143,0,255,0.14); }
.tilt-glare{
  position:absolute; inset:0; pointer-events:none; border-radius: inherit;
  background: radial-gradient( circle at 50% 50%, rgba(255,255,255,0.28), transparent 60% );
  opacity: 0; transition: opacity 200ms ease;
}
.tilt:hover .tilt-glare{ opacity: 1; }

/* Soft shadow below 3D card for extra depth */
.tilt-shadow{
  position:absolute; left:10%; right:10%; bottom:-10px; height:20px;
  background: radial-gradient(50% 50% at 50% 50%, rgba(15,23,42,0.25), transparent 70%);
  filter: blur(6px);
  transform: translateZ(0);
}

/* Icon tile: white square container for icons */
.icon-tile{
  width: 3rem; height: 3rem; display:grid; place-items:center;
  border-radius: 0.75rem; 
  background: linear-gradient(135deg, rgba(31,81,255,0.12), rgba(143,0,255,0.12));
  border:1px solid rgba(31,81,255,0.15);
  box-shadow: 0 8px 20px rgba(31,81,255,0.10), 0 2px 8px rgba(143,0,255,0.08);
  animation: iconPulse 3s ease-in-out infinite;
}
@media (prefers-color-scheme: dark){
  .icon-tile{ 
    background: linear-gradient(135deg, rgba(31,81,255,0.18), rgba(143,0,255,0.18));
    border-color: rgba(143,0,255,0.18); 
    box-shadow: 0 8px 24px rgba(143,0,255,0.12); 
  }
}

@keyframes iconPulse{
  0%, 100%{ transform: scale(1); }
  50%{ transform: scale(1.05); }
}

/* Depth utilities for 3D parallax inside tilt cards */
.depth-1{ transform: translateZ(8px); }
.depth-2{ transform: translateZ(16px); }
.depth-3{ transform: translateZ(24px); }
.depth-4{ transform: translateZ(36px); }

/* Subtle float animation for autonomous motion */
.float-anim{ animation: floatY 4.5s ease-in-out infinite; }
@keyframes floatY{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-10px); }
}

/* === ROTATING HERO CARDS === */
.hero-rotating-container {
  position: relative;
  width: 100%;
  height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rotating-cards-orbit {
  position: relative;
  width: 420px;
  height: 420px;
}

/*
  Le card orbitano lungo un cerchio condiviso (senza ruotare su loro stesse).
  offset-rotate: 0deg mantiene icona e titolo sempre dritti.
*/
.hero-card-square {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  transform: translate(-50%, -50%) scale(var(--hover-scale));
  offset-path: circle(var(--orbit-radius) at 50% 50%);
  offset-distance: 0%;
  offset-rotate: 0deg;
  animation: heroOrbit 12s linear infinite, cardPulse 3s ease-in-out infinite;
  animation-delay: var(--orbit-delay, 0s);
  --hover-scale: 1;
  --orbit-radius: clamp(140px, 19vw, 190px);
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,255,255,0.95)) padding-box,
              linear-gradient(135deg, rgba(31,81,255,0.6), rgba(143,0,255,0.6)) border-box;
  border: 3px solid transparent;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 15px 40px rgba(31, 81, 255, 0.35),
              0 8px 20px rgba(143, 0, 255, 0.3),
              0 0 0 1px rgba(31, 81, 255, 0.15);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  z-index: 1;
  will-change: offset-distance, transform;
}

@keyframes heroOrbit {
  from { offset-distance: 0%; }
  to { offset-distance: 100%; }
}

.dark .hero-card-square {
  background: linear-gradient(135deg, rgba(10,22,40,0.98), rgba(15,28,46,0.92)) padding-box,
              linear-gradient(135deg, rgba(31,81,255,0.6), rgba(143,0,255,0.6)) border-box;
  box-shadow: 0 15px 40px rgba(31, 81, 255, 0.35),
              0 8px 20px rgba(143, 0, 255, 0.25),
              inset 0 1px 0 rgba(255,255,255,0.05);
}

.hero-card-square:nth-child(1) {
  --orbit-delay: 0s;
}

.hero-card-square:nth-child(2) {
  --orbit-delay: -4s;
}

.hero-card-square:nth-child(3) {
  --orbit-delay: -8s;
}

@keyframes cardPulse {
  0%, 100% {
    box-shadow: 0 15px 40px rgba(31, 81, 255, 0.3),
                0 8px 20px rgba(143, 0, 255, 0.25),
                0 0 0 1px rgba(31, 81, 255, 0.15);
  }
  50% {
    box-shadow: 0 20px 50px rgba(31, 81, 255, 0.4),
                0 10px 25px rgba(143, 0, 255, 0.35),
                0 0 0 1px rgba(31, 81, 255, 0.25);
  }
}

.hero-card-square:hover {
  box-shadow: 0 25px 60px rgba(31, 81, 255, 0.5),
              0 15px 35px rgba(143, 0, 255, 0.4),
              0 0 0 2px rgba(31, 81, 255, 0.35) !important;
  --hover-scale: 1.05;
}

.hero-card-icon {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 16px rgba(31, 81, 255, 0.6));
  transition: transform 0.3s ease;
  shape-rendering: geometricPrecision;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.hero-card-square:hover .hero-card-icon {
  transform: scale(1.12) rotate(5deg);
  filter: drop-shadow(0 6px 20px rgba(31, 81, 255, 0.8));
}

.hero-card-title {
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  background: linear-gradient(135deg, #1F51FF, #8F00FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

@media (max-width: 768px) {
  .hero-rotating-container {
    height: 360px;
  }

  .rotating-cards-orbit {
    width: 300px;
    height: 300px;
  }

  .hero-card-square {
    width: 110px;
    height: 110px;
    --orbit-radius: clamp(110px, 26vw, 150px);
  }

  .hero-card-icon {
    width: 48px;
    height: 48px;
  }

  .hero-card-title {
    font-size: 0.8rem;
  }
}/* Animated gradient border (for special elements) */
.animated-border{
  position: relative;
  background: linear-gradient(var(--card-bg-light), var(--card-bg-light)) padding-box,
              linear-gradient(135deg, var(--accent-a), var(--accent-b)) border-box;
  border: 2px solid transparent;
  background-size: 200% 200%;
  animation: gradientBorderShift 6s ease-in-out infinite;
}
@keyframes gradientBorderShift{
  0%, 100%{ background-position: 0% 50%; }
  50%{ background-position: 100% 50%; }
}

/* Badge pulse animation */
.badge-pulse{
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse{
  0%, 100%{ transform: scale(1); opacity: 1; }
  50%{ transform: scale(1.08); opacity: 0.92; }
}

/* Icon shimmer */
.icon-shimmer{
  animation: iconShimmer 3s ease-in-out infinite;
}
@keyframes iconShimmer{
  0%, 100%{ filter: brightness(1); }
  50%{ filter: brightness(1.3); }
}

/* === SERVICE CARDS ENHANCED ANIMATIONS === */
.service-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.service-card:hover::before {
  animation: shimmerSweep 1.5s ease-in-out;
}

@keyframes shimmerSweep {
  0% {
    left: -50%;
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    left: 150%;
    opacity: 0;
  }
}

.service-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 25px 50px rgba(31, 81, 255, 0.25), 
              0 15px 30px rgba(143, 0, 255, 0.2),
              0 0 60px rgba(31, 81, 255, 0.15);
}

/* Gradient border animation */
.service-card-border {
  position: relative;
  background: linear-gradient(var(--card-bg-light), var(--card-bg-light)) padding-box,
              linear-gradient(135deg, rgba(31,81,255,0.3), rgba(143,0,255,0.3), rgba(31,81,255,0.3)) border-box;
  border: 2px solid transparent;
  background-size: 200% 200%;
  animation: gradientRotate 4s ease infinite;
}

.dark .service-card-border {
  background: linear-gradient(var(--card-bg-dark), var(--card-bg-dark)) padding-box,
              linear-gradient(135deg, rgba(31,81,255,0.4), rgba(143,0,255,0.4), rgba(31,81,255,0.4)) border-box;
}

@keyframes gradientRotate {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Icon bounce on hover */
.service-card:hover .service-icon {
  animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-8px) scale(1.1); }
  50% { transform: translateY(0) scale(1.05); }
  75% { transform: translateY(-4px) scale(1.08); }
}

/* Glow effect on hover */
.service-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  border-radius: inherit;
  opacity: 0;
  filter: blur(20px);
  z-index: -1;
  transition: opacity 0.4s ease;
}

.service-card:hover::after {
  opacity: 0.3;
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.2; filter: blur(20px); }
  50% { opacity: 0.4; filter: blur(25px); }
}

/* Staggered reveal animation */
.service-card-reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: cardReveal 0.6s ease forwards;
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.service-card-reveal:nth-child(1) { animation-delay: 0.1s; }
.service-card-reveal:nth-child(2) { animation-delay: 0.2s; }
.service-card-reveal:nth-child(3) { animation-delay: 0.3s; }
.service-card-reveal:nth-child(4) { animation-delay: 0.4s; }
.service-card-reveal:nth-child(5) { animation-delay: 0.5s; }
.service-card-reveal:nth-child(6) { animation-delay: 0.6s; }

/* Continuous floating animation for service cards */
.service-card-float {
  animation: continuousFloat 6s ease-in-out infinite;
}

.service-card-float:nth-child(1) { animation-delay: 0s; }
.service-card-float:nth-child(2) { animation-delay: 1.5s; }
.service-card-float:nth-child(3) { animation-delay: 3s; }
.service-card-float:nth-child(4) { animation-delay: 4.5s; }

@keyframes continuousFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-8px) rotate(1deg);
  }
  50% {
    transform: translateY(-15px) rotate(0deg);
  }
  75% {
    transform: translateY(-8px) rotate(-1deg);
  }
}

/* Continuous subtle rotation for icons */
.icon-rotate-continuous {
  animation: subtleRotate 8s ease-in-out infinite;
}

@keyframes subtleRotate {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-5deg) scale(1.05); }
  50% { transform: rotate(5deg) scale(1.1); }
  75% { transform: rotate(-3deg) scale(1.05); }
}

/* Breathing glow effect */
.glow-breathe {
  animation: breatheGlowContinuous 4s ease-in-out infinite;
}

@keyframes breatheGlowContinuous {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(14, 165, 233, 0.2),
                0 5px 15px rgba(6, 182, 212, 0.15);
  }
  50% {
    box-shadow: 0 15px 40px rgba(14, 165, 233, 0.3),
                0 8px 20px rgba(6, 182, 212, 0.25);
  }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce){
  .float-anim{ animation: none !important; }
  .lift-on-hover{ transition: none !important; }
  .tilt-inner{ transition: none !important; }
  .service-card::before,
  .service-card::after,
  .service-card-border { animation: none !important; }
  .service-card:hover { transform: none !important; }
  .service-card-float,
  .icon-rotate-continuous,
  .glow-breathe { animation: none !important; }
  /* Keep hero orbit active even when motion reduction is enabled */
  .rotating-cards-orbit { animation-duration: 12s !important; }
  .hero-card-square { animation-duration: 12s, 3s !important; }
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* === PARTICLE BACKGROUND (CSS-only alternative to Three.js) === */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: radial-gradient(circle, var(--color-primary-mid), transparent);
  border-radius: 50%;
  opacity: 0.6;
  animation: particleFloat 15s ease-in-out infinite;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(10px, -10px);
  }
  50% {
    transform: translate(-5px, -20px);
  }
  75% {
    transform: translate(-10px, -10px);
  }
}

/* Stagger particle delays */
.particle:nth-child(2n) { animation-delay: -3s; }
.particle:nth-child(3n) { animation-delay: -6s; }
.particle:nth-child(4n) { animation-delay: -9s; }
.particle:nth-child(5n) { animation-delay: -12s; }

/* === RESPONSIVE === */
/* Tablet breakpoint */
@media (max-width: 1024px) {
  :root {
    --header-scale: 1.2;
    --header-text-scale: 1.3;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  :root {
    --font-size-5xl: 3rem;
    --font-size-4xl: 2.25rem;
    --space-10: 3rem;
    --header-scale: 1.0;
    --header-text-scale: 1.1;
  }

  .nav {
    height: 64px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary-mid);
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Nova cards UI */
.card-ui{
  position: relative;
  z-index: 0;
  background: linear-gradient(var(--card-bg-light), var(--card-bg-light)) padding-box,
              linear-gradient(145deg, rgba(31,81,255,var(--card-border-alpha)), rgba(143,0,255,var(--card-border-alpha))) border-box;
  border: 1px solid transparent;
  border-radius: 1.5rem;
  box-shadow: 0 10px 30px rgba(31,81,255,0.08), 0 6px 14px rgba(15,23,42,0.08), 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}
.dark .card-ui{
  background: linear-gradient(var(--card-bg-dark), var(--card-bg-dark)) padding-box,
              linear-gradient(145deg, rgba(31,81,255,0.25), rgba(143,0,255,0.25)) border-box;
  box-shadow: 0 10px 28px rgba(143,0,255,0.10), 0 6px 14px rgba(0,0,0,0.25);
}
.card-ui:hover{
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(31,81,255,0.16), 0 10px 20px rgba(15,23,42,0.14), 0 2px 6px rgba(0,0,0,0.08);
}
.card-ui::after{
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  opacity: 0.10;
  filter: blur(12px);
  animation: breatheGlow 4s ease-in-out infinite;
  z-index: -1;
}
.dark .card-ui::after{ opacity: 0.14; }
.card-ui:hover::after{ opacity: 0.18; filter: blur(16px); animation: breatheGlowHover 2s ease-in-out infinite; }

@keyframes breatheGlow{
  0%, 100%{ opacity: 0.10; filter: blur(12px); }
  50%{ opacity: 0.16; filter: blur(14px); }
}
@keyframes breatheGlowHover{
  0%, 100%{ opacity: 0.18; filter: blur(16px); }
  50%{ opacity: 0.24; filter: blur(18px); }
}

/* === HEADER SCALABILE === */
header.site-header {
  height: calc(var(--header-base-height) * var(--header-scale));
  transition: height 0.3s ease;
}

header .logo {
  transform: scale(var(--header-text-scale));
  transform-origin: left center;
  transition: transform 0.3s ease;
}

header .nav-item {
  font-size: calc(1rem * var(--header-text-scale));
  transition: font-size 0.3s ease;
}

/* === PROGRESS BAR === */
.progress-container {
  background: rgba(0, 123, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
  position: relative;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--color-blue), var(--color-purple));
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* === XP BADGE & GAMIFICATION === */
.xp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.15), rgba(155, 0, 255, 0.15));
  border: 1px solid rgba(155, 0, 255, 0.3);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-purple);
  box-shadow: 0 4px 12px rgba(155, 0, 255, 0.2);
  animation: badgePulse 2.5s ease-in-out infinite;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  background: var(--color-gradient);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 2px 8px rgba(155, 0, 255, 0.3);
}

/* === CTA BUTTON PROMINENTE === */
.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--color-gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 0 2px rgba(155, 0, 255, 0.3), 0 8px 24px rgba(0, 123, 255, 0.4);
  text-decoration: none;
}

.btn-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(155, 0, 255, 0.4), 0 12px 32px rgba(0, 123, 255, 0.5);
}

.btn-continue:active {
  transform: translateY(0);
}

/* Touch target size minimo 44px per mobile */
@media (max-width: 768px) {
  .btn-continue {
    min-height: 44px;
    min-width: 44px;
  }
}

/* === FEEDBACK IMMEDIATO (Quiz/Esercizi) === */
.feedback-correct {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border-left: 4px solid #10B981;
  border-radius: 8px;
  color: #047857;
  font-weight: 600;
  animation: slideInFromLeft 0.4s ease;
}

.feedback-incorrect {
  padding: 1rem;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(239, 68, 68, 0.05));
  border-left: 4px solid #EF4444;
  border-radius: 8px;
  color: #B91C1C;
  font-weight: 600;
  animation: slideInFromLeft 0.4s ease;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === CHECKLIST STYLE === */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(0, 123, 255, 0.05);
  border-left: 3px solid var(--color-blue);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.checklist-item:hover {
  background: rgba(0, 123, 255, 0.1);
  transform: translateX(4px);
}

.checklist-item.completed {
  opacity: 0.6;
  border-left-color: #10B981;
  background: rgba(16, 185, 129, 0.05);
}

.checklist-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--color-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.checklist-item.completed .checklist-icon {
  background: #10B981;
  border-color: #10B981;
  color: white;
}

/* === CALLOUT BOXES === */
.callout {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin: 1rem 0;
  border-left: 4px solid;
}

.callout-info {
  background: rgba(0, 123, 255, 0.1);
  border-left-color: var(--color-blue);
  color: #0369a1;
}

.callout-success {
  background: rgba(16, 185, 129, 0.1);
  border-left-color: #10B981;
  color: #047857;
}

.callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border-left-color: #F59E0B;
  color: #92400e;
}

.callout-tip {
  background: rgba(155, 0, 255, 0.1);
  border-left-color: var(--color-purple);
  color: #7c3aed;
}

/* Dark mode callouts */
.dark .callout-info { color: #7dd3fc; }
.dark .callout-success { color: #6ee7b7; }
.dark .callout-warning { color: #fcd34d; }
.dark .callout-tip { color: #c4b5fd; }






