/* tools page (2026-10-05): a map of the tools in the header (the person at the centre in amber,
   the tools around him in teal, each point a way in), then the tools as cards whose motifs open
   out on hover. Extends the shared components; restyles none of them. */

/* ------------------------------------------------------------------ header + map */
.page-head.tools-head{padding-block-end:clamp(20px,3vw,40px);}
.tools-head .head-grid{display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr); gap:clamp(24px,5vw,72px); align-items:center;}
@media (max-width:860px){ .tools-head .head-grid{grid-template-columns:minmax(0,1fr);} }

.tool-map{position:relative; inline-size:100%; max-inline-size:440px; aspect-ratio:10/9; justify-self:center;}
.tool-map svg{position:absolute; inset:0; inline-size:100%; block-size:100%; overflow:visible;}
html[dir="ltr"] .tool-map svg{transform:scaleX(-1);}
.tool-map line{stroke:var(--teal-2); stroke-width:.45; stroke-linecap:round; transition:stroke .25s ease, stroke-opacity .25s ease, stroke-width .25s ease;}
.tool-map .ring line{stroke-opacity:.4; stroke-dasharray:.6 1.8;}
.tool-map .spokes line{stroke-opacity:.28;}
.tool-map ul{list-style:none; margin:0; padding:0;}
.tool-map .map-center{position:absolute; inset-inline-start:50%; top:46%; inline-size:18px; block-size:18px; border-radius:50%; background:var(--amber);
  box-shadow:0 0 0 9px var(--amber-wash), 0 0 0 24px rgba(255,244,222,.55); transform:translate(-50%,-50%);}

.tool-map .node{position:absolute; inset-inline-start:var(--x); top:var(--y); z-index:1; display:flex; flex-direction:column; align-items:center; gap:7px;
  padding:0 2px 2px; border-radius:16px; transform:translate(-50%,-9px);}
html[dir="rtl"] .tool-map .node{transform:translate(50%,-9px);}
.tool-map .pt{inline-size:18px; block-size:18px; border-radius:50%; background:var(--teal-3);
  box-shadow:0 0 0 5px var(--teal-wash), 0 0 0 6px rgba(20,163,150,.22); transition:transform .3s var(--ease), background .2s ease, box-shadow .2s ease;}
.tool-map .lbl{display:inline-flex; align-items:center; min-block-size:34px; padding-inline:13px; border-radius:999px; background:var(--surface); border:1px solid var(--line);
  box-shadow:var(--shadow-1); font-size:15px; font-weight:600; line-height:1.2; color:var(--ink); white-space:nowrap; transition:border-color .2s ease, color .2s ease, box-shadow .2s ease;}
.tool-map .node:hover .pt, .tool-map .node:focus-visible .pt{transform:scale(1.3); background:var(--amber); box-shadow:0 0 0 5px var(--amber-wash), 0 0 0 6px rgba(242,181,68,.35);}
.tool-map .node:hover .lbl, .tool-map .node:focus-visible .lbl{border-color:var(--teal-2); color:var(--teal); box-shadow:var(--shadow-2);}
.tool-map .node:focus-visible{outline:none;}
.tool-map .node:focus-visible .lbl{outline:3px solid var(--teal); outline-offset:2px;}
/* the line from the person to the tool under the pointer turns amber */
.tool-map:has(.n1:hover,.n1:focus-visible) .l1,
.tool-map:has(.n2:hover,.n2:focus-visible) .l2,
.tool-map:has(.n3:hover,.n3:focus-visible) .l3,
.tool-map:has(.n4:hover,.n4:focus-visible) .l4,
.tool-map:has(.n5:hover,.n5:focus-visible) .l5,
.tool-map:has(.n6:hover,.n6:focus-visible) .l6{stroke:var(--amber); stroke-opacity:1; stroke-width:.9;}
/* the header's one motion moment: the tools bloom outward from the person, the lines draw out to
   them, then the ring between the tools closes */
