@import url("/prism.css");   /* house palette: black, white, prism highlights (one place) */
/* ==================================================================
   library.nunascape.com — style.css
   The whole look lives in the two token blocks below. They are the
   current values, not fixed rules: change a token here and every page
   follows. The reasoning behind them is in docs/STYLE.md.

   Theme: a checkbox (#paper) sits first in <body>; everything after it
   is a sibling, so the White/Black switch works without JavaScript.
   ================================================================== */

/* ---------- tokens: Black (default) ----------
   Black and white with prism highlights (Aaron, 17 Oct 2026). Neutrals only here;
   the prism accent comes from /prism.css (--nl-*). --ac = the one solid prism key. */
:root,
.site{
  --ground:#000000;  --ground-ix:#000000; --plate:#0D0D0D;
  --ink:#EDEDED;     --bright:#FFFFFF;    --soft:#A6A6A6;
  --rule:#2B2B2B;    --pale:#D4D4D4;      --ac:var(--nl-key);

  --serif:"Iowan Old Style",Palatino,"Palatino Linotype",Georgia,serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --display:"Cormorant Garamond","Iowan Old Style",Palatino,Georgia,serif;
  --wm-a:var(--nl-prism);
}

/* ---------- tokens: White ---------- */
#paper:checked ~ .site{
  --ground:#FFFFFF;  --ground-ix:#FFFFFF; --plate:#F4F4F4;
  --ink:#141414;     --bright:#000000;    --soft:#5C5C5C;
  --rule:#D6D6D6;    --pale:#1F1F1F;      --ac:var(--nl-key);
}
html:has(#paper:checked),
html:has(#paper:checked) body{background:#FFFFFF}   /* overscroll colour */

/* ---------- base ---------- */
:root{
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
  --nav-h:15.5rem;   /* shared header height; keep in step with #nuna-nav */
}
*,*::before,*::after{box-sizing:inherit}
html{scroll-padding-top:env(safe-area-inset-top,0px); background:#000}
/* Only pages with the shared header; full-page games have no #nuna-nav. */
html:has(#nuna-nav){scroll-padding-top:calc(var(--nav-h) + env(safe-area-inset-top,0px))}
body{margin:0; background:#000}
.site{
  min-height:100vh; background:var(--ground); color:var(--ink);
  font-family:var(--serif); font-size:17px; line-height:1.62;
  -webkit-font-smoothing:antialiased;
}
.site ::selection{background:var(--nl-sel)}
a{color:inherit}
img,svg{max-width:100%}
table{width:100%; border-collapse:collapse; font-size:15px}
pre,code{font-family:var(--mono); font-size:13px}
pre{overflow-x:auto}
.scroll{overflow-x:auto}
:focus-visible{outline:2px solid var(--ac); outline-offset:2px}

/* the theme checkbox: present, focusable, invisible */
.theme-chk{position:absolute; width:1px; height:1px; margin:0; padding:0;
  clip:rect(0 0 0 0); clip-path:inset(50%); overflow:hidden; white-space:nowrap}

/* page widths */
main{margin:0 auto; padding:3.5rem 1.4rem 6rem; max-width:46rem}
main.is-wide{max-width:none; padding:0}

/* shared label voice */
.label{font-family:var(--mono); font-size:10px; letter-spacing:.18em;
  text-transform:uppercase; color:var(--soft)}

/* the wordmark: Cormorant 300, the a running through the prism */
.wm{font-family:var(--display); font-weight:300; letter-spacing:.01em;
  color:var(--bright); line-height:1}
.wm-a{background:var(--wm-a); -webkit-background-clip:text; background-clip:text;
  color:transparent; -webkit-text-fill-color:transparent}

/* ==================================================================
   HEADER  (#nuna-nav)
   A centred masthead: the solid tile is the black/newsprint switch,
   LIBRARY is the link to the library home. The tab bar ends in three Nuna
   waves: the menu, with Home (out to nunascape.com) and Quizzes underneath.
   Draft, 27 Nov 2026, revision 2.
   ================================================================== */
#nuna-nav{background-color:var(--ground-ix); color:var(--ink);
  border-bottom:1px solid var(--rule);
  display:flex; flex-direction:column; align-items:center; padding:26px clamp(16px,4vw,48px) 0;
  position:sticky; top:0; z-index:50; width:100%}
#nuna-nav .nh-sr{position:absolute; width:1px; height:1px; overflow:hidden;
  clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap}

#nuna-nav .nh-mast{display:flex; flex-direction:column; align-items:center;
  gap:14px; padding:6px 0 22px}
#nuna-nav .nh-switch{display:block; line-height:0; padding:6px; cursor:pointer;
  color:var(--bright); transition:transform .18s, opacity .18s}
#nuna-nav .nh-switch:hover{transform:translateY(-2px); opacity:.82}
#nuna-nav .nh-tile{display:block; width:23px; height:35px}
#paper:focus-visible ~ .site #nuna-nav .nh-switch{outline:2px solid var(--ac); outline-offset:3px}
#nuna-nav .nh-word{font-family:var(--display); font-weight:300; font-size:64px;
  line-height:1; letter-spacing:.08em; color:var(--bright); text-decoration:none}

