/* /den/how-it-works/: "How Den and Den Hub fit together" in direction D. Loaded only by src/den-how-it-works.njk.
   The D tokens in the first block are copied from the /den design (den.css, then den-d.css at d5742d4) (renamed dd- to dh-); this file does not import it.

   RULES (same as D)
   - Three full-bleed coloured chapters only: the hero (orange), Den with Den Hub (saffron), the closer (moss). Everything else is A's ground or night.
   - A coloured chapter holds its diagram on a dark "plate" in A's night tokens; on ground and night the diagram sits flat on the page.
   - Diagram grammar (B, in warm tokens): hairline wires, orthogonal routes, 3px-corner boxes, filled arrowheads. Ember only where a person decides.
     The arch is only the Den Hub lamp, in the wheel.
   - No text under 13px (measured on the rendered page). Every text node is AA on its real background.
   - Two moments: "One Den" builds as it enters, and the Den Hub lap runs once. Everything else is still, or a single 10px rise and fade.
     Only transform, opacity and stroke-dashoffset animate. The hidden "before" states exist only under html.dh-js, which is not set with
     reduced motion and is taken off again if den-how.js never reports ready. No JS, or reduced motion: everything shows finished. */
.dh,.dh-dark,.dh-plate{
  --night:#0E0A07; --ground:#17120D; --surface:#211A13; --raised:#2D241A; --sunken:#0E0A07; --line:#43362A; --line-strong:#85705A;
  --text:#F6EEE2; --muted:#C7B7A0; --faint:#A39078;
  --ember:#FF7300; --ember-t:#FF8A33; --ink:#1A0D00;
  --amber:#F4B04A; --amber-t:#F4B04A; --accent:#F4B04A;
  --moss:#A3C46A; --moss-t:#A3C46A;
  --stone:#B9A689; --bad:#EE7C62; --remote:#6FB3A6;
  --node-top:#271E16; --node-bot:#3B2A17;
  --ember-ln:#FF7300; --amber-ln:#F4B04A; --moss-ln:#A3C46A;
  --glow:rgba(244,176,74,.34);
}
.dh-light,.dh-plate-light{
  --night:#EADFCD; --ground:#F5EEE3; --surface:#FFFAF2; --raised:#FFFFFF; --sunken:#EADFCD; --line:#D3C5B0; --line-strong:#8A7860;
  --text:#2A1E14; --muted:#5C4B38; --faint:#66553F;
  --ember:#FF7300; --ember-t:#A83A00; --ink:#1A0D00;
  --amber:#E79A1F; --amber-t:#8F5200; --accent:#B26A00;
  --moss:#7A9C45; --moss-t:#3F5E24;
  --stone:#6F5D47; --bad:#A93A24; --remote:#276A5F;
  --node-top:#FFFCF6; --node-bot:#FBE3B8;
  --ember-ln:#D95A00; --amber-ln:#B26A00; --moss-ln:#5E8A2E;
  --glow:rgba(231,154,31,.30);
}
@media (prefers-color-scheme:light){
  .dh{
    --night:#EADFCD; --ground:#F5EEE3; --surface:#FFFAF2; --raised:#FFFFFF; --sunken:#EADFCD; --line:#D3C5B0; --line-strong:#8A7860;
    --text:#2A1E14; --muted:#5C4B38; --faint:#66553F;
    --ember-t:#A83A00;
    --amber:#E79A1F; --amber-t:#8F5200; --accent:#B26A00;
    --moss:#7A9C45; --moss-t:#3F5E24;
    --stone:#6F5D47; --bad:#A93A24; --remote:#276A5F;
    --node-top:#FFFCF6; --node-bot:#FBE3B8;
    --ember-ln:#D95A00; --amber-ln:#B26A00; --moss-ln:#5E8A2E;
    --glow:rgba(231,154,31,.30);
    color-scheme:light;
  }
  /* a plate is always night, whatever the page is: re-state the night set below the light one */
  .dh .dh-plate:not(.dh-plate-light){
    --night:#0E0A07; --ground:#17120D; --surface:#211A13; --raised:#2D241A; --sunken:#0E0A07; --line:#43362A; --line-strong:#85705A;
    --text:#F6EEE2; --muted:#C7B7A0; --faint:#A39078;
    --ember-t:#FF8A33; --ember-ln:#FF7300;
    --amber:#F4B04A; --amber-t:#F4B04A; --accent:#F4B04A;
    --moss:#A3C46A; --moss-t:#A3C46A; --moss-ln:#A3C46A; --amber-ln:#F4B04A;
    --stone:#B9A689; --bad:#EE7C62; --remote:#6FB3A6;
    --node-top:#271E16; --node-bot:#3B2A17;
    --glow:rgba(244,176,74,.34);
    color-scheme:dark;
  }
}

