/*! 
 * (c) 2026 Sabrina Rizzi
 * Role: AI Developer & Data Analyst
 * Tutela legale: All Rights Reserved. Plagiarism is strictly prohibited.
 */


/* ===== ROOT VARIABLES ===== */
:root {
  /* Modern AI/Tech Theme Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;

  --accent-primary: #8b5cf6;
  /* Violet */
  --accent-secondary: #3b82f6;
  /* Blue */
  --accent-tertiary: #ec4899;
  /* Pink */

  --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  --accent-glow: 0 0 20px rgba(139, 92, 246, 0.5);

  --surface-glass: rgba(30, 41, 59, 0.7);
  --surface-glass-border: rgba(255, 255, 255, 0.1);
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(12px);

  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;

  --border-radius-sm: 16px;
  --border-radius-md: 24px;
  --border-radius-lg: 40px;
  --radius-lg: 40px;
  /* Legacy support */
  --radius-full: 9999px;

  /* Animations */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
  --shadow-neon: 0 0 15px rgba(139, 92, 246, 0.3);
}

[data-theme="light"] {
  --bg-primary: #f5f3ff;
  /* Soft Innovation Purple */
  --bg-secondary: #ffffff;
  --bg-tertiary: #ede9fe;

  --text-primary: #1e1b4b;
  --text-secondary: #7978c7;
  --text-tertiary: #6366f1;

  --surface-glass: rgba(255, 255, 255, 0.8);
  --surface-glass-border: rgba(139, 92, 246, 0.15);
  --border-color: rgba(139, 92, 246, 0.15);
  --shadow-sm: 0 2px 8px rgba(139, 92, 246, 0.05);
  --shadow-md: 0 8px 24px rgba(139, 92, 246, 0.1);
  --shadow-lg: 0 16px 48px rgba(139, 92, 246, 0.12);
}

/* Enhanced Dark Mode Hover Effects */
[data-theme="dark"] .soft-skill-card:hover,
[data-theme="dark"] .service-card:hover,
[data-theme="dark"] .why-me-card:hover,
[data-theme="dark"] .projects-cta-card:hover {
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), inset 0 0 10px rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.5);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ===== RESET & BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

a {
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ===== COMPONENT UTILITIES (Glassmorphism) ===== */
.glass-panel {
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--surface-glass-border);
  box-shadow: var(--shadow-md);
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  /* Fixed height for calculations */
  z-index: 1000;
  transition: all var(--transition-base);
  background: transparent;
  padding: 0 2rem;
  display: flex;
  align-items: center;
}

.nav.scrolled {
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--surface-glass-border);
  height: 70px;
  box-shadow: var(--shadow-md);
}

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

.nav-brand {
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: var(--spacing-md);
}

.nav-link {
  position: relative;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  padding: 0.5rem 0;
}

.nav-link:hover {
  color: var(--accent-secondary);
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-gradient);
  transition: width var(--transition-base);
  border-radius: 2px;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-controls {
  display: flex;
  gap: var(--spacing-sm);
}

.lang-toggle,
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.lang-toggle:hover,
.theme-toggle:hover {
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

.lang-inactive {
  color: var(--text-tertiary);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.sun-icon {
  display: none;
}

[data-theme="dark"] .sun-icon {
  display: block;
}

[data-theme="dark"] .moon-icon {
  display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1001;
  background: var(--bg-secondary);
  border-radius: 12px;
  justify-content: center;
  align-items: center;
}

.hamburger {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  display: block;
  position: relative;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s ease;
  left: 0;
  /* Ensure centered alignment */
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  bottom: -8px;
}

.mobile-menu-toggle.active .hamburger {
  background: transparent;
}

.mobile-menu-toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.mobile-menu-toggle.active .hamburger::after {
  top: 0;
  /* Center vertically for X */
  transform: rotate(-45deg);
}

@media (max-width: 968px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 100px 2rem 2rem;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    font-size: 1.25rem;
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid var(--surface-glass-border);
  }
}

/* ===== NAVIGATION LOGO ===== */
.nav-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

/* ===== HERO SECTION ===== */
/* Roots Background Canvas */
.roots-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Roots on top of blobs but below content */
  pointer-events: none;
  background-color: transparent !important;
}

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 100px;
  padding-bottom: 100px;
  position: relative;
  background: transparent;
  overflow: hidden;
}

/* Background animated shapes */

