/* Entropy Shaker — the draw32 stylesheet, carried over so the two products
   read as one publisher. Everything draw32-specific (the pill set, the colour
   switcher, the string diagrams, the worksheet faces, the shop card) is cut,
   and the wordmark is typeset rather than drawn.

   Layout: a slim sticky masthead carrying a persistent order
   capsule; every page is one measured prose column, broken by full-bleed
   bands for the pill set, the spec tables and the shop. The primary button
   is drawn as a capsule, so the thing you click has the shape of the thing
   you are buying. */

:root{
  /* the publish skeleton sets these on the main page; subpages need them too */
  color-scheme:light;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);

  /* The page is paper. Sections are told apart by space and hairlines, never
     by a change of fill, so --surface matches --bg in light mode and a card is
     white with a border rather than a grey block. Only genuinely contained
     things (the payload chip in the string diagram) take --surface-2. */
  --bg:#ffffff;
  --surface:#ffffff;
  --surface-2:#f2f3f0;
  --fg:#14171a;
  --muted:#5e6468;
  --rule:#e4e6e1;
  --rule-strong:#c2c6be;
  --accent:#e8650d;
  --accent-ink:#a9440a;
  --on-accent:#14171a;

  /* The mark is drawn, not set. Two files per lockup: an SVG loaded as an
     image cannot see the page's data-theme, so the stylesheet swaps the file.
     The ratios are the built marks' own, and
     scripts/build_entropyshaker_brand.py asserts these numbers against them. */
  --wordmark:url(wordmark.svg);
  --wordmark-mast:url(wordmark-mast.svg);
  --wm-ratio:2.6564/1;
  --wm-mast-ratio:4.7801/1;

  --display:"Archivo",ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  --prose:"Spectral",ui-serif,Georgia,"Times New Roman",serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;

  --measure:37rem;
  --gutter:1.25rem;
  --s1:.375rem; --s2:.75rem; --s3:1.25rem; --s4:2rem; --s5:3.25rem; --s6:5rem;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --bg:#0e1012;
  --surface:#15181a;
  --surface-2:#1d2124;
  --fg:#e9ebe8;
  --muted:#9aa09f;
  --rule:#262a2d;
  --rule-strong:#3b4145;
  --accent:#ff8338;
  --accent-ink:#ffa972;
  --on-accent:#141719;
  --wordmark:url(wordmark-dark.svg);
  --wordmark-mast:url(wordmark-mast-dark.svg);
}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0e1012;
  --surface:#15181a;
  --surface-2:#1d2124;
  --fg:#e9ebe8;
  --muted:#9aa09f;
  --rule:#262a2d;
  --rule-strong:#3b4145;
  --accent:#ff8338;
  --accent-ink:#ffa972;
  --on-accent:#141719;
  --wordmark:url(wordmark-dark.svg);
  --wordmark-mast:url(wordmark-mast-dark.svg);
}

*{box-sizing:border-box}
html{scroll-padding-top:5rem}
body{
  margin:0; background:var(--bg); color:var(--fg);
  font-family:var(--prose); font-size:1.0625rem; line-height:1.66;
  -webkit-font-smoothing:antialiased; overflow-x:hidden;
}
img{max-width:100%}
[hidden]{display:none!important}

/* ---------- type ---------- */
h1,h2,h3,h4{
  font-family:var(--display); font-weight:800; font-stretch:92%;
  letter-spacing:-.022em; line-height:1.1; margin:0; text-wrap:balance;
}
h1{font-size:clamp(2.1rem,7.2vw,3.35rem)}
h2{font-size:clamp(1.5rem,4.6vw,2.05rem); margin-block:var(--s5) var(--s3)}
h3{font-size:1.125rem; font-weight:700; font-stretch:96%; letter-spacing:-.008em;
   margin-block:var(--s4) var(--s2)}
h4{font-size:.9375rem; font-weight:700; font-stretch:100%; letter-spacing:0; margin-block:var(--s3) var(--s1)}
p{margin:0 0 var(--s3)}
a{color:inherit; text-underline-offset:.16em; text-decoration-thickness:1px;
  text-decoration-color:color-mix(in srgb,var(--accent) 55%,transparent)}
