/* ==================================================================
   INK LAYER: hand-printed marks for the template.

   Every file in assets/ink/ is black ink on transparent and is used
   ONLY as a mask. Colour always comes from the component (a palette
   variable or currentColor), so the same file works on any background
   and nothing here knows what the page says.

   Hooks (use these when writing new pages):
     .kicker                section label, gets a brush dash
     .outcomes, .roster, .ink-list   lists, get hand-printed bullets
     .ink-list.check / .cross        tick or X bullets
     .go, .more             links, get an inked arrow (don't type a → in the text)
     .ul                    word(s) underlined with a brush swash
     .dots                  decorative speck clusters
   Variants cycle with :nth-child so repeated items differ slightly.
   Remove the <link> to this file and the site falls back to plain CSS.
   ================================================================== */

/* ---------- section label dash ---------- */
.kicker::before{width:34px;height:12px;border-radius:0;background:var(--sun);
  -webkit-mask:url(ink/dash-1.webp) left center/contain no-repeat;mask:url(ink/dash-1.webp) left center/contain no-repeat}
section:nth-of-type(3n+2) .kicker::before{-webkit-mask-image:url(ink/dash-2.webp);mask-image:url(ink/dash-2.webp)}
section:nth-of-type(3n) .kicker::before{-webkit-mask-image:url(ink/dash-3.webp);mask-image:url(ink/dash-3.webp)}
.night .kicker::before{background:var(--sky)}

/* ---------- bullets ---------- */
.ink-list{list-style:none;margin:18px 0 0;padding:0;display:grid;gap:10px}
.ink-list li,.roster li{position:relative;padding-left:28px}
.roster li{border-left:0}
.outcomes li::before,.ink-list li::before,.roster li::before{content:"";position:absolute;left:2px;top:.5em;width:13px;height:13px;border-radius:0;background:var(--sun);
  -webkit-mask:url(ink/bullet-1.webp) center/contain no-repeat;mask:url(ink/bullet-1.webp) center/contain no-repeat}
.outcomes li::before{left:6px}
.roster li::before{background:var(--rust)}
.night .outcomes li::before,.night .ink-list li::before,.night .roster li::before{background:var(--sky)}
:is(.outcomes,.ink-list,.roster) li:nth-child(6n+2)::before{-webkit-mask-image:url(ink/bullet-2.webp);mask-image:url(ink/bullet-2.webp)}
:is(.outcomes,.ink-list,.roster) li:nth-child(6n+3)::before{-webkit-mask-image:url(ink/bullet-3.webp);mask-image:url(ink/bullet-3.webp)}
:is(.outcomes,.ink-list,.roster) li:nth-child(6n+4)::before{-webkit-mask-image:url(ink/bullet-4.webp);mask-image:url(ink/bullet-4.webp)}
:is(.outcomes,.ink-list,.roster) li:nth-child(6n+5)::before{-webkit-mask-image:url(ink/bullet-5.webp);mask-image:url(ink/bullet-5.webp)}
:is(.outcomes,.ink-list,.roster) li:nth-child(6n)::before{-webkit-mask-image:url(ink/bullet-6.webp);mask-image:url(ink/bullet-6.webp)}
.ink-list.check li::before,.ink-list.cross li::before{width:16px;height:16px;top:.35em;-webkit-mask-image:url(ink/check-1.webp);mask-image:url(ink/check-1.webp)}
.ink-list.check li::before{background:var(--navy)}
.ink-list.cross li::before{background:var(--rust);-webkit-mask-image:url(ink/cross-1.webp);mask-image:url(ink/cross-1.webp)}

/* ---------- arrows ---------- */
.go::after,.more::after{content:"";display:inline-block;width:1.35em;height:.7em;margin-left:.45em;vertical-align:-.02em;background:currentColor;
  -webkit-mask:url(ink/arrow-1.webp) center/contain no-repeat;mask:url(ink/arrow-1.webp) center/contain no-repeat;transition:transform .2s}
.doors .card:nth-child(2n) .go::after{-webkit-mask-image:url(ink/arrow-2.webp);mask-image:url(ink/arrow-2.webp)}
.doors .card:nth-child(3n) .go::after,.btn.more::after{-webkit-mask-image:url(ink/arrow-3.webp);mask-image:url(ink/arrow-3.webp)}
a:hover .go::after,a.more:hover::after{transform:translateX(4px)}

/* ---------- brush underline ---------- */
.ul{position:relative;white-space:nowrap;z-index:0}
.ul::after{content:"";position:absolute;z-index:-1;left:-.06em;right:-.1em;bottom:-.08em;height:.26em;background:var(--ul,var(--sun));opacity:.9;
  -webkit-mask:url(ink/underline-1.webp) center/100% 100% no-repeat;mask:url(ink/underline-1.webp) center/100% 100% no-repeat}
.ul.v2::after{-webkit-mask-image:url(ink/underline-2.webp);mask-image:url(ink/underline-2.webp)}
.ul.v3::after{-webkit-mask-image:url(ink/underline-3.webp);mask-image:url(ink/underline-3.webp)}