.bg-blob {
  position: absolute;
  filter: blur(120px);
  opacity: 0.2;
  /* Ridotta opacità per non sovrastare le radici */
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.2, 0, 0.2, 1);
  animation: morphBlob 25s infinite alternate;
  will-change: transform, border-radius;
  pointer-events: none;
}

@keyframes morphBlob {
  0% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }

  25% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }

  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }

  75% {
    border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
  }

  100% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }
}

.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  /* Level below roots */
  pointer-events: none;
}

.bg-blob-1 {
  top: 800px;
  /* Between Hero and About - LEFT */
  left: -15%;
  width: 50vw;
  height: 50vw;
  background: var(--accent-primary);
  opacity: 0.5;
  transform: translate(calc(var(--mouse-x, 0.5) * -60px), calc(var(--mouse-y, 0.5) * -60px));
}

.bg-blob-2 {
  top: 1400px;
  /* Between About and Services - RIGHT */
  right: -15%;
  width: 55vw;
  height: 55vw;
  background: var(--accent-tertiary);
  opacity: 0.4;
  transform: translate(calc(var(--mouse-x, 0.5) * 80px), calc(var(--mouse-y, 0.5) * 80px));
}

.bg-blob-3 {
  top: 2200px;
  /* Between Services and Education - LEFT */
  left: -18%;
  width: 52vw;
  height: 52vw;
  background: var(--secondary-color);
  opacity: 0.4;
  transform: translate(calc(var(--mouse-x, 0.5) * -100px), calc(var(--mouse-y, 0.5) * 100px));
}

.bg-blob-4 {
  top: 2800px;
  /* Between Education and Skills - RIGHT */
  right: -12%;
  width: 58vw;
  height: 58vw;
  background: var(--accent-secondary);
  opacity: 0.35;
  transform: translate(calc(var(--mouse-x, 0.5) * 50px), calc(var(--mouse-y, 0.5) * -50px));
}

.bg-blob-5 {
  top: 3600px;
  /* Between Skills and Soft Skills - LEFT */
  left: -20%;
  width: 60vw;
  height: 60vw;
  background: var(--accent-primary);
  opacity: 0.4;
  transform: translate(calc(var(--mouse-x, 0.5) * -70px), calc(var(--mouse-y, 0.5) * 40px));
}

.bg-blob-6 {
  top: 4400px;
  /* Between Soft Skills and Projects - RIGHT */
  right: -15%;
  width: 54vw;
  height: 54vw;
  background: var(--accent-tertiary);
  opacity: 0.35;
  transform: translate(calc(var(--mouse-x, 0.5) * 60px), calc(var(--mouse-y, 0.5) * -40px));
  z-index: -1;
  /* Behind content */
}

.bg-blob-7 {
  top: 5000px;
  /* Between Projects and Why Me - LEFT */
  left: -18%;
  width: 56vw;
  height: 56vw;
  background: var(--primary-color);
  opacity: 0.3;
  transform: translate(calc(var(--mouse-x, 0.5) * -50px), calc(var(--mouse-y, 0.5) * 70px));
}

.bg-blob-8 {
  top: 5800px;
  /* Between Why Me and Contact - RIGHT */
  right: -20%;
  width: 62vw;
  height: 62vw;
  background: var(--accent-secondary);
  opacity: 0.35;
  transform: translate(calc(var(--mouse-x, 0.5) * 80px), calc(var(--mouse-y, 0.5) * -60px));
}

.hero-content-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: var(--spacing-lg);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  z-index: 1;
}

.hero-text {
  order: 1;
}