a:hover{text-decoration-color:var(--accent)}
:focus-visible{outline:2px solid var(--accent); outline-offset:3px; border-radius:3px}
strong{font-weight:600}
hr{border:0; border-top:1px solid var(--rule); margin-block:var(--s5)}
.mono{font-family:var(--mono); font-variant-numeric:tabular-nums; font-size:.94em}
.eyebrow{font-family:var(--display); font-size:.71rem; font-weight:700; font-stretch:100%;
  letter-spacing:.15em; text-transform:uppercase; color:var(--muted); margin:0 0 var(--s2)}
.lede{font-family:var(--display); font-weight:400; font-stretch:100%;
  font-size:clamp(1.08rem,3.1vw,1.22rem); line-height:1.5; letter-spacing:-.008em}
.small{font-size:.9rem; line-height:1.6}
.muted{color:var(--muted)}
.ui{font-family:var(--display); font-stretch:100%}

/* ---------- shell ---------- */
.wrap{max-width:var(--measure); margin-inline:auto; padding-inline:var(--gutter)}
.wide{max-width:60rem; margin-inline:auto; padding-inline:var(--gutter)}
main{display:block}
section{min-width:0}

header.mast{
  position:sticky; top:env(safe-area-inset-top,0px); z-index:20;
  background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--rule);
}
.mast-in{
  max-width:60rem; margin-inline:auto; padding:.55rem var(--gutter);
  display:flex; align-items:center; gap:var(--s3);
}
/* Two lockups of one mark: the masthead gets it on a line with the shaker in
   place of the word space, the hero gets it beside the two-line stack. */
.wm{background-repeat:no-repeat; background-position:left center;
    background-size:contain; display:block}
.mast .wm{background-image:var(--wordmark-mast); aspect-ratio:var(--wm-mast-ratio);
    height:1.75rem; flex:none}
.mast a.home{display:flex; align-items:center; text-decoration:none}
.mast nav{display:flex; gap:var(--s3); margin-left:auto; font-family:var(--display);
  font-stretch:100%; font-size:.9375rem; font-weight:600}
.mast nav a{text-decoration:none; color:var(--muted); white-space:nowrap}
.mast nav a:hover{color:var(--fg)}
.mast nav a[aria-current="page"]{color:var(--fg)}
.mast .cta-mini{margin-left:var(--s2)}
.icon-btn{flex:none; display:inline-flex; align-items:center; justify-content:center;
  width:2.1rem; height:2.1rem; padding:0; margin-left:var(--s3); cursor:pointer;
  border:1px solid var(--rule); border-radius:999px; background:transparent;
  color:var(--muted)}
.icon-btn:hover{color:var(--fg); border-color:var(--rule-strong)}
.icon-btn svg{display:block; width:1.05rem; height:1.05rem}
@media (max-width:760px){
  .mast nav{gap:.9rem; font-size:.875rem}
  .mast .cta-mini{display:none}
}
@media (max-width:420px){
  .mast-in{gap:.5rem; padding-inline:.75rem}
  .mast nav{gap:.6rem; font-size:.8125rem}
  .icon-btn{margin-left:0}
  .mast .wm{height:1.4rem}
}
/* Three pages and a theme toggle is one item more than the masthead was drawn
   for, and at 320 px the toggle hung off the edge. The mark gives up the room. */
@media (max-width:360px){
  .mast nav{gap:.5rem; font-size:.78rem}
  .mast .wm{height:1.2rem}
}

/* ---------- the capsule button: the product's own shape ---------- */
.btn{
  font-family:var(--display); font-stretch:100%; font-weight:700; font-size:.9375rem;
  letter-spacing:-.005em; cursor:pointer; border:1px solid transparent;
  border-radius:999px; padding:.7rem 1.4rem; display:inline-flex; align-items:center;
  gap:.6rem; text-decoration:none; white-space:nowrap;
  transition:transform .12s ease, filter .12s ease;
}
.btn:hover{filter:brightness(1.05)}
.btn:active{transform:translateY(1px)}
/* The accent fill is fixed rather than following the colour pair: white-bodied
   pills would put orange on white and fail contrast on the one control that
   must always be readable. The capsule shape still comes from the product. */
