/* AgenticGrid's public pages (web/public_site.py). The design is in docs/public-site.md.
   Night, with the lights on: the pages are dark, and the pictures are Tessa's models of real towns.
   Colour means something: orange is live (the market now, the one main action), cyan is a source, white is ink. */
@font-face{font-family:"Poppins";src:url(fonts/poppins-medium.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Poppins";src:url(fonts/poppins-semibold.woff2) format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"AGrid Text";src:url(fonts/agrid-text-regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:"AGrid Text";src:url(fonts/agrid-text-bold.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:"AGrid Text";src:url(fonts/agrid-text-italic.woff2) format("woff2");font-weight:400;font-style:italic;font-display:swap}

:root{
  --night:#04061A; --navy:#090E3C; --raise:#10164F;
  --white:#F5F6FF; --mist:#BFC6E6; --dim:#8990B8; --rule:rgba(255,255,255,.14);
  --ink:#fff; --ink-soft:#E3E6F8; --warn:#FFB070; --rule-strong:rgba(255,255,255,.3); --wire:rgba(255,255,255,.45);
  --live:#F05D22; --live-hi:#FF8A4C; --source:#5CF0FF;
  --display:"Poppins","Avenir Next","Century Gothic",sans-serif;
  --text:"AGrid Text","Lato","Helvetica Neue",Arial,sans-serif;
  --edge:clamp(20px,4.4vw,72px); --wide:1320px;
  color-scheme:dark;
}

*,*::before,*::after{box-sizing:border-box}
html{font-size:112.5%;-webkit-text-size-adjust:100%;scroll-behavior:smooth;background:var(--night)}
body{margin:0;font-family:var(--text);line-height:1.6;color:var(--white);background:var(--night);
  font-variant-numeric:tabular-nums lining-nums;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
h1,h2,h3{font-family:var(--display);font-weight:600;margin:0;text-wrap:balance}
p{margin:0 0 1em;text-wrap:pretty}
a{color:var(--source);text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:var(--ink)}
:focus-visible{outline:3px solid var(--source);outline-offset:3px;border-radius:2px}
cite{font-style:italic}
img,video{max-width:100%}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.skip{position:absolute;left:var(--edge);top:-60px;z-index:9;padding:8px 14px;background:#fff;color:var(--navy);border-radius:3px}
.skip:focus{top:10px}

/* ---------- top: it sits over the picture ---------- */
.top{position:absolute;inset:0 0 auto 0;z-index:5;display:flex;align-items:center;gap:30px;padding:24px var(--edge)}
.top-logo{display:block;flex:none;line-height:0}
.top-logo img{display:block;height:28px;width:auto}
.top-nav{display:flex;gap:28px;margin-left:auto}
.top-nav a,.top-talk{font-family:var(--display);font-weight:500;font-size:.8rem;color:#fff;text-decoration:none;padding:6px 0;
  border-bottom:2px solid transparent;text-shadow:0 1px 12px rgba(4,6,26,.6)}
.top-nav a:hover,.top-talk:hover{border-bottom-color:rgba(255,255,255,.5)}
.top-nav a[aria-current]{border-bottom-color:var(--live)}
.top-actions{display:flex;align-items:center;gap:24px}
/* Nothing in the bar ever wraps. Below 860px the pages move into a menu under a Menu button (site.js opens it). */
.top-nav a,.top-talk,.top .button,.theme-switch,.top-menu{white-space:nowrap}
.top-menu{display:none;align-items:center;gap:7px;margin-left:auto;font-family:var(--display);font-weight:500;font-size:.8rem;
  color:#fff;background:transparent;border:1px solid rgba(255,255,255,.4);border-radius:999px;padding:5px 12px 5px 9px;cursor:pointer;
  text-shadow:0 1px 12px rgba(4,6,26,.6)}
.top-menu:hover{border-color:#fff}
.top-menu svg{width:16px;height:16px;flex:none}
.top-menu .cross,.top-menu[aria-expanded="true"] .bars{display:none}
.top-menu[aria-expanded="true"] .cross{display:inline}
.top-nav-talk{display:none}
@media (max-width:1060px) and (min-width:861px){.top-nav a:nth-child(-n+2){display:none}}
@media (max-width:860px){
  .top{gap:14px;padding-block:16px}
  .top-logo img{height:24px}
  .top-menu{display:inline-flex}
  .top-talk{display:none}
  .top-nav{display:none;position:absolute;top:100%;left:var(--edge);right:var(--edge);margin:0;flex-direction:column;gap:0;
    padding:6px 18px;background:#04061a;border:1px solid rgba(255,255,255,.18);border-radius:10px;
    box-shadow:0 18px 40px rgba(4,6,26,.45)}
  .top.open .top-nav{display:flex}
  .top-nav a,.top-nav .top-nav-talk{display:block;padding:13px 0;font-size:.9rem;border-bottom:1px solid rgba(255,255,255,.12)}
  .top-nav a:last-child{border-bottom:0}
  .top-nav a[aria-current]{border-bottom-color:rgba(255,255,255,.12);color:var(--live)}
}
@media (max-width:460px){
  .top-menu span{display:none}
  .top-menu{padding:6px}
  .top-actions{gap:12px}
  .top .button.quiet{padding:.6em .9em}
  .top-logo img{height:20px}
}

.button{display:inline-flex;align-items:center;font-family:var(--display);font-weight:600;font-size:.89rem;line-height:1.2;
  padding:.85em 1.35em;border-radius:3px;border:2px solid var(--live);background:var(--live);color:var(--navy);text-decoration:none;
  transition:background-color .15s,border-color .15s,color .15s}
.button:hover{background:var(--live-hi);border-color:var(--live-hi);color:var(--navy)}
.button.quiet{background:rgba(4,6,26,.35);border-color:rgba(255,255,255,.75);color:var(--ink);font-weight:500;font-size:.8rem;padding:.68em 1.1em}
.button.quiet:hover{background:#fff;border-color:#fff;color:var(--navy)}
.plain-link{font-family:var(--display);font-weight:500;font-size:.89rem;color:var(--ink)}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:14px 28px;margin:1.7em 0 0}

/* ---------- a picture or a clip ---------- */
.shot{margin:0}
.shot video,.shot img,.shot-empty{display:block;width:100%;height:100%;object-fit:cover}
.shot-empty{background:
  radial-gradient(90% 70% at 72% 30%,rgba(92,240,255,.10),transparent 60%),
  radial-gradient(70% 60% at 20% 80%,rgba(240,93,34,.12),transparent 62%),
  linear-gradient(180deg,#0B1146,var(--night))}
.shot figcaption{font-size:.74rem;line-height:1.45;color:var(--mist)}
.shot figcaption b{font-family:var(--display);font-weight:500;color:var(--ink)}
.shot figcaption a{color:var(--mist)}

/* ---------- the opening: the whole screen is the model ---------- */
.hero{position:relative;isolation:isolate;overflow:hidden;min-height:100svh;display:flex;flex-direction:column;justify-content:flex-end;
  padding:150px var(--edge) clamp(44px,8vh,96px)}
.hero > .shot > video,.hero > .shot > img,.hero > .shot > .shot-empty{position:absolute;inset:0;z-index:-2}
.hero::before{content:"";position:absolute;inset:0;z-index:-1;background:
  linear-gradient(90deg,rgba(4,6,26,.80) 0%,rgba(4,6,26,.38) 46%,rgba(4,6,26,0) 78%),
  linear-gradient(180deg,rgba(4,6,26,.78) 0%,rgba(4,6,26,.10) 24%,rgba(4,6,26,.22) 48%,rgba(4,6,26,.88) 86%,var(--night) 100%)}
.hero-words{max-width:var(--wide);width:100%;margin:0 auto}
.hero h1{font-size:clamp(2.5rem,6.9vw,6.6rem);line-height:.98;letter-spacing:-.036em;max-width:14.5ch;text-shadow:0 2px 40px rgba(4,6,26,.55)}
.lede{font-size:clamp(1.04rem,1.45vw,1.28rem);line-height:1.5;color:var(--ink-soft);max-width:56ch;margin:1.25em 0 0;text-shadow:0 1px 18px rgba(4,6,26,.7)}
.hero > .shot figcaption{position:absolute;right:var(--edge);bottom:clamp(20px,3.4vh,40px);max-width:34ch;text-align:right}
@media (max-width:900px){.hero > .shot figcaption{position:static;display:none}}
/* the other pages open plainly */
.hero.small{min-height:0;padding:clamp(150px,22vh,230px) var(--edge) clamp(20px,3vw,40px)}
.hero.small::before{background:radial-gradient(70% 120% at 85% 0%,rgba(240,93,34,.16),transparent 60%),
  radial-gradient(60% 100% at 10% 0%,rgba(92,240,255,.08),transparent 62%)}
.hero.small h1{font-size:clamp(2.4rem,6vw,5.2rem);max-width:16ch}

/* ---------- a plain scene ---------- */
.scene{padding:clamp(72px,10.5vw,160px) var(--edge)}
.scene > .in{max-width:var(--wide);margin:0 auto}
.scene h2,.film h2{font-size:clamp(1.9rem,4.6vw,4.1rem);line-height:1.03;letter-spacing:-.03em;max-width:17ch}
.intro{font-size:clamp(1.04rem,1.35vw,1.22rem);line-height:1.5;color:var(--mist);max-width:58ch;margin:1.1em 0 0}

/* ---------- the NEM, right now ---------- */
.scene.now{background:var(--navy);padding-block:clamp(56px,7.5vw,112px)}
.now h2{font-size:clamp(1.5rem,3vw,2.6rem);max-width:none}
.now-time{color:var(--mist);margin:0;font-size:1rem}
/* Wide: the words run down the left and the map stands beside them, top to bottom. #now-live is only a wrapper for
   what site.js refreshes, so its children take their places in the scene's own grid. */
.now .in{display:grid;gap:clamp(12px,1.6vw,20px) clamp(24px,4vw,72px)}
#now-live{display:contents}
.now-facts{min-width:0}
.nem{min-width:0;width:100%;max-width:600px;justify-self:center}
@media (max-width:899px){.now-time,.now-wait{order:1}.nem{order:2}.now-facts{order:3}.now-foot{order:4}}
@media (min-width:900px){
  .now .in{grid-template-columns:minmax(0,1fr) minmax(0,600px);grid-template-areas:"head map" "time map" "facts map" "foot map";
    grid-template-rows:auto auto auto 1fr;align-items:start}
  .now h2{grid-area:head}
  .now-time,.now-wait{grid-area:time}
  .now-facts{grid-area:facts}
  .nem{grid-area:map;justify-self:end}
  .now-foot{grid-area:foot}
}
.nem-svg{display:block;width:100%;height:auto;overflow:visible}
.state{fill:rgba(255,255,255,.075);stroke:rgba(255,255,255,.34);stroke-width:1;stroke-linejoin:round}
.state.off{fill:rgba(255,255,255,.02);stroke:rgba(255,255,255,.13)}
.leader{fill:none;stroke:rgba(255,255,255,.4);stroke-width:1}
.wire{fill:none;stroke:rgba(255,255,255,.5);stroke-width:2;stroke-dasharray:1;stroke-dashoffset:0}
.ic.limit .wire{stroke:var(--warn)}
.flow{fill:none;stroke:var(--source);stroke-width:3.2;stroke-linecap:round;stroke-dasharray:.1 9;filter:drop-shadow(0 0 4px rgba(92,240,255,.85))}
.node{fill:var(--live);filter:drop-shadow(0 0 5px rgba(240,93,34,.9))}
.ic.on .wire{stroke:#fff;stroke-width:3}
.ic.on .nem-tagname{fill:var(--source)}
.nem-name{font:500 13.5px var(--display);fill:var(--mist)}
.nem-price{font:600 27px var(--display);fill:#fff;letter-spacing:-.01em;paint-order:stroke;stroke:rgba(9,14,60,.55);stroke-width:4px}
.nem-unit{font:400 11.5px var(--text);fill:#AEB6DA;letter-spacing:0;stroke:none}
.nem-demand{font:400 13px var(--text);fill:var(--mist)}
.nem-tagname{font:500 10.5px var(--display);fill:#fff}
.nem-tag{font:400 10.5px var(--text);fill:var(--mist)}
.nem-tag.limit{fill:var(--warn)}
.nem-off{font:400 10px var(--text);fill:rgba(255,255,255,.3)}
@media (max-width:640px){.nem-tagname,.nem-tag{display:none}}
.nem-links{border-collapse:collapse;margin:clamp(6px,1vw,14px) 0 16px;font-size:.8rem;color:var(--mist)}
.nem-links caption{text-align:left;font-family:var(--display);font-weight:500;font-size:.74rem;color:var(--dim);padding-bottom:4px}
.nem-links th,.nem-links td{padding:3px 0;text-align:left;font-weight:400;vertical-align:baseline}
.nem-links th{padding-right:22px;color:var(--ink-soft)}
.nem-links tr.limit td{color:var(--warn)}
.nem-links tr.on th,.nem-links tr.on td{color:var(--source)}
.now-source,.now-late,.now-wait,.now-credit{font-size:.84rem;margin:0}
.now-source{color:var(--source)}
.now-credit{color:var(--dim);margin-top:.35em}
.now-late{color:var(--warn);margin-bottom:.3em}
.now-wait{color:var(--mist);padding:3em 0;font-size:1rem}
.now-foot{margin-top:6px;padding-top:18px;border-top:1px solid var(--rule);color:var(--mist);font-size:.88rem;line-height:1.55}
.now-foot p{margin:0 0 .8em;max-width:56ch}
@media (prefers-reduced-motion:no-preference){
  .wire{animation:draw .9s cubic-bezier(.2,.7,.2,1) both}
  .wire.d2{animation-delay:.1s}.wire.d3{animation-delay:.2s}.wire.d4{animation-delay:.3s}.wire.d5{animation-delay:.4s}
  .flow{animation:appear .5s .9s both}
  .flow-ab{animation:flow-ab 1.1s linear infinite,appear .5s .9s both}
  .flow-ba{animation:flow-ba 1.1s linear infinite,appear .5s .9s both}
}
@keyframes draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
@keyframes appear{from{opacity:0}to{opacity:1}}
@keyframes flow-ab{to{stroke-dashoffset:-9.1}}
@keyframes flow-ba{to{stroke-dashoffset:9.1}}

/* ---------- real answers ---------- */
.answers{margin-top:clamp(28px,4vw,56px);display:grid;gap:28px}
.answer{background:var(--navy);border:1px solid var(--rule);border-radius:5px;padding:clamp(22px,3.2vw,48px);min-width:0}
.answer-kind{font-family:var(--display);font-weight:500;font-size:.78rem;color:var(--source);margin:0 0 .5em}
.answer-q{font-size:clamp(1.15rem,1.9vw,1.6rem);line-height:1.25;letter-spacing:-.012em;max-width:30ch}
.answer-body{margin-top:1.2em;max-width:70ch;overflow-x:auto;color:var(--ink-soft)}
.answer-body p,.answer-body li{margin:0 0 .85em}
.answer-body ol,.answer-body ul{padding-left:1.3em;margin:0 0 .85em}
.answer-body strong{color:var(--ink)}
.cite{color:var(--source);font-weight:700;font-size:.86em;white-space:nowrap}
.answer-body table{border-collapse:collapse;font-size:.88rem;margin:.4em 0 1em;min-width:100%}
.answer-body th,.answer-body td{padding:.55em .9em .55em 0;border-bottom:1px solid var(--rule);text-align:left;vertical-align:top}
.answer-body .align-right{text-align:right;padding-right:0;padding-left:.9em}
.answer-body .align-center{text-align:center}
.answer-body th{font-family:var(--display);font-weight:500;font-size:.78rem;color:var(--mist)}
.answer-sources{margin-top:1.5em;padding-top:1.1em;border-top:2px solid var(--source);max-width:70ch}
.answer-sources p{font-family:var(--display);font-weight:500;font-size:.78rem;color:var(--source);margin:0 0 .4em}
.answer-sources ol{margin:0;padding-left:1.5em;font-size:.9rem;color:var(--mist)}
.answer-sources li{margin:.2em 0}
.answer-sources li::marker{color:var(--source);font-weight:700}
.answer-meta{font-size:.82rem;color:var(--dim);margin:1.4em 0 0}
/* With scripts on, the three answers become one sheet with a list of the questions beside it (site.js). */
.answers.tabs{grid-template-columns:minmax(0,1fr)}
.answers.tabs .answer[hidden]{display:none}
.answers.tabs .answer-kind{display:none}
.answer-list{display:flex;flex-direction:column}
.answer-list button{all:unset;box-sizing:border-box;cursor:pointer;display:block;padding:16px 0 16px 20px;border-left:3px solid var(--rule);
  color:var(--mist)}
.answer-list button:hover{border-left-color:var(--wire);color:var(--ink)}
.answer-list button[aria-selected="true"]{border-left-color:var(--live);color:var(--ink)}
.answer-list button:focus-visible{outline:3px solid var(--source);outline-offset:-3px}
.answer-list .kind{display:block;font-family:var(--display);font-weight:500;font-size:.78rem;color:var(--source)}
.answer-list .q{display:block;font-family:var(--display);font-weight:500;font-size:.98rem;line-height:1.35;margin-top:.25em}
@media (min-width:900px){.answers.tabs{grid-template-columns:minmax(0,4fr) minmax(0,9fr);gap:clamp(28px,4vw,64px);align-items:start}}

/* ---------- a scene that is a film: the picture fills it, the words stand in its shadow ---------- */
.film{position:relative;isolation:isolate;overflow:hidden;min-height:min(90svh,780px);display:flex;align-items:center;
  padding:clamp(88px,11vw,160px) var(--edge)}
.film > .shot > video,.film > .shot > img,.film > .shot > .shot-empty{position:absolute;inset:0;z-index:-2}
.film::before{content:"";position:absolute;inset:0;z-index:-1;background:
  linear-gradient(90deg,rgba(4,6,26,.94) 0%,rgba(4,6,26,.84) 30%,rgba(4,6,26,.30) 58%,rgba(4,6,26,0) 80%),
  linear-gradient(180deg,var(--night) 0%,rgba(4,6,26,0) 20%,rgba(4,6,26,0) 78%,var(--night) 100%)}
.film.right{justify-content:flex-end}
.film.right::before{background:
  linear-gradient(270deg,rgba(4,6,26,.94) 0%,rgba(4,6,26,.84) 30%,rgba(4,6,26,.30) 58%,rgba(4,6,26,0) 80%),
  linear-gradient(180deg,var(--night) 0%,rgba(4,6,26,0) 20%,rgba(4,6,26,0) 78%,var(--night) 100%)}
.film .words{width:min(100%,600px);margin-left:max(0px,calc((100vw - var(--wide)) / 2 - var(--edge)))}
.film.right .words{margin-left:0;margin-right:max(0px,calc((100vw - var(--wide)) / 2 - var(--edge)))}
.film h2{font-size:clamp(1.9rem,4.2vw,3.7rem);max-width:13ch}
.film .words > p{color:var(--ink-soft);margin:1.1em 0 0}
.film .words > p.who{font-family:var(--display);font-weight:500;font-size:.86rem;color:var(--ink);padding-left:14px;border-left:3px solid var(--live)}
.film .words > p.actions{margin-top:1.8em}
.what-ifs{list-style:none;margin:1.3em 0 0;padding:0}
.what-ifs li{position:relative;padding:9px 0 9px 26px;border-top:1px solid var(--rule);font-family:var(--display);font-weight:500;font-size:.92rem}
.what-ifs li:last-child{border-bottom:1px solid var(--rule)}
@media (min-width:560px){.what-ifs.two{display:grid;grid-template-columns:1fr 1fr;column-gap:28px}.what-ifs.two li:nth-last-child(2):nth-child(odd){border-bottom:1px solid var(--rule)}}
.what-ifs li::before{content:"";position:absolute;left:0;top:1.28em;width:14px;height:4px;border-radius:2px;background:var(--live);
  box-shadow:0 0 8px rgba(240,93,34,.8)}
.film > .shot figcaption{position:absolute;right:var(--edge);bottom:clamp(20px,3.4vh,40px);max-width:34ch;text-align:right;
  text-shadow:0 1px 10px rgba(4,6,26,.9)}
.film.right > .shot figcaption{right:auto;left:var(--edge);text-align:left}
/* Narrower than a desk screen there is no room beside the picture, so the words come up over its lower edge instead:
   the film stays whole on top and fades into the page where the heading starts. */
@media (max-width:1099px){
  .film,.film.right{display:block;min-height:0;padding:0 0 clamp(52px,9vw,96px)}
  .film::before,.film.right::before{display:none}
  .film > .shot{position:relative;display:block}
  .film > .shot > video,.film > .shot > img,.film > .shot > .shot-empty{position:relative;inset:auto;z-index:0;height:auto;
    aspect-ratio:16/9;max-height:72svh}
  .film > .shot::before{content:"";position:absolute;z-index:1;inset:0 0 auto 0;height:30%;
    background:linear-gradient(180deg,rgba(4,6,26,.78),rgba(4,6,26,0))}
  .film > .shot::after{content:"";position:absolute;z-index:1;inset:auto 0 0 0;height:66%;
    background:linear-gradient(180deg,rgba(4,6,26,0),rgba(4,6,26,.72) 58%,var(--night) 96%)}
  .film > .shot figcaption,.film.right > .shot figcaption{position:absolute;z-index:2;inset:14px var(--edge) auto var(--edge);
    max-width:none;text-align:left}
  .film .words,.film.right .words{position:relative;z-index:2;width:auto;max-width:680px;
    margin:calc(-1 * clamp(96px,19vw,210px)) 0 0;padding:0 var(--edge)}
}
@media (max-width:560px){
  .film > .shot > video,.film > .shot > img,.film > .shot > .shot-empty{aspect-ratio:4/3}
}

/* ---------- who the work was done with ---------- */
.with-scene{background:var(--navy)}

/* ---------- CVEC: the loop ---------- */
.loop-top{display:grid;gap:clamp(24px,4vw,64px);align-items:center}
@media (min-width:900px){.loop-top{grid-template-columns:minmax(0,6fr) minmax(0,5fr)}}
.loop-svg{display:block;width:100%;max-width:520px;height:auto;justify-self:center;overflow:visible}
.loop-svg .wire{stroke:var(--wire)}
.loop-stage{font:600 19px var(--display);fill:var(--ink)}
.loop-return{font:400 13px var(--text);fill:var(--source)}
.loop-name{font:600 58px var(--display);fill:var(--ink);letter-spacing:-.02em}
.loop-stages{list-style:none;counter-reset:stage;margin:clamp(32px,5vw,72px) 0 0;padding:0;display:grid;gap:0 clamp(24px,3vw,48px)}
.loop-stages li{padding:22px 0 8px;border-top:2px solid var(--rule-strong)}
.loop-stages h3{font-size:1.15rem;line-height:1.25}
.loop-stages p{font-size:.94rem;color:var(--mist);margin:.55em 0 0}
@media (min-width:640px){.loop-stages{grid-template-columns:1fr 1fr}}
@media (min-width:1100px){.loop-stages{grid-template-columns:repeat(4,1fr)}}
.sub-head{font-size:clamp(1.15rem,2vw,1.5rem);line-height:1.2;letter-spacing:-.014em;margin-top:clamp(36px,5vw,64px)}

/* ---------- the rules, said large ---------- */
.rules-scene{background:var(--navy)}
.big-rules{list-style:none;margin:clamp(28px,4vw,56px) 0 0;padding:0;display:grid;gap:0 clamp(28px,4vw,64px)}
.big-rules li{font-family:var(--display);font-weight:600;font-size:clamp(1.3rem,2.5vw,2.25rem);line-height:1.12;letter-spacing:-.022em;
  padding:clamp(18px,2.2vw,30px) 0;border-top:1px solid var(--rule);text-wrap:balance}
@media (min-width:860px){.big-rules{grid-template-columns:1fr 1fr}}

/* ---------- how she works ---------- */
.path{list-style:none;counter-reset:step;margin:clamp(32px,4.5vw,60px) 0 0;padding:0;display:grid;gap:30px}
.path li{counter-increment:step;position:relative;padding-top:28px;border-top:2px solid var(--rule-strong)}
.path li::before{content:"";position:absolute;left:0;top:-8px;width:14px;height:14px;border-radius:50%;background:var(--night);
  border:3px solid var(--source);box-shadow:0 0 10px rgba(92,240,255,.6)}
.path li:last-child::before{background:var(--live);border-color:var(--live);box-shadow:0 0 12px rgba(240,93,34,.9)}
.path h3{font-size:1.1rem;line-height:1.25}
.path h3::before{content:counter(step) ". ";color:var(--dim)}
.path p{font-size:.94rem;color:var(--mist);margin:.6em 0 0}
@media (min-width:1000px){.path{grid-template-columns:repeat(4,1fr);gap:0}.path li{padding-right:30px}}
.rules{margin:clamp(28px,4vw,52px) 0 0}
.rules > div{display:grid;gap:8px 56px;padding:26px 0;border-top:1px solid var(--rule)}
.rules dt{font-family:var(--display);font-weight:600;font-size:clamp(1.15rem,2vw,1.6rem);line-height:1.18;letter-spacing:-.016em;text-wrap:balance}
.rules dd{margin:0;color:var(--mist);max-width:58ch}
@media (min-width:900px){.rules > div{grid-template-columns:minmax(0,5fr) minmax(0,7fr)}}
.aside-note{font-size:.92rem;color:var(--mist);border-left:2px solid var(--source);padding-left:20px;max-width:64ch;margin:2.2em 0 0}

/* ---------- sources ---------- */
.plain{width:100%;border-collapse:collapse;margin-top:clamp(22px,3vw,40px);font-size:.94rem}
.plain th,.plain td{text-align:left;vertical-align:top;padding:16px 28px 16px 0;border-top:1px solid var(--rule)}
.plain thead th{font-family:var(--display);font-weight:500;font-size:.78rem;color:var(--dim);border-top:0;padding-bottom:8px}
.plain tbody th{font-family:var(--display);font-weight:500;width:30%;color:var(--ink)}
.plain td{color:var(--mist)}
.plain.three tbody th{width:36%}
.plain.three td:last-child{width:20%;color:var(--ink)}
@media (max-width:700px){
  .plain thead{display:none}
  .plain tr{display:block;padding:14px 0;border-top:1px solid var(--rule)}
  .plain th,.plain td,.plain tbody th,.plain.three tbody th,.plain.three td:last-child{display:block;width:auto;padding:2px 0;border:0}
}
.credits{list-style:none;margin:clamp(22px,3vw,40px) 0 0;padding:0}
.credits li{display:grid;gap:6px 56px;padding:24px 0;border-top:1px solid var(--rule)}
.credits h3{font-size:1.08rem;line-height:1.3}
.credits p{margin:0;color:var(--mist);max-width:62ch}
@media (min-width:900px){.credits li{grid-template-columns:minmax(0,4fr) minmax(0,8fr)}}
.work{list-style:none;margin:1.8em 0 0;padding:0;max-width:66ch}
.work li{position:relative;padding:14px 0 14px 30px;border-top:1px solid var(--rule);color:var(--mist)}
.work li::before{content:"";position:absolute;left:0;top:1.58em;width:16px;height:4px;border-radius:2px;background:var(--live)}

/* ---------- the front desk: a chat with Tessa to get a meeting ---------- */
.desk{position:fixed;z-index:20;right:clamp(12px,2.4vw,32px);bottom:clamp(12px,2.4vw,32px);width:min(420px,calc(100vw - 24px));
  height:min(640px,calc(100svh - 24px));display:flex;flex-direction:column;background:var(--navy);border:1px solid rgba(255,255,255,.28);
  border-radius:8px;box-shadow:0 24px 80px rgba(0,0,0,.6)}
.desk[hidden]{display:none}
.desk-head{display:flex;align-items:center;justify-content:space-between;padding:16px 18px;border-bottom:1px solid var(--rule)}
.desk-head h2{font-size:1.05rem;letter-spacing:-.01em}
.desk-close{all:unset;cursor:pointer;font-family:var(--display);font-weight:500;font-size:.78rem;color:var(--mist);padding:4px 8px;border-radius:3px}
.desk-close:hover{color:var(--ink)}
.desk-close:focus-visible{outline:3px solid var(--source)}
.desk-log{flex:1;overflow-y:auto;padding:18px;display:flex;flex-direction:column;gap:12px;font-size:.92rem;line-height:1.5}
.desk-log p{margin:0;max-width:88%;padding:10px 14px;border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere}
.desk-tessa{align-self:flex-start;background:var(--raise);color:var(--ink)}
.desk-you{align-self:flex-end;background:#fff;color:var(--navy)}
.desk-done{align-self:stretch;max-width:none !important;background:transparent;border:1px solid var(--live);color:var(--ink);font-family:var(--display);font-weight:500}
.desk-tessa.waiting{color:var(--mist);font-style:italic}
.desk-times{display:flex;flex-wrap:wrap;gap:8px}
.desk-times button{all:unset;cursor:pointer;font-family:var(--display);font-weight:500;font-size:.8rem;color:var(--ink);padding:8px 12px;border-radius:3px;
  border:1px solid rgba(255,255,255,.6)}
.desk-times button:hover{background:#fff;color:var(--navy)}
.desk-times button:focus-visible{outline:3px solid var(--source)}
.desk-times button:disabled{opacity:.45;cursor:default;pointer-events:none}
.desk-form{display:flex;gap:10px;align-items:flex-end;padding:12px 14px;border-top:1px solid var(--rule)}
.desk-form[hidden]{display:none}
.desk-form textarea{flex:1;resize:none;font:inherit;font-size:.92rem;line-height:1.4;color:var(--ink);background:var(--night);border:1px solid rgba(255,255,255,.3);
  border-radius:4px;padding:9px 11px}
.desk-form textarea:focus-visible{outline:3px solid var(--source);outline-offset:1px}
.desk-form .button{padding:.7em 1em;font-size:.82rem}
.desk-note{margin:0;padding:0 16px 12px;font-size:.72rem;line-height:1.4;color:var(--dim)}
.desk-note a{color:var(--mist)}
@media (max-width:560px){.desk{inset:0;width:auto;height:auto;border-radius:0;border:0}}

/* ---------- the foot ---------- */
.foot{border-top:1px solid var(--rule);color:var(--mist);font-size:.88rem}
.foot-in{max-width:calc(var(--wide) + 2 * var(--edge));margin:0 auto;padding:clamp(48px,6vw,80px) var(--edge) 48px;display:grid;gap:30px 64px}
.foot-about img{display:block;height:28px;width:auto;margin-bottom:18px}
.foot-about p{margin:0;max-width:44ch}
.foot a{color:var(--ink)}
.foot a:hover{color:var(--source)}
.foot-nav ul{list-style:none;margin:0;padding:0;display:grid;gap:9px}
.foot-small p{margin:0 0 .4em}
@media (min-width:900px){.foot-in{grid-template-columns:minmax(0,5fr) minmax(0,3fr) minmax(0,4fr)}}

@media print{
  body{background:#fff;color:#000}
  .top,.actions,.skip,.shot{display:none}
}

/* ---------- who the work was done with: each organisation's own logo, in white ---------- */
.with-list > div{row-gap:20px}
.with-list dt{display:flex;flex-wrap:wrap;align-items:center;gap:20px 44px;padding-top:4px}
.with-list .org{display:block;height:auto}

/* ---------- How she works: the loop, its diagram held in view while the stages are read ---------- */
.cvec{display:grid;gap:clamp(28px,4vw,64px);margin-top:clamp(32px,5vw,72px)}
.cvec-map .loop-svg{max-width:440px;margin:0 auto}
.cvec-note{font-size:.9rem;color:var(--mist);max-width:44ch;margin:18px auto 0}
.cvec-stages{list-style:none;margin:0;padding:0}
.cvec-stages li{padding:clamp(28px,3.6vw,48px) 0;border-top:1px solid var(--rule)}
.cvec-stages li:last-child{border-bottom:1px solid var(--rule)}
.cvec-stages h3{font-size:clamp(1.7rem,3.2vw,2.7rem);line-height:1.05;letter-spacing:-.025em}
.cvec-stages .aim{font-size:clamp(1.06rem,1.45vw,1.24rem);line-height:1.45;color:var(--ink);max-width:46ch;margin:.7em 0 0}
.cvec-stages .done{color:var(--mist);max-width:56ch;margin:1.1em 0 0;padding-left:18px;border-left:3px solid var(--live)}
.cvec-stages .maxim{font-family:var(--display);font-weight:500;font-size:clamp(1rem,1.35vw,1.14rem);color:var(--source);
  max-width:48ch;margin:1.1em 0 0}
@media (min-width:1000px){
  .cvec{grid-template-columns:minmax(0,5fr) minmax(0,7fr);align-items:start}
  .cvec-map{position:sticky;top:clamp(72px,12vh,128px)}
}
/* With the script on and the diagram held beside the text, the stage being read is lit on it and the others step
   back. On a phone the diagram scrolls away above, so every stage reads at full strength. */
.cvec .node{transform-box:fill-box;transform-origin:center}
@media (min-width:1000px){
  .cvec-map .loop-svg{max-width:500px}
  .cvec.live .cvec-stages li{opacity:.42}
  .cvec.live .cvec-stages li.on{opacity:1}
  .cvec.live .node{fill:rgba(240,93,34,.38);filter:none}
  .cvec.live .node.on{fill:var(--live);filter:drop-shadow(0 0 7px rgba(240,93,34,.95));transform:scale(1.7)}
  .cvec.live .loop-stage{fill:var(--dim)}
  .cvec.live .loop-stage.on{fill:var(--ink)}
}
@media (prefers-reduced-motion:no-preference){
  .cvec-stages li,.cvec .node,.cvec .loop-stage{transition:opacity .45s ease,fill .45s ease,transform .45s ease}
}

/* ---------- Model first: the words beside a system diagram, drawn on paper ---------- */
.model-grid{display:grid;gap:clamp(28px,4vw,64px);align-items:center}
@media (min-width:1000px){.model-grid{grid-template-columns:minmax(0,5fr) minmax(0,7fr)}}
.model-scene .words > p{color:var(--mist);max-width:58ch}
.model-scene .what-ifs{margin:clamp(18px,2.4vw,28px) 0}
.model-scene .shot img{height:auto;object-fit:contain;border-radius:6px;background:#fff;filter:invert(.94) hue-rotate(180deg) saturate(1.4);border:1px solid var(--rule)}
.model-scene .shot-empty{min-height:260px;border-radius:6px}
.model-scene .shot figcaption{margin-top:10px}

/* ---------- Model first: a window on the system model, a minimap of the whole, and parts to go to ---------- */
.sysmap{margin:0;min-width:0}
.sysmap-stage{position:relative}
.sysmap-view{position:relative;overflow:hidden;border:1px solid var(--rule);border-radius:6px;background:var(--navy)}
.sysmap-art{display:block;width:100%;height:auto;user-select:none;-webkit-user-select:none;-webkit-user-drag:none}
.sysmap.live .sysmap-view{aspect-ratio:3/2;cursor:grab;touch-action:none}
.sysmap.live .sysmap-view.dragging{cursor:grabbing}
.sysmap.live .sysmap-art{position:absolute;left:0;top:0;max-width:none;transform-origin:0 0;will-change:transform}
.sysmap-mini,.sysmap-tools{display:none}
.sysmap.live .sysmap-mini{display:block;position:absolute;right:10px;bottom:10px;width:min(30%,200px);
  border:1px solid var(--rule);border-radius:4px;background:var(--night);overflow:hidden;cursor:crosshair;touch-action:none;
  box-shadow:0 6px 24px rgba(0,0,0,.35)}
.sysmap-mini img{display:block;width:100%;height:auto;opacity:.9;pointer-events:none}
.sysmap-frame{position:absolute;border:2px solid var(--live);border-radius:2px;background:rgba(240,93,34,.08);pointer-events:none}
.sysmap.live .sysmap-tools{display:block;margin-top:12px}
.sysmap-stops{display:flex;flex-wrap:wrap;gap:8px}
.sysmap-tools button,.sysmap-zoom button{font-family:var(--display);font-weight:500;font-size:.78rem;line-height:1.2;color:var(--white);
  background:transparent;border:1px solid var(--rule);border-radius:999px;padding:7px 13px;cursor:pointer}
.sysmap-tools button:hover,.sysmap-zoom button:hover{border-color:var(--mist)}
.sysmap-tools button[aria-pressed="true"]{border-color:var(--live);color:var(--white);background:rgba(240,93,34,.14)}
.sysmap-zoom{display:none}
.sysmap.live .sysmap-zoom{display:flex;flex-direction:column;gap:6px;position:absolute;top:10px;right:10px}
.sysmap-zoom button{width:34px;height:34px;padding:0;font-size:1.05rem;border-radius:8px;background:var(--night);
  border-color:var(--rule)}
.sysmap figcaption{margin-top:10px;font-size:.74rem;line-height:1.45;color:var(--mist)}
.sysmap figcaption b{font-family:var(--display);font-weight:500;color:var(--white)}
.sysmap figcaption a{color:var(--mist)}
@media (max-width:600px){
  .sysmap-stops{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
  .sysmap-stops button{flex:none;font-size:.72rem;padding:6px 11px}
  .sysmap.live .sysmap-mini{width:34%;right:8px;bottom:8px}
  .sysmap.live .sysmap-zoom{top:8px;right:8px}
}

/* ---------- the light theme (Karl's), chosen with the switch in the top bar and remembered (theme.js) ----------
   The words go dark on light; the hero, the films and the NEM map keep their night, since they are pictures. */
html[data-theme="light"]{
  --night:#F5F6FA; --navy:#EAEDF6; --raise:#DCE2F0;
  --white:#0B1033; --ink:#0B1033; --ink-soft:#2A3255; --mist:#3B4366; --dim:#5D6585;
  --rule:rgba(9,14,60,.14); --rule-strong:rgba(9,14,60,.28); --wire:rgba(9,14,60,.38);
  --live:#D9480F; --live-hi:#F05D22; --source:#0B7285; --warn:#9A5B00;
  color-scheme:light;
}
html[data-theme="light"] :is(.top,.hero,.film,.scene.now,.foot){
  --night:#04061A; --navy:#090E3C; --raise:#10164F;
  --white:#F5F6FF; --ink:#fff; --ink-soft:#E3E6F8; --mist:#BFC6E6; --dim:#8990B8;
  --rule:rgba(255,255,255,.14); --rule-strong:rgba(255,255,255,.3); --wire:rgba(255,255,255,.45);
  --live:#F05D22; --live-hi:#FF8A4C; --source:#5CF0FF; --warn:#FFB070;
  color:var(--white); color-scheme:dark;
}
/* the films keep their night as a background too: below 1100 px the words sit under the picture, not over it, and
   would otherwise be light words on the light page */
html[data-theme="light"] :is(.hero,.film,.foot){background:var(--night)}
html[data-theme="light"] .scene:not(.now) .button.quiet,html[data-theme="light"] .desk .button.quiet{
  background:transparent;border-color:var(--ink);color:var(--ink)}
html[data-theme="light"] .scene:not(.now) .button.quiet:hover{background:var(--ink);color:#fff}
html[data-theme="light"] .scene .button{color:#fff}
html[data-theme="light"] .with-list .org{filter:brightness(0);opacity:.84}
html[data-theme="light"] .desk-you{background:var(--ink);color:#fff}
html[data-theme="light"] a:hover{color:var(--ink)}

/* the switch */
.theme-switch{display:inline-flex;align-items:center;gap:7px;font-family:var(--display);font-weight:500;font-size:.78rem;
  color:#fff;background:transparent;border:1px solid rgba(255,255,255,.4);border-radius:999px;padding:5px 11px;cursor:pointer;
  text-shadow:0 1px 12px rgba(4,6,26,.6)}
.theme-switch:hover{border-color:#fff}
.theme-switch svg{width:15px;height:15px;flex:none}
.theme-switch .to-dark{display:none}
html[data-theme="light"] .theme-switch .to-light{display:none}
html[data-theme="light"] .theme-switch .to-dark{display:inline}
@media (max-width:640px){.theme-switch .label{display:none}.theme-switch{padding:6px}}