#nuna-nav .nh-bar{width:100%; border-top:1px solid var(--rule); height:58px;
  display:flex; justify-content:center; align-items:center}
#nuna-nav .nh-tabs{display:flex; justify-content:center; align-items:center; gap:clamp(20px,3.2vw,44px)}
#nuna-nav .nh-tab{height:44px; display:flex; align-items:center; padding:0 4px;
  text-decoration:none; color:var(--soft); font-family:var(--serif);
  font-size:14px; letter-spacing:.16em; text-transform:uppercase;
  transition:color .18s}
#nuna-nav .nh-tab:hover{color:var(--ink)}

/* active tab — stamped by build.py as data-section on <html>, no JS */
html[data-section="home"]     #nuna-nav .nh-tab[data-tab="home"],
html[data-section="paint"]    #nuna-nav .nh-tab[data-tab="paint"],
html[data-section="games"]    #nuna-nav .nh-tab[data-tab="games"],
html[data-section="shapes"]   #nuna-nav .nh-tab[data-tab="shapes"],
html[data-section="patterns"] #nuna-nav .nh-tab[data-tab="patterns"],
html[data-section="notes"]    #nuna-nav .nh-tab[data-tab="notes"],
html[data-section="quizzes"]  #nuna-nav .nh-tab[data-tab="quizzes"]{color:var(--bright)}

/* ---- the menu (draft): three Nuna waves at the end of the tab bar, where
   the prismatic tile was. One wave is two quarter arcs of radius r, convex
   then concave (pitch r√2): the Notes mark's path, unrotated; the three sit
   one radius apart. A native <details>, so it opens and closes with no
   JavaScript. Home and Quizzes drop underneath it. */
#nuna-nav .nh-menu{position:relative; display:block; flex:none; line-height:0}
#nuna-nav .nh-burger{display:block; list-style:none; box-sizing:border-box; width:44px; height:44px;
  padding:10px 9px 0; margin:0 -9px; cursor:pointer; color:var(--soft);
  -webkit-tap-highlight-color:transparent; transition:color .18s}
#nuna-nav .nh-burger::-webkit-details-marker{display:none}
#nuna-nav .nh-burger::marker{content:""}
#nuna-nav .nh-burger:hover,#nuna-nav .nh-menu[open] .nh-burger{color:var(--bright)}
#nuna-nav .nh-burger:focus-visible{outline:2px solid var(--bright); outline-offset:-4px}
#nuna-nav .nh-waves{display:block; width:26px; height:auto; overflow:visible}
#nuna-nav .nh-waves path{fill:none; stroke:currentColor; stroke-width:.2;
  stroke-linecap:round; stroke-linejoin:round}
/* open: the middle wave turns over, concave then convex */
#nuna-nav .nh-w2{transform-box:fill-box; transform-origin:center;
  transition:transform .22s cubic-bezier(.22,.61,.36,1)}
#nuna-nav .nh-menu[open] .nh-w2{transform:scaleY(-1)}
#nuna-nav .nh-panel{position:absolute; top:calc(100% + 7px); right:-9px; z-index:5;
  box-sizing:border-box; min-width:10.5rem; display:flex; flex-direction:column; padding:6px 0;
  background:var(--ground-ix); border:1px solid var(--rule); line-height:1;
  animation:nh-open .2s ease-out}
@keyframes nh-open{from{opacity:0; transform:translateY(-4px)}}
#nuna-nav .nh-mi{display:flex; align-items:center; min-height:44px; padding:0 22px;
  color:var(--soft); text-decoration:none; font-family:var(--serif); font-size:14px;
  letter-spacing:.16em; text-transform:uppercase; white-space:nowrap; transition:color .18s}
#nuna-nav .nh-mi:hover{color:var(--bright)}
#nuna-nav .nh-mi:focus-visible{outline:2px solid var(--bright); outline-offset:-3px}
html[data-section="quizzes"] #nuna-nav .nh-mi[data-mi="quizzes"]{color:var(--bright)}
@media (prefers-reduced-motion:reduce){
  #nuna-nav .nh-burger,#nuna-nav .nh-w2,#nuna-nav .nh-mi{transition:none}
  #nuna-nav .nh-panel{animation:none}
}