.hero-image {
  order: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Specific selector to override any potential square frame */
.hero .profile-image {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  cursor: pointer;
  background: transparent !important;
  border: none !important;
  border-radius: 42% 58% 70% 30% / 45% 45% 55% 55% !important;
  /* Use filter: drop-shadow instead of box-shadow for organic shapes */
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
  transition: all var(--transition-base);
}

.hero .profile-image:hover {
  transform: scale(1.04) rotate(1deg);
  border-radius: 48% 52% 52% 48% / 50% 50% 50% 50% !important;
  filter: drop-shadow(0 15px 30px rgba(102, 126, 234, 0.4));
}

/* Availability Badge */
.availability {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #10b981;
  /* Fallback */
  margin-bottom: var(--spacing-md);
  backdrop-filter: blur(4px);
  animation: fadeInDown 0.6s ease both;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Hero Typography */
.hero-title {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: var(--spacing-md);
  animation: fadeInUp 0.6s ease 0.2s both;
  color: var(--text-primary);
}

.hero-title .greeting {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: block;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero-title .name {
  display: block;
  background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title .role-wrapper {
  display: block;
  font-size: 0.6em;
  /* Relative to hero-title font size */
  color: var(--accent-secondary);
  margin-top: 0.5rem;
  min-height: 1.5em;
  display: flex;
  align-items: center;
}

.role-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cursor {
  display: inline-block;
  color: var(--accent-primary);
  animation: blink 1s step-end infinite;
  margin-left: 5px;
  font-weight: 400;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.hero-greeting {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wave-hand {
  display: inline-block;
  font-size: 1em;
  animation: wave 0.6s ease-in-out;
  transform-origin: 70% 70%;
  cursor: pointer;
  position: relative;
}

.wave-hand:hover {
  animation: wave 0.6s ease-in-out;
}

.wave-hand::after {
  content: attr(data-greeting);
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--accent-gradient);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.wave-hand:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@keyframes wave {
  0% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  30% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }

  60% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

.greeting-text {
  font-weight: 800;
}

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

.hero-description {
  max-width: 600px;
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
  animation: fadeInUp 0.6s ease 0.4s both;
}

.hero-cta {
  display: flex;
  gap: var(--spacing-sm);
  animation: fadeInUp 0.6s ease 0.6s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-base);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-secondary);
  backdrop-filter: blur(5px);
}

.btn-secondary:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-3px);
  background: rgba(139, 92, 246, 0.1);
}

/* Scroll Mouse Animation */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.scroll-mouse {
  width: 26px;
  height: 42px;
  border: 2px solid var(--text-secondary);
  border-radius: 20px;
  position: relative;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
}

/* ===== SECTIONS ===== */
section {
  padding: var(--spacing-xl) 0;
  background: transparent;
  /* Garantisce la visibilità del canvas */
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.section-label {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--spacing-sm);
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  /* Ensure consistent visibility */
}

/* ===== ABOUT SECTION ===== */
.about {
  position: relative;
  overflow: hidden;
  background: transparent;
}

.about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  /* Make About text central */
}

.about-text p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #475569;
  /* Applied requested color */
  margin-bottom: var(--spacing-md);
}

[data-theme="dark"] .about-text p {
  color: #ffffff;
  /* White in Dark Mode */
}

.about-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-md);
  margin-top: var(--spacing-lg);
}

.highlight-item {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.highlight-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.highlight-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.highlight-label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* ===== SERVICES SECTION ===== */
.services {
  background: transparent;
  position: relative;
  z-index: 1;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

/* Service Card (Glassmorphism) */
.service-card {
  padding: var(--spacing-lg) var(--spacing-md);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

[data-theme="light"] .service-card {
  background: #ffffff;
  color: #1e1b4b;
}

[data-theme="dark"] .service-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.service-card .service-title {
  color: inherit;
}

[data-theme="light"] .service-card .service-description {
  color: #475569;
}

[data-theme="dark"] .service-card .service-description {
  color: var(--text-secondary);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg), var(--shadow-neon);
  border-color: rgba(139, 92, 246, 0.3);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-md);
  display: inline-block;
  color: var(--accent-primary);
  background: transparent;
  /* Reset background for safety */
  filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.3));
  transition: transform var(--transition-base);
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

.service-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.service-description {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== EDUCATION SECTION ===== */
.education-card {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .education-card {
  background: #ffffff;
  color: #1e1b4b;
}

[data-theme="dark"] .education-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.education-card h3,
.education-card .education-institution {
  color: inherit;
  /* Respects [data-theme] colors defined in education-card */
}

.education-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gradient);
}

[data-theme="light"] .education-period,
[data-theme="light"] .education-description {
  color: #475569;
  /* Applied requested color */
}

