/* Draw32 — 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 three colours a pill is printed in */
  --fil-white:#ffffff;
  --fil-black:#171a1e;
  --fil-orange:#f47721;
  --rim-white:#c9cbc4;
  --rim-black:#484b4e;
  --rim-orange:#bd5a16;

  /* the live colour pair, rewritten by the switcher */
  --pill-body:#f47721;
  --pill-mark:#171a1e;
  --pill-rim:#bd5a16;

  --wordmark:url(wordmark.png);

  --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;
  --rim-white:#b6b8b2;
  --rim-black:#5a5e61;
  --rim-orange:#ffa066;
  --pill-rim:#ffa066;
  --wordmark:url(wordmark-dark.png);
}}
: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;
  --rim-white:#b6b8b2;
  --rim-black:#5a5e61;
  --rim-orange:#ffa066;
  --pill-rim:#ffa066;
  --wordmark:url(wordmark-dark.png);
}

*{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);
}
.wm{background-image:var(--wordmark); background-size:contain; background-repeat:no-repeat;
    background-position:left center; aspect-ratio:2046/768}
.mast .wm{height:2.1rem; width:5.6rem; 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.8rem; width:4.8rem}
}

/* ---------- 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{width:min(22rem,76vw); 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}
.hero .draw-cycle{font-family:var(--display); font-weight:800; font-stretch:92%;
  font-size:clamp(1.5rem,4.6vw,2rem); line-height:1.15; letter-spacing:-.022em;
  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)}

/* ---------- 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}

/* ---------- pills ---------- */
/* 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)}
.set{display:grid; grid-template-columns:repeat(8,1fr); gap:.4rem}
.set.cols4{grid-template-columns:repeat(4,1fr); max-width:17rem}
@media (max-width:560px){.set{grid-template-columns:repeat(4,1fr)}}
.pill{display:block; width:100%; height:auto}
.pill .body{fill:var(--pill-body); stroke:var(--pill-rim); stroke-width:.22}
.pill text{fill:var(--pill-mark); font-size:6.5px; font-weight:700; text-anchor:middle;
  font-family:Arial,Helvetica,"Liberation Sans",sans-serif}
.pill .bar{fill:var(--pill-mark)}
.pill.void .body{fill:none; stroke:var(--rule-strong); stroke-width:.32; stroke-dasharray:1.1 .9}
.pill.void text{fill:var(--muted); font-weight:400}
.pill.void line{stroke:var(--muted); stroke-width:.45}

/* ---------- colour switcher ---------- */
/* Four colourways, so two by two. auto-fit put three on one line and left the
   fourth alone underneath at the width this band actually gets. */
.ways{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.5rem;
  margin-block:var(--s3)}
@media (max-width:360px){ .ways{grid-template-columns: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:2.4rem 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:2.4rem; display:block}
.ways b{display:block; font-weight:700; min-width:0}

/* ---------- lists ---------- */
ol.steps{list-style:none; margin:0; padding:0; display:grid; gap:var(--s3); counter-reset:step}
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 one step the whole method depends on, so it has to read as different from
   the five around it. 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}
}

/* ---------- string anatomy ---------- */
.anatomy{display:flex; flex-wrap:wrap; gap:.35rem; margin-block:var(--s3)}
.seg{border-radius:9px; padding:.45rem .6rem; font-family:var(--mono); font-size:.9rem;
  background:var(--surface); border:1px solid var(--rule); text-align:center; min-width:0}
.seg.fixed{background:var(--accent); border-color:var(--accent); color:var(--on-accent); font-weight:600}
/* 5.5rem is what the payload's own content measures; it used to ask for 11rem,
   which is wider than the 9.2rem left over once the five fixed segments and
   the gaps are placed, so the row wrapped and the checksum fell to a second
   line. Asking for what it needs and growing into the slack keeps the string
   on one line down to about a 31rem column, and still wraps below that. */