/* chapter fields. Orange, saffron and moss are fixed in both modes; ground and night follow the page. */
.dh{
  --f-orange:#FF7300; --f-saffron:#FFC533; --f-moss:#2E4A1F; --f-teal:#1B4A58; --f-wine:#5A2432; --f-umber:#1A1612; --linen:#F6F0E6;
  --font:"Rubik",system-ui,sans-serif; --mono:"Space Mono",ui-monospace,monospace;
  --gut:max(20px,4.5vw); --pad:clamp(72px,10vw,144px);
  --ease:cubic-bezier(.22,.7,.1,1); --draw:cubic-bezier(.3,0,.1,1);
  color-scheme:dark;
  position:relative; background:var(--ground); color:var(--text);
  font-family:var(--font); font-size:clamp(1.0625rem,1rem + .3vw,1.25rem); line-height:1.5; font-weight:400;
  overflow-x:clip;
}
.dh-dark,.dh-light{background:var(--ground);color:var(--text)}

.dh *,.dh *::before,.dh *::after{box-sizing:border-box}
:where(.dh) :where(h1,h2,h3,h4,p,ul,ol,dl,dd,figure){margin:0;padding:0}
:where(.dh) :where(h1,h2,h3,h4){font-family:var(--font);letter-spacing:inherit;text-transform:none;color:inherit}
:where(.dh) :where(ul,ol){list-style:none}
:where(.dh) :where(img,svg){display:block;max-width:100%}
.dh a{color:inherit;font-size:inherit;text-decoration:none}
.dh a:hover{color:inherit}
.dh :focus-visible{outline:3px solid currentColor;outline-offset:4px;border-radius:4px}
.dh code{font-family:var(--mono)}
.dh-defs{position:absolute}

/* ---------- chapters ---------- */
.dh-ch{position:relative;padding:var(--pad) var(--gut);background:var(--cbg);color:var(--fg)}
.dh-in{width:100%;max-width:1240px;margin-inline:auto}
.dh-ch[data-f="ground"]{--cbg:var(--ground);--fg:var(--text);--sec:var(--muted);--rule:var(--line-strong);--num:var(--ember-t);--ctl:var(--ember);--ctl-fg:var(--ink);--hl:var(--amber-t)}
.dh-ch[data-f="night"]{--cbg:var(--night);--fg:var(--text);--sec:var(--muted);--rule:var(--line-strong);--num:var(--ember-t);--ctl:var(--ember);--ctl-fg:var(--ink);--hl:var(--amber-t)}
.dh-ch[data-f="orange"]{--cbg:var(--f-orange);--fg:var(--f-umber);--sec:rgba(26,22,18,.94);--rule:rgba(26,22,18,.6);--num:var(--f-umber);--ctl:var(--f-umber);--ctl-fg:var(--linen);--hl:var(--f-umber)}
.dh-ch[data-f="saffron"]{--cbg:var(--f-saffron);--fg:var(--f-umber);--sec:rgba(26,22,18,.92);--rule:rgba(26,22,18,.6);--num:var(--f-umber);--ctl:var(--f-umber);--ctl-fg:var(--linen);--hl:var(--f-umber)}
.dh-ch[data-f="moss"]{--cbg:var(--f-moss);--fg:var(--linen);--sec:rgba(246,240,230,.9);--rule:rgba(246,240,230,.45);--num:var(--linen);--ctl:var(--ember);--ctl-fg:var(--ink);--hl:var(--linen)}
.dh-ch + .dh-ch[data-f="ground"],.dh-ch + .dh-ch[data-f="night"]{border-top:1px solid var(--line)}