.education-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(102, 126, 234, 0.1);
  color: var(--accent-primary);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.education-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.education-institution {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.institution-name {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.education-period {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.education-description {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.education-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  font-weight: 600;
  transition: all var(--transition-fast);
}

.education-link:hover {
  gap: 0.75rem;
}

/* ===== SKILLS SECTION ===== */
.skills {
  position: relative;
  overflow: hidden;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-md);
}

.skill-category {
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

[data-theme="light"] .skill-category {
  background: #ffffff;
  color: #1e1b4b;
}

[data-theme="dark"] .skill-category {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.skill-category-title {
  color: inherit;
}

.skill-category-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.5rem 1rem;
  background: var(--bg-primary);
  border: none;
  /* Removed border as requested */
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
}

/* ===== SOFT SKILLS SECTION ===== */
.soft-skills {
  background: transparent;
  position: relative;
  z-index: 1;
}

.soft-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

.soft-skill-card {
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-base);
}

[data-theme="light"] .soft-skill-card {
  background: #ffffff;
  color: #1e1b4b;
}

[data-theme="dark"] .soft-skill-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.soft-skill-card h3 {
  color: inherit;
}

[data-theme="light"] .soft-skill-card p {
  color: #475569;
}

[data-theme="dark"] .soft-skill-card p {
  color: var(--text-secondary);
}

.soft-skill-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.soft-skill-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--accent-primary);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.soft-skill-card:hover .soft-skill-icon {
  background: var(--accent-gradient);
  color: white;
  transform: scale(1.1) rotate(5deg);
  box-shadow: var(--shadow-neon);
  border-color: transparent;
}

.soft-skill-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.soft-skill-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== PROJECTS SECTION ===== */
.projects-cta-card {
  max-width: 700px;
  margin: 0 auto;
  padding: var(--spacing-lg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-base);
}

[data-theme="light"] .projects-cta-card {
  background: #ffffff;
  color: #1e1b4b;
}

[data-theme="dark"] .projects-cta-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.projects-cta-card h3 {
  color: inherit;
}

[data-theme="light"] .projects-cta-card p {
  color: #475569;
}

[data-theme="dark"] .projects-cta-card p {
  color: var(--text-secondary);
}

.projects-cta-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.projects-icon {
  margin-bottom: var(--spacing-md);
  color: var(--accent-primary);
  background: transparent;
  transition: transform 0.3s ease;
}

/* Playful Jump Animation */
.jump-attention {
  animation: jumpShake 6s infinite ease-in-out;
  transform-origin: bottom center;
}

@keyframes jumpShake {

  0%,
  90% {
    transform: scale(1) rotate(0);
  }

  92% {
    transform: scale(1.1) rotate(-5deg) translateY(-10px);
  }

  94% {
    transform: scale(1.1) rotate(5deg) translateY(-10px);
  }

  96% {
    transform: scale(1.1) rotate(-5deg) translateY(-10px);
  }

  98% {
    transform: scale(1.1) rotate(5deg) translateY(-10px);
  }

  100% {
    transform: scale(1) rotate(0);
  }
}

.projects-cta-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.projects-cta-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--spacing-md);
}

.projects-cta-card .btn {
  display: inline-flex;
  gap: 0.5rem;
}

/* ===== WHY ME SECTION ===== */
.why-me {
  background: transparent;
  position: relative;
  z-index: 1;
}

.why-me-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-md);
}

.why-me-card {
  padding: var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

[data-theme="light"] .why-me-card {
  background: #ffffff;
  color: #1e1b4b;
}

[data-theme="dark"] .why-me-card {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.why-me-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.why-me-number {
  display: inline-block;
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: var(--accent-gradient);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.why-me-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.why-me-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

[data-theme="light"] .why-me-card p {
  color: #475569;
  /* Applied requested color */
}

/* ===== CONTACT SECTION ===== */
.contact {
  padding: var(--spacing-xl) 0;
  position: relative;
}

.contact-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.contact-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
}

.contact-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: center;
}

.contact-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  order: -1;
  padding-top: 0;
  /* Remove padding, align to very top */
  margin-top: calc(var(--spacing-md) * -1);
  /* Pull up even higher */
}

.contact-photo {
  width: 100%;
  max-width: 350px;
  border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.8), 0 0 100px rgba(168, 85, 247, 0.5);
  /* Purple tones as requested */
  transition: all var(--transition-base);
  cursor: pointer;
  object-fit: cover;
  aspect-ratio: 1/1;
  position: relative;
}

.contact-photo:hover {
  transform: scale(1.04) rotate(-1deg);
  border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
  /* Smooth morphing for consistency */
  box-shadow: 0 12px 60px rgba(139, 92, 246, 0.4);
}

