:root {
  --primary-color: rgb(18, 120, 197);
  --secondary-color: #00d4ff;
  --wave-alpha: 1;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --text-color: #2c3e50;
  --bg-color: #ffffff;
  --card-bg: #f8f9fa;
  --accent-color: #b3e5fc;
  --gradient-start: #4a90e2;
  --gradient-mid: #00d4ff;
  --gradient-end: #007bff;
  --transition: all 0.3s ease;
  /* Logo accent color */
  --logo-accent: rgb(14, 121, 198);
  /* Primary hover color - changed from violet to cyan */
  --primary-hover: rgba(4, 121, 198, 1);
}





/* Reveal animations used across the page */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] {
  --text-color: #ecf0f1;
  --bg-color: #1a1a1a;
  --card-bg: #2c2c2c;
  --dark-color: #ecf0f1;
  --light-color: #2c3e50;
  --wave-alpha: 1;

}

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

.flex-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

body {
  /* Prefer Inter Tight where available; fall back to Inter and the previous rounded display font */
  font-family: "Inter Tight", "Inter", "M PLUS Rounded 1c", system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  transition: var(--transition);
}

.bold {
  font-weight: 700;
}

html {
  scroll-behavior: smooth;
}

.pt-150 {
  padding-top: 150px;
}
.pt-60 {
  padding-top: 60px;
}

/* Navigation */
.navbar {
  /* frosted glass navbar */
  background-color: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  padding: 0 0;
  transition: var(--transition);
}

[data-theme="dark"] .navbar {
  /* darker frosted glass for dark theme */
  background-color: rgba(10, 10, 10, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-brand .logo-icon {
  height: 80px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* Theme-specific logo swapping: show light logo by default, dark logo only in dark theme */
.logo-icon--dark {
  display: none;
}
.logo-icon--light {
  display: inline-block;
}

[data-theme="dark"] .logo-icon--dark {
  display: inline-block;
}
[data-theme="dark"] .logo-icon--light {
  display: none;
}

/* Improve visibility of dark logo when site is in dark mode.
   Target only the dark-specific logo so we don't override the light/dark swap. */
[data-theme="dark"] .navbar-brand .logo-icon--dark {
  display: inline-block;
}

[data-theme="dark"] .footer-logo .logo-text {
  display: inline-block;
  background-color: rgba(0, 0, 0, 0.68);
  padding: 4px 6px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36),
    0 0 14px rgba(255, 255, 255, 0.02) inset;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  margin-left: 6px;
}

/* Smaller badge for footer logo */
[data-theme="dark"] .footer-logo .logo-icon {
  display: inline-block;
  padding: 4px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36),
    0 0 14px rgba(255, 255, 255, 0.02) inset;
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
}

/* Make room for optional logo text and use Lora */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-family: "Lora", serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-color);
  letter-spacing: 0.05px;
}

/* Preserve logo and face headings from the global Inter Tight setting */
.logo-text,
.navbar-brand .logo-text {
  font-family: "Lora", serif !important;
}

.logo-accent {
  color: var(--logo-accent);
}

.logo-mdb {
  font-weight: 600;
}

.navbar-nav .nav-link {
  color: var(--text-color);
  font-weight: 500;
  margin: 0 1rem;
  transition: var(--transition);
  position: relative;
}

.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transition: var(--transition);
}

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

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

[data-theme="dark"] .navbar-nav .nav-link.active {
  color: var(--primary-color);
}

.navbar-nav .nav-link:hover {
  color: var(--primary-color);
}

.theme-toggle {
  background: none;
  border: 2px solid var(--text-color);
  color: var(--text-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
}

.theme-toggle:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: rotate(180deg);
}

#section {
  padding-top: 150px;
  color: var(--text-color);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(18, 120, 197, 0.12) 0%, rgba(0, 212, 255, 0.12) 100%);
  position: relative;
  overflow: hidden;
  padding-top: 90px;
}
/* Wave divider between sections */
.wave-divider {
  line-height: 0;
  width: 100%;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px; /* overlap the following section */
  z-index: 20;
}
.wave-divider svg {
  display: block;
  width: 100%;
  height: 90px;
}

