/* CYBERPUNK.CSS - Effetti neon, glitch, matrix, darkmode, responsive */

/* Neon glow e glitch text */
.glitch-text {
  position: relative;
  display: inline-block;
  height: 3.8rem;
  min-height: 3.8rem;
  max-width: 100vw;
  line-height: 3.8rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--neon-cyan);
  font-family: var(--font-title);
  text-shadow: 0 0 8px var(--neon-cyan), 0 0 16px var(--neon-magenta);
  animation: cyber-glitch 2.5s infinite linear alternate-reverse;
}
.glitch-text > span, .glitch-text::before, .glitch-text::after {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0.7;
  pointer-events: none;
}
.glitch-text::before {
  color: var(--neon-magenta);
  z-index: -1;
  transform: translate(2px, 0);
  mix-blend-mode: lighten;
}
.glitch-text::after {
  color: var(--neon-yellow);
  z-index: -2;
  transform: translate(-2px, 0);
  mix-blend-mode: lighten;
}
@keyframes cyber-glitch {
  0% { text-shadow: 2px 0 0 var(--neon-magenta), -2px 0 0 var(--neon-yellow); }
  20% { text-shadow: -2px 0 0 var(--neon-cyan), 2px 0 0 var(--neon-yellow); }
  40% { text-shadow: 2px 2px 0 var(--neon-magenta), -2px -2px 0 var(--neon-yellow); }
  60% { text-shadow: 0 2px 0 var(--neon-cyan), 0 -2px 0 var(--neon-magenta); }
  80% { text-shadow: 2px 2px 0 var(--neon-yellow), -2px -2px 0 var(--neon-cyan); }
  100% { text-shadow: 2px 0 0 var(--neon-magenta), -2px 0 0 var(--neon-yellow); }
}

/* Neon button glow */
.cyber-btn.neon {
  box-shadow: 0 0 16px var(--neon-cyan), 0 0 40px var(--neon-magenta);
  text-shadow: 0 0 8px var(--neon-cyan);
}

/* Responsive tweaks */
@media (max-width: 700px) {
  .cyber-nav ul { gap: 1rem; }
  .cyber-hero h1 { font-size: 2rem; }
  .cyber-section { padding: 1rem 0.5rem; }
}

/* Overlay scanlines */
.scanlines-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 100;
  background: repeating-linear-gradient(
    to bottom, rgba(0,255,255,0.06) 0px, rgba(0,255,255,0.06) 2px, transparent 2px, transparent 4px
  );
  mix-blend-mode: lighten;
  opacity: 0.18;
}

/* Overlay noise */
.noise-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 101;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/><feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.1 0"/></filter><rect width="100%" height="100%" filter="url(%23noise)"/></svg>');
  opacity: 0.12;
  mix-blend-mode: screen;
}

/* Overlay flash */
.flash-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  background: white;
  opacity: 0;
  transition: opacity 0.13s;
}
.flash-overlay.active {
  opacity: 0.85;
}

/* Project card cyberpunk */
.project-card {
  background: rgba(10,10,30,0.85);
  border: 2px solid var(--neon-cyan);
  border-radius: 12px;
  box-shadow: 0 0 18px var(--neon-cyan), 0 0 40px var(--neon-magenta);
  padding: 2rem 1.3rem 1.3rem 1.3rem;
  transition: transform 0.23s, box-shadow 0.23s;
  position: relative;
  overflow: hidden;
  animation: cyber-card-in 1.1s cubic-bezier(.7,-0.2,.3,1.3);
  min-height: 200px;
}
.project-card:hover {
  transform: scale(1.045) rotate(-1deg);
  box-shadow: 0 0 32px var(--neon-magenta), 0 0 80px var(--neon-cyan);
  border-color: var(--neon-magenta);
}
@keyframes cyber-card-in {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Matrix, particles, 3D canvas layers */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 0 !important;
  pointer-events: none;
  opacity: 0.7;
}

.cyber-section, .cyber-hero, .projects-grid, .project-card, .cyber-header, .cyber-footer {
  position: relative;
  z-index: 2;
  background: rgba(10, 10, 30, 0.85);
  box-shadow: 0 2px 32px 0 rgba(0,255,255,0.10), 0 0 36px 0 rgba(240,0,255,0.08);
  backdrop-filter: blur(3.5px);
}

