:root{
  --ink:#0d0c11; --ink-2:#15131b; --bone:#efe9df; --bone-2:#b9b2a7; --bone-3:#8f897f;
  --line:rgba(239,233,223,.14);
  --c-edciv:#d2402f; --c-carti:#8a63ff; --c-dream:#1fa39a; --c-blog:#e0a030; --c-port:#d6588a;
  --ease-out:cubic-bezier(.23,1,.32,1);
  /* scala tipografica 1.25 */
  --t-xs:.75rem; --t-s:.875rem; --t-m:1rem; --t-name:clamp(1.25rem,1.75vw,1.875rem); --t-hero:clamp(3rem,min(9vw,13vh),8.5rem);
  /* spazi 4/8 */
  --s2:8px; --s3:16px; --s4:24px; --s5:40px;
  --pad:clamp(16px,3vw,48px);
}
html,body{background:var(--ink)!important;margin:0;padding:0}
body{color:var(--bone);font-family:"Schibsted Grotesk",system-ui,sans-serif;-webkit-font-smoothing:antialiased;overflow:hidden}
#hub *{box-sizing:border-box}
#hub{position:relative;height:calc(100vh - var(--wp-admin--admin-bar--height,0px));height:calc(100svh - var(--wp-admin--admin-bar--height,0px));isolation:isolate}
#hub a{color:inherit;text-decoration:none}
#hub ::selection{background:var(--bone);color:var(--ink)}

/* sfondo animato */
#hub-bg{position:fixed;inset:0;width:100%;height:100%;z-index:-2;display:block}
.hub-grain{position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.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");}

/* tutto in una schermata */
.hub-frame{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:clamp(16px,3.2vh,40px);padding:clamp(16px,3vh,32px) var(--pad);max-width:1600px;margin:0 auto}

.hub-top,.hub-foot{display:flex;justify-content:space-between;align-items:center;gap:var(--s3);font-family:"Spline Sans Mono",monospace;font-size:var(--t-xs);letter-spacing:.06em;text-transform:uppercase;color:var(--bone-2)}
.hub-foot{color:var(--bone-3)}
.hub-clock{font-variant-numeric:tabular-nums}

.hub-hero{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--s5);padding-top:clamp(8px,4vh,56px)}
.hub-title{font-family:"Gloock",Georgia,serif;font-weight:400;font-size:var(--t-hero);line-height:1;letter-spacing:-.02em;margin:0;color:var(--bone)}
.hub-title .ln{display:block;overflow:hidden;padding-bottom:.08em}
.hub-title .ln>span{display:inline-block}
.hub-lead{max-width:36ch;font-size:clamp(.9375rem,1.2vw,1.125rem);line-height:1.5;color:var(--bone-2);margin:0 0 .9em}
.hub-lead b{color:var(--bone);font-weight:500}

/* le tre schede: quella sotto il cursore si allarga */
.hub-cards{display:flex;gap:clamp(10px,1.2vw,18px);min-height:0}
.hub-card{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:var(--ink-2);
  box-shadow:0 0 0 1px var(--line),0 30px 60px -30px rgba(0,0,0,.8);
  transition:flex-grow .7s var(--ease-out),box-shadow .3s ease,transform .16s var(--ease-out);outline:none}
.hub-card[data-k="edciv"]{--cs:var(--c-edciv)}
.hub-card[data-k="carti"]{--cs:var(--c-carti)}
.hub-card[data-k="dream"]{--cs:var(--c-dream)}
.hub-card[data-k="blog"]{--cs:var(--c-blog)}
.hub-card[data-k="port"]{--cs:var(--c-port)}
.hub-card:active{transform:scale(.985)}
.hub-card:focus-visible{box-shadow:0 0 0 2px var(--bone)}

.hub-shot{position:relative;flex:1 1 auto;min-height:0;overflow:hidden;background:#1b1922}
.hub-shot iframe{position:absolute;left:50%;top:0;width:1280px;height:800px;border:0;pointer-events:none;transform-origin:50% 0;background:#fff;opacity:0;transition:opacity .5s ease}
.hub-shot iframe.ready{opacity:1}
.hub-shot::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,transparent 55%,rgba(21,19,27,.55));transition:opacity .4s ease}

