/* RM852. aivrpsych.com. System faces only, so the page loads nothing from
   another server: a Charter-family serif to read, DIN for anything that
   annotates, measures or labels. */

:root {
  --paper: #f1f4f3;
  --ink: #16232b;
  --slate: #56656d;
  --rule: #cbd4d6;
  --core: #e1e7e7;
  --panel: #e7eceb;
  --dim: #2b43c4;
  --construct: #8fc3d6;
  --highlight: #dfe4fb;

  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --din: "DIN Alternate", "DIN 2014", Bahnschrift, "D-DIN", "DIN Next", "Barlow", "Roboto Condensed", "Arial Narrow", sans-serif;

  --measure: 38rem;
  --wide: 52rem;
  --page: 74rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #13212a;
    --ink: #e4ebeb;
    --slate: #9fb0b7;
    --rule: #2e414c;
    --core: #1c2d37;
    --panel: #192a33;
    --dim: #93a6ff;
    --construct: #3f7487;
    --highlight: #23335c;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.62;
  font-kerning: normal;
  font-variant-numeric: oldstyle-nums proportional-nums;
  hyphens: manual;
}

a { color: inherit; text-decoration-color: var(--dim); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--dim); }

:focus-visible { outline: 2px solid var(--dim); outline-offset: 3px; border-radius: 1px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem;
  font-family: var(--din); background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.9rem; text-decoration: none; z-index: 20;
}
.skip:focus { top: 0.75rem; }

/* Masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-family: var(--din);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.masthead-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0.8rem var(--gutter);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark { text-decoration: none; font-weight: 600; flex-shrink: 0; }

/* One row at every width: on a phone the links scroll sideways rather than
   stacking, so the sticky bar never takes more than a line of the screen. */
.masthead nav {
  display: flex;
  gap: 1.4rem;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.masthead nav::-webkit-scrollbar { display: none; }
.masthead nav a { text-decoration: none; color: var(--slate); }
.masthead nav a:hover { color: var(--dim); }

@media (max-width: 40rem) {
  .masthead nav {
    gap: 1.1rem;
    padding-right: 1.5rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent);
  }
}

/* Hero */

.hero {
  max-width: var(--page);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  gap: 2.5rem clamp(2rem, 5vw, 4.5rem);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); align-items: start; }
}

.hero h1 {
  font-family: var(--din);
  font-weight: 600;
  font-size: clamp(2.6rem, 6.4vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0 0 1.4rem;
}

.lede {
  font-size: clamp(1.3rem, 2.3vw, 1.55rem);
  line-height: 1.42;
  margin: 0 0 1.6rem;
  max-width: 30rem;
}

.framing {
  margin: 0 0 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--ink);
  max-width: 30rem;
}

.hero-guide { color: var(--slate); margin: 0; max-width: 30rem; }

/* The section drawing */

.section-figure { margin: 0; }

.drawing svg { display: block; width: 100%; height: auto; overflow: visible; }

.noscript {
  font-family: var(--din);
  color: var(--slate);
  border: 1px dashed var(--rule);
  padding: 2rem 1.25rem;
  margin: 0;
}

