/* Nightbreak store lab: tokens and the pieces every concept shares.
   Colours, type and buttons follow nightbreak.io as measured on 2026-10-30
   (black page, gold starfield, Plus Jakarta Sans, ember buttons, orange headings). */

:root {
  --night: #000;
  --shell: #07080d;
  --surface: #0d0f15;
  --card: #171923;
  --raised: #252731;
  --fg: #f5f5f5;
  --muted: #a3a3ad;
  --hair: rgb(255 255 255 / .10);
  --hair-strong: rgb(255 255 255 / .22);
  --ember: #dc3232;      /* was #e03636: white text on it was 4.42 to 1, this is 4.62 (Dali, 11-12) */
  --ember-hover: #e54a4a;
  --flare: #f85020;      /* the site's heading orange, sampled */
  --flare-deep: #de5a29;
  --flare-hover: #ff6a3d;
  --on-flare: #140b06;   /* dark text on --flare: 5.7:1 (white is 3.4:1); no longer used for the tier tag */
  --flare-fill: #c85208;       /* orange button fill under white text: 4.5:1, clearly apart from --ember red */
  --flare-fill-hover: #d65a08; /* lighter on hover, like the red Add */
  --rule: #c06536;       /* the content-card underline on plugin pages */
  --gold: #c49952;       /* starfield gold */
  --gold-soft: rgb(196 153 82 / .16);
  --ok: #4fbf7a;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-s: 6px;
  --radius-m: 10px;
  --shadow-lift: 0 18px 50px rgb(0 0 0 / .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--flare); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Headings in the site's voice: heavy, orange, tight. */
.nb-heading {
  color: var(--flare);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}

.price { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.price s { color: var(--muted); font-weight: 600; margin-right: .4em; }

/* Buttons: the site's ember fill and white outline. The roles (see
   docs/plans/2026-11-01-nightbreak-store-action-hierarchy.md):
   - primary, .btn--primary: the one next step in a view (Add to cart, Check out, Pay). Red
     fill means "this is the next step" and nothing else on the page is red-filled.
   - secondary, .btn--outline: real alternatives (bundle adds, card Adds, Join a tier, the 3D
     viewer). White outline, same size as primary where they sit side by side.
   - tertiary, .btn--quiet and text links (.ct-textbtn, .ct-link): See everything, Remove,
     View cart. No box; the link underline carries the site's rule colour.
   Colour roles: ember red = the next step; orange (--flare) = headings, the active nav item,
   focus and the Patreon tier tag (a subscription, as weighty as the Add beside it: filled with
   --on-flare text next to a filled Add, outlined next to an outlined one), no other button; gold
   (--lantern, --gold) = savings, reached discounts and things you own; green (--ok) = done and
   safe (added, secure checkout). */
.btn {
  align-items: center;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  font: 700 15px/1 var(--font);
  gap: .55em;
  justify-content: center;
  padding: 13px 22px;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn--primary { background: var(--ember); color: #fff; }
.btn--primary:hover { background: var(--ember-hover); }
.btn--outline { background: transparent; border-color: #fff; color: #fff; }
.btn--outline { transition: background-color .15s, border-color .15s, color .15s, transform .15s; }
/* Every outlined button answers the mouse the same way: a faint orange fill, orange words and
   border, a small lift (Dali, 11-06: the home page's "Browse all content", on every page). */
.btn--outline:hover { background: rgb(248 80 32 / .12); border-color: var(--flare); color: var(--flare); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .btn--outline:hover { transform: none; } }
.btn--quiet { background: transparent; color: var(--fg); padding-inline: 10px; }
.btn--quiet:hover { color: #fff; background: rgb(255 255 255 / .06); }
.btn--small { font-size: 13px; padding: 9px 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 1.1em; height: 1.1em; }

/* Status words on products. Plain sentence case, no capitals. */
.tag {
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  gap: .35em;
  line-height: 1;
  padding: 5px 9px;
  white-space: nowrap;
}
.tag--owned { background: var(--gold-soft); color: var(--gold); }
.tag--pass { background: rgb(248 80 32 / .14); color: var(--flare); }

/* ---- Cart button injected into the shell header ---- */
.lab-cart-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  margin-left: 14px;
  position: relative;
  width: 42px;
}
.lab-cart-button:hover { background: rgb(255 255 255 / .08); }
.lab-cart-button svg { width: 24px; height: 24px; }
.lab-cart-button__count {
  background: var(--ember);
  border-radius: 999px;
  color: #fff;
  font: 800 12px/18px var(--font); /* 12 px is the site's smallest text (Dali, 2026-11-10) */
  height: 18px;
  min-width: 18px;
  padding: 0 5px;
  position: absolute;
  right: 0;
  top: 2px;
  transform: scale(0);
  transition: transform .18s;
}
.lab-cart-button.has-items .lab-cart-button__count { transform: scale(1); }
.nb-shell .lab-cart-button { order: 0; }

.lab-fallback-header {
  align-items: center; background: #000; border-bottom: 1px solid var(--hair);
  display: flex; gap: 24px; padding: 18px 32px; position: sticky; top: 0; z-index: 100;
}

/* ---- Prototype bar (bottom left) ---- */
.lab-bar {
  bottom: 14px;
  font-size: 13px;
  left: 14px;
  position: fixed;
  transition: bottom .28s;
  z-index: 9000;
}
/* Concepts with a bottom tray set data-tray="on" on <body> and --tray-h. */
body[data-tray="on"] .lab-bar { bottom: calc(var(--tray-h, 120px) + 12px); }
/* Pages with the embers keep their pause button in the corner (where the real site will have
   it), so the bar sits just above it. */
body:has(> .nb-embers-toggle) .lab-bar { bottom: calc(var(--nb-embers-toggle-bottom, 14px) + 48px); }
/* A cart bar along the bottom lifts the pause button (embers.js reads the variable) and the bar. */
body[data-tray="on"]:has(> .nb-embers-toggle) { --nb-embers-toggle-bottom: calc(var(--tray-h, 120px) + 14px); }
.lab-bar__details {
  background: rgb(13 15 21 / .94);
  border: 1px solid var(--hair);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(8px);
  max-width: min(340px, calc(100vw - 28px));
}
.lab-bar summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 700;
  gap: 8px;
  list-style: none;
  padding: 9px 12px;
}
.lab-bar summary::-webkit-details-marker { display: none; }
.lab-bar__dot { background: var(--gold); border-radius: 50%; height: 7px; width: 7px; box-shadow: 0 0 10px var(--gold); }
.lab-bar__hint { color: var(--muted); font-weight: 500; }
.lab-bar__body { border-top: 1px solid var(--hair); display: grid; gap: 10px; padding: 12px; }
.lab-bar__row { display: grid; gap: 4px; color: var(--muted); }
.lab-bar__check { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.lab-bar__row[hidden] { display: none; }
.lab-bar__check:has(.lab-bar__note) { flex-wrap: wrap; }
.lab-bar__note { color: var(--muted); flex-basis: 100%; font-size: 12px; font-weight: 500; line-height: 1.35; padding-left: 26px; }
.lab-bar select {
  background: var(--card); border: 1px solid var(--hair-strong); border-radius: 6px;
  color: var(--fg); font: 600 13px var(--font); padding: 7px 8px;
}
.lab-bar__reset {
  background: none; border: 1px solid var(--hair-strong); border-radius: 6px; color: var(--fg);
  cursor: pointer; font: 600 13px var(--font); padding: 7px 8px;
}
.lab-bar__reset:hover { border-color: #fff; }
a.lab-bar__reset { display: block; text-align: center; text-decoration: none; }

/* ---- Toast ---- */
.lab-toast {
  background: var(--raised);
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  bottom: 22px;
  box-shadow: var(--shadow-lift);
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 11px 16px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s;
  z-index: 9500;
}
.lab-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- Language: the header button, its list, the footer link (lab/shared/i18n.js) ---- */
.nb-lang-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: 700 14px/1 var(--font);
  gap: 7px;
  height: 42px;
  margin-left: 14px;
  padding: 0 12px 0 10px;
  white-space: nowrap;
}
.nb-lang-button:hover, .nb-lang-button[aria-expanded="true"] { background: rgb(255 255 255 / .08); }
.nb-lang-button svg { flex: none; height: 20px; width: 20px; }
.nb-lang-button + .lab-cart-button { margin-left: 2px; }
.nb-shell .nb-lang-button { order: 0; }

.nb-lang-menu {
  background: #0e0f15;
  border: 1px solid rgb(255 255 255 / .12);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  color: var(--fg);
  font-family: var(--font);
  padding: 6px;
  position: fixed;
  width: 248px;
  z-index: 10070;
}
.nb-lang-menu__h { color: var(--muted); font-size: 13px; font-weight: 700; margin: 0; padding: 8px 10px 4px; }
.nb-lang-menu__note { border-top: 1px solid var(--hair); color: var(--muted); font-size: 12px; line-height: 1.4; margin: 6px 0 0; padding: 8px 10px 4px; }
.nb-lang-list { display: grid; gap: 1px; list-style: none; margin: 0; padding: 0; }
.nb-lang-opt {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 8px;
  color: #fff;
  column-gap: 10px;
  cursor: pointer;
  display: grid;
  font: 700 14.5px/1.25 var(--font);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 7px 10px;
  text-align: left;
  width: 100%;
}
.nb-lang-opt:hover { background: rgb(255 255 255 / .06); }
.nb-lang-opt[aria-current="true"] { background: rgb(255 255 255 / .06); }
.nb-lang-opt__en { color: var(--muted); font-size: 12.5px; font-weight: 500; grid-column: 1; }
.nb-lang-opt svg { color: var(--ok); grid-column: 2; grid-row: 1 / span 2; height: 16px; width: 16px; }

.nb-lang-foot {
  align-items: center;
  background: none;
  border: 0;
  color: var(--nb-fg, #f5f5f5);
  cursor: pointer;
  display: inline-flex;
  font: 600 16px/1.6 var(--font);
  gap: 6px;
  padding: 0;
  transition: color .16s ease;
}
.nb-lang-foot:hover, .nb-lang-foot:focus-visible { color: var(--nb-highlight, var(--flare)); }
.nb-lang-foot svg { height: 17px; width: 17px; }

/* The first-visit suggestion: a card under the header on the right (the bottom-left corner
   belongs to the embers' pause button and the prototype bar). Not a modal, never focused on
   its own; it fades in once the page has loaded. */
.nb-lang-suggest {
  font-family: var(--font);
  opacity: 0;
  position: fixed;
  right: clamp(12px, 4vw, 56px);
  top: var(--nb-lang-top, 84px);
  transform: translateY(-6px);
  transition: opacity .18s ease-out, transform .18s ease-out;
  width: min(392px, calc(100vw - 24px));
  z-index: 10040;
}
.nb-lang-suggest.is-on { opacity: 1; transform: none; }
.nb-lang-suggest__card {
  background: #0e0f15;
  border: 1px solid rgb(255 255 255 / .14);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgb(0 0 0 / .6);
  padding: 16px 46px 15px 16px;
  position: relative;
}
.nb-lang-suggest__q { align-items: flex-start; color: #fff; display: flex; font-size: 16px; font-weight: 700; gap: 10px; line-height: 1.35; margin: 0; }
.nb-lang-suggest__q svg { color: var(--flare); flex: none; height: 20px; margin-top: 1px; width: 20px; }
.nb-lang-suggest__en { color: var(--muted); font-size: 13.5px; line-height: 1.4; margin: 4px 0 0 30px; }
.nb-lang-suggest__acts { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 14px 0 0 30px; }
.nb-lang-suggest__btn {
  background: transparent;
  border: 2px solid rgb(255 255 255 / .35);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font: 700 14px/1 var(--font);
  padding: 10px 15px;
}
.nb-lang-suggest__btn.is-theirs { border-color: #fff; }
.nb-lang-suggest__btn:hover { background: rgb(255 255 255 / .08); border-color: #fff; }
.nb-lang-suggest__more {
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  font: 700 14px/1.25 var(--font);
  padding: 4px 2px;
  text-align: left;
}
/* The underline sits on the native words only; the English line under them stays plain. */
.nb-lang-suggest__more b {
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.nb-lang-suggest__more:hover b { color: var(--flare); }
.nb-lang-suggest__more span { color: var(--muted); display: block; font-size: 12px; font-weight: 500; margin-top: 4px; }
.nb-lang-suggest__all { border-top: 1px solid var(--hair); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0 30px; padding-top: 8px; }
.nb-lang-suggest__all[hidden] { display: none; }
.nb-lang-suggest__note { color: var(--muted); font-size: 12.5px; line-height: 1.4; margin: 12px 0 0 30px; }
.nb-lang-suggest__x {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 6px;
  top: 6px;
  width: 34px;
}
.nb-lang-suggest__x:hover { background: rgb(255 255 255 / .07); color: #fff; }
.nb-lang-suggest__x svg { height: 16px; width: 16px; }

@media (max-width: 767px) {
  .nb-lang-button { margin-left: 4px; padding: 0; justify-content: center; width: 38px; }
  .nb-lang-button__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nb-lang-suggest { left: 12px; right: 12px; width: auto; }
  .nb-lang-suggest__en, .nb-lang-suggest__acts, .nb-lang-suggest__note, .nb-lang-suggest__all { margin-left: 0; }
}

/* Page container shared by concepts that want the site's width. */
.lab-wrap { margin: 0 auto; max-width: 1368px; padding: 0 clamp(16px, 2.5vw, 36px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
