/* ============================================================
   029 PROJECT — DESIGN SYSTEM
   Street-Tech / Digital Wall / Graffiti Style
   ============================================================ */

/* ------------------------------------------------------------
   1. CUSTOM PROPERTIES — PALETTE DAL LOGO
   ------------------------------------------------------------ */
:root {
  /* Core Brand Colors (estratti dal logo) */
  --primary-red:       #E03820;   /* rosso graffiti dominante     */
  --electric-blue:     #60A0E0;   /* blu elettrico accento        */
  --acid-yellow:       #E0E040;   /* giallo acido neon            */
  --solar-orange:      #E08020;   /* arancio solare               */
  --deep-black:        #0A0A0A;   /* sfondo principale            */
  --dark-surface:      #141414;   /* card / sezioni               */
  --dark-mid:          #202020;   /* bordi, divisori              */
  --off-white:         #F0EEE8;   /* testo principale             */
  --muted-gray:        #888888;   /* testo secondario             */

  /* Neon Glow (uso decorativo) */
  --glow-red:          rgba(224, 56, 32, 0.55);
  --glow-blue:         rgba(96, 160, 224, 0.45);
  --glow-yellow:       rgba(224, 224, 64, 0.40);

  /* Tipografia */
  --font-display:      'Bebas Neue', 'Impact', sans-serif;
  --font-body:         'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:  16px;
  --space-lg:  32px;
  --space-xl:  64px;
  --space-2xl: 128px;

  /* Borders */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg: 16px;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow:   600ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index scale */
  --z-base:    1;
  --z-overlay: 10;
  --z-nav:     100;
  --z-modal:   1000;
}

/* ------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--deep-black);
  color: var(--off-white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;

  /* -------------------------------------------------------
     SFONDO "MURO URBANO + BLUEPRINT"
     Layers (dal basso verso l'alto):
     1. Griglia blueprint tecnica (linee verticali + orizzontali)
     2. Noise grain digitale (texture cemento)
     3. Alone rosso brand in alto a destra (calore / energia)
     4. Alone blu brand in basso a sinistra (freddo / tech)
  ------------------------------------------------------- */
  background-image:
    /* 4. Alone blu — basso sinistra */
    radial-gradient(
      ellipse 60% 50% at 5% 95%,
      rgba(96, 160, 224, 0.055) 0%,
      transparent 70%
    ),
    /* 3. Alone rosso — alto destra */
    radial-gradient(
      ellipse 55% 45% at 95% 8%,
      rgba(224, 56, 32, 0.06) 0%,
      transparent 65%
    ),
    /* 2. Noise grain digitale */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E"),
    /* 1. Griglia blueprint — linee orizzontali */
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(255, 255, 255, 0.022) 39px,
      rgba(255, 255, 255, 0.022) 40px
    ),
    /* 1. Griglia blueprint — linee verticali */
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(255, 255, 255, 0.022) 39px,
      rgba(255, 255, 255, 0.022) 40px
    );
  background-attachment: fixed; /* griglia fissa durante lo scroll — effetto profondità */
}

img, video {
  max-width: 100%;
  display: block;
}

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

ul, ol {
  list-style: none;
}

/* ------------------------------------------------------------
   3. TIPOGRAFIA
   Font caricati via <link> nell'header con media="print" onload="this.media='all'"
   per evitare render-blocking (ottimizzazione Core Web Vitals).
   @import rimosso: bloccava il rendering della pagina.
   ------------------------------------------------------------ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1 { font-size: clamp(3rem, 10vw, 8rem); }
h2 { font-size: clamp(2rem, 6vw, 5rem); }
h3 { font-size: clamp(1.5rem, 4vw, 3rem); }
h4 { font-size: clamp(1.2rem, 3vw, 2rem); }

p {
  font-family: var(--font-body);
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  max-width: 70ch;
}

.text--mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.text--red    { color: var(--primary-red); }
.text--blue   { color: var(--electric-blue); }
.text--yellow { color: var(--acid-yellow); }
.text--orange { color: var(--solar-orange); }

/* ------------------------------------------------------------
   4. LAYOUT UTILITIES
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section {
  padding-block: var(--space-xl);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .container { padding-inline: var(--space-md); }
}

/* ------------------------------------------------------------
   5. EFFETTI STREET-TECH
   ------------------------------------------------------------ */

/* --- Glitch Text --- */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}
.glitch::before {
  color: var(--primary-red);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  animation: glitch-top 3.5s infinite linear;
}
.glitch::after {
  color: var(--electric-blue);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  animation: glitch-bot 3.5s infinite linear;
}