.drawing .ground { stroke: var(--ink); stroke-width: 1.6; }
.drawing .hatch { stroke: var(--slate); stroke-width: 0.8; }
.drawing .core { fill: var(--core); stroke: var(--ink); stroke-width: 1.4; }
.drawing .storey { stroke: var(--construct); stroke-width: 0.8; }
.drawing .construct { stroke: var(--construct); stroke-width: 1; stroke-dasharray: 3 4; }
.drawing .deck-solid { fill: var(--ink); }
.drawing .deck-grate { fill: url(#grate); }
.drawing .grate-bar { stroke: var(--ink); stroke-width: 1.4; }
.drawing .deck-edge { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.drawing .deck-glass { fill: var(--construct); fill-opacity: 0.32; stroke: var(--ink); stroke-width: 1.2; }
.drawing .deck-open { fill: none; stroke: var(--ink); stroke-width: 1.1; stroke-dasharray: 4 3; }
.drawing .wall { fill: var(--ink); }
.drawing .post { stroke: var(--ink); stroke-width: 2.2; }
.drawing .rail { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.drawing .person { fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; }
.drawing .d-line, .drawing .d-tick { stroke: var(--dim); stroke-width: 1.2; }
.drawing .d-tick { stroke-width: 1.6; }
.drawing .d-ext { stroke: var(--dim); stroke-width: 0.7; stroke-opacity: 0.75; }
.drawing .d-label {
  fill: var(--dim);
  font-family: var(--din);
  font-size: 16px;
  font-variant-numeric: lining-nums tabular-nums;
}
.drawing svg.narrow .d-label { font-size: 21px; }
.drawing svg.narrow .person { stroke-width: 2.6; }

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 1.1rem 1.75rem;
  margin: 1.5rem 0 0;
  font-family: var(--din);
  font-size: 0.98rem;
}

.controls[hidden] { display: none; }

.control label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.control output {
  color: var(--dim);
  font-variant-numeric: lining-nums tabular-nums;
}

.control input[type="range"] {
  width: 100%;
  margin: 0.25rem 0;
  accent-color: var(--dim);
}

.control select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--slate);
  border-radius: 2px;
  padding: 0.4rem 0.5rem;
}

.control-note {
  margin: 0.4rem 0 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--slate);
}

.section-figure figcaption {
  margin-top: 1.25rem;
  font-family: var(--din);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--slate);
  max-width: 40rem;
}

/* The report */

.report {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter) 2rem;
}

.report section {
  max-width: var(--wide);
  padding-top: clamp(3rem, 8vw, 5.5rem);
  /* Clear the sticky masthead when a section is reached by its anchor. */
  scroll-margin-top: 3.5rem;
}

/* Prose keeps a reading measure; figures and tables may run wider. */
.report section > :is(p, ul, ol, h3) { max-width: var(--measure); }

.report h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.05rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.005em;
  margin: 0 0 1.25rem;
  max-width: 30ch;
}

.report h3 {
  font-size: 1.2rem;
  line-height: 1.3;
  font-style: italic;
  margin: 2.25rem 0 0.6rem;
}

.report p { margin: 0 0 1.1rem; }

.report cite { font-style: italic; }

.aside {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--slate);
}

/* Shiban et al. 2015, as a 2 x 2 */

.trial { margin: 2rem 0 2.25rem; max-width: var(--wide); }

.trial-grid {
  display: grid;
  gap: 2px;
  font-family: var(--din);
  font-size: 0.98rem;
  line-height: 1.35;
}

.trial-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 1fr;
  gap: 2px;
}

.trial-row > span { padding: 0.85rem 0.9rem; }
.trial-row > [role="cell"] { background: var(--panel); }
.trial-head > span { padding: 0 0.9rem 0.4rem; color: var(--slate); }
.trial-row > [role="rowheader"] { color: var(--slate); padding-left: 0; }
.trial-row > .trial-best { background: var(--highlight); box-shadow: inset 0 0 0 1.5px var(--dim); }

.trial figcaption {
  margin-top: 0.85rem;
  font-family: var(--din);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--slate);
}

@media (max-width: 30rem) {
  .trial-row { grid-template-columns: 4.6rem 1fr 1fr; }
  .trial-row > span { padding: 0.65rem 0.55rem; }
  .trial-grid { font-size: 0.9rem; }
}

/* Tables */

.table-wrap {
  max-width: var(--wide);
  margin: 1.75rem 0 1.5rem;
  overflow-x: auto;
}

.table-wrap:focus-visible { outline-offset: 4px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--din);
  font-size: 0.95rem;
  line-height: 1.38;
  font-variant-numeric: lining-nums tabular-nums;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 1.1rem 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