.btn-buy{
  background:var(--accent); color:var(--on-accent);
  border-color:color-mix(in srgb,var(--accent) 72%,#000);
}
.btn-buy .price{font-variant-numeric:tabular-nums; font-weight:800}
.btn-buy .bar{display:block; width:1.1rem; height:.18rem; border-radius:1px;
  background:var(--on-accent); opacity:.45}
.btn-sm{font-size:.8125rem; padding:.42rem 1rem}
@media (prefers-reduced-motion:reduce){.btn{transition:none}.btn:active{transform:none}}

/* ---------- hero ---------- */
/* Only the home page opens with one. Every other page starts on its first real
   section, which then carries the space the hero used to give it. */
main>section:first-child:not(.hero){margin-top:var(--s5)}
.hero{padding-block:var(--s6) var(--s4)}
.hero .wm{background-image:var(--wordmark); aspect-ratio:var(--wm-ratio);
  height:clamp(4.2rem,12vw,5.65rem); margin-bottom:var(--s4)}
.hero h1{margin-bottom:var(--s3)}
.hero .lede{max-width:33rem; margin-bottom:var(--s4)}
.hero .intro{margin-bottom:var(--s2)}
.hero .rng-note{text-wrap:balance}
.rule-pair{display:flex; gap:.4rem; align-items:center; margin-bottom:var(--s4)}
.rule-pair i{display:block; height:3px; border-radius:2px}
.rule-pair i:first-child{width:3rem; background:var(--accent)}
.rule-pair i:last-child{flex:1; background:var(--rule)}
.buyrow{display:flex; flex-wrap:wrap; align-items:center; gap:var(--s3) var(--s2)}

/* ---------- the shop block ---------- */
.shop{background:var(--surface); border:1px solid var(--rule); border-radius:16px;
  padding:var(--s4) var(--s3); margin-block:var(--s4)}
.shop .price-line{display:flex; flex-wrap:wrap; align-items:baseline; gap:.6rem; margin-bottom:var(--s3)}
.shop .amount{font-family:var(--display); font-weight:800; font-stretch:90%;
  font-size:clamp(2rem,7vw,2.6rem); letter-spacing:-.035em; line-height:1}
.shop .unit{font-family:var(--display); font-stretch:100%; font-weight:700;
  font-size:clamp(1rem,3vw,1.2rem); color:var(--accent-ink); letter-spacing:.01em}
.shop .per{font-family:var(--display); font-stretch:100%; font-size:.875rem; color:var(--muted)}
#buy-fallback{margin-top:var(--s3); padding-top:var(--s3); border-top:1px solid var(--rule)}
#buy-fallback p{margin:0; font-size:.9rem; color:var(--muted)}

/* ---------- notice ---------- */
.notice{background:var(--surface); border:1px solid var(--rule); border-radius:12px;
  padding:var(--s3); display:grid; grid-template-columns:auto 1fr; gap:var(--s2) var(--s3);
  align-items:start; margin-block:var(--s3)}
.notice .dot{width:.5rem; height:.5rem; border-radius:999px; background:var(--accent);
  margin-top:.62rem}
.notice p{margin:0}
.notice p+p{margin-top:var(--s2)}
.notice>*:nth-child(2){min-width:0}

/* ---------- bands ---------- */
/* No fill: a band is two hairlines and some room, which is enough to mark a
   section off without turning it into a different-coloured slab. */
.band{border-block:1px solid var(--rule); padding-block:var(--s5); margin-block:var(--s5)}

/* ---------- lists ---------- */
ol.steps{list-style:none; margin:0; padding:0; display:grid; gap:var(--s3); counter-reset:step}
/* A list that opens on 00, so a step added in front of an existing method
   does not renumber the steps a reader may already know. Scoped, because
   the verify page's own list starts at 01 and should stay there. */
ol.steps.from-zero{counter-reset:step -1}
ol.steps li{counter-increment:step; display:grid; grid-template-columns:2.1rem 1fr; gap:var(--s3)}
ol.steps li>div{min-width:0}
ol.steps li::before{content:counter(step,decimal-leading-zero); font-family:var(--mono);
  font-weight:600; font-size:.8125rem; color:var(--accent-ink); padding-top:.3rem}
ol.steps b{display:block; font-family:var(--display); font-stretch:100%; font-weight:700}
/* The two steps that do not survive being skimmed: 00, which a reader will skip
   because it is optional, and 04, which the whole method depends on. Both have
   to read as different from the plain steps around them. It was styled with
   --surface, which in light mode is the
   same white as --bg: a white box with a hairline border on a white page, marked
   up as important and invisible on screen. The accent bar carries it the way
   .warn does, and the wash separates the block from the page in both themes.
   --surface-2 is declared first as the fallback where color-mix is not understood. */
ol.steps li.key{background:var(--surface-2);
  background:color-mix(in srgb, var(--accent) 10%, var(--bg));
  border:1px solid var(--rule); border-left:4px solid var(--accent);
  border-radius:12px; padding:var(--s3)}
ol.steps li.key::before{color:var(--accent)}
/* A note after a step list is a different kind of thing from the steps, and p has
   no top margin, so it butted straight onto the last one. The only place this
   pattern occurs is the worksheet notes on the method page. */
ol.steps+p{margin-top:var(--s4)}
/* Same reason, one level in: a paragraph after a step's own text. */
ol.steps li>div>p{margin-top:var(--s3)}
ol.steps li.key b{color:var(--accent-ink)}
ul.plain{margin:0 0 var(--s3); padding-left:1.15rem}
ul.plain li{margin-bottom:.45rem}

/* ---------- figures / tables ---------- */
.figures{display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s3);
  border-block:1px solid var(--rule); padding-block:var(--s4); margin-block:var(--s4)}
