/* kalosNetwork — la home è la mappa.
   Dopo l'apertura animata c'è una schermata sola: Nino al centro, le sezioni e i suoi ruoli intorno.
   Le sezioni del sito restano nella pagina (nascoste) e si aprono dentro un pannello.
   File aggiuntivo: per tornare indietro basta togliere il link in index.html */

/* apertura: stessa animazione, percorsa in meno scroll */
.hero { height: 170vh; }

/* ---------- la schermata della mappa ---------- */
.mappa {
  position: relative; z-index: 1;
  min-height: max(680px, 100vh); min-height: max(680px, 100svh);
  padding: 92px var(--gutter) 28px;
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .55);
  overflow: hidden;
}
.mappa-head { position: relative; z-index: 4; max-width: 420px; }
.mappa-head .eyebrow { margin-bottom: .8em; }
.mappa-title { margin: 0 0 10px; font-size: clamp(26px, 2.6vw, 40px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.mappa-title em { font-style: normal; color: var(--teal); }
.mappa-hint { margin: 0; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.mappa-hint::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); animation: mappa-blink 2s ease-in-out infinite; }
@keyframes mappa-blink { 50% { opacity: .25; } }

.map { position: relative; flex: 1; min-height: 560px; margin-top: -40px; }
.map-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.map-lines line { stroke: var(--line); stroke-width: 1.1; transition: stroke .5s, stroke-width .5s, opacity .5s; }
.map-lines line.is-portal { stroke: color-mix(in srgb, var(--c) 55%, transparent); stroke-width: 1.6; }
.map-lines line.is-hot { stroke: var(--c); stroke-width: 2.6; }
.map-lines .orbit { fill: none; stroke: rgba(20, 24, 29, .08); stroke-dasharray: 2 7; }
.map-lines .orbit.inner { stroke: rgba(46, 143, 163, .18); }

/* centro: Nino */
.hub {
  position: absolute; z-index: 5; translate: -50% -50%;
  width: clamp(150px, 13vw, 190px); aspect-ratio: 1;
  display: grid; place-content: center; justify-items: center; text-align: center; gap: 2px;
  border: 0; border-radius: 50%; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--glass-edge), 0 30px 70px -26px rgba(20, 24, 29, .4);
  transition: scale .7s var(--spring), box-shadow .7s var(--spring);
}
.hub:hover { scale: 1.05; box-shadow: var(--glass-edge), 0 36px 80px -24px rgba(20, 24, 29, .45), 0 0 0 2px var(--teal); }
.hub::before, .hub::after {
  content: ""; position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--teal) 32%, transparent);
  animation: mappa-pulse 4s var(--spring) infinite;
}
.hub::after { animation-delay: 2s; }
@keyframes mappa-pulse { from { scale: .9; opacity: .9; } to { scale: 1.45; opacity: 0; } }
.hub-photo { width: 54%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; margin-bottom: 8px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px color-mix(in srgb, var(--teal) 35%, transparent); }
.hub-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.hub strong { font-size: clamp(14px, 1.15vw, 16px); font-weight: 600; letter-spacing: -.02em; }
.hub-sub { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* primo giro: le sezioni */
.portal {
  position: absolute; z-index: 4; translate: -50% -50%;
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 10px 16px 10px 10px; border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; color: var(--ink);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--glass-edge), 0 10px 30px -16px rgba(20, 24, 29, .35);
  transition: scale .7s var(--spring), box-shadow .7s var(--spring);
}
.portal b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--c); }
.portal span { font-size: 15px; font-weight: 600; letter-spacing: -.015em; }
.portal small { font-size: 11px; font-weight: 500; color: var(--muted); }
.portal:hover, .portal.is-hot { scale: 1.07; box-shadow: var(--glass-edge), var(--glass-lift), 0 0 0 2px var(--c); }