thead th { font-weight: 600; color: var(--slate); border-bottom-color: var(--ink); }
tbody th { font-weight: 400; }
td.num, th.num { text-align: right; white-space: nowrap; padding-right: 0; }
td.extrapolation { color: var(--dim); }
td cite { font-style: italic; }

.tiers td, .tiers th { min-width: 8.5rem; }

/* Lists */

.reasons, .rules, .attested, .defects { padding: 0; margin: 0 0 1.5rem; list-style: none; }
.reasons li, .rules li, .defects li { margin: 0 0 0.9rem; padding-left: 1.1rem; position: relative; }
.reasons li::before, .rules li::before, .defects li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.45rem;
  height: 1.5px;
  background: var(--dim);
}

.attested {
  border-left: 3px solid var(--ink);
  padding-left: 1.1rem;
  margin-bottom: 0.6rem;
}
.attested li { margin: 0 0 0.7rem; }

.report .attribution {
  font-family: var(--din);
  font-size: 0.92rem;
  color: var(--slate);
  margin-bottom: 2rem;
}

/* Entries, in the order they landed */

.entries { list-style: none; padding: 0; margin: 1.75rem 0 0; }

.entries li {
  display: grid;
  grid-template-columns: 4.25rem 1fr;
  gap: 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}

.entries li:last-child { border-bottom: 1px solid var(--rule); }

.entries .rm {
  font-family: var(--din);
  font-size: 0.95rem;
  color: var(--dim);
  padding-top: 0.2rem;
  font-variant-numeric: lining-nums tabular-nums;
}

/* APA level 4: bold, title case, not italic. */
.entries h4 { margin: 0 0 0.25rem; font-size: 1.1rem; font-weight: 700; }
.entries p { margin: 0; font-size: 1.05rem; line-height: 1.55; }

/* Colophon */

.colophon {
  max-width: var(--page);
  margin: 0 auto;
  padding: 3rem var(--gutter) 3.5rem;
  font-family: var(--din);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--slate);
}

.colophon p { max-width: 40rem; margin: 0 0 0.6rem; }

/* APA 7 presentation: numbered tables and figures with an italic title above
   and a note below; citations that link to their reference; a reference list
   with a hanging indent. */

.report .apa-number,
.apa-number {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  margin: 2rem 0 0.15rem;
}

.report .apa-title,
.apa-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.4;
  margin: 0 0 0.75rem;
}

.report .apa-note,
.apa-note {
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--slate);
  margin: 0.6rem 0 1.5rem;
}

.apa-note em:first-child { font-style: italic; color: var(--ink); }

.report .table-wrap { margin-top: 0; margin-bottom: 0; }
.report .trial { margin: 0; }

.stat { font-style: italic; }

a.cite {
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
}
a.cite:hover { text-decoration-color: var(--dim); }

/* Use of AI */

.disclosure { margin: 1.5rem 0 1.25rem; max-width: var(--wide); }
.disclosure > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.15rem 1.5rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.disclosure > div:last-child { border-bottom: 1px solid var(--rule); }
.disclosure dt { font-family: var(--din); font-weight: 600; font-size: 0.98rem; padding-top: 0.15rem; }
.disclosure dd { margin: 0; font-size: 1.05rem; line-height: 1.55; max-width: var(--measure); }

@media (min-width: 48rem) {
  .disclosure > div { grid-template-columns: 11rem minmax(0, 1fr); }
}

/* References */

.references { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: var(--wide); }
.references li {
  padding-left: 2rem;
  text-indent: -2rem;
  margin: 0 0 0.85rem;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.references li:target { background: var(--highlight); }
.references a { text-decoration-color: var(--rule); }

.cite-this { font-family: var(--serif); }
figcaption .apa-number, figcaption .apa-title { display: block; }
.references li { scroll-margin-top: 4rem; }

/* Revision 2: the public-speaking demo leads. Screenshots are shown as they
   were captured, with the app's own framing banner and stop control in frame. */

.hero-shot { margin: 0; }
.hero-shot img,
.realism img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--panel);
}
.hero-shot figcaption {
  margin-top: 0.9rem;
  font-family: var(--din);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--slate);
  max-width: 42rem;
}