.hub-info{position:relative;flex:0 0 auto;display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"num name go" "num desc go";column-gap:var(--s3);row-gap:6px;align-items:center;padding:clamp(14px,2.2vh,22px) clamp(14px,1.4vw,22px);background:var(--ink-2);border-top:1px solid var(--line)}
.hub-info::before{content:"";position:absolute;left:0;top:-1px;height:2px;width:100%;background:var(--cs);transform:scaleX(0);transform-origin:0 50%;transition:transform .6s var(--ease-out)}
.hub-num{grid-area:num;align-self:start;font-family:"Spline Sans Mono",monospace;font-size:var(--t-xs);color:var(--bone-3);padding-top:.5em}
.hub-name{grid-area:name;font-family:"Gloock",Georgia,serif;font-size:var(--t-name);line-height:1.1;letter-spacing:-.01em}
.hub-desc{grid-area:desc;font-size:var(--t-s);line-height:1.45;color:var(--bone-2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.hub-go{grid-area:go;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;box-shadow:inset 0 0 0 1px var(--line);transition:background-color .3s ease,box-shadow .3s ease,color .3s ease}
.hub-go svg{width:18px;height:18px;transition:transform .45s var(--ease-out)}

@media (hover:hover) and (pointer:fine){
  .hub-card:hover{flex-grow:1.7}
  .hub-cards:hover .hub-card:not(:hover) .hub-shot iframe{opacity:.45}
  .hub-card:hover .hub-info::before{transform:scaleX(1)}
  .hub-card:hover .hub-go{background:var(--cs);box-shadow:inset 0 0 0 1px var(--cs);color:#fff}
  .hub-card:hover .hub-go svg{transform:translate(2px,-2px)}
}
.hub-card:focus-visible .hub-info::before{transform:scaleX(1)}

/* schermi stretti: tre righe una sopra l'altra, sempre in una schermata */
@media (max-width:860px){
  .hub-hero{flex-direction:column;align-items:flex-start;gap:10px;padding-top:4px}
  .hub-lead{margin:0}
  .hub-top span:nth-child(2),.hub-hint{display:none}
  .hub-cards{flex-direction:column}
  .hub-card{flex-direction:row}
  .hub-shot{flex:0 0 38%}
  .hub-info{flex:1 1 auto;border-top:0;border-left:1px solid var(--line);grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"num go" "name go" "desc desc";align-content:center;row-gap:4px}
  .hub-num{padding:0}
  .hub-go{width:36px;height:36px}
  .hub-info::before{top:0;left:-1px;width:2px;height:100%;transform:scaleY(1);background:var(--cs);opacity:.9}
}
@media (max-width:860px) and (max-height:820px){ .hub-desc{display:none} }

@media (prefers-reduced-motion:reduce){
  .hub-card,.hub-info::before,.hub-go svg{transition:none}
}

body.admin-bar #hub{height:calc(100vh - 32px);height:calc(100svh - 32px)}
@media screen and (max-width:782px){body.admin-bar #hub{height:calc(100vh - 46px);height:calc(100svh - 46px)}}

/* Schede quadrate su schermi larghi: lato = il più piccolo tra un quinto della larghezza e l'altezza disponibile */
@media (min-width:861px){
  .hub-cards{--g:clamp(10px,1.2vw,18px);gap:var(--g);container-type:size;align-items:center;justify-content:center}
  .hub-card{flex:0 0 auto;width:min(calc((100cqw - 4 * var(--g)) / 5), 100cqh);aspect-ratio:1/1;height:auto}
  .hub-card:hover{flex-grow:0}
  .hub-name{font-size:clamp(1.125rem,1.45vw,1.625rem)}
  .hub-info{padding:clamp(12px,1.6vh,18px) clamp(12px,1.1vw,18px);column-gap:12px}
  .hub-go{width:38px;height:38px}
}
@media (min-width:861px) and (max-width:1280px){ .hub-desc{display:none} }