.tool-map .node{animation:map-bloom 1s var(--ease) both; animation-delay:calc(.2s + var(--i,0) * .09s);}
@keyframes map-bloom{from{inset-inline-start:50%; top:46%; opacity:0;}}
.tool-map .spokes line{stroke-dasharray:1; stroke-dashoffset:1; animation:map-draw .9s var(--ease) forwards; animation-delay:calc(.2s + var(--i,0) * .09s);}
@keyframes map-draw{to{stroke-dashoffset:0;}}
.tool-map .ring{animation:map-fade 1s 1s ease both;}
.tool-map .map-center{animation:map-fade .6s .05s ease both;}
@keyframes map-fade{from{opacity:0;}}
@media (prefers-reduced-motion:reduce){
  .tool-map .node, .tool-map .spokes line, .tool-map .ring, .tool-map .map-center{animation:none;}
  .tool-map .spokes line{stroke-dashoffset:0;}
}
@media (max-width:860px){
  .tool-map{max-inline-size:400px; margin-block-start:8px;}
}
@media (max-width:480px){
  .tool-map .lbl{font-size:14px; padding-inline:11px;}
}

/* ------------------------------------------------------------------ tool cards */
.tools-section{padding-block-start:clamp(8px,2vw,24px);}
.tools-grid{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:clamp(16px,2.4vw,28px);}
.tools-grid > li{grid-column:span 2; display:flex; min-inline-size:0;}
.tools-grid > li.wide{grid-column:span 3;}
@media (max-width:980px){
  .tools-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .tools-grid > li, .tools-grid > li.wide{grid-column:span 1;}
  .tools-grid > li:last-child{grid-column:1 / -1;}
}
@media (max-width:640px){
  .tools-grid{grid-template-columns:minmax(0,1fr);}
  .tools-grid > li:last-child{grid-column:auto;}
}

.tool{display:flex; flex-direction:column; gap:14px; inline-size:100%; border-radius:var(--radius-lg); padding:clamp(22px,2.8vw,32px); overflow:hidden; isolation:isolate;}
.tool::before{content:""; position:absolute; z-index:-1; inset-block-start:-34%; inset-inline-end:-22%; inline-size:72%; aspect-ratio:1; border-radius:50%;
  background:radial-gradient(circle, var(--teal-wash) 0%, rgba(232,246,243,0) 70%); opacity:.55; transition:opacity .3s ease, transform .5s var(--ease); pointer-events:none;}
.tool:hover::before, .tool:focus-visible::before{opacity:1; transform:scale(1.12);}
.wide .tool::before{opacity:.9;}
.tool-top{display:flex; align-items:flex-start; justify-content:space-between; gap:12px;}
.tool .motif{inline-size:clamp(84px,8.4vw,108px); block-size:auto; aspect-ratio:1; flex:0 0 auto; overflow:visible; margin-block-start:-4px;}
.wide .tool .motif{inline-size:clamp(104px,11.5vw,156px); margin-block-end:-18px;}
.tool .motif circle, .tool .motif rect{transition:transform .6s var(--ease), opacity .4s ease; transform-box:fill-box; transform-origin:center;}
.tool:hover .motif .grow, .tool:focus-visible .motif .grow{transform:scale(1.32);}
.tool:hover .motif .drift, .tool:focus-visible .motif .drift{transform:translate(var(--dx,0px),var(--dy,0px));}
.tool-head{display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px;}
.tool-name{font-family:var(--f-display); font-size:clamp(26px,2.6vw,34px); line-height:1.1;}
.wide .tool-name{font-size:clamp(30px,3.2vw,40px);}
.tool-desc{color:var(--ink-2); line-height:1.75; max-inline-size:58ch;}
.tool-link{margin-block-start:auto; padding-block-start:10px; display:inline-flex; align-items:center; gap:.55em; align-self:flex-start;
  font-family:var(--f-mono); font-size:14px; font-weight:500; color:var(--teal); border-block-end:1px solid color-mix(in srgb,var(--teal) 35%,transparent);}
.tool:hover .tool-link{color:var(--amber-ink); border-block-end-color:currentColor;}
.tool:target{border-color:var(--teal-2); box-shadow:0 0 0 4px var(--teal-wash), var(--shadow-3);}

/* ------------------------------------------------------------------ questions and collaborations */
.tools-contact-section{padding-block-start:0;}
.tools-contact{display:flex; flex-wrap:wrap; align-items:center; gap:16px 22px; padding:clamp(22px,3vw,32px) clamp(22px,3.4vw,40px); border-radius:var(--radius-lg);}
.tools-contact .tc-mark{inline-size:48px; block-size:48px; flex:0 0 auto;}
.tools-contact .tc-text{flex:1 1 280px; font-family:var(--f-serif); font-size:clamp(18px,2vw,22px); line-height:1.5; color:var(--ink);}
.tools-contact .btn{flex:0 0 auto;}
@media (max-width:520px){ .tools-contact .btn{inline-size:100%;} }