/* legacy: the prismatic tile, the old way out. Only for pages not yet stamped
   with the new header block; the .nh-out / .nh-prism rules can go once every page has it. */
#nuna-nav .nh-out{display:flex; align-items:center; height:44px; padding:0 4px; line-height:0}
#nuna-nav .nh-prism{display:block; width:18px; height:28px;
  filter:hue-rotate(var(--prism, 0deg));
  transition:filter .5s ease-out, transform .18s}
#nuna-nav .nh-out:hover .nh-prism{transform:translateY(-2px)}
/* with JavaScript off the tile still moves, just on hover */
@media (hover:hover){
  #nuna-nav .nh-out:hover .nh-prism{animation:prism-drift 5s ease-in-out infinite}
}
@keyframes prism-drift{0%{filter:hue-rotate(-14deg)}50%{filter:hue-rotate(14deg)}100%{filter:hue-rotate(-14deg)}}
@media (prefers-reduced-motion:reduce){
  #nuna-nav .nh-prism{transition:none; animation:none !important; filter:none}
}

@media (max-width:760px){
  :root{--nav-h:12rem}
  #nuna-nav{padding:18px 8px 0; max-width:100%; overflow-x:hidden; overflow-x:clip}   /* clip: the menu may drop below */
  #nuna-nav .nh-mast{gap:10px; padding:8px 0 16px}
  #nuna-nav .nh-word{font-size:40px}
  #nuna-nav .nh-tile{width:19px; height:29px}
  #nuna-nav .nh-bar{height:58px; padding-bottom:0; max-width:100%; overflow-x:hidden; overflow-x:clip}
  #nuna-nav .nh-tabs{display:flex; flex-wrap:nowrap; justify-content:space-evenly;
    align-items:center; gap:0; width:100%; max-width:100%}
  #nuna-nav .nh-tab{flex:0 1 auto; justify-content:center; height:44px; padding:0 2px;
    white-space:nowrap; min-width:0;
    font-size:clamp(9px, 2.7vw, 13px);            /* six tabs since Quizzes joined */
    letter-spacing:clamp(.01em, .2vw, .14em)}
  #nuna-nav .nh-out{flex:0 0 auto; height:44px; padding:0 2px}
  #nuna-nav .nh-prism{width:14px; height:22px}
  #nuna-nav .nh-burger{padding:12px 11px 0; margin:0 -8px 0 -12px}   /* still a 44px target; 24px of the row */
  #nuna-nav .nh-waves{width:22px}
  #nuna-nav .nh-panel{right:-8px}
}

/* ==================================================================
   FOOTER
   ================================================================== */
#nuna-foot{border-top:1px solid var(--rule); padding:2rem 1.4rem 3rem;
  color:var(--soft); font-family:var(--mono); font-size:10px;
  letter-spacing:.16em; text-transform:uppercase; text-align:center}
#nuna-foot a{color:var(--soft); text-decoration:none}
#nuna-foot a:hover{color:var(--ac)}

/* ==================================================================
   LIBRARY HOME — a plain numbered index (.ix-*)
   ================================================================== */
.ix-shell{background:var(--ground-ix); padding:2.4rem 0 5rem}
.ix-wrap{max-width:50rem; margin:0 auto; padding:0 1.6rem}

.ix-sec{border-top:1px solid var(--rule)}
.ix-sec:last-of-type{border-bottom:1px solid var(--rule)}
.ix-sec > summary{list-style:none; cursor:pointer; display:grid;
  grid-template-columns:2.4rem minmax(0,1fr) auto 1.8rem; align-items:baseline;
  column-gap:1rem; padding:1.15rem 0}
.ix-sec > summary::-webkit-details-marker{display:none}
.ix-sec > summary:focus-visible{outline:2px solid var(--ac); outline-offset:3px}
.ix-num{font-family:var(--mono); font-size:11px; letter-spacing:.14em; color:var(--soft)}
.ix-sec[open] .ix-num{color:var(--ac)}
.ix-name{font-size:1.18rem; color:var(--ink)}
.ix-count{font-family:var(--mono); font-size:10px; letter-spacing:.14em; color:var(--soft)}
.ix-x{position:relative; width:11px; height:11px; justify-self:end; align-self:center}
.ix-x::before,.ix-x::after{content:""; position:absolute; background:var(--soft);
  transition:transform .2s, opacity .2s}
