/* ---------- Lavori ---------- */
.works { margin-top: 8vh; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.work { position: relative; aspect-ratio: 16 / 10; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
  padding: 22px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; overflow: hidden; isolation: isolate; }
.work-big { grid-column: span 2; aspect-ratio: 21 / 8; }
.work-t { font: 800 clamp(30px, 3.6vw, 56px)/1 var(--f-title); letter-spacing: -.045em; transition: transform .6s var(--ease), color .3s; }
.work-t em { font-family: var(--f-serif); font-weight: 400; color: var(--acc); letter-spacing: -.01em; }
.work-big .work-t { font-size: clamp(40px, 6vw, 92px); }
.work .caps { position: relative; z-index: 2; transition: color .3s; }
.work-prev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; opacity: 0; transform: scale(1.04); transition: opacity .5s var(--ease), transform .8s var(--ease); }
.work::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(16,20,18,.55), rgba(16,20,18,.15) 40%, rgba(16,20,18,.55)); opacity: 0; transition: opacity .5s; }
.sel { position: absolute; inset: 10px; border: 1.5px solid var(--acc); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 3; }
.sel i { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid var(--acc); }
.sel i:nth-child(1) { left: -5px; top: -5px; } .sel i:nth-child(2) { right: -5px; top: -5px; }
.sel i:nth-child(3) { left: -5px; bottom: -5px; } .sel i:nth-child(4) { right: -5px; bottom: -5px; }
.work:focus-visible { outline: none; }
.work:focus-visible .sel { opacity: 1; }
@media (hover: hover) {
  .work:hover .work-prev { opacity: 1; transform: none; }
  .work:hover::after { opacity: 1; }
  .work:hover .sel { opacity: 1; }
  .work:hover .work-t { color: #fff; transform: scale(1.03); text-shadow: 0 2px 28px rgba(16,20,18,.5); }
  .work:hover .work-t em { color: var(--stk-sage); }
  .work:hover .work-t .wb-logo { background: var(--stk-sage); }
  .work:hover .caps { color: rgba(255,255,255,.85); }
  .work:hover .nda-txt { color: rgba(255,255,255,.88); }
  .work:hover .nda-arrow { color: var(--stk-sage); }
}
.nda-body { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.nda-txt { max-width: 52ch; color: var(--muted); font-size: 15px; line-height: 1.55; transition: color .3s; }
.nda-arrow { margin-left: 10px; color: var(--acc-text); }
.works-note { margin-top: 22px; font-size: 14px; color: var(--muted); }
.works-note a { color: var(--acc-text); text-underline-offset: 3px; }

/* ---------- Chi sono ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6vw; align-items: center; }

/* la foto: un livello selezionato, si ridimensiona dalle maniglie e si ruota appena fuori dagli angoli */
.about-photo { position: relative; display: flex; justify-content: center; margin-right: 2vw; }
.ph { position: relative; width: clamp(220px, 22vw, 300px); padding: 10px; z-index: 2; touch-action: none; transform-origin: 50% 50%; }
.ph.back { transition: transform .9s var(--ease); }
.ph img { width: 100%; height: auto; border-radius: 50%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.ph-box { position: absolute; inset: 0; border: 1.5px solid var(--acc); pointer-events: none; }
.ph-lbl { position: absolute; left: 0; top: -22px; font-size: 11.5px; font-weight: 500; color: var(--acc-text); white-space: nowrap; transform-origin: 0 100%; }
.ph-dim { position: absolute; left: 50%; bottom: -30px; translate: -50% 0; transform-origin: 50% 0; background: var(--acc); color: #fff; font-size: 11.5px; font-weight: 500; padding: 3px 8px; border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ph .h { position: absolute; width: 9px; height: 9px; background: #fff; border: 1.5px solid var(--acc); z-index: 2; cursor: nwse-resize; }
.ph .h::before { content: ''; position: absolute; inset: -10px; }
.ph .h.tr, .ph .h.bl { cursor: nesw-resize; }
.ph .h.tl { left: -5px; top: -5px; } .ph .h.tr { right: -5px; top: -5px; }
.ph .h.bl { left: -5px; bottom: -5px; } .ph .h.br { right: -5px; bottom: -5px; }
.ph .rot { position: absolute; width: 24px; height: 24px; display: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 15a7 7 0 0 1 11-8M18 3.5v4.5h-4.5M2.5 11.5 6 15.5l3.5-3.8' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M6 15a7 7 0 0 1 11-8M18 3.5v4.5h-4.5M2.5 11.5 6 15.5l3.5-3.8' stroke='%23101412' stroke-width='1.6'/%3E%3C/g%3E%3C/svg%3E") 12 12, grab; }
.ph .rot.tl { left: -34px; top: -34px; } .ph .rot.tr { right: -34px; top: -34px; }
.ph .rot.bl { left: -34px; bottom: -34px; } .ph .rot.br { right: -34px; bottom: -34px; }
@media (pointer: fine) { .ph .rot { display: block; } }
.ph-chat { position: absolute; left: 58%; top: 90%; z-index: 4; padding: 8px 16px 9px; border-radius: 6px 26px 26px 26px; white-space: nowrap; pointer-events: none;
  font-size: 16px; font-weight: 500; color: #fff; background: #1c9a5d; border: 2px solid #11744a; box-shadow: 0 0 0 4px rgba(28, 154, 93, .2), 0 14px 30px -14px rgba(15, 111, 66, .8);
  opacity: 0; transform: translateY(-4px); transition: opacity .3s, transform .35s var(--ease); }
.about-photo.spin .ph-chat { opacity: 1; transform: none; }
@media not (pointer: fine) { .ph-chat { display: none; } } /* si ruota solo col mouse */
.about-text { position: relative; }
.about-text p { margin-top: 22px; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.6; max-width: 62ch; }
.about-text h2 + p { margin-top: 36px; }
.about-text a { color: var(--acc-text); text-underline-offset: 3px; }
.about-note { display: inline-block; margin-top: 14px; transform: rotate(-2deg); }


/* semaforo F1 */
.f1-wrap { margin-top: 12vh; display: grid; grid-template-columns: 1fr 1.5fr; gap: 6vw; align-items: center; }
.f1-intro h3 { font: 800 clamp(30px, 3.4vw, 48px)/1 var(--f-title); letter-spacing: -.04em; }
.f1-intro h3 em { font-family: var(--f-serif); font-weight: 400; color: var(--acc); }
.f1-intro p { margin-top: 14px; color: var(--muted); max-width: 36ch; }
.f1 { background: var(--ink); color: #e9e8e2; border-radius: 18px; padding: 22px 24px 26px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6); }
.f1 .caps { color: #8d918c; }
.f1-head { display: flex; justify-content: space-between; gap: 12px; }
.f1-lights { display: flex; justify-content: center; gap: clamp(8px, 2vw, 18px); margin: 26px 0 22px; }
.f1-col { display: flex; flex-direction: column; gap: 10px; background: #050605; padding: 10px; border-radius: 14px; }
.f1-col i { width: clamp(28px, 4.4vw, 52px); aspect-ratio: 1; border-radius: 50%; background: #2a2d2b; transition: background .08s, box-shadow .08s; }
.f1-col.on i { background: #ff2a1a; box-shadow: 0 0 22px 4px rgba(255,42,26,.55); }
.f1-msg { text-align: center; font: 500 16px/1.4 var(--f-body); min-height: 1.4em; }
.f1.done .f1-msg { color: #b9f0cf; }
.f1.jump .f1-msg { color: #ffb4a8; }
.f1:focus-visible { outline: 3px solid var(--acc); outline-offset: 4px; }

/* ---------- Contatti ---------- */
#contatti { padding-bottom: 12vh; }
.contact-t { max-width: 14ch; }
/* tre adesivi, come quelli della hero: si raddrizzano quando ci passi sopra */
.cards { margin-top: 7vh; display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 22px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 24px 24px 22px; border-radius: 14px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 0 rgba(16,20,18,.06), 0 18px 34px -22px rgba(16,20,18,.45); transform: rotate(var(--rot)); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.card .caps { color: rgba(16,20,18,.62); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(16, 20, 18, .06); transition: transform .45s var(--ease); }
.card-ico svg { width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .card:hover .card-ico { transform: rotate(-6deg) scale(1.06); } }
.card-v { margin-top: auto; font: 800 clamp(22px, 2.3vw, 32px)/1.05 var(--f-title); letter-spacing: -.035em; text-decoration: none; overflow-wrap: anywhere; }
.card-note { font: 600 21px/1 var(--f-hand); color: var(--acc-text); }
.card-btn { position: absolute; top: 18px; right: 18px; min-width: 38px; height: 38px; padding: 0 14px; border-radius: 30px; display: grid; place-items: center; background: var(--ink); color: var(--bg); font: 500 13px var(--f-body); transition: transform .35s var(--ease), background .3s; }
.c-mail { background: var(--stk-sand); --rot: -2deg; }
.c-in { background: var(--stk-sage); --rot: 1.5deg; }
.c-ig { background: var(--stk-peach); --rot: -1deg; }
.card.done .card-btn { background: var(--acc); }
@media (hover: hover) {
  .card:hover { transform: rotate(0) translateY(-6px); box-shadow: 0 1px 0 rgba(16,20,18,.06), 0 28px 44px -24px rgba(16,20,18,.5); }
  .card:hover .card-btn { transform: rotate(-8deg) scale(1.08); }
}

/* ---------- Bottom bar ---------- */
.foot { background: var(--ink); color: #e9e8e2; padding-top: 64px; overflow: hidden; border-radius: 28px 28px 0 0; }
.foot a { text-decoration: none; color: inherit; transition: color .25s; }
.foot a:hover { color: var(--stk-sage); }
.foot .caps { color: #8d918c; }
.foot-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 32px; align-items: start; }
.foot-col { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.foot-col .caps { margin-bottom: 6px; }
.foot-big { font: 700 clamp(18px, 2vw, 24px)/1 var(--f-title); letter-spacing: -.03em; display: flex; align-items: center; gap: 12px; font-variant-numeric: tabular-nums; }
.foot-big #clock { font-size: clamp(30px, 3.4vw, 46px); }
.foot-up { justify-self: end; font-size: 14px; padding: 10px 16px; border: 1px solid #3a3f3c; border-radius: 30px; white-space: nowrap; }
.foot-up:hover { border-color: var(--stk-sage); }

/* il nome, enorme, a riempire la riga. È anche un pianoforte: ogni lettera è un tasto */
.foot-name { margin-top: 1vh; padding: 0 2vw; line-height: .8; }
.foot-name > span { display: inline-block; white-space: nowrap; font: 800 100px/.8 var(--f-title); letter-spacing: -.055em; }
.foot-name i { display: inline-block; font-style: normal; transition: transform .5s var(--ease); }
.foot-name b { font-family: var(--f-serif); font-weight: 400; font-style: italic; color: var(--stk-sage); letter-spacing: -.02em; margin-left: .18em; }
.foot-name b i { font-style: italic; }
.foot-name i { transform-origin: 50% 0; touch-action: manipulation; }
.foot-name i.hit { animation: key .55s var(--ease); }
@keyframes key { 18% { transform: translateY(.07em) scaleY(.94); } 100% { transform: none; } }
.foot-hint.bravo { animation: key .55s var(--ease); }
.foot-piano { position: relative; z-index: 2; margin: 8vh 0 5vh; padding: 0 3vw; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.foot-songs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.foot-songs .caps { margin-right: 6px; }
.foot-songs button { padding: 10px 16px; border: 1px solid #3a3f3c; border-radius: 30px; font-size: 13.5px; color: #e9e8e2; transition: border-color .25s, background .25s, color .25s; }
.foot-songs button:hover { border-color: var(--stk-sage); }
.foot-songs .foot-mute { width: 42px; height: 42px; padding: 0; margin-left: 10px; display: grid; place-items: center; border-radius: 50%; position: relative; }
.foot-songs .foot-mute::before { content: ''; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 1px; background: #3a3f3c; }
.foot-mute svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.foot-mute .spk { fill: currentColor; }
.foot-mute .wave { transition: opacity .25s, transform .35s var(--ease); transform-origin: 12px 12px; }
.foot-mute .cross { opacity: 0; transform: scale(.4); transform-origin: 18.5px 12px; transition: opacity .25s, transform .35s var(--ease); }
.foot-songs .foot-mute[aria-pressed="true"] { background: none; color: #8d918c; border-color: #3a3f3c; }
.foot-mute[aria-pressed="true"] .wave { opacity: 0; transform: scale(.6); }
.foot-mute[aria-pressed="true"] .cross { opacity: 1; transform: none; }
.foot-songs button[aria-pressed="true"] { background: var(--stk-sage); border-color: var(--stk-sage); color: var(--ink); }
.foot-hint { color: var(--stk-sage); font-size: 22px; text-align: right; }
/* la guida: la prossima lettera da suonare si accende */
.foot-name i { position: relative; }
.foot-name i.next { color: var(--stk-sand); }
/* sotto ogni lettera, il tasto che la suona (solo dove c'è una tastiera) */
.foot-name i::before { content: '(' attr(data-key) ')'; position: absolute; left: 50%; top: 128%; translate: -50% 0; display: none; /* % dell'altezza della lettera: resta sotto la lineetta della guida */
  font: 500 13px/1 var(--f-body); font-style: normal; letter-spacing: .04em; color: #8d918c; transition: color .2s; }
.foot-name i.next::before { color: var(--stk-sand); }
@media (pointer: fine) { .foot-name i::before { display: block; } .foot-name { padding-bottom: 44px; } }
.foot-name i.next::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: -.08em; height: .05em; border-radius: 1em; background: var(--stk-sand); animation: blink 1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.foot-bot { display: flex; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 26px; font-size: 13px; color: #8d918c; border-top: 1px solid #262b28; margin-top: 5vh; }

@media (max-width: 760px) {
  .works { grid-template-columns: 1fr; }
  .work, .work-big { grid-column: auto; aspect-ratio: 4 / 3; }
  .about-text p { font-size: 16.5px; }
  /* da telefono la foto va sopra il titolo, più piccola, con la nota a fianco */
  .about { grid-template-columns: 1fr; gap: 0; }
  .about-photo { order: -1; justify-content: flex-start; margin: 0 0 56px; }
  .ph { width: 132px; padding: 8px; }
  .f1-wrap { grid-template-columns: 1fr; gap: 24px; margin-top: 8vh; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card { min-height: 170px; }
  .foot { padding-top: 44px; border-radius: 20px 20px 0 0; }
  .foot-top { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .foot-top > .foot-col:first-child { grid-column: 1 / -1; }
  .foot-up { grid-column: 1 / -1; justify-self: start; }
  .foot-bot { flex-direction: column; gap: 4px; }
  .foot-name b { display: block; margin-left: 0; }
  .foot-hint { text-align: left; font-size: 20px; }
  /* le canzoni: l'etichetta sopra, poi una fila di quattro pulsanti uguali */
  .foot-piano { padding: 0 16px; }
  .foot-songs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 42px; gap: 8px; width: 100%; }
  .foot-songs .caps { grid-column: 1 / -1; margin: 0 0 4px; }
  .foot-songs button { padding: 0 6px; height: 42px; font-size: 13px; white-space: nowrap; }
  .foot-songs .foot-mute { margin-left: 0; }
  .foot-songs .foot-mute::before { display: none; }
}
