:root {
  --bg: #0b0b0b;
  --bg-2: #141414;
  --fg: #f1ede6;
  --muted: #8d8881;
  --line: rgba(241, 237, 230, 0.12);
  --accent: #e5432b;
  --wa: #25d366;
  --pad: clamp(18px, 4vw, 56px);
  --header: 72px;
  --mx: 0;
  --my: 0;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#app { flex: 1; outline: none; }

/* grana pellicola */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -2%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--pad);
  background: linear-gradient(to bottom, rgba(11, 11, 11, 0.85), rgba(11, 11, 11, 0));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-stretch: 112%; letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: 0.25; } }
.site-nav { display: flex; gap: clamp(16px, 2.6vw, 36px); }
.site-nav a { font-size: 13px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); position: relative; transition: color 0.3s; }
.site-nav a::after { content: ''; position: absolute; left: 0; right: 100%; bottom: -6px; height: 1px; background: var(--fg); transition: right 0.4s var(--ease); }
.site-nav a:hover, .site-nav a.active { color: var(--fg); }
.site-nav a.active::after, .site-nav a:hover::after { right: 0; }
.menu-toggle { display: none; width: 36px; height: 36px; position: relative; }
.menu-toggle span { position: absolute; left: 8px; right: 8px; height: 1.5px; background: var(--fg); transition: transform 0.35s var(--ease); }
.menu-toggle span:first-child { top: 14px; }
.menu-toggle span:last-child { top: 21px; }
.menu-open .menu-toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.menu-open .menu-toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 760px) {
  .menu-toggle { display: block; z-index: 2; }
  .site-nav {
    position: fixed; inset: 0; flex-direction: column; justify-content: center; gap: 8px; padding: var(--pad);
    background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 0.35s;
  }
  .site-nav a { font-size: clamp(34px, 11vw, 56px); font-weight: 700; font-stretch: 120%; letter-spacing: -0.01em; color: var(--fg); line-height: 1.15; transform: translateY(20px); transition: transform 0.5s var(--ease), color 0.3s; }
  .site-nav a::after { display: none; }
  .menu-open .site-nav { opacity: 1; pointer-events: auto; }
  .menu-open .site-nav a { transform: none; }
  .menu-open .site-nav a:nth-child(2) { transition-delay: 0.04s; }
  .menu-open .site-nav a:nth-child(3) { transition-delay: 0.08s; }
  .menu-open .site-nav a:nth-child(4) { transition-delay: 0.12s; }
}

/* ---------- entrata pagina ---------- */
#app > * { opacity: 0; }
#app.enter > * { animation: fadeUp 0.8s var(--ease) forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- split (home + scelta) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; height: 100svh; min-height: 520px; }
.panel {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad); padding-bottom: calc(var(--pad) + 40px); isolation: isolate; container-type: inline-size;
  border-right: 1px solid var(--line);
}
.panel:last-child { border-right: 0; }
.panel-bg {
  position: absolute; inset: -6%; z-index: -1; background: center / cover no-repeat var(--bg-2);
  filter: grayscale(1) brightness(0.38) contrast(1.1);
  transform: translate3d(calc(var(--mx) * -22px), calc(var(--my) * -22px), 0) scale(1.04);
  transition: filter 0.9s var(--ease), scale 1.4s var(--ease);
}
.panel-bg--empty { background: radial-gradient(circle at 30% 30%, #262321, var(--bg) 70%); }
.panel::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(11, 11, 11, 0.85), transparent 55%); }
.panel:hover .panel-bg, .panel:focus-visible .panel-bg { filter: grayscale(0) brightness(0.62) contrast(1.05); scale: 1.06; }
.panel-n { position: absolute; top: calc(var(--header) + 12px); left: var(--pad); font-size: 12px; letter-spacing: 0.2em; color: var(--muted); text-transform: uppercase; }
.panel-title {
  margin: 0; font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em;
  font-size: clamp(34px, 12.5cqi, 150px); line-height: 0.86;
  transform: translate3d(calc(var(--mx) * 14px), calc(var(--my) * 10px), 0);
  transition: letter-spacing 0.8s var(--ease);
}
.panel:hover .panel-title { letter-spacing: 0.01em; }
.panel-cta { margin-top: 22px; display: inline-flex; align-items: center; gap: 12px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); transition: color 0.3s; }
.panel-cta svg { transition: transform 0.5s var(--ease); }
.panel:hover .panel-cta { color: var(--fg); }
.panel:hover .panel-cta svg { transform: translateX(8px); }
.split .panel { opacity: 0; }
#app.enter .split .panel { animation: fadeUp 1s var(--ease) forwards; animation-delay: calc(var(--i) * 0.12s); }