/* Legacy header styles - now handled by nav-modern.css */
.minimal-header {
  display: none; /* Hide old header in favor of new cyber-header */
}

/* Overlay mobile navbar: see unified dark style at bottom (.navbar-overlay, .navbar-overlay.is-active) */

/* HERO AVATAR */
.hero-grid {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  margin-bottom: 2.2rem;
}
.hero-avatar {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 18px 0 rgba(56,230,209,0.07);
  position: relative;
}
.hero-avatar img.avatar-image {
  display: block !important; 
  opacity: 1 !important;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  z-index: 5; 
}
.hero-avatar .avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.hero-avatar img:empty, .hero-avatar img:not([src]) {
  display: none;
}
.hero-avatar img[style*="display: none"] ~ .avatar-initials {
  display: flex;
}
.hero-avatar img[style*="display: block"] ~ .avatar-initials {
  display: none;
}
.avatar-initials {
  font-family: var(--font-title);
  font-size: 2.9rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 8px #38e6d1;
}
.hero-content {
  flex: 1;
}
.hero-headline {
  font-family: var(--font-title);
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
  letter-spacing: 1.1px;
}
.hero-bio {
  color: var(--text-secondary);
  font-size: 1.08rem;
  margin-bottom: 1.2rem;
}
.hero-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  margin-top: 2rem;
}
.hero-link img, .contact-link img {
  width: 28px;
  height: 28px;
  min-width: 24px;
  min-height: 24px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 8px 0 rgba(56,230,209,0.06);
  transition: transform 0.14s, box-shadow 0.14s;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.2em;
  opacity: 1;
  filter: none;
}
.hero-link:hover img, .hero-link:focus img {
  transform: scale(1.15) rotate(-4deg);
  box-shadow: 0 2px 16px 0 var(--accent, #38e6d1, 0.19);
}
.hero-actions {
  margin-top: 0.7rem;
}

/* Responsive hero */
@media (max-width: 700px) {
  .hero-grid { flex-direction: column; gap: 1.1rem; align-items: flex-start; }
  .hero-avatar { width: 80px; height: 80px; }
  .hero-content { width: 100%; }
}

/* Contatti con icone */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.1rem;
  align-items: center;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.04rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.14s;
}
.contact-link:hover, .contact-link:focus {
  color: #181924;
}
.contact-link img {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  margin-right: 0.4rem;
}

@media (max-width: 600px) {
  .contact-links { gap: 0.5rem; }
  .contact-link { font-size: 0.98rem; }
}


