/* X Creator Kit site system: tokens, the reader, the bar (nav), keys (buttons), quiet links and the Tools slip.
   Loaded by every page, before the page's own stylesheet. See docs/v1/SITE-READER.md.
   Type: Archivo (width axis: wide for headlines, narrow caps for printed figures, normal for text), Martian Mono for
   labels and figures, Doto only for the bar's readout. All SIL OFL 1.1, self-hosted.
   Colour: white, ink, blue ink for captured figures, and one colourway (the six of the Receiptify scene). The colourway
   never colours a button or text on white, so every colourway keeps its contrast. */
@font-face { font-family: 'Archivo'; src: url(/fonts/archivo-latin-wdth.woff2) format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url(/fonts/martian-mono-latin-wdth.woff2) format('woff2'); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }
@font-face { font-family: 'Doto'; src: url(/fonts/doto-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --paper: #fff; --soft-ground: #f4f4f1; --ink: #131313; --ink-2: #55575c; --ink-3: #8e9096; --rule: #deded8;
  --blue: #2140c9; --lcd: #b9f27c; --bar: #131313; --bar-line: #2b2b2b;
  --accent: #f2c230; --on: #131313; --on-2: rgba(19, 19, 19, .74); --lip-on: rgba(19, 19, 19, .3); --pop: var(--accent);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --r-key: 14px; --r-bar: 18px; --wide: 125%; --narrow: 62%;
  color-scheme: light;
}
:root[data-cw=cobalt] { --accent: #2b3ed8; --on: #fff; --on-2: rgba(255, 255, 255, .8); --lip-on: rgba(0, 0, 0, .38); --pop: #8ea0ff; }
:root[data-cw=bubblegum] { --accent: #ff5aa5; --on: #131313; --on-2: rgba(19, 19, 19, .76); }
:root[data-cw=forest] { --accent: #1f5a3d; --on: #fff; --on-2: rgba(255, 255, 255, .8); --lip-on: rgba(0, 0, 0, .4); --pop: #7fd3a4; }
:root[data-cw=lilac] { --accent: #b6a4ff; --on: #131313; --on-2: rgba(19, 19, 19, .76); }
:root[data-cw=midnight] { --accent: #1c1c1c; --on: #fff; --on-2: rgba(255, 255, 255, .76); --lip-on: rgba(0, 0, 0, .6); --bar: #000; --bar-line: #333; --pop: #fff; }

.mono { font: 500 11px/1.4 'Martian Mono', ui-monospace, monospace; letter-spacing: .05em; text-transform: uppercase; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- the reader: two bracket arms, two square eyes ---------- */
.arm { fill: var(--arm, var(--accent)); stroke: var(--arm-line, none); stroke-width: var(--arm-sw, 0); stroke-linejoin: round; overflow: visible; display: block; flex: none; }
.arm.r { transform: scaleX(-1); }
.rd { display: inline-flex; align-items: center; gap: .14em; height: 1em; font-size: 22px; vertical-align: middle; flex: none; }
.rd .arm { width: .36em; height: 1em; }
.rd .eye { display: block; width: .17em; height: .17em; background: var(--eye, #fff); flex: none; animation: rd-blink 4.6s infinite; transform-origin: 50% 60%; }
.rd .eye + .eye { animation-delay: .05s; }
@keyframes rd-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* ---------- the bar ---------- */
.np { position: fixed; inset: 16px 0 auto 0; z-index: 30; padding: 0 20px; pointer-events: none; }
.np-bar { pointer-events: auto; position: relative; max-width: 1320px; margin: 0 auto; height: 64px; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 20px; background: var(--bar); border-radius: var(--r-bar); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 0 0 1px var(--bar-line), 0 14px 30px -18px rgba(0, 0, 0, .55); }
.np-brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none; font: 800 17px/1 'Archivo', system-ui, sans-serif; font-stretch: var(--wide); letter-spacing: -.025em; margin-right: 18px; white-space: nowrap; border-radius: 8px; }
.np-brand .rd, .np-strip .rd { --eye: #fff; --arm: var(--pop); }
.np-links { display: flex; align-items: center; gap: 2px; }
.np-link { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 0; background: none; border-radius: 10px; font: 500 15px/1 'Archivo', system-ui, sans-serif; color: #c9c9c3; text-decoration: none; cursor: pointer; list-style: none; transition: color .16s; }
.np-link::-webkit-details-marker { display: none; }
.np-link::before, .np-link::after { content: ""; position: absolute; top: 9px; bottom: 9px; width: 5px; border: 2px solid var(--pop); opacity: 0; transition: transform .2s var(--ease), opacity .14s; }
.np-link::before { left: 3px; border-right: 0; transform: translateX(5px); }
.np-link::after { right: 3px; border-left: 0; transform: translateX(-5px); }
.np-link:hover, .np-link[aria-current=page], .np-tools[open] > .np-link { color: #fff; }
.np-link:hover::before, .np-link:hover::after, .np-link[aria-current=page]::before, .np-link[aria-current=page]::after, .np-tools[open] > .np-link::before, .np-tools[open] > .np-link::after { opacity: 1; transform: none; }
.np :focus-visible { outline: 2.5px solid #fff; outline-offset: 3px; border-radius: 8px; }
.np-chev { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .24s var(--ease); }
.np-tools[open] .np-chev { transform: rotate(180deg); }
.np-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.np-lcd { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 13px 0 12px; background: #070807; border-radius: 10px; box-shadow: inset 0 0 0 1px #262826, inset 0 2px 5px rgba(0, 0, 0, .9); font: 900 16px/1 'Doto', ui-monospace, monospace; letter-spacing: .06em; color: var(--lcd); white-space: nowrap; }
.np-lcd small { font: inherit; opacity: .55; }
.np-led { width: 6px; height: 6px; border-radius: 50%; background: var(--lcd); box-shadow: 0 0 8px var(--lcd); animation: np-led 2s steps(2, jump-none) infinite; }
@keyframes np-led { 50% { opacity: .35; } }
.np-prog { position: absolute; left: 18px; right: 18px; bottom: -1px; height: 3px; border-radius: 2px; background: var(--pop); transform-origin: left; transform: scaleX(0); pointer-events: none; opacity: 0; transition: opacity .2s; }
.is-scrolled .np-prog { opacity: 1; }

/* Tools: a slip that prints from the bar. A <details>, so it opens without JavaScript. */
.np-tools { position: relative; }
.np-tslip { position: absolute; left: -14px; top: calc(100% + 12px); width: 560px; filter: drop-shadow(0 26px 28px rgba(0, 0, 0, .28)) drop-shadow(0 2px 2px rgba(0, 0, 0, .2)); }
.np-tslip-mask { overflow: hidden; padding-bottom: 1px; }
.np-tslip-in { background: #fdfdfb; color: var(--ink); padding: 26px 26px 34px; background-image: linear-gradient(180deg, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0) 22px);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 7px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 100% / 14px 7px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 7px) no-repeat, conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 0 100% / 14px 7px repeat-x; }
/* The slip prints only when the page's script is running; without it the menu simply opens. */
.nav-js .np-tools[open] .np-tslip-in { animation: np-print .42s var(--ease) both; }
@keyframes np-print { from { transform: translateY(-100%); } to { transform: none; } }
.np-tslip-h { display: flex; justify-content: space-between; gap: 12px; margin: 0; color: var(--ink-2); padding-bottom: 14px; border-bottom: 1.5px dashed #c9c9c2; }
.np-tslip-g { margin: 16px 0 4px; color: var(--ink-3); }
.np-tslip-row { position: relative; display: grid; grid-template-columns: 30px auto 1fr auto; align-items: baseline; gap: 0 10px; padding: 9px 12px; margin: 0 -12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.np-tslip-n { font: 500 11px 'Martian Mono', monospace; color: var(--ink-3); }
.np-tslip-t { font: 700 18px/1.2 'Archivo', system-ui, sans-serif; letter-spacing: -.015em; }
.np-tslip-dots { border-bottom: 2px dotted #c4c4bd; transform: translateY(-4px); min-width: 20px; }
.np-tslip-d { font: 450 14.5px/1.3 'Archivo', system-ui, sans-serif; color: var(--ink-2); text-align: right; }
.np-tslip-row::before, .np-tslip-row::after { content: ""; position: absolute; top: 7px; bottom: 7px; width: 7px; border: 2.5px solid var(--ink); border-radius: 2px; opacity: 0; transition: transform .2s var(--ease), opacity .12s; }
.np-tslip-row::before { left: 0; border-right: 0; transform: translateX(7px); }
.np-tslip-row::after { right: 0; border-left: 0; transform: translateX(-7px); }
.np-tslip-row:hover, .np-tslip-row:focus-visible, .np-tslip-row[aria-current=page] { background: var(--soft-ground); }
.np .np-tslip-row:focus-visible { outline: 2.5px solid var(--ink); outline-offset: -3px; }
.np-tslip-row:hover::before, .np-tslip-row:hover::after, .np-tslip-row:focus-visible::before, .np-tslip-row:focus-visible::after, .np-tslip-row[aria-current=page]::before, .np-tslip-row[aria-current=page]::after { opacity: 1; transform: none; }
.np-tslip-row.np-tslip-sub { padding-top: 3px; padding-bottom: 6px; }
.np-tslip-sub .np-tslip-t { font-weight: 550; font-size: 15px; color: var(--ink-2); }
.np-tslip-sub .np-tslip-dots { visibility: hidden; }
.np-tslip-f { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0 0; padding-top: 16px; border-top: 1.5px dashed #c9c9c2; color: var(--ink-2); }
.np-tslip-f a { color: var(--ink); font: 650 14px 'Archivo', system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.np .np-tslip-f a:focus-visible { outline-color: var(--ink); }

/* phone: the bar keeps the brand and one key; the menu is a sheet under it */
.np .burger, .np-native { display: none; }
.np-native > summary { list-style: none; }
.np-native > summary::-webkit-details-marker { display: none; }
.np-sheet { pointer-events: auto; position: fixed; inset: 0; z-index: -1; background: var(--bar); padding: 86px 10px 26px; overflow: auto; overscroll-behavior: contain; }
.np-sheet[hidden] { display: none; }
.np-sheet .np-tslip-in { padding: 22px 20px 34px; background-image: none; border-radius: 6px 6px 0 0; }
.np-sheet .np-tslip-row { grid-template-columns: 30px 1fr auto; padding: 12px; }
.np-sheet .np-tslip-t { font-size: 20px; }
.np-sheet .np-tslip-sub .np-tslip-t { font-size: 16px; }
.np-sheet .np-tslip-row::before { display: none; }
.np-sheet .np-tslip-row::after { content: "→"; position: static; opacity: 1; transform: none; border: 0; width: auto; font: 500 18px 'Archivo', system-ui, sans-serif; color: var(--ink-3); }
.np-sheet .np-tslip-f { flex-wrap: wrap; }
.np .np-sheet :focus-visible { outline-color: var(--ink); }

/* ---------- keys ---------- */
.key { --h: 56px; --lip: 4px; --face: var(--ink); --label: #fff; --lipc: var(--lip-on); --cap: #fff; --glyph: var(--ink);
  position: relative; display: inline-flex; align-items: center; gap: 16px; height: var(--h); padding: 0 6px 0 22px; border: 0; border-radius: var(--r-key); background: var(--face); color: var(--label);
  font: 650 17px/1 'Archivo', system-ui, sans-serif; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  box-shadow: 0 var(--lip) 0 0 var(--lipc); transition: transform .14s var(--ease), box-shadow .14s var(--ease), background-color .16s; }
.key .cap { display: grid; place-items: center; width: calc(var(--h) - 12px); height: calc(var(--h) - 12px); border-radius: calc(var(--r-key) - 5px); background: var(--cap); color: var(--glyph); overflow: hidden; flex: none; margin-left: auto; font: 600 13px 'Martian Mono', monospace; }
.key .cap svg { width: 18px; height: 18px; display: block; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .32s var(--ease); }
.key .cap .g2 { position: absolute; transform: translateX(-160%); }
.key--paper { --face: #fff; --label: var(--ink); --lipc: var(--ink); --cap: var(--ink); --glyph: #fff; box-shadow: 0 var(--lip) 0 0 var(--lipc), inset 0 0 0 1.5px var(--ink); }
.key--md { --h: 44px; --lip: 3px; --r-key: 12px; font-size: 15px; padding-left: 16px; gap: 14px; }
.key--md .cap svg { width: 15px; height: 15px; }
.key--sm { --h: 36px; --lip: 2px; --r-key: 10px; font-size: 14px; padding-left: 13px; gap: 10px; }
.key--sm .cap svg { width: 13px; height: 13px; }
.key--bare { padding-right: 22px; }
.key--md.key--bare { padding-right: 16px; }
.key--block { display: flex; width: 100%; }
@media (hover: hover) {
  .key:hover { transform: translateY(-1px); box-shadow: 0 calc(var(--lip) + 1px) 0 0 var(--lipc); }
  .key--paper:hover { box-shadow: 0 calc(var(--lip) + 1px) 0 0 var(--lipc), inset 0 0 0 1.5px var(--ink); }
  .key:hover .cap .g1 { transform: translateX(160%); }
  .key:hover .cap .g2 { transform: none; }
}
.key:active { transform: translateY(var(--lip)); box-shadow: 0 0 0 0 var(--lipc); transition-duration: .06s; }
.key--paper:active { box-shadow: 0 0 0 0 var(--lipc), inset 0 0 0 1.5px var(--ink); }
.key:focus-visible { outline: 2.5px solid var(--ring, var(--ink)); outline-offset: 4px; border-radius: var(--r-key); }
.key[aria-busy=true] .cap svg { display: none; }
.key[aria-busy=true] .cap::after { content: ""; width: 4px; height: 4px; border-radius: 1px; background: currentColor; box-shadow: -8px 0 0 currentColor, 8px 0 0 currentColor; animation: key-busy .9s steps(3, jump-none) infinite; }
@keyframes key-busy { 0% { clip-path: inset(-2px 6px -2px -12px); } 50% { clip-path: inset(-2px -2px -2px -12px); } 100% { clip-path: inset(-2px -12px -2px -12px); } }
.key[disabled], .key[aria-disabled=true] { --face: #e3e3dd; --label: #8e9096; --cap: #d3d3cd; --glyph: #9a9b9e; box-shadow: none; cursor: not-allowed; transform: none; }
.on-ink .key, .np .key { --face: #fff; --label: var(--ink); --cap: var(--ink); --glyph: #fff; --lipc: rgba(255, 255, 255, .28); --ring: #fff; }
.on-ink .key--paper { --face: transparent; --label: #fff; --cap: #fff; --glyph: var(--ink); --lipc: rgba(255, 255, 255, .5); box-shadow: 0 var(--lip) 0 0 var(--lipc), inset 0 0 0 1.5px #fff; }

/* quiet link */
.ql { position: relative; display: inline-flex; align-items: center; gap: 9px; font: 650 17px/1.2 'Archivo', system-ui, sans-serif; letter-spacing: -.01em; color: inherit; text-decoration: none; padding: 6px 2px; border-radius: 6px; cursor: pointer; background: none; border: 0; }
.ql::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 1px; height: 2px; background: currentColor; transform-origin: bottom; transition: transform .2s var(--ease); }
.ql svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; transition: transform .32s var(--ease); }
@media (hover: hover) { .ql:hover svg { transform: translate(2px, 0); } .ql.ql--down:hover svg { transform: translateY(3px); } .ql:hover::after { transform: scaleY(2); } }
.ql:active { opacity: .6; }

@media (max-width: 1100px) { .np-brand { margin-right: 6px; } .np-lcd small { display: none; } .np-lcd [data-utc=date] { display: none; } }
@media (max-width: 860px) {
  .np { inset: 10px 0 auto 0; padding: 0 10px; }
  .np-bar { height: 56px; border-radius: 16px; padding: 0 8px 0 14px; }
  .np-links, .np-right .np-lcd, .np-right .np-add { display: none; }
  .np-brand { font-size: 15px; }
  .nav-js .np .burger { display: inline-flex; }
  .np-native { display: block; }
}
@media (min-width: 861px) { .np-sheet { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .rd .eye, .np-led { animation: none; }
  .nav-js .np-tools[open] .np-tslip-in { animation: none; }
  .key, .key .cap svg, .ql svg, .ql::after, .np-link::before, .np-link::after, .np-tslip-row::before, .np-tslip-row::after, .np-chev { transition: none; }
}
/* Keep the last tool reachable in short desktop windows. */
.np-tools .np-tslip-mask { max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; }