.figures>div{min-width:0}
.figures>div+div{border-left:1px solid var(--rule); padding-left:var(--s3)}
.figures .big{display:block; font-family:var(--display); font-weight:800; font-stretch:88%;
  font-size:clamp(2.2rem,8.5vw,3.3rem); letter-spacing:-.04em; line-height:1}
.figures .lbl{display:block; font-family:var(--display); font-stretch:100%; font-size:.71rem;
  font-weight:700; letter-spacing:.11em; text-transform:uppercase; margin-top:.45rem}
.figures .sub{display:block; font-size:.84rem; color:var(--muted)}
@media (max-width:560px){
  .figures{grid-template-columns:1fr}
  .figures>div+div{border-left:0; border-top:1px solid var(--rule); padding-left:0; padding-top:var(--s3)}
}
.scroll{overflow-x:auto; margin-block:var(--s3)}
table{width:100%; border-collapse:collapse; font-family:var(--display); font-stretch:100%;
  font-size:.9rem; font-variant-numeric:tabular-nums}
th,td{text-align:right; padding:.6rem .55rem; border-bottom:1px solid var(--rule); white-space:nowrap}
th:first-child,td:first-child{text-align:left}
thead th{font-size:.71rem; letter-spacing:.1em; text-transform:uppercase; color:var(--muted);
  font-weight:700; border-bottom-color:var(--fg)}
tbody td:not(:first-child){font-family:var(--mono); font-size:.84rem}
/* the downloads tables carry a sentence in the middle column, not a figure */
tbody td.txt{font-family:var(--prose); font-size:.9rem; white-space:normal}

/* Downloads keep the file choices readable on narrow screens. */
.download-actions{display:flex; flex-wrap:wrap; gap:.75rem; margin-block:var(--s3)}
.download-actions .btn{white-space:normal; max-width:100%; justify-content:center;
  text-align:center}