.seg.pay{flex:1 1 5.5rem; background:var(--surface-2)}
.seg small{display:block; font-family:var(--display); font-stretch:100%; font-size:.64rem;
  font-weight:700; letter-spacing:.09em; text-transform:uppercase; opacity:.72; margin-top:.2rem}
/* ---------- a share set, as rows of the anatomy above ---------- */
/* One row per worksheet, so the two ways of making a 2-of-3 differ visibly
   rather than only in prose: the index segment changes, and the tag says which
   rows you draw and which you calculate. Rows reuse .anatomy and .seg, held to
   one line — a share strip that wrapped would read as a broken string rather
   than a tighter one, so the segments shrink instead and the tag drops below
   on narrow screens. */
.shareset{display:flex; flex-direction:column; gap:.45rem; margin-block:var(--s3)}
.srow{display:flex; align-items:center; gap:.6rem}
.srow .anatomy{margin:0; flex:1 1 auto; flex-wrap:nowrap; gap:.3rem}
.srow .seg{padding:.34rem .5rem; font-size:.82rem}
.srow .seg.pay{flex:1 1 4rem}
/* No <small> part names on these rows. Labelling one row makes it wider than
   the rest, which pushes its tag past the column edge, and the anatomy figure
   above names the parts already. */
.srow .seg.idx{background:var(--accent); border-color:var(--accent);
  color:var(--on-accent); font-weight:700}
.srow .tag{font-family:var(--display); font-stretch:100%; font-size:.68rem;
  font-weight:600; letter-spacing:.04em; color:var(--muted); white-space:nowrap;
  flex:0 0 5.4rem; text-align:right}
.srow .tag.calc{color:var(--accent)}
/* The s worksheet is destroyed, so it is shown present but faded: the point is
   that you write it and then do not keep it. */
.srow.gone .anatomy{opacity:.42}
@media (max-width:560px){
  .srow{display:block}
  .srow .tag{display:block; flex:none; margin-top:.25rem}
  .srow .seg{padding:.3rem .32rem; font-size:.74rem}
  .srow .anatomy{gap:.25rem}
}

.segmented{display:inline-flex; border:1px solid var(--rule); border-radius:999px; padding:2px;
  gap:2px; background:var(--surface)}
.segmented button{font-family:var(--display); font-stretch:100%; font-size:.8125rem;
  font-weight:600; border:0; cursor:pointer; background:transparent; color:var(--muted);
  padding:.32rem .9rem; border-radius:999px}
.segmented button[aria-pressed="true"]{background:var(--accent); color:var(--on-accent)}

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

/* ---------- shop ---------- */
.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)}

/* ---------- worksheet ---------- */
.ws-faces{display:grid; grid-template-columns:repeat(2,1fr); gap:var(--s3);
  margin-block:var(--s3) var(--s4)}
.ws-faces figure{margin:0; min-width:0}
/* the card is a printable, so it stays white paper in both themes */
.ws-faces img{display:block; width:100%; height:auto; background:#ffffff;
  border:1px solid var(--rule); border-radius:8px}
.ws-faces figcaption{font-family:var(--display); font-stretch:100%; font-size:.76rem;
  font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted);
  margin-top:.55rem}
.record-preview{max-width:20rem; margin-block:var(--s3) var(--s4)}
.record-preview img{display:block; width:100%; height:auto; background:#ffffff;
  border:1px solid var(--rule); border-radius:8px}
.record-preview p{margin-top:.6rem}
.method-fields th,.method-fields td{text-align:left; vertical-align:top;
  white-space:normal}
.method-fields tbody th{font-weight:600}
.method-fields tbody td{font-family:var(--prose); font-size:.9rem}
@media (max-width:420px){
  .method-fields th,.method-fields td{padding-inline:.3rem}
}

/* ---------- 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:.45rem}
footer nav a:not(:last-child)::after{content:"\00b7"; margin-left:.45rem;
  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}