.minimal-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.2rem 2rem;
}
.logo-minimal {
  font-family: var(--font-title);
  font-size: 2.1rem;
  color: var(--accent);
  letter-spacing: 2.5px;
  text-decoration: none;
  font-weight: 700;
  padding-right: 1.2rem;
}
.navbar-center {
  flex: 2;
  display: flex;
  justify-content: center;
}
.navbar-menu {
  display: flex;
  gap: 2.4rem;
  list-style: none;
}
.navbar-menu a {
  color: #fff;
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  transition: color 0.22s, text-shadow 0.22s;
  padding-bottom: 4px;
  outline: none;
}
.navbar-menu a::after {
  content: '';
  display: block;
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, #00ffe7 60%, #ff00ea 100%);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform 0.22s cubic-bezier(.7,-0.2,.3,1.3);
  box-shadow: 0 0 8px #00ffe7, 0 0 18px #ff00ea77;
}
.navbar-menu a:hover::after,
.navbar-menu a.active::after,
.navbar-menu a:focus::after {
  transform: scaleX(1);
}
.navbar-menu a:hover,
.navbar-menu a:focus {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan), 0 0 30px #ff00ea77;
  animation: glitch-link 0.7s infinite linear alternate-reverse;
}
.navbar-menu a.active {
  color: #ff00ea;
  text-shadow: 0 0 12px #ff00ea, 0 0 38px #00ffe7;
}
@keyframes glitch-link {
  0% { text-shadow: 0 0 10px var(--neon-cyan); }
  20% { text-shadow: 2px 0 #ff00ea, -2px 0 #00ffe7; }
  40% { text-shadow: -2px 0 #00ffe7, 2px 0 #ff00ea; }
  60% { text-shadow: 0 2px #00ffe7, 0 -2px #ff00ea; }
  100% { text-shadow: 0 0 10px var(--neon-cyan); }
}
.navbar-menu a:focus {
  outline: 2.5px solid #ff00ea;
  outline-offset: 2px;
}
.navbar-menu .badge-new {
  background: linear-gradient(90deg, #ff00ea 60%, #00ffe7 100%);
  color: #181924;
  font-size: 0.7em;
  font-weight: 900;
  border-radius: 6px;
  padding: 0.08em 0.52em;
  margin-left: 0.5em;
  box-shadow: 0 0 8px #ff00ea, 0 0 18px #00ffe7;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.navbar-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.3rem;
}
.cta-minimal {
  font-size: 1.03rem;
  padding: 0.45rem 1.2rem;
  border-radius: 24px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  font-weight: 600;
  transition: background 0.18s, color 0.18s, border 0.18s;
  box-shadow: none;
  text-shadow: none;
}
.cta-minimal:hover, .cta-minimal:focus {
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--accent);
}

.cta-minimal:focus-visible {
  outline: 2px solid transparent;
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.6),
    0 0 12px var(--accent),
    0 0 24px var(--accent);
}

.cta-minimal:active:not([disabled]):not([aria-busy="true"]) {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.25);
}

.cta-minimal[disabled],
.cta-minimal[aria-busy="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Size variants */
.cta-minimal.cta--sm { font-size: 0.92rem; padding: 0.36rem 0.9rem; border-radius: 20px; }
.cta-minimal.cta--lg { font-size: 1.12rem; padding: 0.62rem 1.4rem; border-radius: 28px; }

/* Color variants */
.cta-minimal[data-variant="primary"] { --accent: var(--neon-cyan); }
.cta-minimal[data-variant="ghost"] {
  background: transparent;
  color: var(--text-main);
  border-color: rgba(255,255,255,0.35);
}
.cta-minimal[data-variant="ghost"]:hover,
.cta-minimal[data-variant="ghost"]:focus {
  background: rgba(255,255,255,0.08);
}
.cta-minimal[data-variant="danger"] { --accent: var(--neon-magenta); }

/* Loading state */
.cta-minimal.is-loading {
  position: relative;
  color: transparent !important;
}
.cta-minimal.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1em; height: 1em;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: cta-spin 0.8s linear infinite;
}
@keyframes cta-spin { to { transform: rotate(360deg); } }

/* Icon support */
.cta-minimal.has-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.cta-minimal .cta__icon { display: inline-flex; line-height: 0; }
.cta-minimal .cta__icon--end { order: 2; }

/* Contrast tweak when header is scrolled */
.scrolled .minimal-header .cta-minimal { box-shadow: 0 1px 8px rgba(24,25,36,0.08); }

.navbar-burger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  margin-left: 1.1rem;
}
.navbar-burger span {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--text-main);
  border-radius: 2px;
  transition: all 0.22s;
}
@media (max-width: 900px) {
  .navbar-center { display: none; }
  .navbar-burger { display: flex; }
  .navbar-right { gap: 0.6rem; }
}

/* Box e sezioni minimal */
.cyber-section, .cyber-hero, .projects-grid, .project-card {
  background: var(--box-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 18px 0 rgba(24,25,36,0.07);
  color: var(--text-main);
  padding: 2.2rem 2.2rem 2.2rem 2.2rem;
  margin-bottom: 2.2rem;
}

/* Stili avanzati per le card (Progetti e Interessi) */
.project-card, .interest-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 255, 0.2);
  padding: 1.5rem;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  position: relative;
}

.project-card::before, .interest-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(-10px);
}

.project-card:hover, .interest-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(0, 255, 255, 0.7);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), 0 0 40px rgba(0, 255, 255, 0.15);
}

.project-card:hover::before, .interest-card:hover::before {
  opacity: 0.9;
  transform: translateY(0);
}

.interest-card h3 {
  color: var(--primary-color);
  font-family: 'Orbitron', sans-serif;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}

.interest-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.interest-card blockquote {
  border-left: 3px solid var(--primary-color);
  padding-left: 1rem;
  margin: 0;
  font-style: italic;
  color: var(--text-primary);
}

.interest-card blockquote p {
  margin-bottom: 0.5rem;
}

