/*
  Kit Show · dispositivi simulati (PC Windows, MacBook, iPhone)
  Da COPIARE nella cartella della presentazione, accanto a dispositivi.js.
  Regola (docs/know-how.md §1): ogni dispositivo è disegnato a misura reale fissa e poi scalato.
  Lo scaling lo calcola dispositivi.js e lo scrive in --s; qui si usa solo var(--s).
  Origine: monitor e finestre Windows 11 da Calibro, MacBook e iPhone da TED Monitor.
*/

/* =========================================================================
   Base: contenitore visibile + dispositivo a misura fissa scalato
   ========================================================================= */
/* Lo slot ha la dimensione visibile; l'aspect-ratio lo imposta dispositivi.js da data-width/data-height. */
.device-slot { position: relative; width: 100%; }
.device { position: absolute; left: 0; top: 0; transform: scale(var(--s, 1)); transform-origin: 0 0; }
.device, .device * { box-sizing: border-box; }
/* data-fit="contain": lo slot ha già un'altezza propria; il dispositivo ci sta dentro, centrato in orizzontale. */
.device-slot.is-contain { min-height: 0; }

/* Cambio di schermata dentro un dispositivo */
.swap-in { animation: swap-in .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes swap-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .swap-in { animation: none; } }

/* =========================================================================
   PC Windows: monitor con schermo 1120×630 (scene) o 1280×720 (prototipo)
   ========================================================================= */
