/*
 * Cupelix: the assay.
 *
 * A cupel is the bone-ash cup used in fire assay: the sample goes in, the
 * heat drives off everything that is not the metal, and what remains is
 * what was really there. The site is built from that: coal and iron for
 * the furnace, bone ash for the paper the results are written on, and one
 * hot colour for whatever is still being worked. Every program carries a
 * hallmark, punched with the state it is actually in.
 *
 * System fonts only, no third-party requests. Sections:
 *   1. Tokens   2. Base   3. Family strip   4. Header and footer
 *   5. Hallmarks   6. Home: hero   7. Home: the cupellation (the demo)
 *   8. Home: the line, the rules, the boundary   9. Product pages
 *   10. Figures   11. 404   12. Motion and small screens
 */

/* 1. Tokens ---------------------------------------------------------------- */

:root {
  --coal: #0a0b0d;
  --iron: #121418;
  --iron-2: #191c21;
  --iron-3: #22262d;
  --line: #2b3038;
  --line-hot: #5a3a1c;
  --ash: #ebe5d6;          /* bone ash: the cupel, and the paper */
  --ash-2: #d8d1bf;
  --ash-ink: #1b1a17;
  --ash-ink-2: #55514a;
  --text: #e8e5dd;
  --text-2: #b7b2a7;
  --muted: #8d897f;
  --ember: #ff7a1a;
  --molten: #ffab3d;
  --gold: #f5d48a;
  --accent: #ffab3d;
  --nv-family-accent: #ffab3d;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --wrap: 1200px;
  --gutter: clamp(18px, 4vw, 40px);
}

/* 2. Base ------------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 24px; }
body { margin: 0; background: var(--coal); color: var(--text); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--molten); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--gold); }
:focus-visible { outline: 2px solid var(--molten); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; letter-spacing: -.01em; margin: 0 0 .5em; color: #fff; text-wrap: balance; }
p { margin: 0 0 1.1em; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: .88em; padding: .1em .38em; border: 1px solid var(--line); border-radius: 4px; background: var(--iron-2); color: var(--gold); overflow-wrap: anywhere; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; background: var(--molten); color: #000; font-weight: 700; border-radius: 4px; }
.skip-link:focus { top: 12px; }
.label { font: 600 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.label--hot { color: var(--molten); }
.rule { height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, var(--line), transparent); }

/* 3. Family strip ----------------------------------------------------------- */

/* Novus family strip: the same on every Novus site (see FAMILY-STRIP.md in
   the novus-website repo). */
