/* Poliedria — chapter 07. Visibility of every block is driven from poliedria.mjs (scroll position);
   this file only lays things out. Phases on #archivio[data-phase]: orbits · build · areas · net · cards · exit. */

#archivio{height:1300vh}
.is-mobile #archivio{height:1150vh}
html{scroll-snap-type:y proximity}
.snap{position:absolute;left:0;width:1px;height:1px;scroll-snap-align:start;pointer-events:none}
@media (prefers-reduced-motion:reduce){html{scroll-snap-type:none}}

/* the data panels belong to the orbits phase only */
#archivio:not([data-phase=orbits]) .archive-index,#archivio:not([data-phase=orbits]) .stats{opacity:0!important;translate:0 -14px!important;visibility:hidden;transition:opacity .45s,translate .6s var(--ease),visibility 0s .45s}
#archivio:not([data-phase=orbits]) .star-label{display:none}

/* a card open to the full viewport: the page chrome steps aside */
html.fl-open .rail,html.fl-open .hud{opacity:0;pointer-events:none;transition:opacity .3s}
html.fl-open .mark,html.fl-open .now,html.fl-open .progress{opacity:0;pointer-events:none;transition:opacity .3s}
html.fl-open .top>.cta{background:#0d0b14;color:#fff}
html.fl-open .top{background:none}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.poly-nav:focus-within{position:absolute;z-index:8;left:16px;top:96px;width:auto;height:auto;clip:auto;overflow:visible;white-space:normal;padding:14px 18px;background:#0d0b14f2;border-radius:12px;font-size:15px}
.poly-nav ul{margin:6px 0 0;padding-left:18px;display:grid;gap:4px}

/* ---------- captions (build, net) ---------- */
.poly-copy,.net-copy{position:absolute;z-index:3;left:clamp(20px,6vw,96px);bottom:clamp(44px,10vh,110px);max-width:min(440px,86vw);display:grid;gap:12px;opacity:0;text-shadow:var(--halo)}
.poly-copy h3,.net-copy h3{margin:0;font:400 clamp(32px,3.4vw,52px)/1.02 var(--serif);letter-spacing:-.01em}
.poly-copy p,.net-copy p{margin:0;font-size:17px;line-height:1.55;color:#ece4f2;max-width:42ch}
.poly-copy .kicker,.net-copy .kicker{margin:0}
.poly-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:6px}
.poly-actions .cta{justify-self:start}
.net-copy{left:50%;bottom:clamp(20px,3.4vh,36px);translate:-50% 0;width:max-content;max-width:min(1160px,92vw);grid-template-columns:auto minmax(0,40ch) auto;align-items:center;gap:clamp(18px,2.4vw,36px)}
.net-copy h3{font-size:clamp(26px,2.3vw,36px)}.net-copy p{font-size:15px}.net-copy p:last-child{white-space:nowrap}

/* ---------- area panel (areas phase) ---------- */
.area-panel{--c:#b99bff;position:absolute;z-index:3;left:clamp(20px,6vw,96px);top:50%;transform:translateY(-50%);width:min(440px,40vw);display:grid;gap:14px;opacity:0;
  text-shadow:var(--halo)}
.area-panel .ap-count{margin:0;color:var(--c)}
.ap-title{margin:0;font:400 clamp(40px,4.6vw,72px)/.98 var(--serif);letter-spacing:-.015em}
.ap-offer{margin:0;font-size:17px;line-height:1.5;color:#ece4f2;max-width:36ch}
.ap-stats{display:grid;grid-template-columns:repeat(3,auto);justify-content:start;gap:clamp(18px,2.4vw,36px);margin:10px 0 0;padding:0}
.ap-stats div{display:flex;flex-direction:column-reverse;gap:6px}
.ap-stats dd{margin:0;font:500 clamp(28px,2.6vw,40px)/1 var(--sans);font-variant-numeric:tabular-nums;letter-spacing:-.03em}
.ap-stats div:first-child dd{color:var(--c)}
.ap-stats dt{font:13px/1.35 var(--sans);color:var(--muted);max-width:16ch}
.ap-posts{display:grid;gap:6px}
.ap-sub{margin:6px 0 2px;font:500 15px/1.2 var(--sans);color:var(--ink)}
.ap-post{all:unset;cursor:pointer;display:flex;justify-content:space-between;gap:14px;padding:11px 14px;border-radius:10px;background:#ffffff12;text-shadow:none;
  font-size:15px;line-height:1.35;color:var(--ink);transition:background .2s,translate .3s var(--ease)}
.ap-post i{font:normal 13px/1.4 var(--sans);color:var(--faint);white-space:nowrap;align-self:center}
.ap-post:hover,.ap-post:focus-visible{background:color-mix(in srgb,var(--c) 30%,#0d0b14);translate:4px 0}
.ap-steps{display:flex;gap:8px;margin-top:6px}
.ap-steps button{all:unset;cursor:pointer;width:26px;height:4px;border-radius:2px;background:#ffffff26;transition:background .3s,width .4s var(--ease)}
.ap-steps button[aria-current]{width:46px;background:var(--c)}
.ap-steps button:focus-visible{outline:2px solid var(--amber);outline-offset:4px}

/* ---------- focus layer (cards phase): the card opens to the full viewport ---------- */
.focus-layer{position:absolute;inset:0;z-index:6;visibility:hidden;clip-path:circle(0 at 50% 50%);will-change:clip-path;--v:0}
.fl{position:absolute;inset:0;display:none;overflow:hidden}
.fl.is-on{display:block}
.fl-in{position:relative;height:100%;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:clamp(14px,2.4vh,28px);
  padding:clamp(96px,13vh,132px) clamp(24px,6vw,96px) clamp(28px,5vh,56px);max-width:1440px;margin:0 auto;
  opacity:calc(var(--v) * 1.6 - .6);translate:0 calc((1 - var(--v)) * 18px)}
.fl-head{display:grid;gap:12px}
.fl-kicker{margin:0;font:500 15px/1.4 var(--sans);opacity:.85}
.fl-title{margin:0;line-height:.92}
.fl-tag{margin:0;font-size:clamp(17px,1.5vw,21px);max-width:46ch;line-height:1.4}
.fl-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:clamp(24px,4vw,72px);align-items:center;min-height:0}
.fl-story{display:grid;gap:14px;font-size:clamp(16px,1.1vw,17px);line-height:1.55;max-width:56ch}
.fl-story p{margin:0}
.fl-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(14px,3vw,48px);margin:0;padding-top:clamp(12px,2vh,22px)}
.fl-facts div{display:flex;flex-direction:column-reverse;gap:6px}
.fl-facts dd{margin:0;font-variant-numeric:tabular-nums}
.fl-facts dt{font:13px/1.4 var(--sans);max-width:28ch;opacity:.85}
.fl-cta{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.fl-cta .cta{justify-self:start}
.fl-media{margin:0;min-height:0;display:grid;place-items:center}
.fl-media img{display:block;width:100%;height:auto;max-height:46vh;object-fit:cover;border-radius:6px}
.fl-media--stack{grid-template-columns:1fr 1fr;gap:12px}.fl-media--stack img:first-child{grid-column:1/-1}
.fl-media--stack img{max-height:22vh}
.fl-scroll{position:absolute;right:clamp(20px,4vw,48px);bottom:clamp(20px,4vh,40px);margin:0;font:500 14px/1 var(--sans);opacity:.7;mix-blend-mode:difference;color:#fff}

/* swiss — Scadenze */
.fl--swiss{background:var(--wp,#f2efe8);color:#111;font-family:var(--sans)}
.fl--swiss .fl-head{color:var(--wink,var(--wp,#f2efe8));position:relative;padding-bottom:clamp(16px,3vh,32px)}
.fl--swiss .fl-head::before{content:'';position:absolute;z-index:-1;left:-100vw;right:-100vw;bottom:0;top:-40vh;background:var(--wa,#e1251b)}
.fl--swiss .fl-in{isolation:isolate}
.fl--swiss .fl-title{font:800 clamp(52px,8.4vw,140px)/.9 var(--sans);letter-spacing:-.055em;max-width:11ch}
.fl--swiss .fl-tag{font-weight:600}
.fl--swiss .fl-story b{display:block;font-size:15px;color:var(--wa,#e1251b);margin-bottom:2px}
.fl--swiss .fl-facts{padding-top:0}
.fl--swiss .fl-facts dd{font:800 clamp(34px,4vw,64px)/1 var(--sans);letter-spacing:-.04em}
.fl--swiss .cta{background:#111;color:var(--wp,#f2efe8);border-radius:0;font-weight:700}
.fl--swiss .cta--ghost{background:#1111141a;color:#111}
.fl-traffic{margin:0;display:grid;gap:18px;padding:24px;background:#fff}
.fl-traffic ol{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.fl-traffic li{display:grid;gap:2px;padding:12px 10px;background:color-mix(in srgb,#e1251b calc(var(--i)*22%),#2e9d4f);color:#fff}
.fl-traffic li b{font:800 clamp(22px,2.2vw,34px)/1 var(--sans);letter-spacing:-.03em}.fl-traffic li span{font-size:13px;}
.fl-lights{display:flex;gap:10px}.fl-lights i{width:28px;height:28px;border-radius:50%}
.fl-lights .g{background:#2e9d4f}.fl-lights .y{background:#f2c12e}.fl-lights .o{background:#f08a24}.fl-lights .r{background:#e1251b}
.fl-traffic figcaption{font-size:15px;font-weight:700}

/* blueprint */
.fl--blueprint{background:var(--wd,#0b2a6f);color:#e3ecff;font-family:var(--sans)}
.fl--blueprint .fl-title{font:600 clamp(48px,7.4vw,120px)/.95 var(--sans);letter-spacing:-.05em;color:#fff}
.fl--blueprint .fl-story{font-family:var(--sans);color:#e8efff}
.fl--blueprint .fl-story b{font-family:var(--sans);font-weight:500;color:var(--wa,#9fc0ff)}
.fl--blueprint .fl-facts{padding-top:0}
.fl--blueprint .fl-facts dd{font:600 clamp(28px,3.4vw,52px)/1 var(--sans);color:#fff}
.fl--blueprint .cta{border-radius:0;background:#fff;color:var(--wd,#0b2a6f);font-weight:600}.fl--blueprint .cta--ghost{background:#ffffff1f;color:#fff}
.fl-bench{margin:0;padding:22px 24px;background:#ffffff12}
.fl-bench figcaption{font-size:13px;margin-bottom:14px;display:grid;gap:6px;color:#fff}
.fl-bench small{font-size:13px;text-transform:none;letter-spacing:0;color:#9fc0ff}
.fl-bench table{width:100%;border-collapse:collapse;font-size:clamp(13px,1.1vw,16px)}
.fl-bench th{font-weight:400;font-size:13px;color:#9fc0ff;text-align:left;padding:0 0 8px}
.fl-bench td{padding:12px 0;border-top:1px solid #d6e4ff33;font-variant-numeric:tabular-nums}
.fl-bench tr:nth-child(2) td{color:#fff;font-weight:600}

/* editorial — Session to Blog */
.fl--editorial{background:var(--wp,#efe6d3);color:#1c1a16;font-family:Georgia,var(--serif)}
.fl--editorial .fl-head{text-align:center;justify-items:center;padding-bottom:clamp(10px,2vh,20px)}
.fl--editorial .fl-kicker{color:var(--wa,#8a3b12);font-family:var(--sans);font-weight:600}
.fl--editorial .fl-title{font:italic 400 clamp(60px,9.6vw,160px)/.88 var(--serif);letter-spacing:-.02em}
.fl--editorial .fl-tag{font-style:italic;color:#3b352b}
.fl--editorial .fl-story{columns:2 260px;column-gap:36px;display:block;font-size:clamp(14px,1.1vw,17px)}
.fl--editorial .fl-story p+p{margin-top:12px}
.fl--editorial .fl-story b{font-family:var(--sans);font-size:15px;font-weight:600;color:var(--wa,#8a3b12)}
.fl--editorial .fl-facts{text-align:center}
.fl--editorial .fl-facts div{align-items:center}
.fl--editorial .fl-facts dd{font:400 clamp(40px,4.6vw,72px)/1 var(--serif)}
.fl--editorial .fl-facts dt{font-family:var(--sans)}
.fl--editorial .fl-cta{justify-content:center}
.fl--editorial .cta{background:#1c1a16;color:var(--wp,#efe6d3);font-family:var(--serif);font-style:italic;font-size:19px}.fl--editorial .cta--ghost{background:#1c1a161a;color:#1c1a16}
.fl--editorial .fl-media img{border-radius:0}

/* brutal */
.fl--brutal{background:var(--wa,#e4ff1a);color:#000;font-family:var(--sans)}
.fl--brutal::before,.fl--brutal::after{content:'';position:absolute;left:0;right:0;height:28px;background:repeating-linear-gradient(-45deg,#000 0 18px,var(--wa,#e4ff1a) 18px 36px)}
.fl--brutal::before{top:0}.fl--brutal::after{bottom:0}
.fl--brutal .fl-kicker{font-weight:800}
.fl--brutal .fl-title{font:900 clamp(72px,11.5vw,190px)/.8 var(--sans);letter-spacing:-.065em;}
.fl--brutal .fl-tag{display:inline-block;justify-self:start;background:#000;color:var(--wa,#e4ff1a);padding:8px 14px;font-weight:800;font-size:clamp(14px,1.4vw,19px)}
.fl--brutal .fl-story{font-weight:600}
.fl--brutal .fl-story b{font-weight:900}
.fl--brutal .fl-facts{border-top:6px solid #000}
.fl--brutal .fl-facts dd{font:900 clamp(44px,6vw,96px)/.85 var(--sans);letter-spacing:-.05em}
.fl--brutal .fl-facts dt{font-weight:800}
.fl--brutal .cta{background:#000;color:var(--wa,#e4ff1a);border-radius:0;border:0;font-weight:900;box-shadow:8px 8px 0 #ff2bd6}.fl--brutal .cta::before{background:#ff2bd6;box-shadow:none}
.fl--brutal .cta--ghost{background:transparent;color:#000;box-shadow:none;border:3px solid #000}
.fl-check{margin:0;border:6px solid #000;background:#000;color:#e4ff1a;padding:14px 18px;display:grid;gap:8px;align-self:center}
.fl-check figcaption{font-weight:900;font-size:clamp(14px,1.3vw,18px)}
.fl-check table{width:100%;border-collapse:collapse}
.fl-check td{padding:7px 8px 7px 0;border-top:2px solid #e4ff1a44;font-weight:700;font-size:clamp(13px,1.1vw,16px)}
.fl-check td:first-child{font:900 clamp(20px,1.8vw,28px)/1 var(--sans);letter-spacing:-.03em;width:28%}
.fl-check td:last-child{text-align:right;font-weight:900}
.fl-check .ok{color:#7dff9a}
.fl-check tr.no td:not(:last-child){color:#ff6be3;text-decoration:line-through;text-decoration-thickness:3px}
.fl-check tr.no td:last-child span{display:inline-block;background:#ff2bd6;color:#000;padding:4px 8px}
.fl-check small{font-size:13px;font-weight:600;color:#e4ff1acc}

/* glass */
.fl--glass{color:#f3ecf7;font-family:var(--sans);background:#140d26}
.fl--glass .fl-kicker{color:#ffb877}.fl--glass .cta:not(.cta--ghost){background:var(--amber);color:#1c0d03}
.fl--glass .fl-title{font:italic 400 clamp(64px,9.6vw,160px)/.9 var(--serif);color:#fff}
.fl--glass .fl-story{color:#e6dcee}
.fl--glass .fl-story b{color:#b99bff;font-weight:500}
.fl--glass .fl-facts dd{font:300 clamp(34px,4vw,64px)/1 var(--sans);letter-spacing:-.04em}
.fl--glass .fl-facts dt{color:#b9adc6}
.fl--glass .fl-media img{border-radius:18px}

/* contact face */
.fl--contact{background:#f2a65e;color:#1a0c05}
.fl--contact .fl-in{grid-template-rows:1fr auto auto auto;align-content:center;text-align:center;justify-items:center}
.fl--contact .fl-kicker{align-self:end}
.fl--contact .fl-title{font:400 clamp(56px,9vw,150px)/.9 var(--serif)}
.fl--contact .fl-title em{font-style:italic}
.fl--contact .fl-tag{max-width:40ch}
.fl--contact .cta{background:#1a0c05;color:#ffe2c2}.fl--contact .cta--ghost{background:#1a0c051f;color:#1a0c05}.fl--contact .cta::before{background:#1a0c05;box-shadow:none}

/* ---------- narrow screens ---------- */
@media (max-width:860px){
  .area-panel{left:20px;right:20px;top:auto;bottom:calc(22px + env(safe-area-inset-bottom,0px));transform:none;width:auto;gap:10px}
  .ap-title{font-size:clamp(34px,9vw,48px)}
  .ap-offer{font-size:15px}
  .ap-stats{gap:16px;padding-top:12px}.ap-stats dd{font-size:26px}
  .ap-posts .ap-post:nth-child(n+3){display:none}
  /* phone: a card is a poster — title, mechanism, numbers, actions; the full story lives on the case-study page */
  .fl-in{padding:84px 20px calc(20px + env(safe-area-inset-bottom,0px));grid-template-rows:auto 1fr auto auto;gap:14px}
  .fl-body{grid-template-columns:1fr;gap:12px;align-items:center}
  .fl-story{display:none}
  .fl-title{font-size:clamp(44px,13vw,64px)!important;letter-spacing:-.04em}
  .fl--brutal .fl-title{font-size:clamp(56px,18vw,84px)!important}
  .fl-tag{font-size:15px}
  .fl--brutal .fl-tag{font-size:13px}
  .fl-traffic,.fl-bench,.fl-check{padding:14px}
  .fl-traffic li{padding:8px 6px}.fl-traffic li b{font-size:18px}
  .fl-bench table{font-size:13px}.fl-bench svg{display:none}
  .fl-check td{font-size:13px;padding:5px 6px 5px 0}.fl-check td:first-child{font-size:18px}
  .fl-facts dd{font-size:clamp(24px,7vw,34px)!important}
  .fl-cta .cta{min-height:44px;padding:0 16px;font-size:14px}
  .fl--contact .fl-in{grid-template-rows:1fr auto auto auto}
  .net-copy p{display:none}
  .net-copy h3{font-size:26px}
  .fl-facts{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
  .fl-facts dt{font-size:13px}
  .fl-media img{max-height:26vh}
  .fl-scroll{position:absolute;right:clamp(20px,4vw,48px);bottom:clamp(20px,4vh,40px);margin:0;font:500 14px/1 var(--sans);opacity:.7;mix-blend-mode:difference;color:#fff}
  .poly-copy,.net-copy{left:20px;right:20px;bottom:calc(26px + env(safe-area-inset-bottom,0px));max-width:none;translate:none}
  .net-copy{text-align:left;justify-items:start;grid-template-columns:1fr;width:auto}
}

/* cross-document transition: the card title flies into the case-study page and back */
@view-transition{navigation:auto}
@media (prefers-reduced-motion:reduce){@view-transition{navigation:none}}
.project-links{display:flex;flex-wrap:wrap;gap:10px}

/* capability map (cases without a specific mechanism figure) */
.fl-map{margin:0;display:grid;grid-template-columns:1fr 1fr;gap:clamp(12px,2vw,28px);align-self:center}
.fl-map span{display:block;font:600 15px/1.2 var(--sans);margin-bottom:10px}
.fl-map ul{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.fl-map li{padding:12px 14px;background:color-mix(in srgb,currentColor 9%,transparent);font-size:clamp(15px,1.1vw,17px);line-height:1.3}
.fl--swiss .fl-map li{font-weight:700}
.fl--blueprint .fl-map li{background:#ffffff14}
.fl--editorial .fl-map li{background:none;padding:6px 0;font-style:italic;font-family:var(--serif);font-size:clamp(16px,1.3vw,20px)}
.fl--brutal .fl-map li{border-width:4px;font-weight:900;}
.fl--glass .fl-map li{border-radius:999px;background:#ffffff14}
@media (max-width:860px){.fl-map{grid-template-columns:1fr 1fr}.fl-map li{padding:7px 9px;font-size:13px}}

/* long titles and word-valued facts keep the card inside one viewport */
.fl-long .fl-title{font-size:clamp(40px,5.4vw,88px)!important;max-width:18ch}
.fl--brutal.fl-long .fl-title{font-size:clamp(48px,7vw,112px)!important}
.fl-facts dd.txt{font-size:clamp(20px,2.1vw,34px)!important;letter-spacing:-.01em;line-height:1.05}
.fl-body{overflow:hidden}
@media (max-width:860px){.fl-long .fl-title{font-size:clamp(32px,9vw,46px)!important}.fl-facts dd.txt{font-size:18px!important}}

/* A card opens onto the site itself: its poster, its palette, its sign. */
.fl--site{grid-template-columns:minmax(300px,.38fr) minmax(0,1fr);background:var(--bg);color:var(--fg)}.fl--site.is-on{display:grid}
.fl-shot{order:2;position:relative;display:block;overflow:hidden;background:color-mix(in srgb,var(--fg) 8%,var(--bg))}
.fl-shot img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:0 0}
.fl-side{order:1;display:flex;flex-direction:column;justify-content:flex-end;gap:14px;padding:clamp(84px,12vh,120px) clamp(20px,3vw,48px) clamp(24px,5vh,56px)}
.fl--site .fl-sg{width:clamp(72px,7vw,112px);height:clamp(72px,7vw,112px);color:var(--ac);margin-bottom:auto}
.fl--site .fl-title{font:400 clamp(44px,5vw,84px)/.98 var(--serif);letter-spacing:-.02em}
.fl--site .fl-tag{font-size:clamp(17px,1.4vw,20px)}.fl-note{margin:0;font-size:14px;opacity:.8}
.fl--site .cta{background:var(--fg);color:var(--bg)}.fl--site .cta--ghost{background:none;color:var(--fg);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--fg) 45%,transparent)}
.is-mobile .fl--site{grid-template-columns:1fr;grid-template-rows:42svh minmax(0,1fr)}.is-mobile .fl-shot{order:1}.is-mobile .fl-side{order:2;padding:18px 18px 28px;justify-content:flex-start}.is-mobile .fl--site .fl-sg{display:none}
html.fl-open .scala{opacity:0;pointer-events:none}