.ix-x::before{left:0; top:5px; width:11px; height:1px}
.ix-x::after{left:5px; top:0; width:1px; height:11px}
.ix-sec[open] .ix-x::after{transform:scaleY(0); opacity:0}
.ix-sub{margin:0 0 .7rem; padding-left:3.4rem; max-width:34rem;
  color:var(--soft); font-size:.96rem}

.ix-rows{list-style:none; margin:0; padding:0 0 1.4rem}
.ix-row{display:grid; grid-template-columns:3.4rem minmax(0,1fr) auto;
  column-gap:1rem; align-items:baseline; padding:.62rem 0;
  border-top:1px solid var(--rule)}
.ix-row.is-dim .ix-title{color:var(--soft)}
.ix-n{font-family:var(--mono); font-size:10.5px; letter-spacing:.1em; color:var(--soft)}
.ix-title{display:block; font-size:1.04rem; line-height:1.35; color:var(--ink)}
.ix-blurb{display:block; margin-top:.15rem; font-size:.92rem; color:var(--soft);
  max-width:30rem}
.ix-status{font-family:var(--mono); font-size:9px; letter-spacing:.16em;
  text-transform:uppercase; color:var(--soft); white-space:nowrap}
.ix-status.is-live{color:var(--ac)}
.ix-foot{margin:2.2rem 0 0; font-family:var(--mono); font-size:10px;
  letter-spacing:.14em; text-transform:uppercase; color:var(--soft)}

@media (max-width:640px){
  .ix-sec > summary{grid-template-columns:1.8rem minmax(0,1fr) 1.6rem;
    column-gap:.7rem}
  .ix-count{grid-column:2; grid-row:2}
  .ix-sub{padding-left:2.5rem}
  .ix-row{grid-template-columns:2.8rem minmax(0,1fr); row-gap:.25rem}
  .ix-status{grid-column:2}
}


/* ==================================================================
   BOOK PAGES — six-slot anatomy
   Claim · Construction · Proof · Note · Open questions · Checks
   ================================================================== */
/* book pages set without a mark drawn: one column */
.bk-head.is-plain{display:block}
.bk-head.is-plain h1{margin-top:.5rem}
.bk-mark{width:54px; height:64px}
.bk-mark .hub{fill:var(--soft); fill-opacity:.38}
.bk-mark .on{fill:var(--ac)}

/* slot internals */
.slot h3.label{margin:1.4rem 0 .5rem}
.slot .bk-q{margin:1.1rem 0; padding-left:1.1rem; border-left:2px solid var(--rule);
  font-size:1.08rem; color:var(--bright)}
.slot code{font-size:12.5px; color:var(--pale)}
ul.bk-list{margin:0; padding-left:1.1rem}
ul.bk-list li{margin:0 0 .6rem}
.checks td.bk-src{font-family:var(--mono); font-size:11.5px; color:var(--soft);
  white-space:normal}

/* figure extras */
figure.fig .fl2{fill:var(--ac); fill-opacity:.13}
figure.fig .gd{fill:none; stroke:var(--soft); stroke-width:1; stroke-opacity:.55;
  vector-effect:non-scaling-stroke}
figure.fig .pt{fill:var(--ac)}
figure.fig text{font-family:var(--mono); font-size:13px; fill:var(--soft)}
figure.fig line{vector-effect:non-scaling-stroke}

.bk-head{display:grid; grid-template-columns:auto 1fr; column-gap:1.4rem;
  align-items:end; padding-bottom:1.6rem; margin-bottom:2.2rem;
  border-bottom:1px solid var(--rule)}
.bk-head .nb-sym{width:64px; height:76px}
.bk-crumb{display:block; margin-bottom:.4rem}
.bk-crumb a{text-decoration:none}
.bk-crumb a:hover{color:var(--ac)}
.bk-head h1{margin:0; font-family:var(--display); font-weight:300; font-size:2.4rem;
  line-height:1.05; color:var(--bright)}

.slot{margin:0 0 2.6rem}
.slot > h2{margin:0 0 .8rem; font-family:var(--mono); font-weight:400; font-size:10px;
  letter-spacing:.2em; text-transform:uppercase; color:var(--soft);
  display:flex; gap:.9rem; align-items:baseline}
.slot > h2::before{content:attr(data-n); color:var(--pale)}
.slot p{margin:0 0 1rem}
.slot-claim p{font-size:1.28rem; line-height:1.45; color:var(--bright)}

figure.fig{margin:1.4rem 0; padding:1.4rem; background:var(--plate);
  border:1px solid var(--rule)}