/* Add subtle depth to the wave - uses filter so it scales with the SVG */
.wave-divider svg path {
  filter: drop-shadow(0 6px 12px rgba(18,120,197,0.08));
  transition: filter 220ms ease;
}

[data-theme="dark"] .wave-divider svg path {
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.25));
}

@media (prefers-reduced-motion: reduce) {
  .wave-divider svg path {
    filter: none;
    transition: none;
  }
}

/* Make the wave take the hero background color so it blends smoothly */
.hero-section + .tech-carousel, .hero-section {
  position: relative;
}
.hero-section .wave-fill {
  background: linear-gradient(135deg, rgba(18, 120, 197, 0.12) 0%, rgba(0, 212, 255, 0.12) 100%);
}

@media (max-width: 768px) {
  .wave-divider svg { height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .wave-divider svg { transition: none; }
}
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(18, 120, 197, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(0, 212, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  animation: fadeInUp 1s ease;
}

.hero-image {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.hero-image .hero-lottie {
  width: min(320px, 90%);
  max-width: 360px;
  aspect-ratio: 1 / 1;
  display: block;
}

@media (max-width: 768px) {
  .hero-image {
    min-height: 300px;
  }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--dark-color);
  color: white;
  height: 2.4rem; /* fixed height so background doesn't jump */
  padding: 0 0.9rem;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  min-width: 9ch; /* reserve width for longest word to avoid layout shifts */
  font-family: "Bebas Neue", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.5px;
  position: relative;
}

/* inner monospace span for caret alignment when needed */
.hero-tag .hero-text-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono",
    "Courier New", monospace;
  display: inline-block;
}

[data-theme="dark"] .hero-tag {
  background-color: var(--primary-color);
}

/* Blinking caret to mimic a typewriter cursor */
.hero-tag.typing::after {
  /* solid block cursor while typing (typewriter feel) */
  content: "";
  display: inline-block;
  width: 0.5ch; /* ridotto da 0.7ch per renderlo meno bold */
  height: 1.4rem;
  background: currentColor;
  margin-left: 0.6rem;
  vertical-align: middle;
  border-radius: 2px;
  animation: none;
}

.hero-tag.pause::after {
  /* blinking thin cursor during pauses */
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.4rem;
  background: currentColor;
  margin-left: 0.5rem;
  vertical-align: middle;
  animation: blink 1s steps(1) infinite;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  font-family: "Lora", serif;
  background: linear-gradient(135deg, rgb(18, 120, 197), rgb(0, 212, 255));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 2s ease-in-out infinite alternate;
}

.main-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  margin-bottom: 2rem;
  font-family: "Lora", serif;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color), #6f42c1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 2s ease-in-out infinite alternate;
  padding-bottom: 60px;
}

@keyframes titleGlow {
  from { filter: brightness(1); }
  to { filter: brightness(1.2); }
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-color);
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-animation {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.8);
  animation: animationReveal 1.5s ease forwards 0.5s;
}

@keyframes animationReveal {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, rgba(18, 120, 197, 0.08) 0%, rgba(0, 212, 255, 0.08) 100%);
}

[data-theme="dark"] .hero-section::before {
  background: radial-gradient(circle at 30% 20%, rgba(18, 120, 197, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(0, 212, 255, 0.15) 0%, transparent 50%);
}

.hero-description {
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 2rem;
  max-width: 100%;
  opacity: 0.8;
  text-align: justify;
}

/* Hero CTAs: Developer + Writer */
.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.hero-ctas .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.4rem; /* increased padding for a roomier button */
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: white;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 220ms ease, opacity 180ms ease;
  will-change: transform;
}

.hero-ctas .hero-cta .fas {
  font-size: 1rem;
}

/* Primary variant */
.hero-ctas .cta-primary {
  background: linear-gradient(
    90deg,
    var(--gradient-start),
    var(--gradient-mid)
  );
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-ctas .cta-primary:hover,
.hero-ctas .cta-primary:focus {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 18px 46px rgba(74, 144, 226, 0.2);
}

/* Secondary variant */
.hero-ctas .cta-secondary {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.03)
  );
  color: var(--text-color);
  border: 1px solid rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(3px);
}