.interest-card footer {
  font-style: normal;
  font-weight: bold;
  color: var(--primary-color);
  font-size: 0.9rem;
  opacity: 0.9;
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Titoli principali minimal e Glitch Effect */
.glitch-text, .cyber-hero h1, .cyber-section h2 {
  color: var(--text-main);
  font-family: var(--font-title);
  font-size: 2.2rem;
  letter-spacing: 2px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

/* Visibilità layer glitch nelle interest-card */
.interest-card .glitch-text .glitch-layers {
  display: none;
}
.interest-card:hover .glitch-text .glitch-layers {
  display: block;
}

/* --- Responsive Design --- */

/* Disattiva interazioni hover su dispositivi touch */
@media (hover: none) {
  #custom-cursor {
    display: none !important;
  }
  /* Evita layer glitch su touch */
  .interest-card .glitch-text .glitch-layers {
    display: none !important;
  }
  /* Niente animazione focus su link nel menu su touch */
  .navbar-menu a:focus {
    animation: none !important;
  }
}

/* Riduci le animazioni per accessibilità */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  .glitch-text { animation: none !important; }
  .navbar-menu a:focus { animation: none !important; }
  .project-card { animation: none !important; }
  .flash-overlay { transition: none !important; }
}

/* Stili per Tablet e Mobile (fino a 900px) */
@media (max-width: 900px) {
  body {
    font-size: 16px; /* Aumenta la leggibilità su mobile */
  }

  .container {
    padding: 0 1rem; /* Riduci il padding laterale */
  }

  .cyber-section,
  .cyber-hero {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .glitch-text,
  .cyber-hero h1,
  .cyber-section h2 {
    font-size: 1.8rem; /* Riduci la dimensione dei titoli */
    letter-spacing: 1.5px;
  }

  .hero-grid {
    text-align: center; /* Centra il testo nella hero section */
  }

  .hero-avatar {
    margin: 0 auto 1.5rem auto; /* Centra l'avatar */
  }

  .hero-links {
    justify-content: center; /* Centra le icone social */
  }

  .projects-grid,
  .interests-grid {
    grid-template-columns: 1fr; /* Stack le card in una singola colonna */
    gap: 1rem;
  }

  .project-card,
  .interest-card {
    padding: 1.2rem;
  }

  /* --- Inizio Stili Navbar Mobile --- */
  .navbar-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
    position: relative;
    transition: filter 0.18s;
  }

  .navbar-burger span {
    display: block;
    width: 26px;
    height: 3.5px;
    background: var(--accent, #00ffe7);
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.23s cubic-bezier(0.4, 1.4, 0.7, 1.1);
  }

  .navbar-burger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .navbar-burger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .navbar-burger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  .navbar-center {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    width: 100%;
  }

  .navbar-center.is-active {
    display: flex !important;
  }

  .navbar-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg-dark, #1a1b26);
    padding: 1rem 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color, #222);
    z-index: 1000;
    border-radius: 0 0 18px 18px;
  }

  .navbar-menu li {
    width: 100%;
    text-align: center;
  }

  .navbar-menu li a {
    display: block;
    padding: 1.1rem 1.5rem;
    width: 100%;
    color: var(--accent, #00ffe7) !important;
    font-size: 1.13em;
    font-weight: 600;
    letter-spacing: 2px;
    border-bottom: 1px solid #23233b;
    background: transparent;
    transition: background 0.18s, color 0.18s;
  }

  .navbar-menu li a:hover,
  .navbar-menu li a:focus {
    background: #181924;
    color: #ff00ea !important;
  }
  /* --- Fine Stili Navbar Mobile --- */
}

/* Overlay mobile navbar */
.navbar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 12, 20, 0.93);
  z-index: 999;
  backdrop-filter: blur(8px);
  transition: opacity 0.22s;
  opacity: 0;
  pointer-events: none;
}

.navbar-overlay.is-active {
  display: block;
  opacity: 1;
  pointer-events: all;
}

.projects-grid {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#cyber-cursor, #cyber-cursor-follower {
  position: fixed;
  pointer-events: none;
  z-index: 2000;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  transition: background 0.2s;
}
#cyber-cursor {
  width: 10px;
  height: 10px;
}
#cyber-cursor-follower {
  width: 30px;
  height: 30px;
  opacity: 0.5;
  border: 1px solid var(--neon-magenta);
  background: transparent;
}

