/* =========================================
   ACID HARDTEKNO — RAVER GLITCH SITE
   Dark glitch theme with psychedelic effects
   ========================================= */

:root {
  --bg: #05050a;
  --bg-alt: #0a0a12;
  --text: #00ff41;
  --text-dim: #00cc33;
  --accent: #ff00ff;
  --accent-2: #00ffff;
  --glitch: #ff0055;
  --panel: rgba(10, 10, 18, 0.85);
  --border: rgba(0, 255, 65, 0.35);
  --font-main: 'Courier New', Courier, monospace;
  --transition: 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Background canvas (psychedelic field) */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  display: block;
}

/* Header / Nav */
#header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 10, 0.6);
  backdrop-filter: blur(4px);
}

#nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.logo span {
  color: var(--text);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 0.4rem;
  cursor: pointer;
  z-index: 110;
}

.menu-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s var(--transition), opacity 0.25s var(--transition);
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.menu {
  display: flex;
  gap: 2rem;
}

.menu a {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  transition: opacity var(--transition), color var(--transition);
}

.menu a:hover {
  opacity: 1;
  color: var(--accent-2);
  text-shadow: 0 0 8px var(--accent-2);
}

/* Hero */
.hero {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}

.glitch {
  font-size: clamp(3rem, 12vw, 10rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 0.9;
  position: relative;
  color: var(--text);
  mix-blend-mode: difference;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.glitch::before {
  left: 2px;
  text-shadow: -1px 0 var(--accent);
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -1px 0 var(--glitch);
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.subtitle {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.7;
  color: var(--accent-2);
}

.cta {
  margin-top: 3rem;
  padding: 1.2rem 2.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: bold;
  border: 2px solid var(--text);
  color: var(--text);
  background: transparent;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.cta:hover {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 0 20px var(--text), 0 0 40px var(--text);
  transform: scale(1.05);
}

.cta:active {
  transform: scale(0.95);
}

/* Sections base */
section {
  position: relative;
  z-index: 10;
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
}

/* Track / Player */
.track-section {
  background: var(--panel);
  border: 1px solid var(--border);
}

.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.play-btn {
  padding: 1rem 2rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: bold;
  border: 2px solid var(--accent);
  color: var(--accent);
  transition: all var(--transition);
}

.play-btn:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 15px var(--accent);
}

.play-btn.playing {
  border-color: var(--text);
  color: var(--text);
  background: var(--text);
  box-shadow: 0 0 20px var(--text);
}

.visualizer {
  width: 100%;
  max-width: 600px;
  height: 120px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.visualizer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.15), transparent);
  animation: sweep 3s linear infinite;
}

/* Bio */
.bio-section {
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.bio-text {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 700px;
  opacity: 0.85;
}

/* Contact */
.contact-section {
  background: var(--panel);
  border: 1px solid var(--border);
}

.contact-text {
  font-size: 1.5rem;
  letter-spacing: 0.15em;
  color: var(--accent-2);
  text-shadow: 0 0 10px var(--accent-2);
}

/* Footer */
#footer {
  position: relative;
  z-index: 10;
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.5;
  border-top: 1px solid var(--border);
}

/* Glitch animations */
@keyframes glitch-anim-1 {
  0% { clip: rect(30px, 9999px, 10px, 0); }
  20% { clip: rect(60px, 9999px, 70px, 0); }
  40% { clip: rect(10px, 9999px, 50px, 0); }
  60% { clip: rect(80px, 9999px, 40px, 0); }
  80% { clip: rect(20px, 9999px, 90px, 0); }
  100% { clip: rect(50px, 9999px, 30px, 0); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(10px, 9999px, 80px, 0); }
  25% { clip: rect(40px, 9999px, 10px, 0); }
  50% { clip: rect(70px, 9999px, 60px, 0); }
  75% { clip: rect(30px, 9999px, 20px, 0); }
  100% { clip: rect(90px, 9999px, 50px, 0); }
}

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

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 6rem 1.5rem 2rem;
    gap: 1.5rem;
    background: rgba(5, 5, 10, 0.95);
    border-left: 1px solid var(--border);
    backdrop-filter: blur(8px);
    transition: right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 105;
  }

  .menu.open {
    right: 0;
  }

  .menu a {
    font-size: 1.1rem;
    padding: 0.4rem 0;
    width: 100%;
    opacity: 1;
  }

  .glitch {
    font-size: clamp(2rem, 22vw, 6rem);
  }

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

  section {
    padding: 4rem 1rem;
  }

  .hero {
    height: auto;
    min-height: 100vh;
    padding: 4rem 1rem;
  }

  #header {
    padding: 1rem 1rem;
  }

  #nav {
    padding: 0;
  }

  #bg-canvas {
    display: none;
  }
}