.hero-ctas .cta-secondary:hover,
.hero-ctas .cta-secondary:focus {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.hero-ctas .hero-cta:focus-visible {
  outline: 3px solid rgba(74, 144, 226, 0.18);
  outline-offset: 4px;
}

@media (max-width: 576px) {
  .hero-ctas {
    gap: 0.6rem;
  }
  .hero-ctas .hero-cta {
    padding: 0.8rem 1.1rem;
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ctas .hero-cta {
    transition: none;
  }
}

.social-links {
  display: flex;
  gap: 2rem;
  margin: 2rem auto;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

.social-icon:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-5px);
}
.cta-div {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 2rem;
}
.cta-button {
  display: inline-block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
}

.cta-button:hover {
  transform: scale(1.12) rotate(5deg);
  box-shadow: 0 18px 46px rgba(74, 144, 226, 0.45);
  color: white;
  animation: none; /* stop pulse animation on hover to keep it large */
}

/* CTA attention animation */
@keyframes cta-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
  }
  50% {
    transform: scale(1.12);
    box-shadow: 0 20px 50px rgba(74, 144, 226, 0.5),
      0 0 20px rgba(0, 212, 255, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
  }
}

.cta-button {
  /* subtle attention animation to help the user find CTA */
  animation: cta-pulse 4s ease-in-out 1s infinite;
}

.cta-button:focus-visible {
  outline: 3px solid rgba(0, 212, 255, 0.6);
  outline-offset: 4px;
  transform: scale(1.08);
  box-shadow: 0 20px 50px rgba(74, 144, 226, 0.45);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .cta-button {
    animation: none !important;
    transition: transform 0.15s ease !important;
  }
}



/* About Section */
.about-section, .how-i-work-section {
  /* background-color: var(--card-bg); */
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.05),
    rgba(0, 212, 255, 0.05)
  );
  margin-top: 4rem;
}


/* Skills Section */
.skills-section {
  padding: 4rem 0;
}

.section-title {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.section-subtitle-text {
  text-align: center;
  font-size: 1rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 0.5rem;
}

.title-underline {
  width: 100px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  margin: 0 auto 3rem;
}





/* Contact Section */
.contact-section {
  padding: 6rem 0;
  background: linear-gradient(
    135deg,
    var(--bg-color) 0%,
    rgba(74, 144, 226, 0.15) 50%,
    var(--bg-color) 100%
  );
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 80%,
      rgba(74, 144, 226, 0.2) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(0, 212, 255, 0.2) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.contact-location {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease 0.2s both;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.contact-location i {
  color: var(--primary-color);
  font-size: 1rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: var(--transition);
  position: relative;
  animation: fadeInUp 1s ease 0.4s both;
}

.contact-email i {
  color: var(--primary-color);
  font-size: 1.2rem;
  transition: var(--transition);
}

.contact-email::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transition: var(--transition);
}

.contact-email:hover::after {
  width: 100%;
}

.contact-email:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.contact-email:hover i {
  color: var(--secondary-color);
  transform: scale(1.1);
}

.contact-social {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-top: 2rem;
  animation: fadeInUp 1s ease 0.6s both;
}

.contact-social .social-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--card-bg), rgba(255, 255, 255, 0.1));
  border: 2px solid rgba(74, 144, 226, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  animation: pulse 3s infinite;
}

.contact-social .social-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    rgba(74, 144, 226, 0.3) 0%,
    transparent 70%
  );
  transition: all 0.5s ease;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.contact-social .social-icon:hover::before {
  width: 120px;
  height: 120px;
}