/* ---------- type: C's editorial scale, A's warm voice ---------- */
.dh-eyebrow{display:flex;flex-wrap:wrap;align-items:center;gap:.5em 1rem;margin-bottom:clamp(20px,3vw,36px);font:400 .8125rem/1.4 var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--sec)}
.dh-eyebrow img{width:36px;height:36px;border-radius:9px;background:var(--f-umber)}
.dh-h{font-weight:800;font-size:clamp(2.7rem,7.2vw,7.6rem);line-height:.96;letter-spacing:-.038em;word-spacing:.06em;text-wrap:balance}
.dh-h--hero{font-size:clamp(2.7rem,6.3vw,7rem)}
.dh-h--mid{font-size:clamp(2.7rem,5.6vw,5.8rem)}
.dh-sub{font-weight:700;font-size:clamp(1.6rem,3.2vw,3rem);line-height:1.04;letter-spacing:-.03em;text-wrap:balance}
.dh-h3{font-weight:700;font-size:clamp(1.4rem,1.1rem + 1.1vw,2rem);line-height:1.1;letter-spacing:-.025em;text-wrap:balance}
.dh-lead{font-size:clamp(1.2rem,1rem + .8vw,1.65rem);line-height:1.4;color:var(--sec);max-width:34ch;margin-top:clamp(18px,2.6vw,32px)}
.dh-lead--wide{max-width:46ch}
.dh-body{color:var(--sec);max-width:46ch}
.dh-ch p + p{margin-top:1rem}
.dh-mono{font:400 .8125rem/1.4 var(--mono);letter-spacing:.12em;text-transform:uppercase}
.dh-cap{font:400 .8125rem/1.55 var(--mono);color:var(--sec);margin-top:1.1rem;max-width:72ch}
.dh-badge{display:inline-block;font:400 .8125rem/1 var(--mono);letter-spacing:.08em;border:1px solid currentColor;border-radius:99px;padding:.35rem .7rem;vertical-align:middle;margin-left:.4rem;color:var(--hl)}
.dh .dh-quiet{display:inline-block;font:400 1rem/1.4 var(--mono);color:var(--fg);border-bottom:1px solid var(--rule);padding-bottom:2px}
.dh .dh-quiet:hover{border-bottom-color:currentColor}
.dh-rule{border-top:2px solid var(--fg)}

/* ---------- buttons ---------- */
.dh .dh-btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:52px;padding:.75rem 1.6rem;border-radius:99px;font:700 1rem/1.2 var(--mono);border:2px solid transparent;cursor:pointer;background:var(--ctl);color:var(--ctl-fg)}
.dh .dh-btn--g{background:transparent;color:var(--fg);border-color:currentColor}
.dh-btn svg{width:20px;height:20px;fill:currentColor;flex:none}
.dh-btn:disabled{opacity:.55;cursor:not-allowed}
.dh .dh-btn:hover{filter:brightness(1.08)}
.dh-row{display:flex;flex-wrap:wrap;align-items:center;gap:.9rem 1.5rem}

/* ---------- top bar ---------- */
.dh-top{position:absolute;inset:0 0 auto 0;z-index:5;color:var(--f-umber)}
.dh-top .dh-in{display:flex;align-items:center;justify-content:space-between;gap:1rem;height:76px;padding-inline:var(--gut);max-width:calc(1240px + 2*var(--gut))}
.dh-top a{font:400 .9375rem/1.2 var(--mono);display:inline-flex;gap:.5rem;align-items:center;padding:.5rem 0;border-bottom:1px solid transparent}
.dh .dh-top a:hover{border-bottom-color:currentColor}


/* ---------- hero: orange, type only ---------- */
.dh-hero{padding-top:clamp(108px,12vw,168px);padding-bottom:clamp(72px,9vw,128px)}
.dh-h--hero{font-size:clamp(2.7rem,6.3vw,7rem);max-width:15ch}
.dh-intro{display:grid;grid-template-columns:repeat(3,1fr);gap:clamp(28px,4vw,64px);margin-top:clamp(40px,6vw,88px)}
.dh-intro p{margin:0;border-top:2px solid var(--fg);padding-top:20px;font-size:clamp(1.15rem,1rem + .6vw,1.5rem);line-height:1.38;color:var(--fg)}
.dh-intro p + p{margin-top:0}
.dh-legend{display:flex;flex-wrap:wrap;gap:6px 28px;margin:0 0 clamp(10px,1.6vw,20px);font:400 .8125rem/1.4 var(--mono);color:var(--muted)}
.dh-legend--hero{margin:clamp(28px,4vw,48px) 0 0;color:var(--fg);font-size:.875rem}
.dh-key{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:.6rem;vertical-align:-1px}
.dh-key--den{background:var(--moss-ln)}
.dh-key--hub{background:var(--amber-ln)}
.dh-legend--hero .dh-key{width:12px;height:12px;box-shadow:0 0 0 2px var(--f-umber)}