/* Spotlight Border Effect - Inspired by TechInsider */
.contact-form-wrapper {
  position: relative;
}

.contact-form {
  padding: var(--spacing-md);
  border-radius: var(--border-radius-md);
  /* Nuova tecnica per lo spotlight border preciso da 2.5px */
  background:
    linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
    radial-gradient(200px circle at var(--mouse-x-form) var(--mouse-y-form),
      rgba(255, 255, 255, 1) 0%,
      rgba(168, 85, 247, 1) 35%,
      rgba(139, 92, 246, 1) 70%,
      transparent 100%) border-box;
  border: 2.5px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

/* Rimosso ::before non più necessario con la nuova tecnica */

/* Inner surface layer for better control if needed */
.contact-form-inner {
  position: relative;
  z-index: 1;
  background: transparent;
  height: 100%;
  width: 100%;
}

/* Dark Mode Specifics - Ensure transparent border for spotlight visibility */
[data-theme="dark"] .contact-form {
  border-color: transparent;
}

[data-theme="dark"] .contact-form:hover {
  border-color: transparent;
}

.form-group {
  margin-bottom: var(--spacing-sm);
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.submit-btn {
  width: 100%;
  justify-content: center;
  gap: 0.5rem;
  margin-top: var(--spacing-sm);
}

.social-links-compact {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.social-btn {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-glass);
  border: 1px solid var(--surface-glass-border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: all var(--transition-base);
}

.social-btn:hover {
  background: var(--accent-gradient);
  color: white;
  transform: translateY(-5px) rotate(10deg);
  box-shadow: var(--shadow-neon);
}

/* ===== PHOTO INTERACTION ===== */
.profile-image {
  border-radius: var(--border-radius-lg);
  /* Rounded but not full circle mostly */
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-origin: bottom center;
}

.profile-image:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: var(--shadow-neon);
  /* "Waving" shape effect using border-radius manipulation */
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  animation: blobWave 3s infinite linear;
}

@keyframes blobWave {
  0% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }

  33% {
    border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
  }

  66% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }

  100% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  }
}

/* ===== CIRCUIT BOARD CONNECTIONS ===== */
.circuit-connections {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.circuit-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.circuit-path {
  stroke-dasharray: 5 3;
  animation: flowCircuit 20s linear infinite;
}

.circuit-node-svg {
  animation: pulseNode 2s ease-in-out infinite;
}

@keyframes flowCircuit {
  0% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: 100;
  }
}

@keyframes pulseNode {

  0%,
  100% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }
}

/* Dark mode enhancement */
[data-theme="dark"] .circuit-svg {
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .circuit-svg {
    opacity: 0.3;
  }
}

.footer {
  overflow: visible;
}

.footer {
  padding: var(--spacing-md) 0;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.footer-links a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
  position: fixed;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
  color: white;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 999;
  font-size: 1.25rem;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.5);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero {
    padding-top: 100px;
    padding-bottom: 80px;
  }

  .hero-content-wrapper {
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  /* .nav-menu display handled by hamburger logic above */

  .hero {
    padding-top: 100px;
    padding-bottom: 120px;
    min-height: auto;
  }

  .hero-content-wrapper {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .hero-text {
    order: 2;
    text-align: center;
  }

  .hero-image {
    order: 1;
    margin-top: var(--spacing-md);
  }

  .profile-image {
    max-width: 250px;
  }

  .availability {
    margin-bottom: var(--spacing-md);
  }

  .hero-greeting {
    justify-content: center;
  }

  .hero-description {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-title {
    font-size: 2rem;
    text-align: center;
  }

  .hero-title .role-wrapper {
    justify-content: center;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    gap: var(--spacing-sm);
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .scroll-indicator {
    bottom: 30px;
  }

  .scroll-line {
    height: 40px;
  }

  .skills-grid,
  .services-grid,
  .soft-skills-grid,
  .why-me-grid {
    grid-template-columns: 1fr;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .contact-image-wrapper {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
  }

  .contact-photo {
    max-width: 260px;
  }

  .education-institution {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 90px;
    padding-bottom: 100px;
  }

  .profile-image {
    max-width: 225px;
  }

  .hero-title {
    font-size: clamp(2.25rem, 6vw, 2.5rem);
  }

  .hero-description {
    font-size: 1rem;
  }

  .availability {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .scroll-indicator {
    bottom: 20px;
  }
}