.nv-family { position: relative; z-index: 60; background: #05070a; border-bottom: 1px solid rgba(255, 255, 255, .09); font: 600 11px/1 ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.nv-family-in { display: flex; align-items: center; gap: 0 18px; width: min(1280px, 100% - 32px); margin-inline: auto; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.nv-family-in::-webkit-scrollbar { display: none; }
.nv-family a { display: inline-block; padding: 9px 0; color: #aab3bd; text-decoration: none; }
.nv-family a.nv-family-home { color: #fff; }
.nv-family a:hover, .nv-family a[aria-current] { color: var(--nv-family-accent, var(--accent, #fff)); }
.nv-family-sep { color: #4a5560; }
/* Phones: the row scrolls sideways, so the site you are on comes first. */
@media (max-width: 760px) { .nv-family-home { order: -3; } .nv-family-sep { order: -2; } .nv-family a[aria-current]:not(.nv-family-home) { order: -1; } }

/* 4. Header and footer ------------------------------------------------------ */

.head { position: relative; z-index: 5; border-bottom: 1px solid var(--line); background: var(--coal); }
.head-in { display: flex; align-items: center; justify-content: space-between; gap: 12px 28px; flex-wrap: wrap; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: block; }
.brand-word { height: 21px; width: auto; display: block; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 6px; color: var(--text-2); font: 600 13px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.nav a:hover { color: #fff; background: var(--iron-2); }
.nav a[aria-current] { color: #fff; background: var(--iron-2); box-shadow: inset 0 -2px 0 var(--molten); }

/* The pip: the program's state, in one small mark. Same code as the hallmarks. */
.pip { width: 9px; height: 9px; flex: none; border-radius: 50%; border: 1.5px solid var(--molten); }
.pip[data-state="use"], .pip[data-state="held"] { background: var(--molten); box-shadow: 0 0 8px rgba(255, 171, 61, .7); }
.pip[data-state="early"] { background: linear-gradient(90deg, var(--molten) 50%, transparent 50%); }
.pip[data-state="internal"] { border-color: var(--ash-2); background: transparent; }
.pip[data-state="planned"] { border-color: var(--muted); border-style: dashed; }

.foot { margin-top: clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); background: #070809; color: var(--text-2); font-size: 15px; }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding-block: 44px 28px; }
.foot h2 { font: 600 11px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot li a { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; }
.foot li a:hover { color: var(--molten); }
.foot-brand { font: 400 30px/1 var(--serif); color: #fff; margin-bottom: 10px; }
.foot-base { padding-block: 18px 30px; border-top: 1px solid var(--line); font: 500 12px/1.5 var(--mono); letter-spacing: .04em; color: var(--muted); }

/* 5. Hallmarks -------------------------------------------------------------- */

/* A hallmark is punched into the work by the assay office. Here each
   program has one: its two letters, and a fill that says what state it is
   in. The words are always printed beside it; the fill is the short form. */
.hm { --hm: 58px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--hm); height: var(--hm); font: 400 calc(var(--hm) * .44)/1 var(--serif); letter-spacing: -.02em; color: var(--molten); clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%); background: var(--molten); }
.hm::before { content: ""; position: absolute; inset: 2px; clip-path: inherit; background: var(--iron); }
.hm > span { position: relative; }
.hm[data-state="use"]::before, .hm[data-state="held"]::before { background: linear-gradient(160deg, #ffc56a, var(--molten) 45%, var(--ember)); }
.hm[data-state="use"], .hm[data-state="held"] { color: #1a0d00; }
.hm[data-state="held"]::after { content: ""; position: absolute; inset: 6px; clip-path: inherit; border: 0; background: none; box-shadow: inset 0 0 0 1.5px rgba(26, 13, 0, .55); }
.hm[data-state="early"]::before { background: linear-gradient(180deg, var(--iron) 50%, #c9741d 50%, var(--molten)); }
.hm[data-state="early"] { color: #fff; }
.hm[data-state="internal"] { background: var(--ash-2); color: var(--ash); }
.hm[data-state="planned"] { background: repeating-conic-gradient(var(--muted) 0 3deg, transparent 3deg 6deg); color: var(--muted); }
.hm--lg { --hm: 96px; }
.hm--sm { --hm: 40px; }

.state { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: 999px; font: 600 11.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.state[data-state="use"], .state[data-state="held"] { border-color: var(--line-hot); color: var(--gold); background: rgba(255, 171, 61, .08); }
.state[data-state="early"] { border-color: var(--line-hot); color: var(--molten); }
.state[data-state="internal"] { color: var(--ash-2); }
.state[data-state="planned"] { border-style: dashed; color: var(--muted); }

/* 6. Home: hero ------------------------------------------------------------- */

.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(60% 55% at 76% 78%, rgba(255, 122, 26, .2), transparent 70%), radial-gradient(40% 30% at 76% 80%, rgba(255, 171, 61, .22), transparent 70%), var(--coal); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 72px); align-items: end; padding-block: clamp(48px, 8vw, 104px) 0; }
.hero-copy { padding-bottom: clamp(48px, 7vw, 96px); }
.hero h1 { font-size: clamp(2.7rem, 7.2vw, 6rem); line-height: .98; letter-spacing: -.025em; margin: 18px 0 26px; }
.hero h1 em { font-style: italic; color: var(--molten); }
.hero-lead { max-width: 34em; font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--text-2); }
.hero-lead strong { color: #fff; font-weight: 600; }
.defn { max-width: 36em; margin: 30px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); font: 400 1rem/1.6 var(--serif); color: var(--text-2); }
.defn dfn { font-style: normal; font-weight: 700; color: #fff; }
.defn i { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 1px solid var(--line); border-radius: 6px; background: var(--iron); color: #fff; font: 600 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .15s; }
.btn:hover { border-color: var(--molten); color: var(--molten); transform: translateY(-1px); }
.btn--hot { border-color: transparent; background: linear-gradient(160deg, #ffc56a, var(--molten) 45%, var(--ember)); color: #1a0d00; }
.btn--hot:hover { color: #1a0d00; filter: brightness(1.08); }
.btn svg { width: 16px; height: 16px; flex: none; }

/* fig. 1: the cupel, and the noise leaving it */
.fig-cupel { position: relative; align-self: end; margin: 0; }
.fig-cupel svg { display: block; width: 116%; max-width: none; margin-left: -8%; height: auto; overflow: visible; }
.fig-cupel figcaption { position: absolute; right: 0; top: 0; max-width: 15em; font: 500 11.5px/1.5 var(--mono); letter-spacing: .04em; color: var(--muted); text-align: right; }
.fume { position: absolute; left: 0; right: 0; bottom: 47%; height: 53%; pointer-events: none; }
.fume span { position: absolute; bottom: 0; left: var(--x); font: 600 var(--s, 13px)/1 var(--mono); color: var(--molten); opacity: 0; white-space: nowrap; animation: fume var(--d, 7s) linear var(--w, 0s) infinite; }
@keyframes fume {
  0% { transform: translate(0, 0) scale(1); opacity: 0; color: #ffd08a; filter: blur(0); }
  12% { opacity: 1; }
  55% { color: #b06a2a; opacity: .75; }
  100% { transform: translate(var(--dx, 20px), -270px) scale(.85); opacity: 0; color: #55514a; filter: blur(2.5px); }
}
.bead { animation: bead 3.4s ease-in-out infinite alternate; transform-origin: 50% 50%; transform-box: fill-box; }
@keyframes bead { from { opacity: .82; } to { opacity: 1; } }

/* The line at a glance: five hallmarks, straight under the hero. */
.marks { border-bottom: 1px solid var(--line); background: var(--iron); }
.marks ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
.marks li + li { border-left: 1px solid var(--line); }
.marks a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; height: 100%; padding: 22px 18px; color: var(--text); text-decoration: none; transition: background .15s; }
.marks a:hover { background: var(--iron-2); }
.marks .hm { grid-row: span 2; }
.marks b { font: 400 1.35rem/1.1 var(--serif); color: #fff; }
.marks small { font: 600 10.5px/1.35 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }

/* 7. Home: the cupellation (the demo) --------------------------------------- */

.sec { padding-block: clamp(64px, 9vw, 120px); }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px clamp(24px, 5vw, 72px); align-items: end; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head h2 { font-size: clamp(2rem, 4.6vw, 3.6rem); margin: 10px 0 0; }
.sec-head p { margin: 0; color: var(--text-2); max-width: 34em; }

.assay { border: 1px solid var(--line); border-radius: 10px; background: var(--iron); overflow: hidden; }
.assay-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.assay-tab { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: center; padding: 16px 18px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.assay-tab:last-child { border-right: 0; }
.assay-tab .n { grid-row: span 2; font: 400 2rem/1 var(--serif); color: var(--muted); }
.assay-tab b { font: 600 12px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.assay-tab small { font: 500 11px/1.3 var(--mono); letter-spacing: .04em; color: var(--muted); }
.assay-tab:hover { background: var(--iron-2); }
.assay-tab[aria-selected="true"] { background: linear-gradient(180deg, rgba(255, 171, 61, .13), transparent); box-shadow: inset 0 2px 0 var(--molten); }
.assay-tab[aria-selected="true"] .n { color: var(--molten); }
.assay-tab[aria-selected="true"] b { color: #fff; }

.heat { position: relative; height: 6px; background: var(--iron-3); }
.heat i { position: absolute; inset: 0 auto 0 0; width: calc(var(--at, 0) * 33.333% ); min-width: 6px; background: linear-gradient(90deg, #7a2d06, var(--ember) 40%, var(--molten) 75%, #fff2c9); box-shadow: 0 0 18px rgba(255, 122, 26, .8); transition: width .7s cubic-bezier(.3, .7, .2, 1); }

.assay-stage { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .8fr); }
.assay-stage[hidden] { display: none; }
.specimen { position: relative; margin: 0; padding: 22px 0 22px; border-right: 1px solid var(--line); background: #08090b; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--iron-3) transparent; }
.specimen-cap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 0 22px 14px; font: 600 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.specimen-cap span:last-child { color: var(--molten); }
.listing { margin: 0; padding: 0; font: 400 13px/1.75 var(--mono); color: var(--text-2); tab-size: 2; min-width: max-content; }
.listing > span { display: block; padding: 0 22px; white-space: pre; transition: opacity .6s, color .6s, filter .6s, background .6s; }
.listing .a { color: #5d6470; }           /* address */
.listing .m { color: #fff; }               /* mnemonic */
.listing .c { color: #6f7a69; }            /* comment */
.listing .k { color: var(--molten); }      /* what matters */
.listing .x { color: #8a93a0; }            /* run count */
.listing .x0 { color: #b5532b; }
.listing .keep { background: linear-gradient(90deg, rgba(255, 171, 61, .1), transparent 70%); box-shadow: inset 2px 0 0 var(--molten); }
.listing .slag { color: #6a6f79; }
.listing .slag .m, .listing .slag .k { color: inherit; }
/* Burning off: the lines that are not the metal glow, then go. */
.burning .listing .slag { color: #ffb96a; filter: blur(1.6px); opacity: 0; background: linear-gradient(90deg, rgba(255, 122, 26, .22), transparent); }
.burning .listing .raw { color: #ffb96a; filter: blur(1.6px); opacity: 0; }

.notes { display: flex; flex-direction: column; gap: 14px; padding: 26px 26px 28px; }
.notes h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0; }
.notes p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.notes .who { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-block: 1px solid var(--line); }
.notes .who div { display: grid; gap: 6px; justify-items: start; }
.notes .who b { font: 400 1.25rem/1 var(--serif); color: #fff; }
.notes .caveat { padding: 12px 14px; border: 1px dashed var(--muted); border-radius: 6px; color: var(--text); font-size: 14.5px; }
.notes .more { margin-top: auto; font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.assay-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--iron-2); }
.assay-foot p { margin: 0; font: 500 12px/1.5 var(--mono); color: var(--muted); max-width: 46em; }
.assay-ctl { display: flex; gap: 8px; }
.assay-ctl .btn { min-height: 40px; padding: 0 14px; font-size: 12px; }
.no-js-only { display: none; }
html:not(.js) .assay-tabs, html:not(.js) .heat, html:not(.js) .assay-ctl { display: none; }
html:not(.js) .assay-stage { border-bottom: 1px solid var(--line); }
html:not(.js) .assay-stage[hidden] { display: grid; }

/* Around the furnace: the two programs that are not a stage. */
.around { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.around article { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 18px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--iron); }
.around .hm { grid-row: span 3; }
.around h3 { font-size: 1.5rem; margin: 0; }
.around p { margin: 0; color: var(--text-2); font-size: 15.5px; }
.around .state { justify-self: start; }

/* 8. Home: the line, the rules, the boundary -------------------------------- */

/* The ledger: on bone ash, like the page of an assay book. */
.ledger-sec { background: var(--ash); color: var(--ash-ink); }
.ledger-sec .label { color: var(--ash-ink-2); }
.ledger-sec h2 { color: var(--ash-ink); }
.ledger-sec .sec-head p { color: var(--ash-ink-2); }
.ledger { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ash-ink); }
.ledger li { border-bottom: 1px solid #c4bca8; }
.ledger a { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.5fr) auto; gap: 8px 28px; align-items: center; padding: 24px 6px; color: inherit; text-decoration: none; transition: background .15s, padding .2s; }
.ledger a:hover { background: var(--ash-2); padding-inline: 16px; }
.ledger img { width: 56px; height: 56px; display: block; border-radius: 10px; background: #14161a; padding: 6px; }
.ledger h3 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin: 0 0 6px; color: var(--ash-ink); }
.ledger .lic { font: 600 11.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ash-ink-2); }
.ledger p { margin: 0; color: #35322c; font-size: 15.5px; }
.ledger .stamp { display: grid; justify-items: end; gap: 8px; text-align: right; }
.ledger .stamp b { max-width: 13em; font: 700 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ash-ink); }
.ledger-sec .hm::before { background: var(--ash); }
.ledger-sec .hm[data-state="use"]::before, .ledger-sec .hm[data-state="held"]::before { background: linear-gradient(160deg, #ffb347, #f08a1c 50%, #d9610a); }
.ledger-sec .hm { background: #c2600c; color: #a84f05; }
.ledger-sec .hm[data-state="use"], .ledger-sec .hm[data-state="held"] { color: #1a0d00; }
.ledger-sec .hm[data-state="early"]::before { background: linear-gradient(180deg, var(--ash) 50%, #f08a1c 50%); }
.ledger-sec .hm[data-state="early"] { color: var(--ash-ink); }
.ledger-sec .hm[data-state="internal"] { background: #6f6a5e; color: #55514a; }
.ledger-sec .hm[data-state="planned"] { background: repeating-conic-gradient(#8a8475 0 3deg, transparent 3deg 6deg); color: #8a8475; }

.rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; counter-reset: rule; }
.rules article { position: relative; counter-increment: rule; padding: 30px 28px 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--iron); }
.rules article:nth-child(2n) { border-right: 0; }
.rules article:nth-last-child(-n+2) { border-bottom: 0; }
.rules article::before { content: "rule " counter(rule, decimal-leading-zero); display: block; margin-bottom: 14px; font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--molten); }
.rules h3 { font-size: clamp(1.4rem, 2.3vw, 1.9rem); margin-bottom: 10px; }
.rules p { margin: 0 0 12px; color: var(--text-2); font-size: 15.5px; }
.rules cite { font: 500 11.5px/1.4 var(--mono); font-style: normal; letter-spacing: .04em; color: var(--muted); }

.boundary { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
.boundary h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); margin: 10px 0 18px; }
.boundary p { color: var(--text-2); }

/* 9. Product pages ---------------------------------------------------------- */

/* The head of each product page is its assay certificate: the name, the one
   line that says what it is for, and the state, punched and spelled out. */
.cert { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: radial-gradient(50% 80% at 100% 100%, rgba(255, 122, 26, .16), transparent 70%), var(--coal); }
.cert[data-state="internal"] { background: radial-gradient(50% 80% at 100% 100%, rgba(216, 209, 191, .09), transparent 70%), var(--coal); }
.cert[data-state="planned"] { background: var(--coal); }
.cert-in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding-block: clamp(40px, 6vw, 80px); }
.crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--molten); }
.cert h1 { font-size: clamp(2.8rem, 8vw, 6.4rem); line-height: .95; letter-spacing: -.03em; margin: 0 0 22px; }
.cert h1 span { display: block; font: 600 12px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.cert-line { max-width: 24em; margin: 0; font: italic 400 clamp(1.25rem, 2.3vw, 1.8rem)/1.3 var(--serif); color: var(--gold); }
.cert[data-state="internal"] .cert-line { color: var(--ash); }
.cert[data-state="planned"] .cert-line { color: var(--text-2); }
.slip { position: relative; padding: 22px 22px 8px; border-radius: 4px; background: var(--ash); color: var(--ash-ink); box-shadow: 0 30px 60px -30px #000; transform: rotate(.6deg); }
.slip::before { content: ""; position: absolute; inset: 6px; border: 1px solid #c4bca8; pointer-events: none; }
.slip-top { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--ash-ink); }
.slip-top div { display: grid; gap: 6px; }
.slip-top small { font: 600 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ash-ink-2); }
.slip-top b { font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.05 var(--serif); }
.slip dl { margin: 0; }
.slip dl div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid #c4bca8; }
.slip dl div:last-child { border-bottom: 0; }
.slip dt { font: 600 10.5px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ash-ink-2); }
.slip dd { margin: 0; font-size: 15px; line-height: 1.45; }
.slip a { color: #9a4a05; font-weight: 600; overflow-wrap: anywhere; }
.slip code { border-color: #c4bca8; background: #fff; color: var(--ash-ink); }
.slip .hm::before { background: var(--ash); }
.slip .hm { background: #c2600c; color: #a84f05; }
.slip .hm[data-state="use"]::before, .slip .hm[data-state="held"]::before { background: linear-gradient(160deg, #ffb347, #f08a1c 50%, #d9610a); }
.slip .hm[data-state="use"], .slip .hm[data-state="held"] { color: #1a0d00; }
.slip .hm[data-state="early"]::before { background: linear-gradient(180deg, var(--ash) 50%, #f08a1c 50%); }
.slip .hm[data-state="early"] { color: var(--ash-ink); }
.slip .hm[data-state="internal"] { background: #6f6a5e; color: #55514a; }
.slip .hm[data-state="planned"] { background: repeating-conic-gradient(#8a8475 0 3deg, transparent 3deg 6deg); color: #8a8475; }

.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 80px); align-items: start; padding-block: clamp(40px, 6vw, 72px) 0; }
.toc { position: sticky; top: 24px; }
.toc h2 { font: 600 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; border-left: 1px solid var(--line); }
.toc li { counter-increment: toc; }
.toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; color: var(--text-2); font-size: 14px; line-height: 1.35; text-decoration: none; }
.toc a::before { content: counter(toc, decimal-leading-zero) "  "; font: 500 11px/1 var(--mono); color: var(--muted); }
.toc a:hover, .toc a.on { color: #fff; border-left-color: var(--molten); }

.prose { max-width: 46rem; counter-reset: sec; }
.prose > h2 { counter-increment: sec; margin: 2.4em 0 .7em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: clamp(1.8rem, 3.4vw, 2.6rem); scroll-margin-top: 24px; }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose > h2::before { content: "\00a7  " counter(sec, decimal-leading-zero); display: block; margin-bottom: 12px; font: 600 11px/1 var(--mono); letter-spacing: .16em; color: var(--molten); }
.prose > h3 { margin: 2em 0 .6em; font-size: clamp(1.3rem, 2.2vw, 1.6rem); color: var(--gold); }
.prose p, .prose li { color: #d5d1c7; }
.prose strong { color: #fff; font-weight: 650; }
.prose em { color: var(--ash); }
.prose ul { margin: 0 0 1.2em; padding: 0; list-style: none; display: grid; gap: 12px; }
.prose ul li { position: relative; padding: 14px 16px 14px 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--iron); }
.prose ul li::before { content: ""; position: absolute; left: 16px; top: 21px; width: 14px; height: 14px; clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%); background: var(--molten); }
.table-wrap { margin: 1.4em 0 1.6em; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: var(--iron); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; min-width: 680px; }
th { padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--iron-2); font: 600 11px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: left; }
td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; color: #d5d1c7; }
tr:last-child td { border-bottom: 0; }
td:first-child { color: #fff; white-space: nowrap; }
td code { white-space: nowrap; overflow-wrap: normal; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: clamp(48px, 7vw, 88px); }
.pager a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--iron); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.pager a:hover { border-color: var(--molten); transform: translateY(-2px); }
.pager .hm { grid-row: span 3; }
.pager small { font: 600 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pager b { font: 400 1.5rem/1.1 var(--serif); color: #fff; }
.pager .state { justify-self: start; }
.pager a:last-child:not(:first-child) { text-align: left; }

/* 10. Figures --------------------------------------------------------------- */

.fig { margin: 1.6em 0 1.8em; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #08090b; }
.fig figcaption { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font: 500 12px/1.55 var(--mono); color: var(--muted); }
.fig figcaption b { color: var(--molten); font-weight: 600; }
.fig svg { display: block; width: 100%; height: auto; }
.fig svg text { font-family: var(--mono); }

/* 134 commands, 131 lit */
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(14px, 1fr)); gap: 4px; }
.cells i { aspect-ratio: 1; border-radius: 2px; background: linear-gradient(160deg, #ffc56a, var(--molten) 50%, var(--ember)); }
.cells i.off { background: none; border: 1.5px dashed var(--muted); }
.cells-key { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font: 600 12px/1.4 var(--mono); letter-spacing: .04em; color: var(--text-2); }
.cells-key span { display: inline-flex; align-items: center; gap: 8px; }
.cells-key i { width: 12px; height: 12px; border-radius: 2px; background: var(--molten); }
.cells-key i.off { background: none; border: 1.5px dashed var(--muted); }
.cells-key b { color: #fff; font: 400 1.5rem/1 var(--serif); }

/* the privilege tiers, as a stack */
.tiers { display: grid; gap: 6px; }
.tier { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--molten); border-radius: 6px; background: var(--iron); font-size: 14px; }
.tier b { font: 600 12px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.tier span { color: var(--text-2); }
.tier em { font: 600 11px/1.3 var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); text-align: right; }
.tier.dim { border-left-color: var(--muted); border-style: dashed; border-left-style: solid; background: transparent; }
.tier.dim b { color: var(--text-2); }
.tier.dim em { color: var(--muted); }

.empty { display: grid; place-items: center; gap: 14px; padding: clamp(28px, 6vw, 64px) 20px; border: 1.5px dashed var(--muted); border-radius: 10px; text-align: center; color: var(--muted); }
.empty b { font: 400 clamp(1.6rem, 3.4vw, 2.4rem)/1.1 var(--serif); color: var(--text); }
.empty p { margin: 0; max-width: 30em; font: 500 12.5px/1.6 var(--mono); }

/* steps in a row */
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; list-style: none; margin: 0; padding: 0; counter-reset: flow; }
.flow li { counter-increment: flow; flex: 1 1 150px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--iron); font-size: 14px; line-height: 1.45; color: var(--text-2); }
.flow li::before { content: counter(flow, decimal-leading-zero); display: block; margin-bottom: 10px; font: 600 11px/1 var(--mono); letter-spacing: .14em; color: var(--molten); }
.flow li b { display: block; margin-bottom: 4px; font: 400 1.25rem/1.2 var(--serif); color: #fff; }
.flow li.hot { border-color: var(--line-hot); background: rgba(255, 171, 61, .08); }

/* two things, and what is between them */
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
.split > div:not(.wall) { display: grid; align-content: start; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--iron); font-size: 14px; line-height: 1.45; color: var(--text-2); }
.split small { font: 600 11px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--molten); }
.split b { font: 400 clamp(1.3rem, 2.4vw, 1.7rem)/1.1 var(--serif); color: #fff; }
.wall { position: relative; display: grid; place-items: center; width: clamp(96px, 18vw, 190px); }
.wall::before { content: ""; position: absolute; top: -10px; bottom: -10px; left: 50%; border-left: 2px dashed var(--muted); }
.wall span { position: relative; padding: 8px 6px; background: #08090b; font: 600 10.5px/1.45 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); text-align: center; }
.wall span::after { content: "\2192"; display: block; margin-top: 2px; font-size: 20px; line-height: 1; color: var(--molten); }
@media (max-width: 640px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .wall { width: auto; height: 84px; }
  .wall::before { top: 50%; bottom: auto; left: -10px; right: -10px; border-left: 0; border-top: 2px dashed var(--muted); }
  .wall span::after { content: "\2193"; }
}

/* 11. 404 ------------------------------------------------------------------- */

.lost { display: grid; place-items: center; text-align: center; padding-block: clamp(64px, 12vw, 160px) 0; }
.lost svg { width: min(260px, 60vw); height: auto; margin-bottom: 26px; }
.lost h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.lost p { max-width: 32em; color: var(--text-2); }

/* 12. Motion and small screens ---------------------------------------------- */

.js .rise { opacity: 0; transform: translateY(18px); transition: opacity .7s, transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .rise.in { opacity: 1; transform: none; }

@media (max-width: 1000px) {
  .hero-in, .cert-in, .boundary, .sec-head { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-bottom: 0; }
  .fig-cupel { max-width: 460px; margin-inline: auto; width: 100%; }
  .marks ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .marks li + li { border-left: 0; }
  .marks li { border-bottom: 1px solid var(--line); }
  .marks li:nth-child(odd) { border-right: 1px solid var(--line); }
  .marks li:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .assay-stage { grid-template-columns: minmax(0, 1fr); }
  .specimen { border-right: 0; border-bottom: 1px solid var(--line); }
  .ledger a { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .ledger a > p { grid-column: 2 / -1; }
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--iron); }
  .toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; border-left: 0; }
  .toc a { padding-left: 0; border-left: 0; }
  .slip { transform: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .head-in { padding-block: 12px 0; }
  .nav { width: 100%; margin-inline: calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter)); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav ul { padding-inline: calc(var(--gutter) - 10px); width: max-content; }
  .nav a { padding: 12px 10px; font-size: 12px; border-radius: 0; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-word { height: 18px; }
  .fig-cupel figcaption { position: static; max-width: none; text-align: left; padding: 0 0 14px; }
  .fig-cupel svg { width: 100%; margin-left: 0; }
  .marks ul { grid-template-columns: minmax(0, 1fr); }
  .marks li:nth-child(odd) { border-right: 0; }
  .marks a { padding: 16px var(--gutter); }
  .assay { border-radius: 0; margin-inline: calc(-1 * var(--gutter)); border-inline: 0; }
  .assay-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .assay-tab { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 8px; text-align: center; justify-items: center; }
  .assay-tab .n { grid-row: auto; font-size: 1.5rem; }
  .assay-tab b { font-size: 10px; letter-spacing: .04em; }
  .assay-tab small { display: none; }
  .listing { font-size: 12px; }
  .listing > span, .specimen-cap { padding-inline: var(--gutter); }
  .notes { padding: 22px var(--gutter) 24px; }
  .assay-foot { padding-inline: var(--gutter); }
  .around, .rules, .pager, .foot-in { grid-template-columns: minmax(0, 1fr); }
  .rules article { border-right: 0; }
  .rules article:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .ledger a { grid-template-columns: 48px minmax(0, 1fr); gap: 8px 16px; padding: 20px 0; }
  .ledger a:hover { padding-inline: 0; }
  .ledger img { width: 48px; height: 48px; }
  .ledger a > p, .ledger .stamp { grid-column: 1 / -1; }
  .ledger .stamp { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; gap: 12px; }
  .toc ol { grid-template-columns: minmax(0, 1fr); }
  .tier { grid-template-columns: minmax(0, 1fr); }
  .tier em { text-align: left; }
  .slip dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fume span { opacity: .55; transform: translate(calc(var(--dx, 20px) * var(--p, .5)), calc(-250px * var(--p, .5))); }
  .js .rise { opacity: 1; transform: none; }
}