.home-tag {
  position: absolute; left: 0; right: 0; bottom: 18px; margin: 0; z-index: 2; pointer-events: none;
  display: flex; justify-content: center; gap: 28px; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted);
}
#app:has(.split--home) { position: relative; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: var(--pad); }
  .panel:first-child { padding-top: calc(var(--header) + 20px); }
  .panel-n { top: auto; bottom: calc(var(--pad) + 2px); left: auto; right: var(--pad); }
  .panel:first-child .panel-n { top: auto; }
  .home-tag { display: none; }
  /* su touch il colore arriva col movimento */
  .panel-bg { filter: grayscale(0.4) brightness(0.48); }
}

/* ---------- lista video ---------- */
.list { padding: calc(var(--header) + 48px) var(--pad) 96px; }
.list-head { margin-bottom: clamp(32px, 6vw, 72px); }
.crumb { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); transition: color 0.3s; }
.crumb svg { transform: rotate(180deg); transition: transform 0.4s var(--ease); }
.crumb:hover { color: var(--fg); }
.crumb:hover svg { transform: rotate(180deg) translateX(6px); }
.crumb--static { cursor: default; }
.list-title { margin: 14px 0 0; font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(52px, 11vw, 180px); line-height: 0.85; }
.list-title sup { font-size: 0.16em; font-weight: 500; font-stretch: 100%; letter-spacing: 0.1em; color: var(--accent); vertical-align: top; margin-left: 0.3em; position: relative; top: 0.6em; }
.client-note { max-width: 640px; margin: 28px 0 0; color: var(--muted); font-size: 18px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: clamp(28px, 4vw, 56px) clamp(16px, 2.4vw, 32px); perspective: 1200px; }
.grid--tall { grid-template-columns: repeat(auto-fill, minmax(min(46%, 240px), 1fr)); }
.grid--mixed { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.grid--mixed .card--tall { max-width: 300px; }

.card { display: block; text-align: left; width: 100%; opacity: 0; }
#app.enter .card { animation: fadeUp 0.9s var(--ease) forwards; animation-delay: calc(0.15s + var(--i) * 0.07s); }
.card-media {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-2);
  transform: rotateY(calc(var(--mx) * 3deg)) rotateX(calc(var(--my) * -3deg));
  transition: box-shadow 0.6s var(--ease);
}
.card--tall .card-media { aspect-ratio: 9 / 16; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transform: translate3d(calc(var(--mx) * -8px), calc(var(--my) * -8px), 0) scale(1.08); transition: scale 1.2s var(--ease), filter 0.6s; filter: saturate(0.85); }
.card:hover .card-media img, .card:focus-visible .card-media img { scale: 1.14; filter: saturate(1.05); }
.card:hover .card-media { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9); }
.card-ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; background: radial-gradient(circle at calc(50% + var(--mx) * 30%) calc(40% + var(--my) * 30%), #2b2622, #111 70%); }
.card-ph span { font-weight: 800; font-stretch: 125%; text-transform: uppercase; font-size: clamp(18px, 2.4vw, 28px); line-height: 0.95; color: rgba(241, 237, 230, 0.25); }
.card-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; color: var(--bg); background: var(--fg);
  opacity: 0; transform: scale(0.6); transition: opacity 0.4s, transform 0.5s var(--ease);
}
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; transform: scale(1); }
@media (hover: none) { .card-play { opacity: 0.9; transform: scale(0.8); width: 52px; height: 52px; margin: -26px; font-size: 18px; } }
.card-meta { display: flex; flex-direction: column; gap: 2px; padding-top: 16px; }
.card-title { font-weight: 700; font-stretch: 110%; text-transform: uppercase; font-size: clamp(16px, 1.6vw, 20px); letter-spacing: 0.01em; line-height: 1.15; }
.card-sub { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); font-size: 18px; }

