:root {
  --flow1: #00e0ff;
  --flow2: #ff00ff;
  --flow3: #00ff99;
  --flow4: #ff004f;
  --dark-main: #0a0a13;
  --dark-alt: #1a1a24;
  --card-radius: 14px;
  --transition: 0.3s cubic-bezier(0.75, 0, 0.175, 1);
}

/* ===== RESET / BASE ===== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--dark-main);
  color: #fff;
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  /* Più spazio in fondo per player sticky e safe-area */
  padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
}
img, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5 { font-weight: 700; margin: 0 0 .5rem; }
a { color: #fff; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--flow4); }
:focus-visible { outline: 2px solid var(--flow4); outline-offset: 2px; }

/* Evita che gli anchor link si nascondano sotto la navbar sticky */
[id] { scroll-margin-top: 76px; }

/* ===== NAVBAR (sticky) ===== */
.custom-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10,10,19,.92);
  padding: 4px 0; /* Navbar più compatta */
  border-bottom: 1px solid #18182480;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.custom-navbar .logo { 
  height: 64px;   /* Logo un po' più grande senza esagerare */
  transition: transform var(--transition);
}
.custom-navbar .logo:hover { transform: scale(1.05); }

@media (max-width: 768px) {
  .custom-navbar .logo { height: 40px; }
}

/* ===== HERO con video sotto e card sopra ===== */
.hero {
  position: relative;              /* fondamentale per lo stacking */
  /* isolamento per creare un contesto di stacking dedicato e garantire che la card resti sopra */
  isolation: isolate;
  min-height: clamp(60vh, 70vh, 82vh);
  padding: clamp(80px, 10vw, 120px) 0 clamp(50px, 7vw, 80px);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero .container {
  position: relative;
  z-index: 3;                      /* sopra overlay e video */
  width: 100%;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;                      /* video in basso */
  overflow: hidden;
  background: var(--dark-main);
  pointer-events: none;            /* il video non intercetta click */
}
.hero-bg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(1.08) brightness(.6) contrast(1.05);
  transform: translateZ(0);
  /* Evita scroll-jank su alcuni device */
  will-change: transform;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;                      /* sopra il video, sotto la card */
  pointer-events: none;
  background:
    radial-gradient(1200px 500px at 12% 18%, rgba(0,224,255,0.10), transparent 12%),
    radial-gradient(1000px 420px at 88% 82%, rgba(255,0,79,0.08), transparent 14%),
    linear-gradient(180deg, rgba(10,10,19,0.50) 0%, rgba(10,10,19,0.30) 30%, rgba(10,10,19,0.64) 100%);
}