@media (max-width: 480px) {
  .section-title {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .cta {
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
  }

  .play-btn {
    padding: 0.9rem 1.5rem;
    font-size: 0.9rem;
  }

  .visualizer {
    height: 90px;
  }

  .contact-text {
    font-size: 1.2rem;
  }
}

/* === iPhone e smartphone: tutte le dimensioni (fonte: devices.json) ===
   Ordine decrescente: le regole più piccole vengono dopo e sovrascrivono. */

@media (max-width: 430px) {
  /* iPhone 15 Pro Max / 16 Pro Max — 430 × 932 */
  .glitch { font-size: clamp(2rem, 20vw, 5.5rem); }
  .section-title { font-size: 1.6rem; }
  .subtitle { font-size: 0.95rem; }
  .cta { padding: 1rem 1.5rem; font-size: 0.9rem; }
  .play-btn { padding: 0.9rem 1.5rem; font-size: 0.9rem; }
  .visualizer { height: 85px; max-width: 100%; }
  .contact-text { font-size: 1.1rem; }
  section { padding: 3.5rem 1rem; }
  #header { padding: 1rem 1rem; }
}

@media (max-width: 428px) {
  /* iPhone 14 / 15 Plus — 428 × 926 */
  .glitch { font-size: clamp(2rem, 20vw, 5.5rem); }
  .section-title { font-size: 1.6rem; }
  .subtitle { font-size: 0.95rem; }
  .cta { padding: 1rem 1.5rem; font-size: 0.9rem; }
  .play-btn { padding: 0.9rem 1.5rem; font-size: 0.9rem; }
  .visualizer { height: 85px; max-width: 100%; }
  .contact-text { font-size: 1.1rem; }
  section { padding: 3.5rem 1rem; }
  #header { padding: 1rem 1rem; }
}

@media (max-width: 414px) {
  /* iPhone 8 Plus / XR / 11 — 414 × 896 */
  .glitch { font-size: clamp(1.8rem, 18vw, 5rem); }
  .section-title { font-size: 1.5rem; }
  .subtitle { font-size: 0.9rem; }
  .cta { padding: 0.95rem 1.5rem; font-size: 0.85rem; }
  .play-btn { padding: 0.85rem 1.5rem; font-size: 0.85rem; }
  .visualizer { height: 80px; max-width: 100%; }
  .contact-text { font-size: 1.05rem; }
  section { padding: 3rem 1rem; }
  #header { padding: 1rem 1rem; }
}

@media (max-width: 412px) {
  /* iPhone 12/13/14/15 Pro Max — 412 × 915 (Android Pro) */
  .glitch { font-size: clamp(1.8rem, 18vw, 5rem); }
  .section-title { font-size: 1.5rem; }
  .subtitle { font-size: 0.9rem; }
  .cta { padding: 0.95rem 1.5rem; font-size: 0.85rem; }
  .play-btn { padding: 0.85rem 1.5rem; font-size: 0.85rem; }
  .visualizer { height: 80px; max-width: 100%; }
  .contact-text { font-size: 1.05rem; }
  section { padding: 3rem 1rem; }
  #header { padding: 1rem 1rem; }
}

@media (max-width: 393px) {
  /* Google Pixel 7/8/9 — 393 × 854 */
  .glitch { font-size: clamp(1.7rem, 17vw, 4.5rem); }
  .section-title { font-size: 1.4rem; }
  .subtitle { font-size: 0.85rem; }
  .cta { padding: 0.9rem 1.25rem; font-size: 0.85rem; }
  .play-btn { padding: 0.8rem 1.25rem; font-size: 0.8rem; }
  .visualizer { height: 75px; max-width: 100%; }
  .contact-text { font-size: 1rem; }
  section { padding: 3rem 0.75rem; }
  #header { padding: 0.9rem 0.75rem; }
}

@media (max-width: 390px) {
  /* iPhone 12 / 13 / 14 / 15 — 390 × 844 */
  .glitch { font-size: clamp(1.7rem, 17vw, 4.5rem); }
  .section-title { font-size: 1.4rem; }
  .subtitle { font-size: 0.85rem; }
  .cta { padding: 0.9rem 1.25rem; font-size: 0.85rem; }
  .play-btn { padding: 0.8rem 1.25rem; font-size: 0.8rem; }
  .visualizer { height: 75px; max-width: 100%; }
  .contact-text { font-size: 1rem; }
  section { padding: 3rem 0.75rem; }
  #header { padding: 0.9rem 0.75rem; }
}

@media (max-width: 375px) {
  /* iPhone SE / mini — 375 × 667 / 812 */
  .glitch { font-size: clamp(1.5rem, 15vw, 4rem); }
  .section-title { font-size: 1.3rem; }
  .subtitle { font-size: 0.8rem; }
  .cta { padding: 0.85rem 1.2rem; font-size: 0.8rem; }
  .play-btn { padding: 0.75rem 1.2rem; font-size: 0.75rem; }
  .visualizer { height: 70px; max-width: 100%; }
  .contact-text { font-size: 0.95rem; }
  section { padding: 2.5rem 0.75rem; }
  #header { padding: 0.85rem 0.75rem; }
  .menu { width: 90vw; max-width: 280px; }
}

@media (max-width: 360px) {
  /* Samsung Galaxy S23 / S24 — 360 × 800 */
  .glitch { font-size: clamp(1.4rem, 14vw, 3.5rem); }
  .section-title { font-size: 1.25rem; }
  .subtitle { font-size: 0.75rem; }
  .cta { padding: 0.8rem 1.1rem; font-size: 0.75rem; }
  .play-btn { padding: 0.7rem 1.1rem; font-size: 0.75rem; }
  .visualizer { height: 65px; max-width: 100%; }
  .contact-text { font-size: 0.9rem; }
  section { padding: 2.5rem 0.5rem; }
  #header { padding: 0.8rem 0.5rem; }
  .menu { width: 90vw; max-width: 260px; }
}

/* === Reveal scroll === */
.reveal {
  opacity: 0;
  transform: perspective(1000px) rotateX(15deg) translateY(30px) scale(0.97);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.reveal-visible {
  opacity: 1;
  transform: perspective(1000px) rotateX(0deg) translateY(0) scale(1);
}

/* === Tilt mouse === */
.tilt {
  display: inline-block;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
  will-change: transform;
}

/* === Tilt disattivato su mobile (evita conflitti con touch/orientazione) === */
@media (max-width: 768px) {
  .tilt {
    transform: none !important;
    transition: none !important;
  }
}

/* === Glitch potenziato === */
.glitch-strong {
  position: relative;
  color: var(--text);
  text-shadow: 0 0 8px var(--accent);
}

.glitch-strong::before,
.glitch-strong::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.glitch-strong::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent);
  clip: rect(20px, 9999px, 100px, 0);
  animation: glitch-strong-1 2.2s infinite linear alternate-reverse;
}