@keyframes glitch-top {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  92%            { transform: translate(-4px, -2px); opacity: 0.8; }
  94%            { transform: translate(4px, 2px); opacity: 0.8; }
  96%            { transform: translate(-2px, 0); opacity: 0.8; }
}
@keyframes glitch-bot {
  0%, 90%, 100% { transform: translate(0); opacity: 0; }
  93%            { transform: translate(4px, 2px); opacity: 0.7; }
  95%            { transform: translate(-4px, -2px); opacity: 0.7; }
  97%            { transform: translate(2px, 0); opacity: 0.7; }
}

/* --- Neon Border --- */
.neon-border--red {
  border: 1px solid var(--primary-red);
  box-shadow: 0 0 8px var(--glow-red), inset 0 0 8px var(--glow-red);
}
.neon-border--blue {
  border: 1px solid var(--electric-blue);
  box-shadow: 0 0 8px var(--glow-blue), inset 0 0 8px var(--glow-blue);
}
.neon-border--yellow {
  border: 1px solid var(--acid-yellow);
  box-shadow: 0 0 8px var(--glow-yellow), inset 0 0 8px var(--glow-yellow);
}

/* --- Tag / Badge Street --- */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  clip-path: polygon(6px 0%, 100% 0%, calc(100% - 6px) 100%, 0% 100%);
}
.tag--red    { background: var(--primary-red);    color: var(--deep-black); }
.tag--blue   { background: var(--electric-blue);  color: var(--deep-black); }
.tag--yellow { background: var(--acid-yellow);    color: var(--deep-black); }

/* --- Scanlines Overlay --- */
.scanlines {
  position: relative;
}
.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: var(--z-overlay);
}

/* --- Clip angled sections --- */
.clip-top {
  clip-path: polygon(0 4vw, 100% 0, 100% 100%, 0 100%);
  margin-top: -4vw;
  padding-top: calc(4vw + var(--space-xl));
}
.clip-bottom {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 4vw), 0 100%);
  padding-bottom: calc(4vw + var(--space-xl));
}

/* ------------------------------------------------------------
   6. BUTTONS
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 28px;
  cursor: pointer;
  border: none;
  transition: all var(--transition-normal);
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}
.btn:hover::after { transform: translateX(0); }

.btn--primary {
  background: var(--primary-red);
  color: var(--off-white);
}
.btn--primary:hover {
  box-shadow: 0 0 24px var(--glow-red);
  transform: translateY(-2px);
}

.btn--secondary {
  background: transparent;
  color: var(--electric-blue);
  border: 1px solid var(--electric-blue);
  box-shadow: 0 0 8px var(--glow-blue);
}
.btn--secondary:hover {
  background: var(--electric-blue);
  color: var(--deep-black);
  box-shadow: 0 0 24px var(--glow-blue);
}

.btn--ghost {
  background: transparent;
  color: var(--off-white);
  border: 1px solid var(--dark-mid);
}
.btn--ghost:hover {
  border-color: var(--acid-yellow);
  color: var(--acid-yellow);
  box-shadow: 0 0 12px var(--glow-yellow);
}

/* ------------------------------------------------------------
   7. NAVBAR
   ------------------------------------------------------------ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  padding-block: var(--space-md);
  transition: background var(--transition-normal),
              backdrop-filter var(--transition-normal);
}

.site-header.scrolled {
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dark-mid);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo img {
  height: 48px;
  width: auto;
}

.nav__links {
  display: flex;
  gap: var(--space-lg);
}

.nav__links a {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-gray);
  transition: color var(--transition-fast);
  position: relative;
}
.nav__links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--primary-red);
  transition: width var(--transition-normal);
}
.nav__links a:hover { color: var(--off-white); }
.nav__links a:hover::after { width: 100%; }

.nav__cta { margin-left: var(--space-md); }

/* Hamburger mobile */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.nav__toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--off-white);
  transition: all var(--transition-normal);
}

@media (max-width: 768px) {
  .nav__toggle { display: flex; }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(10,10,10,0.97);
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg);
    gap: var(--space-md);
    border-bottom: 1px solid var(--dark-mid);
  }
  .nav__links.open { display: flex; }
  .nav__cta { display: none; }
}

/* ------------------------------------------------------------
   8. FOOTER (base)
   ------------------------------------------------------------ */
.site-footer {
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-mid);
  padding-block: var(--space-xl);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted-gray);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.footer__copy a { color: var(--primary-red); }
.footer__copy a:hover { text-decoration: underline; }

/* ------------------------------------------------------------
   9. SCROLL REVEAL (base class — animata via JS)
   ------------------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--transition-slow),
              transform var(--transition-slow);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ------------------------------------------------------------
   10. SELECTION & SCROLLBAR
   ------------------------------------------------------------ */
::selection {
  background: var(--primary-red);
  color: var(--off-white);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--deep-black); }
::-webkit-scrollbar-thumb {
  background: var(--primary-red);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--electric-blue); }