/* Card/CTA sopra il video */
.hero-card {
  position: relative;
  z-index: 4;                      /* garantisce che sia SOPRA */
  max-width: 720px;
  width: min(92%, 720px);
  margin: 0 auto;
  padding: 20px;
  background: rgba(18,18,28,0.70);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--card-radius);
  box-shadow: 0 8px 26px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform var(--transition), box-shadow var(--transition);
   margin-bottom: 36px;
}
.hero-card:hover {
  /* Mantieni la centratura, aggiungi l'effetto hover */
  transform: translate(-50%, calc(-50% - 4px));
  box-shadow: 0 12px 32px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.08);
}
.hero-card h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.hero-card .lead { color: #ddd; font-size: clamp(1rem, 3vw, 1.15rem); margin-bottom: 12px; }
.hero-card audio { width: 100%; max-width: 560px; margin-inline: auto; display: block; }

/* ===== VIDEO SLIDE (secondo blocco video) ===== */
.video-slide {
  position: relative;
  isolation: isolate;              /* stesso ragionamento della HERO */
  min-height: clamp(45vh, 55vh, 70vh);
  padding: clamp(50px, 8vw, 80px) 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.video-slide .container { position: relative; z-index: 3; width: 100%; }
.video-slide-bg {
  position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--dark-main); pointer-events: none;
}
.video-slide-bg video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center center;
  filter: saturate(1.1) brightness(.65) contrast(1.1);
  transform: translateZ(0);
}
.video-slide-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(1000px 400px at 15% 20%, rgba(0,224,255,0.12), transparent 15%),
    radial-gradient(900px 380px at 85% 80%, rgba(255,0,79,0.10), transparent 15%),
    linear-gradient(180deg, rgba(10,10,19,0.55) 0%, rgba(10,10,19,0.35) 30%, rgba(10,10,19,0.65) 100%);
}
.video-slide-card {
  position: relative; z-index: 4;
  max-width: 660px;
  width: min(92%, 660px);
  margin: 0 auto;
  padding: 18px;
  background: rgba(18,18,28,0.75);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--card-radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform var(--transition), box-shadow var(--transition);
}
.video-slide-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.10); }
.video-slide-card h2 { font-size: clamp(1.5rem, 4.2vw, 1.9rem); margin: 0 0 8px; }
.video-slide-card .lead { color: #ddd; font-size: clamp(.95rem, 2.6vw, 1.1rem); }

/* ===== ABOUT ===== */
.about-section {
  position: relative;
  padding: clamp(40px, 8vw, 60px) 0;
  background:
    radial-gradient(900px 400px at 12% 20%, rgba(0,224,255,0.05), transparent 30%),
    radial-gradient(800px 360px at 88% 80%, rgba(255,0,79,0.05), transparent 30%),
    #0f0f17;
}
.about-section .container { position: relative; z-index: 1; }
.about-photo {
  width: clamp(80px, 20vw, 110px);
  height: clamp(80px, 20vw, 110px);
  border-radius: 50%;
  border: 3px solid var(--flow4);
  box-shadow: 0 0 20px #ff00ff55;
  object-fit: cover;
  background: #000;
}

/* ===== GENERIC SECTION / MUSIC ===== */
.section { padding: clamp(40px, 7vw, 60px) 0; }

.card {
  background: rgba(26,26,36,.95);
  border: none;
  border-radius: var(--card-radius);
  transition: transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 8px 20px rgba(0,0,0,.5), 0 0 15px var(--flow4); }
.track-card {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px; height: 100%;
}
.track-card .cover { font-size: 30px; margin-bottom: 8px; color: var(--flow4); filter: drop-shadow(0 0 6px var(--flow2)); }
.card h5 { font-size: 1rem; font-weight: 600; margin: 0 0 8px; text-align: center; }
.card audio { width: 100%; outline: none; }
.music-album-title {
  background: linear-gradient(90deg, var(--flow1), var(--flow2), var(--flow3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700; font-size: 1.2rem; letter-spacing: .03em; margin: 22px 0 14px;
}

/* ===== CONTACT ===== */
.form { max-width: 760px; margin: 0 auto; }
form input, form select, form textarea {
  width: 100%; margin-bottom: 10px; padding: 10px 12px;
  border: none; border-radius: 6px; background: #1c1c1c; color: #fff; font-size: 1rem;
  transition: outline .2s, box-shadow .2s, background-color .2s;
}
form input::placeholder, form textarea::placeholder { color: #a7a7a7; }
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid var(--flow4); box-shadow: 0 0 6px #ff00ff66; background-color: #202020;
}
.btn {
  display: inline-block; padding: 12px 24px;
  background: linear-gradient(90deg, var(--flow4), var(--flow2));
  border: none; color: #fff; border-radius: 6px; cursor: pointer;
  font-weight: 600; font-size: 1rem;
  transition: background .3s, box-shadow .3s, transform .2s;
}
.btn:hover { background: linear-gradient(90deg, var(--flow3), var(--flow2), var(--flow1)); box-shadow: 0 0 15px #ff00ff66; transform: scale(1.03); }

/* ===== GLOBAL STICKY PLAYER ===== */
.global-player {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 1200;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(8,8,12,.98), rgba(12,12,18,.96));
  border-top: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 -6px 20px rgba(0,0,0,.4);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.gp-left { display: flex; gap: 10px; align-items: center; flex: 1 1 240px; min-width: 200px; }
.gp-playbtn {
  width: 42px; height: 42px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, var(--flow4), var(--flow2));
  color: #fff; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
.gp-info {
  font-weight: 600; font-size: .9rem; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px;
}
.gp-progress { flex: 2 1 320px; display: flex; align-items: center; gap: 8px; min-width: 220px; }
.gp-bar { height: 5px; background: rgba(255,255,255,.1); border-radius: 5px; position: relative; flex: 1 1 auto; cursor: pointer; }
.gp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--flow3), var(--flow1)); border-radius: 5px; transition: width .1s linear; }
.gp-time { min-width: 80px; font-size: .85rem; color: #ccc; text-align: right; }
.gp-controls { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.gp-control-btn { background: transparent; border: none; color: #fff; font-size: 1rem; cursor: pointer; opacity: .85; transition: opacity .2s, transform .2s; }
.gp-control-btn:hover { opacity: 1; transform: translateY(-1px); }

/* ===== FOOTER ===== */
.footer { background: #000; color: #aaa; font-size: .92rem; padding: 16px 0; border-top: 1px solid #18182480; }
.footer p { margin: 0; }

/* ===== ACCESSIBILITY ===== */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 992px) {
  .hero, .video-slide { min-height: 60vh; padding: 80px 0 50px; }
  .hero-card h1, .video-slide-card h2 { font-size: clamp(1.6rem, 4.6vw, 2rem); }
  .hero-card .lead, .video-slide-card .lead { font-size: clamp(.95rem, 3vw, 1.1rem); }
  .about-section { padding: clamp(30px, 6vw, 50px) 0; }
  .gp-info { max-width: 300px; }
}
@media (max-width: 768px) {
  .spotify-table th:nth-child(4), .spotify-table td:nth-child(4), /* Artista */
  .spotify-table th:nth-child(5), .spotify-table td:nth-child(5)  /* Album */
  { display: none; }
}
@media (max-width: 576px) {
  .spotify-table th:nth-child(2), .spotify-table td:nth-child(2) { display: none; }
}

/* Usa i viewport dinamici su browser moderni per migliorare l'occupazione verticale */
@supports (height: 100dvh) {
  .hero { min-height: 70dvh; }
  .video-slide { min-height: 55dvh; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-card:hover, .video-slide-card:hover, .card:hover { transform: none !important; }
}

.track-card {
  background: linear-gradient(140deg, #181824 60%, #22223a 100%);
  border-radius: 18px;
  padding: 28px 18px 22px 18px;
  min-width: 190px;
  max-width: 230px;
  width: 100%;
  margin-bottom: 0;
  box-shadow: 0 6px 32px 0 #0006, 0 1px 0 0 #2223;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.14s, box-shadow 0.14s, background 0.3s;
  position: relative;
}
.track-card:hover {
  transform: translateY(-8px) scale(1.04);
  background: linear-gradient(130deg, #282c3a 60%, #ff004f 100%);
  box-shadow: 0 14px 48px 0 #0008, 0 2px 0 0 #2224;
}
.track-card .cover {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff00ff 0%, #00e0ff 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.7rem;
  margin-bottom: 15px;
  box-shadow: 0 4px 18px #ff00ff, 0 1px 0 #fff2;
}
.track-card h5 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
  text-align: center;
  text-shadow: 0 2px 12px #0004;
}
.track-card audio {
  width: 100%;
  margin-top: 10px;
  border-radius: 12px;
  background: #15151f;
  outline: none;
  min-height: 36px;
}
@media (max-width: 991px) {
  .track-card {
    min-width: 160px;
    max-width: 200px;
    padding: 22px 10px 16px 10px;
  }
  .track-card .cover {
    width: 48px;
    height: 48px;
    font-size: 2rem;
  }
}
@media (max-width: 700px) {
  .track-card {
    min-width: 100px;
    max-width: 370px;
    width: 95vw;
    margin-bottom: 0;
    padding: 18px 10px 12px 10px;
  }
}

/* Stili per sezione Music in stile Spotify */
.music-section {
  background: #181818;
  padding: 2rem 0;
}
.table-dark {
  background: transparent;
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(255,255,255,0.1);
}
.table th {
  color: #b3b3b3;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.table td {
  color: #fff;
}
.track-row {
  cursor: pointer;
  transition: background-color 0.2s;
}
.track-row:hover {
  background: rgba(255,255,255,0.1) !important;
}
.track-row.active {
  background: rgba(13, 110, 253, 0.2) !important;
}
.track-cover {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}
.track-duration {
  color: #b3b3b3;
}
#playlistList {
  max-height: 200px;
  overflow-y: auto;
}
#playlistList .list-group-item {
  background: transparent;
  color: #fff;
  cursor: pointer;
}
#playlistList .list-group-item:hover {
  background: rgba(255,255,255,0.1);
}
#playlistList .list-group-item.active {
  background: rgba(13, 110, 253, 0.2);
  border-color: #0d6efd;
}

/* Stili per Global Player */
.global-player {
  position: sticky;
  bottom: 0;
  background: rgba(20, 20, 30, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  z-index: 1000;
  flex-wrap: wrap;
}
.gp-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 200px;
}
.gp-cover {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}
.gp-info {
  flex: 1;
}
.gp-progress {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 200px;
}
.gp-bar {
  flex: 1;
  height: 6px;
  background: #444;
  border-radius: 3px;
  cursor: pointer;
}
.gp-fill {
  height: 100%;
  background: #1db954; /* Verde Spotify */
  border-radius: 3px;
  transition: width 0.1s;
}
.gp-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.gp-control-btn, .gp-playbtn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  padding: 0.5rem;
}
.gp-control-btn:hover, .gp-playbtn:hover {
  color: #1db954;
}
.gp-control-btn.active {
  color: #1db954;
}

/* Responsività */
@media (max-width: 768px) {
  .spotify-table th:nth-child(4),
  .spotify-table td:nth-child(4),
  .spotify-table th:nth-child(5),
  .spotify-table td:nth-child(5) {
    display: none; /* Nasconde "Artista" e "Album" su schermi piccoli */
  }
}
@media (max-width: 576px) {
  /* Mantieni le stesse colonne nascoste, NON nascondere la colonna Titolo */
  .global-player {
    flex-direction: column;
    align-items: stretch;
  }
  .gp-left, .gp-progress, .gp-controls {
    min-width: 100%;
    justify-content: center;
  }
  .gp-controls {
    justify-content: space-around;
  }
  .track-cover {
    width: 30px;
    height: 30px;
  }
}
@media (max-width: 400px) {
  .gp-control-btn, .gp-playbtn {
    font-size: 1rem;
    padding: 0.3rem;
  }
  .gp-cover {
    width: 40px;
    height: 40px;
  }
}
.equalizer {
  display: flex;
  align-items: flex-end;
  height: 32px;
  gap: 3px;
  margin-bottom: 10px;
}
.equalizer span {
  display: block;
  width: 5px;
  height: 12px;
  background: #1ed760;
  border-radius: 2px;
  opacity: 0.7;
  transform: scaleY(0.5);
  animation: eqMove 1s infinite linear alternate;
  animation-play-state: paused;
}
.equalizer.active span {
  animation-play-state: running;
}
.equalizer.active span:nth-child(1) { animation-delay: 0.1s; }
.equalizer.active span:nth-child(2) { animation-delay: 0.3s; }
.equalizer.active span:nth-child(3) { animation-delay: 0.5s; }
.equalizer.active span:nth-child(4) { animation-delay: 0.7s; }
.equalizer.active span:nth-child(5) { animation-delay: 0.9s; }

@keyframes eqMove {
  0% { transform: scaleY(0.3);}
  50% { transform: scaleY(1);}
  100% { transform: scaleY(0.4);}
}
.banner-equalizer {
  width: 100vw;
  max-width: 100%;
  height: 90px;
  display: block;
  margin: 0 auto;
  background: transparent;
  position: relative;
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 600px) {
  .banner-equalizer { height: 54px; }
}
.blog-card,
.blog-card * {
  color: #fff !important;
}
.about-equalizer-canvas {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  height: 90px;
  display: block;
  margin: 0;
  padding: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
  border-radius: 0;
  box-shadow: none;
}
@media (max-width: 600px) {
  .about-equalizer-canvas { height: 54px; }
}
.about-section { margin-bottom: 0; }
#music.section.music-section { margin-top: 0; padding-top: 0.5rem; }

.footer .social-links {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: flex-end;
}
.footer .social-icon {
  font-size: 2rem;
  color: #fff;
  transition: color 0.2s, transform 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer .social-icon.ig:hover { color: #e4405f; }
.footer .social-icon.yt:hover { color: #ff0000; }
@media (max-width: 767px) {
  .footer .container {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }
  .footer .social-links {
    justify-content: center;
    margin-top: 10px;
  }
}