/* ---------- decorative specks (was a CSS dot grid) ---------- */
.dots i{border-radius:0;width:11px;height:11px;-webkit-mask:url(ink/bullet-1.webp) center/contain no-repeat;mask:url(ink/bullet-1.webp) center/contain no-repeat}
.dots i:nth-child(3n+2){-webkit-mask-image:url(ink/bullet-4.webp);mask-image:url(ink/bullet-4.webp);transform:rotate(40deg)}
.dots i:nth-child(4n+3){-webkit-mask-image:url(ink/bullet-6.webp);mask-image:url(ink/bullet-6.webp);transform:rotate(-70deg) scale(.85)}
.dots i:nth-child(7n){-webkit-mask-image:url(ink/star-2.webp);mask-image:url(ink/star-2.webp);transform:scale(1.25)}

/* ---------- printed card surfaces ----------
   Coloured blocks get flecks of paper showing through, like a linocut
   that didn't take the ink evenly. Replaces the CSS ring on .card. */
.card,.case.navy,.case.rust,.c-navy,.c-sun,.c-sky,.c-rust{position:relative;isolation:isolate}
.card::after,.case.navy::after,.case.rust::after{content:"";position:absolute;inset:0;width:auto;height:auto;right:0;bottom:0;border:0;border-radius:inherit;z-index:-1;pointer-events:none;
  background:var(--paper);opacity:.16;-webkit-mask:url(ink/texture-gaps.webp) 0 0/420px repeat;mask:url(ink/texture-gaps.webp) 0 0/420px repeat}
.card:nth-child(2n)::after{-webkit-mask-position:180px 90px;mask-position:180px 90px}
.c-sun::after,.c-sky::after{opacity:.24}

/* ---------- torn edges between dark and light ----------
   The page colour (--edge, default the wall) tears into a dark band.
   No extra markup: hooked on .night sections, the nav and the footer. */
.night::before,.night::after,.foot::before,.nav::after,.subnav::after{content:"";position:absolute;left:0;right:0;height:22px;pointer-events:none;z-index:2;background:var(--edge,var(--wall));
  -webkit-mask:url(ink/edge-torn-1.webp) 0 0/auto 100% repeat-x;mask:url(ink/edge-torn-1.webp) 0 0/auto 100% repeat-x}
.night::before{top:-1px;transform:scaleY(-1)}
.night::after{bottom:-1px;-webkit-mask-image:url(ink/edge-torn-2.webp);mask-image:url(ink/edge-torn-2.webp);-webkit-mask-position:300px 0;mask-position:300px 0}
.foot{position:relative}
.foot::before{top:-1px;transform:scaleY(-1);-webkit-mask-image:url(ink/edge-torn-2.webp);mask-image:url(ink/edge-torn-2.webp)}
.nav,.subnav{position:relative}
.nav::after,.subnav::after{bottom:-1px}
body:has(.subnav) .nav::after{display:none}
/* two dark bands touching: no tear between them */
main>.night:last-child::after,main:has(>.night:last-child)+.foot::before{display:none}
main>.night:first-child::before{display:none}

/* ---------- dividers ---------- */
hr,.rule{border:0;height:12px;margin:48px 0;background:var(--rule-c,var(--muted));opacity:.55;
  -webkit-mask:url(ink/rule-1.webp) center/100% 100% no-repeat;mask:url(ink/rule-1.webp) center/100% 100% no-repeat}
hr.double,.rule.double{height:14px;-webkit-mask-image:url(ink/rule-2.webp);mask-image:url(ink/rule-2.webp)}
hr.dotted,.rule.dotted{height:14px;-webkit-mask:url(ink/rule-3.webp) left center/auto 100% repeat-x;mask:url(ink/rule-3.webp) left center/auto 100% repeat-x}
.night hr,.night .rule{--rule-c:var(--paper);opacity:.35}

/* ---------- hand-cut frames ----------
   Replaces thin CSS borders on outline boxes. Uses mask-box-image (Chrome,
   Safari, Edge); Firefox keeps the plain CSS border, which is fine. */
@supports (-webkit-mask-box-image:none){
  .frame,.love,.gear>div,.writing,.book.unwritten{position:relative;border-color:transparent!important;border-radius:6px}
  .frame::before,.love::before,.gear>div::before,.writing::before,.book.unwritten::before{content:"";position:absolute;inset:-2px;pointer-events:none;
    background:var(--frame-c,rgba(94,88,78,.38));-webkit-mask-box-image:url(ink/frame.webp) 60 / 5px stretch}
  .night .love::before,.night .frame::before{--frame-c:rgba(251,249,244,.22)}
  .writing::before{--frame-c:rgba(94,88,78,.5);-webkit-mask-box-image-width:7px}
}

/* ---------- Footnotes (any page) ----------
   Marker: <sup class="fn">*</sup>   Notes: <ol class="notes"><li data-m="*">…</li></ol>
   The marker text is whatever you type (*, **, †, 1); data-m repeats it in the list. */
.fn{font:700 .8em/0 'Fraunces',serif;color:var(--rust);margin-left:1px;vertical-align:super}
.notes{list-style:none;margin:30px 0 0;padding:18px 0 0;max-width:56ch;font-size:.88rem;color:var(--muted);position:relative}
.notes::before{content:"";position:absolute;left:0;top:0;width:min(220px,50%);height:10px;background:currentColor;opacity:.5;
  -webkit-mask:url(ink/rule-1.webp) left center/100% 100% no-repeat;mask:url(ink/rule-1.webp) left center/100% 100% no-repeat}
.notes li{position:relative;padding-left:2.2em;margin:6px 0}
.notes li::before{content:attr(data-m);position:absolute;left:0;width:1.8em;text-align:right;font:700 1em/inherit 'Fraunces',serif;color:var(--rust)}
.night .notes{color:rgba(251,249,244,.62)}