.realism { margin: 0; }
.realism-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem 1.1rem;
}
.realism-grid li { margin: 0; }
.realism-grid p {
  margin: 0.45rem 0 0;
  font-family: var(--din);
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--slate);
}
.realism-grid p strong { color: var(--ink); font-weight: 600; }

.heights-figure { margin: 2rem 0 0; max-width: var(--wide); }
.heights-figure .controls { margin-top: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); }

.status-note {
  border-left: 3px solid var(--dim);
  padding-left: 1rem;
  margin: 1.25rem 0 1.5rem;
  max-width: var(--measure);
}

/* RM853: the evidence review. The same drafting vernacular: findings are
   annotated blocks, what the check read is a DIN margin note, and the one
   figure is a dimensioned forest plot drawn with the dimension ink. */

.hero-plain { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 60rem) {
  .hero-plain { grid-template-columns: minmax(0, 1fr); }
  .hero-plain .hero-text { max-width: 46rem; }
}
.kicker {
  font-family: var(--din);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 0.9rem;
}

.short-version {
  counter-reset: short;
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: var(--wide);
  border-top: 1px solid var(--ink);
}
.short-version li {
  counter-increment: short;
  position: relative;
  padding: 0.95rem 0 0.95rem 3rem;
  border-bottom: 1px solid var(--rule);
  font-size: 1.08rem;
  line-height: 1.55;
  max-width: none;
}
.short-version li::before {
  content: counter(short, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 1.15rem;
  font-family: var(--din);
  font-size: 0.95rem;
  color: var(--dim);
}

.report .finding {
  max-width: var(--measure);
  margin: 0 0 0.4rem;
  padding: 1.1rem 0 0.2rem;
  border-top: 1px solid var(--rule);
}
.report .finding:first-of-type { border-top-color: var(--ink); }
.report .finding h3 { margin-top: 0; }
.report .finding p { max-width: none; }
.report .finding p.checked,
.report p.checked {
  font-family: var(--din);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--slate);
  margin: -0.35rem 0 1rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--construct);
}

tr.total th, tr.total td { font-weight: 600; border-top: 1.5px solid var(--ink); }

.forest { margin: 2rem 0 2.25rem; max-width: var(--wide); }
.forest-table { min-width: 40rem; }
.forest-table td, .forest-table th { vertical-align: middle; }
.forest-group th {
  font-weight: 600;
  color: var(--slate);
  padding-top: 1rem;
  border-bottom-color: var(--ink);
}
.forest-table td.forest-plot, .forest-table th.forest-plot-head, .forest-table td.forest-ticks { width: 34%; min-width: 11rem; padding-left: 1.1rem; padding-right: 0; }
.forest-plot svg { display: block; width: 100%; height: 1.4rem; overflow: visible; }
.forest-plot-head { color: var(--slate); }
.forest-plot-head span { font-weight: 400; font-size: 0.78rem; line-height: 1.2; }
.forest-plot-head span:last-child { float: right; text-align: right; }
.forest-axis td { border-bottom: 0; padding-top: 0.3rem; }
.forest-tick-row { display: flex; }
.forest-tick-row span { flex: 1 1 0; text-align: center; font-size: 0.78rem; color: var(--slate); }
.forest-grid { stroke: var(--rule); stroke-width: 1; vector-effect: non-scaling-stroke; }
.forest-zero { stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.forest-ci { stroke: var(--dim); stroke-width: 1.6; vector-effect: non-scaling-stroke; }
.forest-pt { stroke: var(--dim); stroke-width: 4; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.corrections li { line-height: 1.55; }
.corrections .was, .corrections .now {
  font-family: var(--din);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.corrections .was { color: var(--slate); }
.corrections .now { color: var(--dim); margin-left: 0.25rem; }