/* ---------- the eight chapters ---------- */
.dh-head{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:20px clamp(24px,5vw,80px);align-items:end}
.dh-head .dh-eyebrow{margin-bottom:clamp(14px,2vw,24px)}
.dh-head .dh-lead{margin-top:0;max-width:34ch}
.dh-h--sec{font-size:clamp(2.4rem,5.2vw,5.4rem);line-height:.98}
.dh-fig{margin:clamp(36px,5vw,72px) 0 0}
.dh-fig .dh-cap{margin-top:1.4rem;max-width:68ch}
.dh-points{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(24px,3.5vw,48px) clamp(24px,5vw,80px);margin-top:clamp(40px,5vw,72px)}
.dh-points li{border-top:2px solid var(--fg);padding-top:18px;color:var(--sec);font-size:clamp(1.0625rem,1rem + .3vw,1.25rem);line-height:1.5;max-width:50ch}
.dh-stat{display:flex;align-items:flex-end;flex-wrap:wrap;gap:12px clamp(16px,2.4vw,32px);margin-top:clamp(40px,5vw,72px)}
.dh-stat b{font-weight:800;font-size:clamp(4.5rem,11vw,9rem);line-height:.82;letter-spacing:-.05em;color:var(--num)}
.dh-stat span{font:400 .875rem/1.6 var(--mono);letter-spacing:.06em;color:var(--sec);padding-bottom:.4rem}
.dh-stat code{font-size:inherit}
.dh-more{margin-top:clamp(28px,3.5vw,44px)}

/* the diagram sits flat on ground and night; on the saffron chapter it sits on a dark plate */
.dh-plate{position:relative;background:var(--ground);color:var(--text);border:1px solid var(--line-strong);border-radius:14px;overflow:hidden;padding:clamp(14px,2.4vw,32px)}
.dh-sec--hub .dh-fig .dh-cap{color:var(--sec)}