.client-cta { margin-top: clamp(64px, 10vw, 120px); padding-top: 40px; border-top: 1px solid var(--line); }
.client-cta p { font-size: clamp(24px, 3.4vw, 40px); font-weight: 700; font-stretch: 112%; margin: 0 0 24px; }

/* ---------- bottoni ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px; padding: 16px 26px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.btn svg { font-size: 18px; transition: transform 0.4s var(--ease); }
.btn:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn:hover svg:last-child { transform: translateX(4px); }
.btn--wa { background: var(--wa); color: #06210f; border-color: var(--wa); }
.btn--wa:hover { background: #1fb457; border-color: #1fb457; color: #06210f; }

/* ---------- about ---------- */
.about { padding: calc(var(--header) + 56px) var(--pad) 110px; display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 7vw, 120px); align-items: start; }
.about-lead {
  margin: 0; position: sticky; top: calc(var(--header) + 40px);
  font-weight: 800; font-stretch: 122%; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(40px, 6.2vw, 104px); line-height: 0.9;
  transform: translate3d(calc(var(--mx) * 10px), calc(var(--my) * 8px), 0);
}
.about-lead span { display: block; }
.about-lead em { display: block; margin-top: 0.4em; font-style: normal; font-weight: 400; font-stretch: 100%; text-transform: none; letter-spacing: 0; font-size: 0.34em; line-height: 1.2; color: var(--muted); }
.about-body p { margin: 0 0 1.2em; font-size: clamp(16px, 1.25vw, 19px); color: #c9c4bc; }
.about-body .about-intro { font-size: clamp(20px, 1.8vw, 26px); color: var(--fg); line-height: 1.35; }
.about-body strong { font-weight: 700; }
.about-body .about-punch { margin-top: 2em; padding-left: 20px; border-left: 2px solid var(--accent); color: var(--fg); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.45; }
.about-punch span { color: var(--accent); font-weight: 700; }
.services { list-style: none; margin: 2.4em 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.services li { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about-lead { position: static; }
}

/* ---------- contatti ---------- */
.contact { padding: calc(var(--header) + 48px) var(--pad) 80px; display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 5vw, 80px); align-items: stretch; min-height: 100svh; }
.contact-title { margin: 0 0 clamp(28px, 4vw, 48px); font-weight: 800; font-stretch: 122%; text-transform: uppercase; letter-spacing: -0.02em; font-size: clamp(44px, 7vw, 116px); line-height: 0.88; }
.contact-title em { font-style: normal; color: var(--accent); }
.contact-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.contact-row { display: grid; grid-template-columns: 28px 120px 1fr 24px; align-items: center; gap: 16px; padding: 20px 4px; border-bottom: 1px solid var(--line); transition: padding 0.4s var(--ease), background 0.3s; }
.contact-ico { font-size: 22px; display: grid; }
.contact-label { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.contact-value { font-size: clamp(16px, 1.5vw, 20px); font-weight: 600; overflow-wrap: anywhere; }
.contact-arrow { font-size: 20px; opacity: 0.4; transition: transform 0.4s var(--ease), opacity 0.3s; }
.contact-row:hover { padding-left: 16px; background: rgba(241, 237, 230, 0.03); }
.contact-row:hover .contact-arrow { opacity: 1; transform: translateX(4px); }
.contact-row--wa .contact-ico, .contact-row--wa .contact-value { color: var(--wa); }

.playground {
  position: relative; min-height: 420px; border: 1px solid var(--line); border-radius: 28px; overflow: hidden; touch-action: none;
  background: radial-gradient(circle at calc(50% + var(--mx) * 25%) calc(30% + var(--my) * 25%), #1d1a18, var(--bg) 75%);
}
.ball {
  position: absolute; left: 0; top: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--fg); color: var(--bg); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none;
  box-shadow: inset 0 -6px 14px rgba(0, 0, 0, 0.2), 0 14px 30px -12px rgba(0, 0, 0, 0.8); will-change: transform;
}
.ball svg { width: 44%; height: 44%; stroke-width: 1.8; pointer-events: none; }
.ball.grab { cursor: grabbing; }
.ball--wa { background: var(--wa); color: #06210f; }
.ball--ig { background: linear-gradient(135deg, #feda75, #d62976 50%, #4f5bd5); color: #fff; }
.ball--tiktok { background: #111; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2), -3px -2px 0 -1px #25f4ee, 3px 2px 0 -1px #fe2c55, 0 14px 30px -12px #000; }
.ball--mail { background: var(--accent); color: #fff; }
.playground-hint { position: absolute; left: 0; right: 0; top: 22px; text-align: center; font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); pointer-events: none; }
@media (max-width: 860px) {
  .contact { grid-template-columns: 1fr; min-height: 0; }
  .playground { order: -1; min-height: 300px; height: 46svh; }
  .contact-row { grid-template-columns: 24px 1fr 20px; }
  .contact-label { display: none; }
}

/* ---------- 404 ---------- */
.notfound { min-height: 80svh; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: calc(var(--header) + 40px) var(--pad); }
.notfound h1 { margin: 0; font-weight: 800; font-stretch: 125%; text-transform: uppercase; font-size: clamp(64px, 14vw, 220px); line-height: 0.85; }
.notfound p { color: var(--muted); font-size: 18px; margin: 20px 0 32px; }

/* ---------- footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; padding: 28px var(--pad);
  border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.footer-links a:hover { color: var(--fg); }
body[data-page='home'] .site-footer, body[data-page='music-video'] .site-footer, body[data-page='commercial'] .site-footer { display: none; }

/* ---------- popup video ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 5, 5, 0.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; transition: opacity 0.4s; }
.modal.show .modal-backdrop { opacity: 1; }
.modal-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; opacity: 0; transform: scale(0.96); transition: opacity 0.45s var(--ease), transform 0.6s var(--ease); }
.modal.show .modal-stage { opacity: 1; transform: none; }
.modal-frame { position: relative; background: #000; box-shadow: 0 40px 120px -40px #000; }
.modal-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.modal-frame--wide { width: min(92vw, calc((100svh - 200px) * 16 / 9)); aspect-ratio: 16 / 9; }
.modal-frame--tall { height: min(80svh, 860px); aspect-ratio: 9 / 16; max-width: 92vw; }
.modal-frame--ig { width: min(440px, 92vw); height: min(80svh, 800px); background: #fff; border-radius: 6px; overflow: hidden; }
.modal-info { width: 100%; display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.modal-frame--tall + .modal-info, .modal-frame--ig + .modal-info { max-width: min(440px, 92vw); flex-direction: column; gap: 6px; }
.modal-title { margin: 0; font-weight: 700; font-stretch: 112%; text-transform: uppercase; font-size: 18px; line-height: 1.2; }
.modal-sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.modal-credits { margin: 0; color: var(--muted); font-size: 13px; white-space: pre-line; max-width: 420px; }
.modal-btn {
  position: absolute; z-index: 2; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
  border: 1px solid var(--line); transition: background 0.3s, color 0.3s, transform 0.3s;
}
.modal-btn:hover { background: var(--fg); color: var(--bg); }
.modal-btn[hidden] { display: none; }
.modal-close { top: 18px; right: 18px; }
.modal-close:hover { transform: rotate(90deg); }
.modal-prev { left: 18px; top: 50%; margin-top: -26px; }
.modal-next { right: 18px; top: 50%; margin-top: -26px; }
.modal-open { overflow: hidden; }
@media (max-width: 760px) {
  .modal-prev, .modal-next { top: auto; bottom: 18px; margin: 0; }
  .modal-close { top: 12px; right: 12px; }
  .modal-frame--wide { width: 100vw; }
  .modal-info { padding: 0 16px; }
  .modal-frame--tall { height: min(72svh, 860px); }
  .modal-frame--ig { height: 72svh; }
}

/* ---------- invito movimento (iPhone) ---------- */
.motion-hint {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 999px; background: rgba(241, 237, 230, 0.12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap;
}
.motion-hint[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .grain { display: none; }
}
