@import url('https://fonts.cdnfonts.com/css/neue-montreal');

:root {
  --vanta: #050505;
  --concrete: #111111;
  --steel: #E0E0E0;
  --steel-dim: #707070;
  --steel-faint: #2a2a2a;
  --red: #FF0000;
  --green: #00FF41;
  --font-display: 'Neue Montreal', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; cursor: none; }
body { background: var(--vanta); color: var(--steel); font-family: var(--font-display); overflow-x: hidden; }

/* Film grain overlay */
body::before {
  content: ''; position: fixed; inset: 0;
  pointer-events: none; z-index: 10000; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--vanta); }
::-webkit-scrollbar-thumb { background: var(--red); }

/* Scanline */
.scanline {
  position: fixed; top: 0; left: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--red) 30%, var(--red) 70%, transparent 95%);
  box-shadow: 0 0 10px var(--red); z-index: 9999; opacity: 0.5;
  animation: scan 10s linear infinite;
}
@keyframes scan { 0% { top: -1px; } 100% { top: 100vh; } }

/* Custom cursor */
.cursor {
  position: fixed; width: 20px; height: 20px;
  pointer-events: none; z-index: 99999; mix-blend-mode: difference;
  transition: transform 0.15s var(--ease-expo);
}
.cursor::before, .cursor::after { content: ''; position: absolute; background: white; }
.cursor::before { width: 1px; height: 100%; left: 50%; transform: translateX(-50%); }
.cursor::after { width: 100%; height: 1px; top: 50%; transform: translateY(-50%); }
.cursor.expanded { transform: scale(2.5) rotate(45deg); }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 40px; mix-blend-mode: difference;
}
.nav-brand { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.3em; color: var(--steel); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 24px; }
.nav-indicator { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.12em; color: var(--steel-dim); }
.nav-indicator::before { content: ''; width: 5px; height: 5px; background: var(--red); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.nav-links { display: flex; gap: 24px; }
.nav-link { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--steel-dim); text-decoration: none; transition: color 0.3s; position: relative; }
.nav-link.active { color: var(--steel); }
.nav-link::after { content: ''; position: absolute; bottom: -3px; left: 0; width: 0; height: 1px; background: var(--red); transition: width 0.4s var(--ease-expo); }
.nav-link.active::after { width: 100%; }
.nav-link:hover { color: var(--steel); }
.nav-link:hover::after { width: 100%; }

/* Page hero (shared across pittura, portfolio, segnale) */
.page-hero {
  min-height: 50vh; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 0 40px 48px; position: relative;
}
.page-hero::after { content: ''; position: absolute; bottom: 0; left: 40px; right: 40px; height: 1px; background: rgba(255,255,255,0.06); }
.ph-tag { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.35em; text-transform: uppercase; color: var(--steel-dim); display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.ph-tag::before { content: ''; width: 32px; height: 1px; background: var(--red); }
.ph-title { font-family: var(--font-display); font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; text-transform: uppercase; }
.ph-title .accent { color: var(--red); }
.ph-desc { margin-top: 20px; max-width: 520px; font-family: var(--font-mono); font-size: 11px; line-height: 1.75; color: var(--steel-dim); font-weight: 300; }

/* Section header */
.section-header {
  padding: 64px 40px 24px; display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.section-title { font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.3em; color: var(--steel-dim); }
.section-count { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.1em; color: var(--red); }

/* Masonry gallery (shared pittura, generative-lab) */
.masonry {
  column-count: 3;
  column-gap: 48px;
  padding: 48px 40px 80px;
}
.art-piece {
  break-inside: avoid;
  margin-bottom: 56px;
  position: relative;
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s var(--ease-expo), transform 0.6s var(--ease-expo);
}
.art-piece.visible { opacity: 1; transform: translateY(0); }
.art-piece img {
  display: block; width: 100%; height: auto;
  transition: filter 0.5s, transform 0.6s var(--ease-expo);
  filter: grayscale(5%);
}
.art-piece:hover img {
  filter: grayscale(0%);
  transform: scale(1.015);
}
.art-piece::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 0; height: 1px; background: var(--red);
  transition: width 0.6s var(--ease-expo);
}
.art-piece:hover::after { width: 100%; }
.art-meta { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 0; }
.art-meta-left { display: flex; align-items: baseline; gap: 10px; }
.art-sku { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.08em; color: var(--steel-faint); }
.art-name { font-family: var(--font-display); font-size: 13px; font-weight: 500; letter-spacing: -0.01em; color: var(--steel); opacity: 0; transition: opacity 0.4s; }
.art-piece:hover .art-name { opacity: 1; }

/* CTA section */
.cta-section { padding: 64px 40px; text-align: center; position: relative; }
.cta-section::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 1px; height: 60px; background: linear-gradient(to bottom, transparent, var(--red)); }
.cta-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--steel-dim); margin-bottom: 24px; }
.cta-btn {
  display: inline-block; padding: 14px 36px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--vanta); background: var(--red); text-decoration: none;
  transition: box-shadow 0.4s, transform 0.3s var(--ease-expo);
}
.cta-btn:hover { box-shadow: 0 0 20px rgba(255,0,0,0.4); transform: scale(1.02); }

/* Footer */
.footer { padding: 40px; border-top: 1px solid rgba(255,255,255,0.04); display: flex; justify-content: space-between; align-items: center; }
.footer-brand { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em; color: var(--steel-dim); }
.footer-logo { height: 36px; width: auto; opacity: 0.6; transition: opacity 0.3s; }
.footer-logo:hover { opacity: 0.9; }
.footer-sig { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; color: var(--steel-faint); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.7s var(--ease-expo), transform 0.7s var(--ease-expo); transition-delay: calc(var(--stagger, 0) * 0.08s); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Divider */
.divider { margin: 0 40px; height: 1px; background: rgba(255,255,255,0.04); }

/* ═══════════════════════════════════════════
   RESPONSIVE — SHARED
═══════════════════════════════════════════ */
@media (max-width: 1200px) {
  .masonry { column-count: 2; column-gap: 36px; }
}
@media (max-width: 768px) {
  .nav { padding: 16px 20px; }
  .nav-links { display: none; }
  .page-hero { padding: 0 20px 36px; min-height: 40vh; }
  .section-header { padding: 48px 20px 20px; }
  .masonry { column-count: 1; padding: 36px 20px 60px; column-gap: 0; }
  .art-piece { margin-bottom: 40px; }
  .art-name { opacity: 1; }
  .cta-section { padding: 48px 20px; }
  .footer { padding: 32px 20px; flex-direction: column; gap: 12px; }
  .cursor { display: none; }
  * { cursor: auto; }
}
