/* RNDBI -- site stylesheet, on the ratified identity (docs/design/rndbi/rndbi-identity.html in the
   Lumina repo; tokens from config/report/brands.yaml, brand rndbi).
   Colour: paper and ink, one green. The bright green belongs to the dark profile only. Critical red
   marks the one thing that needs a person: on this site, the human gate on the authority scale.
   Type: IBM Plex, three cuts. Serif for headings and the lead line, Sans for body and controls,
   Mono for the wordmark, figures, dates and the footer.
   Structure: a reading column plus a margin of notes. Every note says what kind of claim the
   sentence beside it is. */

@font-face { font-family: "IBM Plex Sans"; src: url("fonts/plex-sans-var.woff2") format("woff2");
  font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/plex-serif-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/plex-serif-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Serif"; src: url("fonts/plex-serif-500-italic.woff2") format("woff2");
  font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  /* screen-light profile */
  --page: #FBFAF7;
  --page-2: #F3F4EF;
  --ink: #101B2D;
  --muted: #46586E;
  --muted-2: #5F6E80;
  --rule: #D9DED6;
  --green: #1F6E5C;
  --green-deep: #155546;
  --tint: #E4EFEA;
  --crit: #ab3a37;
  /* the dark band (screen-dark profile), used by the authority scale in both modes */
  --d-page: #0B1424;
  --d-ink: #E9ECE6;
  --d-green: #5FBFA3;
  --d-muted: #9AA8B8;
  --d-rule: #24334A;
  --d-crit: #d76d69;

  --serif: "IBM Plex Serif", Georgia, "Iowan Old Style", serif;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* type scale: a 1.25 step from a 17px reading size */
  --t-note: .8125rem;
  --t-small: .9rem;
  --t-body: 1.0625rem;
  --t-lede: 1.375rem;
  --t-h3: 1.3rem;
  --t-h2: 2rem;
  --t-h1: clamp(2.3rem, 5.4vw, 4.4rem);

  --measure: 36rem;
  --margin: 15rem;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Dark is there for screens that ask for it. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0B1424;
    --page-2: #111D31;
    --ink: #E9ECE6;
    --muted: #9AA8B8;
    --muted-2: #9AA8B8;
    --rule: #24334A;
    --green: #5FBFA3;
    --green-deep: #8FD3BE;
    --tint: #13283A;
    --crit: #d76d69;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: var(--t-body); line-height: 1.6;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--green); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--green-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--ink); color: var(--page);
  padding: .5rem .8rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* masthead: the ratified lockup at 17px, the site header size */
.mast { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.4rem var(--gutter); font-size: var(--t-small); border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; align-items: center; gap: .6em; font: 500 17px/1 var(--mono);
  letter-spacing: .16em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark b { color: var(--green); font-weight: inherit; }
.wordmark svg { width: 1.19em; height: 1.19em; flex: none; }
.wordmark:hover { color: var(--ink); }
.mast nav { display: flex; gap: .35rem 1.5rem; flex-wrap: wrap; }
.mast nav a { color: var(--muted); text-decoration: none; }
.mast nav a:hover, .mast nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* the page grid: margin notes on the left, reading column on the right of them */
.sheet { display: grid; grid-template-columns: var(--margin) minmax(0, var(--measure)) 1fr;
  column-gap: 2.5rem; padding: 0 var(--gutter); }
.sheet > * { grid-column: 2; }
.sheet > .wide { grid-column: 2 / 4; }
.sheet > .full { grid-column: 1 / 4; }
.note { grid-column: 1; font-size: var(--t-note); line-height: 1.5;
  color: var(--muted); padding-top: .5rem; border-top: 1px solid var(--rule); align-self: start; }
.note b { display: block; font-weight: 600; color: var(--ink); margin-bottom: .15rem; }
.row { display: contents; }

/* claim kinds, shown as a short swatch in the margin */
.k { display: inline-block; width: .7rem; height: .7rem; margin-right: .4rem; vertical-align: -.05rem; }
.k-seen { background: var(--green); }
.k-derived { background: transparent; border: 2px solid var(--green); }
.k-open { background: transparent; border: 2px dashed var(--muted); border-radius: 50%; }

/* hero */
.hero { padding-top: clamp(3rem, 9vw, 7rem); padding-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.hero h1 { grid-column: 2 / 4; font-family: var(--serif); font-weight: 500; font-size: var(--t-h1);
  line-height: 1.08; letter-spacing: -.015em; margin: 0; max-width: 17ch; }
.hero .lede { font-family: var(--serif); font-weight: 500; font-size: var(--t-lede); line-height: 1.5;
  margin: 2rem 0 0; color: var(--ink); }
.hero .note { margin-top: 2.4rem; }

h2 { font-family: var(--serif); font-weight: 500; font-size: var(--t-h2); line-height: 1.15;
  letter-spacing: -.01em; margin: 0 0 1rem; }
h3 { font-family: var(--serif); font-weight: 600; font-size: var(--t-h3); line-height: 1.25; margin: 0 0 .4rem; }
p { margin: 0 0 1.05rem; }
.section { padding-top: clamp(3rem, 7vw, 5.5rem); }
.section > h2 { margin-top: 0; }

/* research programs: a plain list, each a small essay opening */
.programs { list-style: none; margin: 0; padding: 0; }
.programs li { padding: 1.4rem 0 1.25rem; border-top: 1px solid var(--rule); }
.programs li:first-child { border-top: 0; padding-top: .4rem; }
.programs p { margin: 0; color: var(--muted); }
.programs a { font-size: var(--t-small); }

/* the authority scale: the one dark band on the site, always in the dark profile */
.field { background: var(--d-page); color: var(--d-ink); margin-top: clamp(4rem, 8vw, 6.5rem);
  padding: clamp(3rem, 7vw, 5rem) 0 clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--d-rule); border-bottom: 1px solid var(--d-rule); }
.field a { color: var(--d-green); }
.field :focus-visible { outline-color: var(--d-green); }
.field .note { color: var(--d-muted); border-top-color: var(--d-rule); }
.field .note b { color: var(--d-ink); }
.field .k-seen { background: var(--d-green); }
.field h2, .field h3 { color: var(--d-ink); }
.scale { margin-top: 1.8rem; }
.scale-bands { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px;
  list-style: none; margin: 0; padding: 0; }
.scale-bands button { all: unset; box-sizing: border-box; display: flex; flex-direction: column;
  justify-content: flex-end; gap: .25rem; width: 100%; padding: .75rem .7rem .7rem; cursor: pointer;
  font-family: var(--sans); color: var(--d-ink); background: rgba(233,236,230,.06);
  min-height: 7.5rem; transition: background .25s var(--ease); position: relative; }
.scale-bands button::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: var(--h); background: var(--band); transition: height .45s var(--ease); z-index: 0; }
.scale-bands button > * { position: relative; z-index: 1; }
/* on a critical fill the text is set in the page colour (5.5:1) */
.scale-bands [data-level="3"], .scale-bands [data-level="4"], .scale-bands [data-level="5"] { color: var(--d-page); }
.scale-bands .lv { font-family: var(--mono); font-size: var(--t-note); opacity: .85; }
.scale-bands .nm { font-weight: 600; font-size: 1rem; }
.scale-bands button:hover { background: rgba(233,236,230,.11); }
.scale-bands button[aria-pressed="true"] { background: rgba(233,236,230,.16); outline: 2px solid var(--d-ink); outline-offset: -2px; }
.scale-bands button:focus-visible { outline: 2px solid var(--d-green); outline-offset: 2px; }
.scale-axis { display: flex; justify-content: space-between; font-size: var(--t-note); color: var(--d-muted);
  margin: .6rem 0 0; }
.scale-axis .gate { color: var(--d-crit); }
.scale-detail { margin-top: 1.6rem; min-height: 9.5rem; border-left: 3px solid var(--d-crit);
  padding: .2rem 0 .2rem 1.2rem; }
.scale-detail dl { display: grid; grid-template-columns: 7.5rem 1fr; gap: .35rem 1rem; margin: .7rem 0 0;
  font-size: 1rem; }
.scale-detail dt { font-size: var(--t-small); color: var(--d-muted); padding-top: .1rem; }
.scale-detail dd { margin: 0; }
.scale noscript p, .scale .fallback { font-size: 1rem; }

/* the work: a definition list, name then sentence */
.works { margin: 1.2rem 0 0; }
.works > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem;
  padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.works dt { font-family: var(--mono); font-weight: 500; font-size: .98rem; letter-spacing: .04em; padding-top: .2rem; }
.works dd { margin: 0; }
.works dd span { display: block; font-size: var(--t-note); color: var(--muted); margin-top: .3rem; }

/* how the work reaches the world: the flow diagram */
.flow { margin: 1.6rem 0 0; }
.flow svg { width: 100%; height: auto; }
.flow .node rect { fill: var(--page); stroke: var(--ink); stroke-width: 1.4; }
.flow .node.us rect { fill: var(--green); stroke: var(--green); }
.flow .node.us text { fill: var(--page); }
.flow .node text { font-family: var(--sans); fill: var(--ink); }
.flow .node .t1 { font-size: 15px; font-weight: 600; }
.flow .node .t2 { font-size: 12px; }
.flow .edge { stroke: var(--muted); stroke-width: 1.4; fill: none; marker-end: url(#arrow); }
.flow .lbl { font-family: var(--sans); font-size: 11.5px; fill: var(--muted); }
.flow-list { display: none; }
.flow-cap { font-size: var(--t-note); color: var(--muted); margin: .8rem 0 2rem; }

/* principles (research page) */
.principles { list-style: none; padding: 0; margin: 0; }
.principles li { padding: .9rem 0; border-top: 1px solid var(--rule); font-family: var(--serif);
  font-weight: 500; font-size: 1.2rem; line-height: 1.4; }
.principles li span { display: block; font-family: var(--sans); font-weight: 400; font-size: 1rem;
  color: var(--muted); margin-top: .3rem; }
.questions { margin: .6rem 0 0; padding-left: 1.2rem; }
.questions li { margin: .35rem 0; }
.program { padding-top: 2.6rem; }

/* contact + footer: contact lines and the footer are set in Mono */
.contact { font-family: var(--serif); font-weight: 500; font-size: var(--t-lede); line-height: 1.45; }
.foot { margin-top: clamp(4rem, 9vw, 7rem); padding: 1.6rem var(--gutter) 2.4rem; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: var(--t-note); color: var(--muted);
  display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between; }
.foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* legal pages */
.legal h1 { font-family: var(--serif); font-weight: 500; font-size: var(--t-h2); margin: 0 0 .3rem; }
.legal h2 { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 .5rem; }
.legal p, .legal li { font-size: 1.02rem; }
.draftbar { font-size: var(--t-small); background: var(--tint); color: var(--ink);
  border-left: 4px solid var(--green); padding: .8rem 1rem; margin: 1rem 0 1.8rem; }
.tbd { background: var(--tint); padding: 0 .2rem; font-size: .9em; }

/* the one orchestrated moment: the scale bands rise once on load */
@media (prefers-reduced-motion: no-preference) {
  .scale.ready .scale-bands button::before { transition-delay: calc(var(--i) * 70ms); }
  .scale.armed:not(.ready) .scale-bands button::before { height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* narrow screens: notes move inline above their text */
@media (max-width: 960px) {
  .sheet { grid-template-columns: minmax(0, 1fr); }
  .sheet > *, .sheet > .wide, .sheet > .full, .note, .hero h1 { grid-column: 1; }
  .note { margin: 1.2rem 0 .6rem; max-width: var(--measure); }
  .sheet > :not(.note):not(.wide):not(.full) { max-width: var(--measure); }
}
@media (max-width: 720px) {
  .scale-bands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scale-detail dl { grid-template-columns: 1fr; }
  .works > div { grid-template-columns: 1fr; gap: .2rem; }
  .flow svg { display: none; }
  .flow-list { display: block; }
  .mast { flex-direction: column; align-items: flex-start; gap: .8rem; }
}