.btn-download{background:var(--surface); color:var(--fg); border-color:var(--rule-strong)}
.downloads-table th,.downloads-table td{text-align:left; vertical-align:top}
.downloads-table th:first-child,.downloads-table td:first-child{white-space:normal; width:44%}
.downloads-table th:last-child,.downloads-table td:last-child{text-align:right}
@media (max-width:420px){
  .download-actions .btn{width:100%; padding-inline:.8rem}
  .downloads-table th,.downloads-table td{padding-inline:.3rem}
}

dl.spec{display:grid; grid-template-columns:auto 1fr; gap:.45rem var(--s3); margin:0 0 var(--s3);
  font-size:.9375rem}
dl.spec dt{font-family:var(--display); font-stretch:100%; color:var(--muted); font-size:.875rem}
dl.spec dd{margin:0; font-family:var(--mono); font-size:.86rem; font-variant-numeric:tabular-nums;
  min-width:0}
dl.spec dd.txt{font-family:var(--prose); font-size:.9375rem}
@media (max-width:460px){
  dl.spec{grid-template-columns:1fr; gap:.1rem}
  dl.spec dt{margin-top:.5rem}
}

/* ---------- warn ---------- */
.warn{border-left:3px solid var(--accent); padding:.15rem 0 .15rem var(--s3); margin-block:var(--s3)}
.warn p{margin:0}

/* ---------- drawings ---------- */
/* Vector, transparent and theme-aware, so they sit on the page's own background
   in either theme rather than on a card of their own. They are drawings, not
   photographs: every dimension in them is the figure the kit is built to, and
   none of them is evidence of how a printed pill or a sewn bag looks. */
img.viz{display:block; width:100%; height:auto; margin-block:var(--s4)}
img.viz.narrow{max-width:24rem}

/* ---------- footer ---------- */
/* Sits on the same measure as the body copy, so its left edge lines up with
   every other line of text on the page rather than starting 11rem out. */
footer{border-top:1px solid var(--rule); margin-top:var(--s6);
  padding-block:var(--s3) var(--s4); color:var(--muted); font-size:.9rem}
footer .f-in{max-width:var(--measure); margin-inline:auto; padding-inline:var(--gutter)}
footer nav{display:flex; flex-wrap:wrap; align-items:baseline; row-gap:.3rem;
  font-family:var(--display); font-stretch:100%; font-size:.875rem; font-weight:600}
footer nav a{text-decoration:none; color:var(--muted)}
footer nav a:hover{color:var(--fg)}
/* The separator trails its own item rather than leading the next one. Both
   look identical on one line, but the footer wraps on a narrow screen, and a
   leading separator comes out dangling at the start of the new line. */
footer nav a+a{margin-left:.55rem}
footer nav a:not(:last-child)::after{content:"\00b7"; margin-left:.55rem;
  color:var(--rule-strong)}
@media (prefers-reduced-motion:reduce){*{animation:none!important; transition:none!important}}

/* Two rules that used to be inline style attributes, lifted out so the vhost's
   Content-Security-Policy can drop 'unsafe-inline' from style-src. */
.flush{margin-top:0}
.one-col{grid-template-columns:1fr}

/* ---------- the hero render ---------- */
/* A render with a transparent background, so it sits on the page in either
   theme. It is a drawing of the mesh, not a photograph of a printed tray. */
.art{display:block; width:100%; height:auto; margin-block:var(--s4)}
.art.wide-art{max-width:34rem}
figure{margin:0}
figure.viz-fig{margin-block:var(--s4)}
figure.viz-fig img{display:block; width:100%; height:auto}
figure.viz-fig img.plan{max-width:22rem; margin-inline:auto}
figcaption{font-family:var(--display); font-stretch:100%; font-size:.82rem;
  color:var(--muted); margin-top:var(--s2); text-wrap:balance}

/* ---------- the hero drawing ---------- */
/* The shaker is drawn black, so one file cannot serve both themes: an <img>
   cannot see data-theme any more than a background SVG can, and a black tray
   on the dark page would be a silhouette. Each dice colour is built twice and
   the stylesheet shows one of the pair. */