/* secondo giro: i ruoli */
.node {
  --c: var(--teal);
  position: absolute; z-index: 3; translate: -50% -50%;
  width: clamp(132px, 11.5vw, 170px);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 11px 11px 12px; text-align: center;
  border: 0; border-radius: 18px; cursor: pointer; font: inherit; color: var(--ink);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--glass-edge);
  transition: scale .7s var(--spring), box-shadow .7s var(--spring), background .4s;
}
.node:hover, .node.is-hot, .node.is-on { scale: 1.07; background: var(--glass-strong); box-shadow: var(--glass-edge), var(--glass-lift); }
.node.is-on { box-shadow: var(--glass-edge), var(--glass-lift), 0 0 0 2px var(--c); }
.node-logo { height: 26px; display: grid; place-items: center; margin-bottom: 3px; }
.node-logo img { max-height: 26px; max-width: 100px; width: auto; height: auto; object-fit: contain; mix-blend-mode: multiply; }
.node-logo.is-dark { background: #0d0f14; border-radius: 8px; padding: 3px 8px; height: 28px; }
.node-logo.is-dark img { mix-blend-mode: normal; max-height: 22px; }
.node-logo.is-text { font-weight: 700; font-size: 14px; letter-spacing: .04em; color: #1d2733; }
.node-logo.is-small { font-size: 12px; letter-spacing: 0; }
.node-role { font-size: 9px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--c); }
.node-name { font-size: 13px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }

/* le sezioni restano nella pagina, ma si vedono solo dentro il pannello.
   Niente display:none: main.js costruisce ScrollTrigger e divide i testi su
   queste sezioni, e con gli elementi fuori dal layout l'intro va in errore e
   la pagina resta bloccata su is-loading. Le nascondiamo tenendole nel flusso. */
.kn-vault {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

/* ---------- scheda (ruoli) e pannello (sezioni) ---------- */
.kn-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(251, 251, 253, .6);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity .4s; }
.kn-sheet {
  --c: var(--teal);
  position: fixed; z-index: 91; left: 50%; top: 50%; translate: -50% -50%;
  width: min(520px, calc(100vw - 24px)); max-height: min(84vh, 760px); overflow: auto; overscroll-behavior: contain;
  padding: 30px 30px 28px; border-radius: 26px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(28px) saturate(180%); backdrop-filter: blur(28px) saturate(180%);
  box-shadow: var(--glass-edge), 0 40px 100px -30px rgba(20, 24, 29, .45);
  opacity: 0; scale: .95; pointer-events: none; transition: opacity .4s, scale .7s var(--spring);
}
.kn-sheet.is-wide { width: min(1180px, calc(100vw - 24px)); padding: 34px clamp(20px, 3vw, 44px) 36px; }
.kn-sheet::before { content: ""; position: sticky; display: block; top: -30px; height: 4px; margin: -30px -30px 26px; background: var(--c); }
.kn-sheet.is-wide::before { top: -34px; margin: -34px calc(-1 * clamp(20px, 3vw, 44px)) 28px; }
.kn-open .kn-scrim { opacity: 1; pointer-events: auto; }
.kn-open .kn-sheet { opacity: 1; scale: 1; pointer-events: auto; }
.kn-sheet .x { position: sticky; float: right; top: 0; margin: -14px -14px 0 0; z-index: 2; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(20, 24, 29, .07); font-size: 19px; cursor: pointer; color: var(--ink); }
.kn-sheet .x:hover { background: rgba(20, 24, 29, .13); }
.kn-sheet .card-logo { height: 44px; display: flex; align-items: center; margin-bottom: 16px; }
.kn-sheet .card-logo img { max-height: 44px; max-width: 180px; object-fit: contain; mix-blend-mode: multiply; }
.kn-sheet .card-logo.is-dark { background: #0d0f14; border-radius: 10px; padding: 6px 12px; width: max-content; }
.kn-sheet .card-logo.is-dark img { mix-blend-mode: normal; max-height: 32px; }
.kn-sheet .card-photo { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; margin-bottom: 16px;
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px color-mix(in srgb, var(--teal) 35%, transparent); }
.kn-sheet .card-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.kn-sheet .tag { margin-bottom: 10px; color: var(--c); }
.kn-sheet > h3 { margin: 0 0 14px; font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
.kn-sheet > p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.kn-sheet > p + p { margin-top: 12px; }
.kn-sheet .go { display: inline-flex; margin-top: 20px; padding: 11px 18px; border-radius: 999px; background: var(--ink);
  color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; transition: background .3s; }
.kn-sheet .go::after { content: " ↗"; margin-left: 6px; }
.kn-sheet .go:hover { background: var(--c); }
.kn-sheet .panel-title { margin: 0 0 6px; font-size: clamp(28px, 3.4vw, 48px); font-weight: 600; letter-spacing: -.04em; line-height: 1.02; }
.kn-sheet .panel-title em { font-style: normal; color: var(--c); }
.kn-sheet .panel-intro { margin: 0 0 26px; max-width: 60ch; font-size: 16px; line-height: 1.55; color: var(--muted); }
.kn-sheet .panel-sub { margin: 34px 0 14px; }

/* contenuti delle sezioni dentro il pannello: stesso stile, meno spazio */
.kn-sheet .section { padding: 0; border: 0; background: none; }
.kn-sheet .profilo-grid { margin-top: 0; }
.kn-sheet .stats { margin-top: 26px; }
.kn-sheet .quote { margin-top: 30px; text-align: left; }
.kn-sheet .quote-text { margin: 0 0 10px; max-width: none; font-size: clamp(19px, 1.8vw, 26px); }
.kn-sheet .quote-text .word { opacity: 1 !important; }
.kn-sheet .feature { margin-bottom: 16px; }
.kn-sheet .timeline li::before { background: var(--c); }
@media (min-width: 900px) {
  .kn-sheet .projects { grid-template-columns: repeat(3, 1fr); }
  .kn-sheet .project, .kn-sheet .project.is-wide { grid-column: auto; }
  .kn-sheet .services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 26px; border-bottom: 0; }
  .kn-sheet .service { grid-template-columns: 1fr; gap: 10px; align-content: start; padding: 20px 0 4px; }
  .kn-sheet .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 26px; }
  .kn-sheet .partners { display: grid !important; grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .kn-sheet .people-grid { grid-template-columns: repeat(5, 1fr) !important; }
}
.kn-sheet .project { padding: 26px 24px 28px; }
.kn-sheet .project h3 { font-size: 22px; }
.kn-sheet .project p:not(.tag) { font-size: 14.5px; }
.kn-sheet .service h3 { font-size: clamp(20px, 1.7vw, 26px); }
.kn-sheet .service p, .kn-sheet .step p { font-size: 14.5px; }
.kn-sheet .step { padding: 20px 0 0; opacity: 1; }
.kn-sheet .step-num { font-size: clamp(36px, 3.4vw, 52px); margin-bottom: 8px; }
.kn-sheet .step h3 { font-size: clamp(20px, 1.8vw, 26px); }
.kn-sheet .partners > .partner-card { flex: none !important; }
.kn-sheet .people { margin-top: 0; }
.kn-sheet .contatti { text-align: center; padding: 10px 0; }
.kn-sheet .contatti .big-title { font-size: clamp(30px, 3.6vw, 52px); }
.kn-sheet .contatti-mark { width: 72px; height: 72px; margin-bottom: 24px; }

/* ---------- mobile: centro, sezioni e ruoli uno sotto l'altro ---------- */
@media (max-width: 860px) {
  .mappa { min-height: 0; padding-top: 84px; }
  .map { flex: none; min-height: 0; margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .map-lines { display: none; }
  .hub, .portal, .node { position: relative; left: auto !important; top: auto !important; translate: none; }
  .hub { grid-column: 1 / -1; margin: 10px auto 18px; width: 170px; }
  .portal { justify-content: flex-start; border-radius: 16px; }
  .node { width: auto; }
  .kn-sheet, .kn-sheet.is-wide { top: auto; bottom: 0; translate: -50% 0; max-height: 88vh; border-radius: 24px 24px 0 0; }
}

@media (prefers-reduced-motion: reduce) { .hub::before, .hub::after, .mappa-hint::before { animation: none; } }
