/* AI for distributors guide: the map of distributor work, how often it happens against how much judgement each case
   needs, in four zones. Markup: ai_map() in tools/build_services.py. Behaviour: assets/ai-map.js (only adds .in when the
   map is on screen, so the items settle into their zones). Colours come from the section (.lt or .dk). Only opacity and
   transform are animated. Linked items are amber, as every link on the site is. */
.am{ --am-fg:var(--fg, #000); --am-low:var(--low, #8a8a8a); --am-mid:var(--mid, #5a5a5a); --am-line:var(--line, rgba(0,0,0,.14)); --am-hard:var(--hard, #000);
  display:grid; grid-template-columns:3.5rem minmax(0,1fr); grid-template-rows:auto auto; gap:.75rem; }
.am-y{ grid-row:1; grid-column:1; display:flex; flex-direction:column; justify-content:space-between; align-items:center; padding-block:.5rem; font-size:.75rem; color:var(--am-low); }
.am-y span:nth-child(2){ writing-mode:vertical-rl; transform:rotate(180deg); font-weight:500; color:var(--am-mid); letter-spacing:.02em; }
.am-x{ grid-row:2; grid-column:2; display:flex; justify-content:space-between; font-size:.75rem; color:var(--am-low); }
.am-x span:nth-child(2){ font-weight:500; color:var(--am-mid); }
.am-grid{ grid-row:1; grid-column:2; display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); box-shadow:inset 0 0 0 1px var(--am-hard); }
.am-z{ position:relative; display:flex; flex-direction:column; gap:.75rem; padding:clamp(1.25rem, 2.4vw, 2rem); min-height:clamp(15rem, 24vw, 19rem); }
.am-z:nth-child(1), .am-z:nth-child(2){ box-shadow:inset 0 -1px 0 var(--am-line); }
.am-z:nth-child(1), .am-z:nth-child(3){ box-shadow:inset -1px 0 0 var(--am-line); }
.am-z:nth-child(1){ box-shadow:inset -1px -1px 0 var(--am-line); }
.am-k{ font-size:.75rem; font-weight:500; letter-spacing:.08em; text-transform:uppercase; color:var(--am-low); }
.am-t{ font-weight:500; font-size:clamp(1.375rem, 2vw, 1.75rem); line-height:1.1; letter-spacing:-.025em; }
.am-p{ max-width:26rem; font-size:.9375rem; line-height:1.5; color:var(--am-mid); }
.am-items{ display:flex; flex-wrap:wrap; gap:.5rem; margin-top:auto; padding-top:.5rem; }
.am-i{ padding:.375rem .625rem; font-size:.875rem; line-height:1.25; box-shadow:inset 0 0 0 1px var(--am-line); }
a.am-i{ color:var(--go, #986612); box-shadow:inset 0 0 0 1px currentColor; transition:opacity .2s ease; }
a.am-i:hover{ opacity:.75; }
a.am-i:active{ opacity:.55; }
a.am-i:focus-visible{ outline:2px solid var(--amber, #D9921A); outline-offset:2px; }
/* the zone where AI pays off most is the one drawn solid */
.am-z.am-best{ background:var(--am-fg); color:var(--bg, #fff); --am-low:rgba(255,255,255,.62); --am-mid:rgba(255,255,255,.78); --am-line:rgba(255,255,255,.28); }
.am-z.am-best a.am-i{ color:var(--amber, #D9921A); }
.dk .am-z.am-best{ color:#000; --am-low:rgba(0,0,0,.6); --am-mid:rgba(0,0,0,.75); --am-line:rgba(0,0,0,.2); }
.dk .am-z.am-best a.am-i{ color:var(--amber-deep, #986612); }

/* with the script: the items settle into their zones once the map is on screen */
.am-js .am-i{ opacity:0; transform:translateY(8px); transition:opacity .45s ease, transform .8s var(--expo, cubic-bezier(.16,1,.3,1)); transition-delay:calc(var(--i, 0) * 60ms + var(--z, 0) * 140ms); }
.am-js.in .am-i{ opacity:1; transform:none; }
.am-js.in a.am-i:hover{ opacity:.75; transition-delay:0s; }

/* phones: the four zones stacked, with the two scales written into each zone's label */
@media (max-width:760px){
  .am{ grid-template-columns:minmax(0,1fr); }
  .am-y, .am-x{ display:none; }
  .am-grid{ grid-row:auto; grid-column:1; grid-template-columns:minmax(0,1fr); }
  .am-z, .am-z:nth-child(n){ min-height:0; box-shadow:inset 0 -1px 0 var(--am-line); }
}
@media (prefers-reduced-motion: reduce){ .am *{ transition:none !important; } }

/* ---------- the rest of the guide ---------- */
.ai-by{ margin-top:1.5rem; font-size:.9375rem; color:var(--mid); }
.ai-by .ul{ color:var(--fg); }
.ai-intro{ margin-top:clamp(2.5rem, 5vw, 4rem); display:grid; grid-template-columns:minmax(0,1fr); gap:1.25rem 3rem; max-width:62rem; }
@media (min-width:900px){ .ai-intro{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
.ai-intro p{ font-size:clamp(1.0625rem, 1.35vw, 1.25rem); line-height:1.55; color:var(--mid); }
.ai-intro b{ font-weight:500; color:var(--fg); }
.ai-lead{ margin-top:1rem; max-width:40rem; font-size:clamp(1.0625rem, 1.35vw, 1.25rem); line-height:1.55; color:var(--mid); }
.ai-four .out{ row-gap:clamp(2rem, 3.5vw, 3rem); }
@media (min-width:900px){ .ai-four .out{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
.ai-q{ margin-top:clamp(2rem, 4vw, 3rem); box-shadow:inset 0 1px 0 var(--hard); }
.ai-q li{ display:grid; grid-template-columns:minmax(0,1fr); gap:.375rem 3rem; padding-block:clamp(1rem, 2vw, 1.375rem); box-shadow:inset 0 -1px 0 var(--line); }
@media (min-width:900px){ .ai-q li{ grid-template-columns:minmax(0,7fr) minmax(0,5fr); } }
.ai-q b{ font-weight:500; font-size:clamp(1.125rem, 1.6vw, 1.375rem); line-height:1.3; letter-spacing:-.015em; }
.ai-q span{ font-size:1rem; line-height:1.5; color:var(--mid); }
.ai-start{ display:flex; flex-wrap:wrap; gap:1rem 2rem; margin-top:1.5rem; }
.ai-src{ margin-top:1rem; display:grid; gap:.5rem; font-size:.9375rem; color:var(--mid); }