/* ---------- diagram grammar (B), in A's tokens ---------- */
.dh-svg{display:block;width:100%;height:auto;overflow:visible}
.dh-svg .t{fill:var(--text);font:600 17px var(--font)}
.dh-svg .cld{fill:none;stroke:var(--amber-ln);stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}
.dh-svg .t.sm{font:500 15px var(--font)}
.dh-svg .t.xs{font:500 14px var(--font);letter-spacing:-.01em}
.dh-svg .t.ctr,.dh-svg .s.ctr,.dh-svg .m.ctr{text-anchor:middle}
.dh-svg .t.lg{font:800 30px var(--font);letter-spacing:-.02em}
.dh-svg .s{fill:var(--muted);font:400 15px var(--font)}
.dh-svg .s.e{fill:var(--ember-t)}
.dh-svg .lb{fill:var(--stone);font:400 15.5px var(--mono);letter-spacing:.04em}
.dh-svg .lb.e{fill:var(--ember-t)}
.dh-svg .lb.a{fill:var(--amber-t)}
.dh-svg .m{fill:var(--muted);font:400 14px var(--mono);letter-spacing:.02em}
.dh-svg .nf{fill:url(#dh-plain)}
.dh-svg .nfl{fill:url(#dh-lit)}
.dh-svg .ns{fill:none;stroke:var(--line-strong);stroke-width:1.25;stroke-linejoin:miter}
.dh-svg .ns.on{stroke:var(--moss-ln);stroke-width:1.75}
.dh-svg .ns.amb{stroke:var(--amber-ln);stroke-width:1.75}
.dh-svg .ns.emb{stroke:var(--ember-ln);stroke-width:2}
.dh-svg .ns.bxs{stroke-width:1.25}
.dh-svg .ns.bxs.on,.dh-svg .ns.bxs.amb{stroke-width:1.25}
.dh-svg .ns.gh{stroke:var(--line)}
.dh-svg .wr{fill:none;stroke:var(--line-strong);stroke-width:1.25}
.dh-svg .wr.dash{stroke-dasharray:5 5}
.dh-svg .wr.emb{stroke:var(--ember-ln);stroke-width:1.5}
.dh-svg .wr.amb{stroke:var(--amber-ln)}
.dh-svg .ah{fill:var(--line-strong)}
.dh-svg .ah.emb{fill:var(--ember-ln)}
.dh-svg .ah.amb{fill:var(--amber-ln)}
.dh-svg .led{fill:var(--line-strong)}
.dh-svg .led.pin{fill:var(--moss-ln)}
.dh-svg .sig{fill:none;stroke:var(--amber-ln);stroke-width:2.75;stroke-linecap:round;stroke-dasharray:var(--dl,.1) 4;opacity:0}
.dh-svg .sig.g{stroke-width:11;stroke-opacity:.22}
.dh-svg .sig.w{--dl:.016}
.dh-svg .sig.n{--dl:.03}
.dh-svg .hubglow{fill:url(#dh-hubglow)}
.dh-svg .hubfill{fill:var(--surface);stroke:var(--amber-ln);stroke-width:1.75}
.dh-plate .dh-svg .nf{fill:url(#dh-plain-n)}
.dh-plate .dh-svg .nfl{fill:url(#dh-lit-n)}
.dh-plate .dh-svg .hubglow{fill:url(#dh-hubglow-n)}
.dh-svg .draw{stroke-dasharray:1;stroke-dashoffset:0}
.dh-n,.dh-nl{display:none}

/* the closer is the shared Den closer (den-closer.njk), styled by den.css */
.dh-foot{margin-top:1.6rem;font:400 .875rem/1.4 var(--mono);letter-spacing:.06em;color:var(--sec)}
.dh .dh-foot a{text-decoration:underline;text-underline-offset:.25em}

/* ---------- the one reveal rule: a 10px rise and fade, once ---------- */
@media (prefers-reduced-motion:no-preference){
  .dh-js .dh-rv{opacity:0;transform:translateY(10px);transition:opacity .6s var(--ease),transform .6s var(--ease)}
  .dh-js .dh-rv.in{opacity:1;transform:none}
}

/* ---------- MOMENT 1: "One Den" builds as it enters. Default = finished. Hairlines draw, boxes and words fade in, in reading order. ---------- */
@media (prefers-reduced-motion:no-preference){
  .dh-js .dh-build:not(.go) .pa{opacity:0}
  .dh-js .dh-build:not(.go) .pa.draw{opacity:1;stroke-dashoffset:1}
  .dh-build.go .pa{animation:dh-fade var(--du,.3s) ease-out calc(var(--d,0s) * .7) both}
  .dh-build.go .pa.draw{animation:dh-draw var(--du,.6s) var(--draw) calc(var(--d,0s) * .7) both}
}
@keyframes dh-fade{from{opacity:0}to{opacity:1}}
@keyframes dh-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}

/* ---------- MOMENT 2: the lap (Den Hub wheel). One signal, once, never stopping at a step. Default = finished (every station lit). ---------- */
@media (prefers-reduced-motion:no-preference){
  .dh-js .dh-lapfig:not(.run) .sg{opacity:0}
  .dh-js .dh-lapfig:not(.run) .hubglow{opacity:0}
  .dh-lapfig.run .sg{animation:dh-fade .55s ease-out var(--d,0s) both}
  .dh-lapfig.run .hubglow{animation:dh-fade 1s ease-out .1s both}
  .dh-lapfig.run .lap{animation-delay:.6s;animation-timing-function:linear;animation-fill-mode:both}
  .dh-lapfig.run .lap.w{animation-name:dh-lapw;animation-duration:5.32s}
  .dh-lapfig.run .lap.n{animation-name:dh-lapn;animation-duration:3.7s}
}
@keyframes dh-lapw{0%{stroke-dashoffset:.016;opacity:1}100%{stroke-dashoffset:-1;opacity:1}}
@keyframes dh-lapn{0%{stroke-dashoffset:.03;opacity:1}100%{stroke-dashoffset:-1;opacity:1}}
@media (prefers-reduced-motion:reduce){
  .dh *,.dh *::before,.dh *::after{animation:none!important;transition:none!important}
}

/* ---------- phones and tablets: each diagram has a narrow drawing. 15px of drawing text stays at 13px or more rendered. ---------- */
@media (max-width:1100px){
  .dh-wl{display:none!important}
  .dh-nl{display:block!important;max-width:460px;margin-inline:auto}
}
@media (max-width:980px){
  .dh-w{display:none!important}
  .dh-n{display:block!important;max-width:460px;margin-inline:auto}
}
@media (max-width:900px){
  .dh-head,.dh-points,.dh-intro{grid-template-columns:1fr}
  .dh-hero__row{align-items:flex-start}
}
@media (max-width:480px){
  .dh-plate{padding:12px 10px}
}

/* Japanese: break at phrases, never mid-word, in the big headlines. */
:lang(ja) .dh{word-break:auto-phrase;line-break:strict}

/* 08 You keep your data: where it lives, as marks. Today in the text colour; coming, a step quieter. */
.dh-ds{display:grid;grid-template-columns:1fr 2fr 2fr;gap:clamp(24px,3vw,40px);margin-top:clamp(28px,4vw,48px);border-top:2px solid var(--fg)}
.dh-ds__g{padding-top:16px}
.dh-ds__h{font:400 .875rem/1.4 var(--mono);letter-spacing:.08em;text-transform:uppercase;color:var(--sec);margin:0 0 14px}
.dh-ds ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:12px 22px}
.dh-ds li{display:inline-flex;align-items:center;gap:.55rem;font:500 1rem/1.3 var(--font);color:var(--sec)}
.dh-ds__g--on li{color:var(--fg);font-weight:600}
.dh-ds__i{flex:none;width:24px;height:24px}
@media (max-width:980px){.dh-ds{grid-template-columns:1fr}}

/* 07 Den Hub for Enterprise: two bands (amber: Monster Orange runs it; moss: yours), one dark Hub card, named Dens.
   The Hub card is a night plate in both modes, so it states the night values itself. Builds with .dh-build.go (moment 1); packets (.pk) only play. */
.dh-svg .band{stroke:none}
.dh-svg .band.amb{fill:var(--amber);fill-opacity:.14}
.dh-svg .band.on{fill:var(--moss);fill-opacity:.13}
.dh-svg .brule{fill:none;stroke:var(--line-strong);stroke-width:1.25}
.dh-svg .lb.on{fill:var(--moss-t)}
.dh-svg .hub{--text:#F6EEE2;--muted:#C7B7A0}
.dh-svg .hub .hbg{fill:#1B140E;stroke:#F4B04A;stroke-width:1.75}
.dh-svg .hub .hrow{fill:#2D241A}
.dh-svg .hub .hbar{fill:#F4B04A}
.dh-svg .hub .hchip{fill:#0E0A07;stroke:#85705A;stroke-width:1}
.dh-svg .hub .hok{fill:none;stroke:#FF8A33;stroke-width:1}
.dh-svg .hub .t,.dh-svg .hub .s,.dh-svg .hub .m{fill:#F6EEE2}
.dh-svg .hub .s,.dh-svg .hub .m{fill:#C7B7A0}
.dh-svg .hub .m.e{fill:#FF8A33}
.dh-svg .t.hh{font:800 24px var(--font);letter-spacing:-.02em}
.dh-svg .m.on{fill:var(--moss-t)}
.dh-svg .dcard{fill:var(--raised);stroke:var(--moss-ln);stroke-width:1.75}
.dh-svg .dav{fill:var(--moss-ln);fill-opacity:.3}
.dh-svg .dgh{fill:none;stroke:var(--line-strong);stroke-width:1.25;stroke-dasharray:4 4}
.dh-svg .plus{fill:var(--muted);font:300 30px var(--font);text-anchor:middle}
.dh-svg .snode{fill:var(--raised);stroke:var(--line-strong);stroke-width:1.25}
.dh-svg .wr.r2{stroke-width:2}
.dh-svg .wr.on{stroke:var(--moss-ln)}
.dh-svg .ah.on{fill:var(--moss-ln)}
.dh-svg .pk{fill:none;stroke-linecap:round;stroke-dasharray:.12 3;stroke-dashoffset:.12;opacity:0;stroke-width:3.5}
.dh-svg .pk.g{stroke-width:11;stroke-opacity:.25}
.dh-svg .pk.on{stroke:var(--moss-ln)}
.dh-svg .pk.amb{stroke:var(--amber-ln)}
.dh-svg .pk.emb{stroke:var(--ember-ln)}
@media (prefers-color-scheme:light){.dh-svg .pk.g{display:none}}
@media (prefers-reduced-motion:no-preference){
  .dh-build.go .pk{animation:dh-pk 1.2s linear var(--d,0s) both}
}
@keyframes dh-pk{0%{stroke-dashoffset:.12;opacity:1}100%{stroke-dashoffset:-1;opacity:1}}


/* ---------- COPY MOMENTS: at most four on the page, each helps one key line land. Only opacity, transform and stroke-dashoffset; once; finished without JS or with reduced motion.
   1  the hero's "fit together" lights moss, as /den's "up and green" does (.dh-lit, den-how.js adds .go to #hw-top)
   2  the 55 count and its tick rail (the shared den-built component)
   3  05 "one Hub": an amber rule is drawn under the phrase as its header rises in
   4  08 "stay yours": a moss rule is drawn under the phrase as its header rises in ---------- */
.dh-nb{white-space:nowrap}
.dh-lit{position:relative;display:inline-block;white-space:nowrap;background:var(--f-umber);color:var(--linen);padding:0 .14em .05em;border-radius:.14em}
.dh-lit__on{position:absolute;left:.14em;top:0;color:#A3C46A;opacity:1}
.dh-k{position:relative;display:inline-block;white-space:nowrap}
.dh-k::after{content:"";position:absolute;left:0;right:0;bottom:-.02em;height:.085em;border-radius:2px;background:var(--amber-ln);transform-origin:0 50%}
.dh-k--den::after{background:var(--moss-ln)}
@media (prefers-reduced-motion:no-preference){
  .dh-js .dh-hero:not(.go) .dh-lit__on{opacity:0}
  .dh-hero.go .dh-lit__on{animation:dh-fade .5s ease-out .9s both}
  .dh-js .dh-rv:not(.in) .dh-k::after{transform:scaleX(0)}
  .dh-js .dh-rv.in .dh-k::after{transition:transform .8s var(--draw) .55s}
}

/* ---------- 01 to 06 and 08, in the Enterprise language ----------
   Tinted ownership bands (amber: Monster Orange runs it; moss: yours; neutral: any browser), one dark hero card per diagram, quiet repeats.
   .hub.dn is the same dark card with moss as its accent (a Den, not the Hub). Dark in both modes, so it states its own night values (see 07). */
.dh-svg .band.neu{fill:var(--line-strong);fill-opacity:.12}
.dh-svg .hub.dn .hbg{stroke:#A3C46A}
.dh-svg .hub .hbar.on{fill:#A3C46A}
.dh-svg .hub .hrow.q{fill:#241B13}
.dh-svg .hub .chk{stroke:#A3C46A}
.dh-svg .chk{fill:none;stroke:var(--moss-ln);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dh-svg .trk{fill:var(--raised);stroke:var(--line);stroke-width:1}
.dh-svg .trd{fill:none;stroke:var(--line);stroke-width:1}
.dh-svg .snode.amb{stroke:var(--amber-ln);stroke-width:1.75}
.dh-svg .snode.q{fill:var(--raised);stroke:var(--line)}
.dh-svg .ic{fill:none;stroke:var(--muted);stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.dh-svg .ic.f{fill:var(--muted);stroke:none}
.dh-svg .lb.n{fill:var(--stone)}
.dh-svg .lb.amb{fill:var(--amber-t)}
.dh-svg .ah.on{fill:var(--moss-ln)}
.dh-svg .led.on{fill:var(--moss-ln)}
.dh-svg .hub .led{fill:#A3C46A}
.dh-svg .wr.dim{stroke:var(--line-strong);stroke-opacity:.7}
.dh-svg .wr.amb.r2{stroke-width:2}
/* the lap's stations are filled steps, not outlines; a lit station takes the amber stroke */
.dh-lap .nd .nf{fill:var(--raised)}
.dh-lap .nd > .ns{stroke:none}
.dh-lap .hubfill{stroke-width:2.25}
.dh-svg .bar.amb{fill:var(--amber-ln)}
.dh-svg .bar.on{fill:var(--moss-ln)}
.dh-svg .dav.n{fill:var(--line-strong);fill-opacity:.4}
.dh-svg .dcard.n{stroke:var(--line-strong);stroke-width:1.25}
.dh-svg .hub .tile{fill:#241B13}
.dh-svg .snode.on{stroke:var(--moss-ln);stroke-width:1.75}

/* 04 Runs anywhere: where it runs, as marks, under the drawing (same list style as 08) */
.dh-ds--plat{grid-template-columns:1fr 1fr}
.dh-plat__need{margin-top:1.2rem}
@media (max-width:980px){.dh-ds--plat{grid-template-columns:1fr}}

/* 06 Teams and Enterprise: the compare table under the diagram is den.css's .dd-table; here only its spacing, and the small "Enterprise only" tag in the drawing */
.dh-cmp{margin-top:clamp(28px,4vw,48px);scroll-margin-top:24px}
.dh-cmp .dd-table{margin-top:0}
.dh-svg .etag{fill:none;stroke:var(--line-strong);stroke-width:1}
.dh-svg .lb.sm{font-size:13.5px;letter-spacing:.02em}

/* ---------- research pass (den-next): spine, numbered figure captions, the "without Den" figure, the agent field, who runs what ---------- */
/* Figure numbers, Warp/Linear style: "[ fig. 01 — one den ]" before the caption's claim. */
.dh-fign{display:block;margin-bottom:.35rem;font:400 .8125rem/1.4 var(--mono);letter-spacing:.08em;color:var(--fg);opacity:.85}
/* Chapter pills: the eyebrow becomes "01 · One Den" in a pill. */
.dh-pill .dh-pill__n{font-weight:700;color:var(--fg)}
.dh-pill .dh-pill__t{display:inline-flex;align-items:center;min-height:28px;padding:2px 12px;border:1px solid var(--rule);border-radius:99px;letter-spacing:.08em;color:var(--fg)}
/* "Without Den": dashed, unjoined boxes. */
.dh-svg .snode.gh{fill:none;stroke:var(--line-strong);stroke-dasharray:6 6}
.dh-fig--before{margin-bottom:clamp(40px,6vw,80px);opacity:.92}
/* The agent field: one square per task, glyph = vendor, fill = state. An illustration, not live data. */
.dh-field__key{display:flex;flex-wrap:wrap;gap:10px 22px;margin-top:18px;font:400 .8125rem/1.4 var(--mono);color:var(--sec)}
.dh-field__key li{display:flex;align-items:center;gap:8px}
.dh-field__key b{font-weight:700;color:var(--fg)}
/* Who runs what. */
.dh-own{margin-top:clamp(40px,5vw,72px)}
.dh-own__grid{display:grid;grid-template-columns:1fr 1fr;gap:clamp(20px,3vw,40px)}
.dh-own__col{border-top:2px solid var(--moss-ln);padding-top:18px}
.dh-own__col--mo{border-top-color:var(--amber-ln)}
.dh-own__h{display:flex;align-items:center;gap:10px;font:700 .9375rem/1.3 var(--mono);color:var(--fg);margin-bottom:12px}
.dh-own__col li{padding:10px 0;border-top:1px solid var(--line);color:var(--sec)}
@media (max-width:700px){.dh-own__grid{grid-template-columns:1fr}}
.dh-svg .m.mf{font-size:12.5px;letter-spacing:0}

/* 03b, agents in one Den (den-dh-field.njk): words first, then the plate, projects side by side (stacked below 900px).
   Each agent square walks queued -> working -> done on its own clock (--t, --d); reduced motion holds the written state. */
.dh-ag{margin-top:clamp(48px,6vw,88px)}
.dh-ag__head{max-width:62ch;margin-bottom:clamp(20px,3vw,32px)}
.dh-ag__title{font:800 clamp(1.5rem,2.6vw,2.125rem)/1.1 var(--font);letter-spacing:-.02em;color:var(--fg)}
.dh-ag__lead{margin-top:.75rem;color:var(--sec);font-size:1.0625rem;line-height:1.55}
.dh-ag__plate{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(14px,2vw,28px);padding:clamp(48px,5vw,60px) clamp(16px,2.5vw,32px) clamp(16px,2.5vw,32px);background:var(--surface);border:1px solid var(--line);border-radius:10px}
.dh-ag__tag{position:absolute;top:14px;right:16px;font:400 .8125rem/1 var(--mono);letter-spacing:.12em;text-transform:uppercase;color:var(--muted);border:1px solid var(--line-strong);border-radius:99px;padding:.35em .7em}
.dh-ag__proj{border:1px dashed var(--line-strong);border-radius:6px;padding:22px}
.dh-ag__name{font:700 1rem/1.2 var(--font);color:var(--fg);margin-bottom:22px}
.dh-ag__name span{font:400 .8125rem/1 var(--mono);color:var(--muted);margin-left:.35em;letter-spacing:.06em}
.dh-ag__proj ul{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
.dh-ag__c{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;aspect-ratio:1;border-radius:5px;border:1px solid var(--line-strong);background:transparent;color:var(--muted)}
.dh-ag__c b{font:700 .9375rem/1 var(--mono)}
.dh-ag__c span{font:400 .8125rem/1 var(--mono)}
.dh-ag__c--w{background:var(--amber);border-color:var(--amber);color:var(--ink)}
.dh-ag__c--d{background:var(--moss);border-color:var(--moss);color:var(--ink)}
.dh-ag__k{display:inline-block;width:16px;height:16px;border-radius:4px;border:1px solid var(--line-strong)}
@media (max-width:900px){.dh-ag__plate{grid-template-columns:1fr}}
.dh-ag__kw{display:inline-block;width:22px;border-top:2px solid var(--fg);opacity:.8}
/* Fig 03b in motion (den-how.js): states change as agents work; working agents pulse slowly; a message is a trace that runs
   only through the gaps between cards, from one working agent to another, shows while the packet travels, then fades.
   Reduced motion: no state changes, no pulse, one still trace between working agents. */
.dh-ag__c{position:relative;z-index:1;transition:background-color .7s ease,border-color .7s ease,color .7s ease}
@keyframes dh-ag-pulse{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--amber) 0%,transparent)}50%{box-shadow:0 0 0 8px color-mix(in srgb,var(--amber) 28%,transparent)}}
@media (prefers-reduced-motion:no-preference){.dh-ag__c--w{animation:dh-ag-pulse 3.2s ease-in-out infinite}}
.dh-ag__c--rx{outline:2px solid var(--ember);outline-offset:3px}
.dh-ag__wires{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:2}
.dh-ag__wires .w{fill:none;stroke:var(--fg);stroke-width:2;stroke-linejoin:round;stroke-linecap:round;opacity:0;transition:opacity .4s ease}
.dh-ag__wires .w.on{opacity:.45}
.dh-ag__wires .pk{fill:none;stroke:var(--ember);stroke-width:7;stroke-linecap:round;stroke-linejoin:round}
.dh-ag__wires .pk.re{stroke:var(--fg);stroke-width:5}