/* Doubled classes throughout: figure.viz-fig img already sets display, and a
   single .art-dark would lose to it. */
.art.art-dark{display:none}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .art.art-light{display:none}
  :root:not([data-theme="light"]) .art.art-dark{display:block}}
:root[data-theme="dark"] .art.art-light{display:none}
:root[data-theme="dark"] .art.art-dark{display:block}
:root[data-theme="light"] .art.art-light{display:block}
:root[data-theme="light"] .art.art-dark{display:none}
.shaker-fig .art{margin-bottom:var(--s3)}

/* the edition switcher, built by shaker.js and absent without it. Centred
   under the drawing it changes: margin-inline auto centres the grid itself,
   justify-content centres the two buttons inside it when the figure is wider
   than they are. Both are needed - one alone leaves them hanging left. */
.ways{display:grid; grid-template-columns:repeat(2,minmax(0,12rem)); gap:.5rem;
  justify-content:center; max-width:24rem; margin-block:var(--s2);
  margin-inline:auto}
@media (max-width:360px){ .ways{grid-template-columns:minmax(0,1fr)} }
.ways button{
  font-family:var(--display); font-stretch:100%; font-size:.8125rem; font-weight:600;
  cursor:pointer; text-align:left; display:grid; grid-template-columns:1.5rem 1fr;
  gap:.6rem; align-items:center; padding:.5rem .7rem;
  border:1px solid var(--rule); border-radius:10px; background:var(--surface);
  color:var(--muted); min-width:0;
}
.ways button:hover{color:var(--fg)}
.ways button[aria-pressed="true"]{border-color:var(--fg); color:var(--fg);
  box-shadow:inset 0 0 0 1px var(--fg)}
.ways .sw{width:1.5rem; display:block}
.ways b{display:block; font-weight:700; min-width:0}

/* ---------- the count line ---------- */
/* Three numbers that are the product: seats, dice, and what a hundred dice
   carry if they are fair. Reuses .figures' grid at a smaller size. */
.counts{display:grid; grid-template-columns:repeat(3,1fr); gap:var(--s3);
  border-block:1px solid var(--rule); padding-block:var(--s4); margin-block:var(--s4)}
.counts>div{min-width:0}
.counts>div+div{border-left:1px solid var(--rule); padding-left:var(--s3)}
.counts .big{display:block; font-family:var(--display); font-weight:800; font-stretch:88%;
  font-size:clamp(1.9rem,7vw,2.8rem); letter-spacing:-.04em; line-height:1}
.counts .lbl{display:block; font-family:var(--display); font-stretch:100%; font-size:.71rem;
  font-weight:700; letter-spacing:.11em; text-transform:uppercase; margin-top:.45rem}
.counts .sub{display:block; font-size:.84rem; color:var(--muted)}
@media (max-width:560px){
  .counts{grid-template-columns:1fr}
  .counts>div+div{border-left:0; border-top:1px solid var(--rule); padding-left:0; padding-top:var(--s3)}
}

/* ---------- the reading prompt ---------- */
/* A block of text whose whole purpose is to be pasted somewhere else, so it is
   drawn as a thing you take rather than as prose: mono, bordered, and wrapped
   rather than scrolled, since a prompt read on a phone should not need two
   gestures. The copy button is inserted by shaker.js and absent without it. */
.prompt{border:1px solid var(--rule); border-radius:12px; background:var(--surface);
  margin-block:var(--s3); overflow:hidden}
.prompt-top{display:flex; flex-wrap:wrap; align-items:center; gap:var(--s2);
  justify-content:space-between; padding:var(--s2) var(--s3);
  border-bottom:1px solid var(--rule); font-family:var(--display); font-stretch:100%;
  font-size:.82rem; color:var(--muted)}
.prompt-top .btn{flex:none}
.prompt pre{margin:0; padding:var(--s3); font-family:var(--mono); font-size:.8rem;
  line-height:1.62; white-space:pre-wrap; overflow-wrap:break-word; color:var(--fg)}