.glitch-strong::after {
  left: -2px;
  text-shadow: -2px 0 var(--glitch);
  clip: rect(110px, 9999px, 180px, 0);
  animation: glitch-strong-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-strong-1 {
  0% { clip: rect(30px, 9999px, 10px, 0); }
  20% { clip: rect(60px, 9999px, 70px, 0); }
  40% { clip: rect(10px, 9999px, 50px, 0); }
  60% { clip: rect(80px, 9999px, 40px, 0); }
  80% { clip: rect(20px, 9999px, 90px, 0); }
  100% { clip: rect(50px, 9999px, 30px, 0); }
}

@keyframes glitch-strong-2 {
  0% { clip: rect(10px, 9999px, 80px, 0); }
  25% { clip: rect(40px, 9999px, 10px, 0); }
  50% { clip: rect(70px, 9999px, 60px, 0); }
  75% { clip: rect(30px, 9999px, 20px, 0); }
  100% { clip: rect(90px, 9999px, 50px, 0); }
}

@media (max-width: 320px) {
  /* Smartphone piccolo generico — 320 × 568 */
  .glitch { font-size: clamp(1.2rem, 12vw, 3rem); }
  .section-title { font-size: 1.1rem; }
  .subtitle { font-size: 0.7rem; }
  .cta { padding: 0.75rem 1rem; font-size: 0.7rem; }
  .play-btn { padding: 0.65rem 1rem; font-size: 0.7rem; }
  .visualizer { height: 60px; max-width: 100%; }
  .contact-text { font-size: 0.85rem; }
  section { padding: 2rem 0.5rem; }
  #header { padding: 0.75rem 0.5rem; }
  .menu { width: 95vw; max-width: 240px; }
}