.monitor { position: relative; width: 100%; }
.mon-screen { position: relative; z-index: 1; padding: 1.2%; background: #15191e; border: 1.5px solid #3a424b; border-radius: 14px; box-shadow: 0 40px 80px -24px rgba(11, 42, 69, .5); }
.mon-screen > .device-slot { overflow: hidden; border-radius: 3px; background: #9fb4c8; }
.mon-neck { width: 14%; height: 34px; margin: 0 auto; background: linear-gradient(90deg, #9aa3ac, #d3d8dd 45%, #8b949d); clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%); }
.mon-foot { width: 34%; height: 12px; margin: 0 auto; border-radius: 6px 6px 3px 3px; background: linear-gradient(#d8dde2, #a3acb5); box-shadow: 0 14px 24px -8px rgba(0, 0, 0, .35); }

/* Scrivania di Windows 11: sfondo neutro, finestre .wf-win e barra .taskbar dentro */
.desk {
  --wf-font: "Segoe UI", "Segoe UI Variable Text", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  position: absolute; inset: 0; overflow: hidden; font-family: var(--wf-font); font-size: 12px; color: #000; line-height: 1.25;
  background: radial-gradient(120% 90% at 85% 10%, #dfe7ee 0%, transparent 55%), linear-gradient(160deg, #c9d6e2 0%, #9fb4c8 45%, #6f8aa6 100%);
}
.desk, .desk * { box-sizing: border-box; }

/* Barra delle applicazioni */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; z-index: 50; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: #e9eef3; border-top: 1px solid rgba(255, 255, 255, .6); }
.tb-app { position: relative; width: 38px; height: 38px; border-radius: 5px; display: grid; place-items: center; border: 0; background: transparent; padding: 0; }
button.tb-app:hover { background: rgba(255, 255, 255, .7); }
.tb-app img, .tb-app svg { width: 24px; height: 24px; }
.tb-app .tb-logo { width: 22px; height: 22px; }
.tb-app.is-running::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 6px; height: 3px; margin-left: -3px; border-radius: 2px; background: #8a96a3; }
.tb-app.is-front::after { width: 16px; margin-left: -8px; background: #0067c0; }
.tb-search { display: flex; align-items: center; gap: 8px; width: 190px; height: 32px; padding: 0 12px; border-radius: 16px; background: rgba(255, 255, 255, .85); color: #5d6670; font-size: 12px; margin: 0 6px; }
.tb-search::before { content: ""; width: 10px; height: 10px; border: 1.8px solid #5d6670; border-radius: 50%; }
.tb-clock { position: absolute; right: 14px; text-align: right; font-size: 11px; line-height: 1.35; color: #1b1b1b; }

/* Finestra Windows 11 (titolo bianco, comandi riduci/ingrandisci/chiudi) */
.wf-win { position: absolute; isolation: isolate; display: flex; flex-direction: column; background: #f0f0f0; border: 1px solid #7a8a99; border-radius: 8px; overflow: hidden;
  box-shadow: 0 18px 44px rgba(16, 32, 52, .35), 0 2px 6px rgba(16, 32, 52, .2); }
.wf-win.is-inactive { box-shadow: 0 8px 22px rgba(16, 32, 52, .22); border-color: #a3afba; }
.wf-win.is-inactive .wf-title { color: #7a7a7a; }
.wf-title { flex: 0 0 31px; display: flex; align-items: center; gap: 8px; padding-left: 10px; background: #fff; font-size: 12px; user-select: none; }
.wf-tico { width: 16px; height: 16px; flex: none; display: grid; place-items: center; }
.wf-tico > img, .wf-tico > svg { width: 100%; height: 100%; }
.wf-ttext { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-tbtn { position: relative; flex: 0 0 44px; height: 31px; border: 0; background: transparent; padding: 0; }
.wf-tbtn::before, .wf-tbtn::after { content: ""; position: absolute; left: 50%; top: 50%; }
.g-min::before { width: 10px; height: 1px; margin: 0 0 0 -5px; background: #222; }
.g-max::before { width: 9px; height: 9px; margin: -5px 0 0 -5px; border: 1px solid #222; border-radius: 1.5px; }
.g-x::before, .g-x::after { width: 13px; height: 1.2px; margin: 0 0 0 -6.5px; background: #222; transform: rotate(45deg); }
.g-x::after { transform: rotate(-45deg); }
button.wf-close:hover { background: #c42b1c; }
button.wf-close:hover::before, button.wf-close:hover::after { background: #fff; }
.wf-body { position: relative; flex: 1; min-height: 0; overflow: auto; }

/* =========================================================================
   MacBook: schermo 980×612
   ========================================================================= */
.macbook { width: 100%; }
.mb-screen { padding: 1.1% 1.1% 1.5%; background: #0b0d11; border: 1.5px solid #474d57; border-radius: 18px 18px 4px 4px; box-shadow: 0 40px 80px -24px rgba(5, 63, 59, .45); }
.mb-screen > .device-slot { overflow: hidden; border-radius: 4px; background: #f5f7f9; }
.mb-view { position: absolute; inset: 0; overflow: hidden; }
.mb-base { position: relative; height: 14px; margin: 0 -6%; background: linear-gradient(#e2e6eb, #9ba4ae); border-radius: 2px 2px 16px 16px; box-shadow: 0 18px 30px -10px rgba(0, 0, 0, .35); }
.mb-base::before { content: ""; position: absolute; left: 41%; right: 41%; top: 0; height: 5px; border-radius: 0 0 6px 6px; background: #b3bbc5; }

/* Finestra macOS e barra del browser (semafori rosso/giallo/verde) */
.mac-win { position: absolute; display: flex; flex-direction: column; overflow: hidden; border-radius: 12px; background: #fff; border: 1px solid rgba(0, 0, 0, .18);
  box-shadow: 0 34px 80px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(255, 255, 255, .3); font-family: -apple-system, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif; }
.mac-title { flex: 0 0 38px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #e9edf0; border-bottom: 1px solid #d5dbe0; font-size: 12px; color: #4a5566; }
.mac-lights { display: flex; gap: 6px; flex: none; }
.mac-lights i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.mac-lights i:nth-child(2) { background: #febc2e; }
.mac-lights i:nth-child(3) { background: #28c840; }
.mac-ttext { flex: 1; min-width: 0; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mac-address { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; color: #6b7686; min-width: 0; white-space: nowrap; overflow: hidden; }
.mac-lock { width: 8px; height: 7px; border-radius: 1px; background: #8b95a3; position: relative; margin-top: 3px; flex: none; }
.mac-lock::before { content: ""; position: absolute; left: 1px; top: -5px; width: 4px; height: 5px; border: 1.5px solid #8b95a3; border-bottom: 0; border-radius: 3px 3px 0 0; }
.mac-body { position: relative; flex: 1; min-height: 0; overflow: auto; }

/* =========================================================================
   iPhone: 320×660 (slide) o 393×852 (prototipo navigabile)
   ========================================================================= */
.iphone-screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff;
  border: 7px solid #080b10; border-radius: 48px; box-shadow: 0 30px 60px rgba(5, 63, 59, .3), 0 0 0 1.5px #9eaeb9, 0 0 0 3px #52616d;
  font-family: -apple-system, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
}
.ios-status { flex: 0 0 40px; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 6px 24px 0; background: #fff; color: #111; font-size: 12.5px; font-weight: 650; transition: background .3s ease, color .3s ease; }
.ios-island { position: absolute; left: calc(50% - 34px); top: 9px; width: 68px; height: 21px; border-radius: 14px; background: #030507; }
/* Tacche, Wi-Fi e batteria; il colore segue il testo della barra */
.ios-icons { width: 64px; height: 11.3px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 12'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='5.7' width='3' height='6.3' rx='.8'/%3E%3Crect x='9.2' y='3.3' width='3' height='8.7' rx='.8'/%3E%3Crect x='13.8' y='.8' width='3' height='11.2' rx='.8'/%3E%3Cpath d='M29 11.8 26.6 9a3.6 3.6 0 0 1 4.8 0z'/%3E%3Cpath d='M24.4 7.1a6.6 6.6 0 0 1 9.2 0' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M21.6 4.1a10.6 10.6 0 0 1 14.8 0' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Crect x='41.5' y='.6' width='23' height='10.8' rx='3.3' fill='none' stroke='black' stroke-opacity='.4'/%3E%3Crect x='43.4' y='2.5' width='17' height='7' rx='1.7'/%3E%3Cpath d='M66 4v4a2 2 0 0 0 0-4z' fill-opacity='.4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 12'%3E%3Crect x='0' y='8' width='3' height='4' rx='.8'/%3E%3Crect x='4.6' y='5.7' width='3' height='6.3' rx='.8'/%3E%3Crect x='9.2' y='3.3' width='3' height='8.7' rx='.8'/%3E%3Crect x='13.8' y='.8' width='3' height='11.2' rx='.8'/%3E%3Cpath d='M29 11.8 26.6 9a3.6 3.6 0 0 1 4.8 0z'/%3E%3Cpath d='M24.4 7.1a6.6 6.6 0 0 1 9.2 0' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Cpath d='M21.6 4.1a10.6 10.6 0 0 1 14.8 0' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3Crect x='41.5' y='.6' width='23' height='10.8' rx='3.3' fill='none' stroke='black' stroke-opacity='.4'/%3E%3Crect x='43.4' y='2.5' width='17' height='7' rx='1.7'/%3E%3Cpath d='M66 4v4a2 2 0 0 0 0-4z' fill-opacity='.4'/%3E%3C/svg%3E") center / contain no-repeat; }
.ios-home { flex: 0 0 18px; display: grid; place-items: center; background: #fff; transition: background .3s ease; }
.ios-home i { width: 34%; height: 4px; border-radius: 4px; background: #111; }
.phone-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
/* Prototipo navigabile (393×852): la vista dell'app scorre dentro il telefono, non la pagina */
.iphone.is-proto .iphone-screen { border-radius: 44px; }
.iphone.is-proto .phone-view { overflow-y: auto; overscroll-behavior: contain; }
/* Varianti di colore della barra: aggiungi .is-dark allo schermo per status e home scuri */
.iphone-screen.is-dark .ios-status, .iphone-screen.is-dark .ios-home { background: #0d1b2a; color: #fff; }
.iphone-screen.is-dark .ios-home i { background: #fff; }