figure.fig svg{display:block; margin:0 auto; height:auto}
figure.fig .ln{fill:none; stroke:var(--ink); stroke-width:1.2; vector-effect:non-scaling-stroke}
figure.fig .fl{fill:var(--ink); fill-opacity:.08}
figure.fig .hi{fill:none; stroke:var(--ac); stroke-width:1.6; vector-effect:non-scaling-stroke}
figure.fig figcaption{margin-top:1rem; font-family:var(--mono); font-size:10px;
  letter-spacing:.14em; text-transform:uppercase; color:var(--soft)}

/* Note: Aaron's slot. While empty it shows as scaffolding. */
.slot-note.is-scaffold{border:1px dashed var(--rule); padding:1.1rem 1.2rem}
.slot-note.is-scaffold p{color:var(--soft); font-style:italic; margin:0}

.checks{width:100%; font-size:14px}
.checks th,.checks td{text-align:left; padding:.55rem .6rem .55rem 0;
  border-top:1px solid var(--rule); vertical-align:top}
.checks th{font-family:var(--mono); font-weight:400; font-size:9.5px;
  letter-spacing:.16em; text-transform:uppercase; color:var(--soft)}

/* stub pages (tabs not yet filled) */
.stub h1{margin:0 0 .6rem; font-family:var(--display); font-weight:300;
  font-size:2.6rem; line-height:1.05; color:var(--bright)}
.stub p{color:var(--soft)}

/* ---------- print: always paper, no chrome ---------- */
@media print{
  .site{--ground:#fff; --ground-ix:#fff; --plate:#fff; --ink:#000; --bright:#000;
    --soft:#444; --rule:#bbb; --pale:#222; --ac:#000}
  #nuna-nav .nh-prism{filter:none}
  #nuna-nav,#nuna-foot{display:none}
  .nb-shelf > summary{break-after:avoid}
  .nb-row,.slot,figure.fig{break-inside:avoid}
}

/* ==================================================================
   PRISM HIGHLIGHTS (Libra, 17 Oct 2026). Accents only, never fills.
   Gradients/keys come from /prism.css; change them there.
   ================================================================== */
/* header: a 1px prism hairline replaces the grey bottom rule */
#nuna-nav{border-bottom:0; background-image:var(--nl-prism); background-repeat:no-repeat;
  background-position:left bottom; background-size:100% 1px; padding-bottom:1px}
/* active tab: white (or black) type over a 2px prism bar */
html[data-section="home"]     #nuna-nav .nh-tab[data-tab="home"],
html[data-section="paint"]    #nuna-nav .nh-tab[data-tab="paint"],
html[data-section="games"]    #nuna-nav .nh-tab[data-tab="games"],
html[data-section="shapes"]   #nuna-nav .nh-tab[data-tab="shapes"],
html[data-section="patterns"] #nuna-nav .nh-tab[data-tab="patterns"],
html[data-section="notes"]    #nuna-nav .nh-tab[data-tab="notes"],
html[data-section="quizzes"]  #nuna-nav .nh-tab[data-tab="quizzes"]{
  background-image:var(--nl-prism); background-repeat:no-repeat;
  background-position:left calc(100% - 5px); background-size:100% 2px}
/* links: plain ink, the underline turns prism-key on hover */
.site main a{text-underline-offset:3px}
.site main a:hover{text-decoration-color:var(--ac)}
#nuna-foot{border-top:0; background-image:var(--nl-prism); background-repeat:no-repeat;
  background-size:100% 1px; background-position:left top}
/* index: an open section gets a prism top rule; "live" gets a small prism dot */
.ix-sec[open]{border-top-color:transparent; background-image:var(--nl-prism);
  background-repeat:no-repeat; background-size:100% 1px; background-position:left top}
.ix-status.is-live{color:var(--bright)}
.ix-status.is-live::before{content:""; display:inline-block; width:6px; height:6px; border-radius:50%;
  background:var(--nl-prism-c); margin-right:.45em; vertical-align:1px}
/* book pages: the head rule is a prism hairline */
.bk-head{border-bottom:0; background-image:var(--nl-prism); background-repeat:no-repeat;
  background-size:100% 1px; background-position:left bottom}
/* the lock screen (tools/lockall/page.template.html): the Unlock button gets a prism edge */
.lk-form button{border:1px solid transparent;
  background:linear-gradient(var(--plate),var(--plate)) padding-box, var(--nl-prism) border-box}
.lk-form input[type=password]:focus{outline:2px solid var(--ac); outline-offset:1px}
@media print{
  #nuna-nav,.ix-sec[open],.bk-head,#nuna-foot{background-image:none}
  .bk-head{border-bottom:1px solid #bbb}
}