.contact-social .social-icon:hover {
  transform: translateY(-8px) scale(1.4);
  box-shadow: 0 20px 50px rgba(74, 144, 226, 0.6);
  border-color: var(--primary-color);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

.contact-social .social-icon:nth-child(1) {
  animation: bounceIn 1s ease 0.8s both, pulse 3s infinite 1.8s;
}

.contact-social .social-icon:nth-child(2) {
  animation: bounceIn 1s ease 1s both, pulse 3s infinite 2s;
}

.contact-social .social-icon:nth-child(3) {
  animation: bounceIn 1s ease 1.2s both, pulse 3s infinite 2.2s;
}

.contact-social .social-icon:nth-child(1):hover,
.contact-social .social-icon:nth-child(2):hover,
.contact-social .social-icon:nth-child(3):hover {
  animation-play-state: paused;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
  }
  70% {
    transform: scale(0.9) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.py-90{
  padding-top:90px;
  padding-bottom:90px;
}

/* Footer */
.footer {
  background-color: var(--card-bg);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  /* margin-top: 4rem; */
}

.footer-brand .logo-icon {
  height: 40px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

/* Ensure theme switching works for footer logos */
.footer-brand .logo-icon--light {
  display: inline-block;
}

.footer-brand .logo-icon--dark {
  display: none;
}

[data-theme="dark"] .footer-brand .logo-icon--light {
  display: none;
}

[data-theme="dark"] .footer-brand .logo-icon--dark {
  display: inline-block;
}

.footer-brand .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.footer-description {
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.6;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social .social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.1),
    rgba(0, 212, 255, 0.1)
  );
  border: 2px solid rgba(74, 144, 226, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.footer-social .social-link:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
}

.footer-heading {
  color: var(--text-color);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  position: relative;
}

.footer-heading::after {
  content: "";
  position: absolute;
  bottom: -8px;
  right: 0;
  width: 30px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  border-radius: 2px;
}

.footer-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.75rem;
}

.footer-nav a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.8;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.footer-nav a:hover {
  color: var(--primary-color);
  opacity: 1;
  transform: translateX(5px);
}

.footer-contact .contact-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  opacity: 0.8;
}

.footer-contact .contact-item i {
  color: var(--primary-color);
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.footer-contact .contact-item a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.8;
  transition: var(--transition);
}

.footer-contact .contact-item a:hover {
  color: var(--primary-color);
  opacity: 1;
}

/* FAQ Section */
.faq-section {
  padding: 4rem 0;
  background-color: var(--bg-color);
}

.faq-section h5 {
  color: var(--text-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
}

/* FAQ Accordion */
.accordion {
  background: transparent;
  border: none;
  margin-top: 1rem;
}

.accordion-item {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.03),
    rgba(0, 212, 255, 0.03)
  );
  border: 1px solid rgba(74, 144, 226, 0.1);
  border-radius: 12px !important;
  margin-bottom: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.accordion-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
  border-color: rgba(74, 144, 226, 0.2);
}

.accordion-button {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.05),
    rgba(0, 212, 255, 0.05)
  );
  color: var(--text-color);
  border: none;
  padding: 1.25rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px !important;
  box-shadow: none;
  transition: all 0.3s ease;
  position: relative;
}

.accordion-button:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.08),
    rgba(0, 212, 255, 0.08)
  );
  color: var(--primary-color);
  transform: translateX(4px);
}

.accordion-button:focus {
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.1),
    rgba(0, 212, 255, 0.1)
  );
}

.accordion-button:not(.collapsed) {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.accordion-button:not(.collapsed):hover {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  transform: none;
}

.accordion-button i {
  color: var(--primary-color);
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.accordion-button:not(.collapsed) i {
  color: white;
}

.accordion-body {
  padding: 1.5rem 1.75rem;
  color: var(--text-color);
  opacity: 0.9;
  line-height: 1.7;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(74, 144, 226, 0.1);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode adjustments for FAQ */
[data-theme="dark"] .faq-section {
  background-color: var(--bg-color);
}

[data-theme="dark"] .faq-section h5 {
  color: var(--text-color);
}

[data-theme="dark"] .accordion-item {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.05),
    rgba(0, 212, 255, 0.05)
  );
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .accordion-item:hover {
  box-shadow: 0 8px 25px rgba(74, 144, 226, 0.2);
  border-color: rgba(74, 144, 226, 0.3);
}

[data-theme="dark"] .accordion-button {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.08),
    rgba(0, 212, 255, 0.08)
  );
}

[data-theme="dark"] .accordion-button:hover {
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.12),
    rgba(0, 212, 255, 0.12)
  );
}

[data-theme="dark"] .accordion-body {
  background: rgba(0, 0, 0, 0.02);
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* Footer Bottom */
.footer-bottom-links {
  display: flex;
  gap: 2rem;
  justify-content: flex-end;
  align-items: center;
}

.footer-bottom-links a {
  color: var(--text-color);
  text-decoration: none;
  opacity: 0.6;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--primary-color);
  opacity: 1;
}

.footer-copyright {
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.6;
  margin: 0;
}

/* Responsive Footer */
@media (max-width: 991px) {
  .footer-social {
    justify-content: center;
  }

  .footer-bottom-links {
    justify-content: center;
    margin-top: 1rem;
  }

  .accordion-button {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }

  .accordion-body {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  .footer-brand {
    text-align: center;
  }

  .footer-heading {
    text-align: center;
  }

  .footer-heading::after {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-nav {
    text-align: center;
  }

  .footer-nav a:hover {
    transform: none;
  }

  .footer-contact {
    text-align: center;
  }

  .footer-contact .contact-item {
    justify-content: center;
  }

  .footer-bottom-links {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 576px) {
  .footer-social {
    gap: 0.75rem;
  }

  .footer-social .social-link {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .accordion-item {
    margin-bottom: 0.75rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.3);
  }
}

.fade-in {
  animation: fadeInUp 1s ease;
}

/* Responsive */
@media (max-width: 991px) {
  .hero-title {
    font-size: 3rem;
  }

  .section-title {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .about-content,
  .skills-content {
    padding: 2rem;
  }

  .work-card {
    height: 250px;
  }

  .profile-photo {
    width: 250px;
    height: 330px;
  }

  .hero-animation dotlottie-player {
    width: 200px !important;
    height: 200px !important;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }

  .cta-button {
    width: 100px;
    height: 100px;
    font-size: 1rem;
  }

  .navbar-nav .nav-link {
    margin: 0.5rem 0;
  }

  .theme-toggle {
    margin-left: 0;
    margin-top: 1rem;
  }

  .hero-animation dotlottie-player {
    width: 150px !important;
    height: 150px !important;
  }
}

/* Scroll animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.6s ease;
}

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

/* Homepage Half Face */
.face {
  width: 100%;
  max-width: 100%;
  position: relative;
  margin: 0 auto;
  min-height: clamp(360px, 58vw, 520px);
  aspect-ratio: 26 / 15;
}
/* ensure containing block for absolutely positioned wave */
#section {
  position: relative;
  overflow: visible;
}
.face .face-img {
  display: block;
  margin: 0px auto;
  max-width: 100%;
  width: min(1040px, 100%);
  height: auto;
  aspect-ratio: 26 / 15;
}
.face a {
  color: var(--text-color);
  text-decoration: none;
}

.face a h1.accent {
  color: var(--logo-accent);
  font-size: 3.5rem;
  display: none; /* nascosto per default su schermi piccoli */
}

@media only screen and (min-width: 740px) {
  .face a h1.accent {
    font-size: 3.5rem;
  }
}
.face a .writer {
  font-family: "Charm", cursive;
}
.face a .coder {
  font-family: "Cascadia Code", monospace;
  text-align: end;
}

.face .coder,
.face .writer {
  position: absolute;
  width: 40%;
  display: block;
  z-index: 10;
  height: 20%;
  /* vertical centering */
  margin: auto;
  top: 0;
  bottom: 0;
}
.face .coder h1,
.face .writer h1 {
  display: none;
}
.face .writer {
  left: 0;
}
.face .coder {
  right: 0;
  text-align: right;
}
.face .writer-img,
.face .coder-img,
.face .writer-bg,
.face .coder-bg,
.face .coder p,
.face .writer p {
  display: none;
}
@media only screen and (min-width: 320px) {
  .face .coder h1,
  .face .writer h1 {
    display: block;
    font-size: 22px;
    font-size: 2.2rem;
  }
  .face .coder h1 span,
  .face .writer h1 span {
    line-height: 1;
  }
  .face .coder h1 span.chevron-left,
  .face .writer h1 span.chevron-left {
    padding: 0 0.1em 0 0;
  }
  .face .coder h1 span.chevron-right,
  .face .writer h1 span.chevron-right {
    padding: 0 0 0 0.14em;
  }
}
@media only screen and (min-width: 375px) {
  .face .coder h1,
  .face .writer h1 {
    font-size: 26px;
    font-size: 2.6rem;
  }
}
@media only screen and (min-width: 414px) {
  .face .coder h1,
  .face .writer h1 {
    font-size: 30px;
    font-size: 3rem;
  }
}
@media only screen and (min-width: 500px) {
  .face .coder h1,
  .face .writer h1 {
    font-size: 36px;
    font-size: 3.6rem;
  }
}
@media only screen and (min-width: 600px) {
  .face .coder h1,
  .face .writer h1 {
    font-size: 46px;
    font-size: 4.6rem;
  }
}
@media only screen and (min-width: 768px) {
  .face .coder,
  .face .writer {
    width: 30%;
    height: 44%;
  }
  .face .coder h1,
  .face .writer h1 {
    font-size: 56px;
    font-size: 5.6rem;
  }
  .face .coder p,
  .face .writer p {
    display: block;
    font-size: 16px;
    font-size: 1.6rem;
    margin: 0px;
  }
  .face a h1.accent {
    display: block;
  }
}
@media only screen and (min-width: 900px) {
  .face .coder,
  .face .writer {
    width: 32%;
  }
  .face .coder h1,
  .face .writer h1 {
    font-size: 64px;
    font-size: 6.4rem;
  }
}
@media only screen and (min-width: 1024px) {
  .face .coder,
  .face .writer {
    width: 30%;
  }
  .face .coder h1,
  .face .writer h1 {
    font-size: 72px;
    font-size: 7.2rem;
  }
  .face .coder p,
  .face .writer p {
    font-size: 18px;
    font-size: 1.8rem;
    line-height: 1.4;
  }
}
@media only screen and (min-width: 1140px) {
  .face {
    width: 100%;
    height: 600px;
    position: relative;
    margin: 0 0;
    aspect-ratio: auto;
    /* Face images */
    /* Background images */
    /* Hide default image with no effects */
  }
  .face .coder,
  .face .writer {
    width: 32%;
    height: 600px;
    top: 0px;
    position: absolute;
  }
  .face .coder h1,
  .face .writer h1 {
    font-size: 82px;
    font-size: 8.2rem;
  }
  .face .coder .description,
  .face .writer .description {
    position: absolute;
    top: 180px;
    width: 290px;
  }
  .face .coder .arrow,
  .face .writer .arrow {
    width: 85px;
    height: 140px;
    background: url("assets/images/mdb_creative_writer.png") no-repeat;
    display: block;
    position: absolute;
    top: 20px;
  }
  .face .coder {
    text-align: left;
    right: 0px;
  }
  .face .coder .description {
    right: 0px;
  }
  .face .coder .arrow {
    right: 0px;
    background-position: 0px -751px;
  }
  .face .writer {
    left: 0px;
  }
  .face .writer .description {
    left: 0px;
  }
  .face .writer .arrow {
    left: 0px;
    background-position: 0px -892px;
  }
  .face .writer-img,
  .face .coder-img {
    width: 420px;
    height: 600px;
    position: absolute;
    top: 0;
    display: block;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
  }
  .face .writer-img {
    background-image: url("./../images/mdb_creative_writer.png");
    left: 310px;
    clip-path: inset(0 50% 0 0);
  }
  .face .coder-img {
    background-image: url("./../images/mdb_web_developer.png");
    left: 310px;
    clip-path: inset(0 0 0 50%);
  }
  .face .writer-bg,
  .face .coder-bg {
    width: 420px;
    height: 200px;
    position: absolute;
    bottom: 0px;
    background: url("./../images/mdb_creative_writer.png") 0 -1300px no-repeat;
    display: block;
  }
  .face .writer-bg {
    left: 100px;
  }
  .face .coder-bg {
    right: 100px;
    background-position: 100% -1300px;
  }
  .face .face-img {
    display: none;
  }
}

/* Tech carousel (marquee-like row of icons) */
.tech-carousel {
  margin: 2rem 0 1.5rem;
  overflow: hidden;
  width: 100%;
  display: flex;
}
.tech-track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 1rem 0;
  padding-right: 2.5rem; /* Match gap for seamless loop */
  animation: tech-marquee 20s linear infinite;
  flex-shrink: 0;
}
.tech-track-reverse {
  /* animation: tech-marquee-reverse 18s linear infinite; */
  /* Use same animation as tech-track for seamless single row */
}
.tech-track + .tech-track {
  margin-left: 0;
}
.tech-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 120px;
  color: var(--text-color);
  opacity: 0.95;
}
.tech-item i {
  font-size: 1.6rem;
  color: var(--primary-color);
}
.tech-item span {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
}

/* SVG icon support for the carousel: sized and responsive. */
.tech-item img.tech-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: inline-block;
  filter: none;
}

/* Larger icons on desktop */
@media (min-width: 992px) {
  .tech-item img.tech-icon {
    width: 44px;
    height: 44px;
  }
}

/* If SVGs are colored, keep their colors; if they use currentColor, tint to primary */
.tech-item img.tech-icon[currentColor] {
  color: var(--primary-color);
}

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

@keyframes tech-marquee-reverse {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Pause animation on hover for accessibility */
.tech-carousel:hover .tech-track {
  animation-play-state: paused;
}

@media (max-width: 768px) {
  .tech-track {
    gap: 1.2rem;
    padding-right: 1.2rem;
    animation-duration: 22s;
  }
  .tech-item {
    min-width: 90px;
  }
  .tech-item i {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-track {
    animation: none;
  }
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.back-to-top:hover {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .back-to-top {
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .back-to-top:hover {
  box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

/* Skill Cards */
.skill-card {
  background: transparent;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  opacity: 0;
  transform: translateY(30px);
  animation: skillCardFadeIn 0.8s ease forwards;
}

.skill-card:nth-child(1) {
  animation-delay: 0.1s;
}
.skill-card:nth-child(2) {
  animation-delay: 0.3s;
}
.skill-card:nth-child(3) {
  animation-delay: 0.5s;
}

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

.skill-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .skill-card {
  box-shadow: 0 8px 32px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .skill-card:hover {
  box-shadow: 0 20px 60px rgba(255, 255, 255, 0.2);
}

.skill-card-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 1.5rem;
  text-align: center;
}

.skill-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.skill-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.5px;
}

.skill-card-body {
  padding: 1.5rem;
}

.skill-card-body p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 1.5rem;
}

.skill-badges {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.skill-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(
    135deg,
    rgba(74, 144, 226, 0.1),
    rgba(0, 212, 255, 0.1)
  );
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: 25px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  transition: all 0.3s ease;
  cursor: default;
  opacity: 0;
  transform: translateY(10px);
  animation: skillBadgeFadeIn 0.6s ease forwards;
}

.skill-badge:nth-child(1) {
  animation-delay: 0.8s;
}
.skill-badge:nth-child(2) {
  animation-delay: 0.9s;
}
.skill-badge:nth-child(3) {
  animation-delay: 1s;
}
.skill-badge:nth-child(4) {
  animation-delay: 1.1s;
}
.skill-badge:nth-child(5) {
  animation-delay: 1.2s;
}

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

.skill-badge:hover {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.skill-badge i {
  font-size: 1rem;
}

.skill-badge .skill-icon {
  width: 1rem;
  height: 1rem;
  object-fit: contain;
}

.skill-badge span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .skill-badges {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
  .skill-card-header {
    padding: 1rem;
  }
  .skill-card-body {
    padding: 1rem;
  }
}

/* Custom Tooltip Styles */
.tooltip-inner {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.85rem;
  border-radius: 6px;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before,
.tooltip.bs-tooltip-bottom .tooltip-arrow::before,
.tooltip.bs-tooltip-left .tooltip-arrow::before,
.tooltip.bs-tooltip-right .tooltip-arrow::before {
  border-color: var(--primary-color);
}

/* Gallery Image Uniform Sizing */
.gallery-img {
  height: 250px;
  object-fit: cover;
  width: 100%;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.gallery-img:hover {
  transform: scale(1.05);
}

.ecosystem-img {
  max-width: 420px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

.section-img {
  height: 320px;
  object-fit: cover;
  width: 100%;
  max-width: 480px;
  display: block;
  margin: 0 auto;
}
