/* Unde se termină albastrul.
   The viewing chambers stay neutral so the colour judgements remain honest.
   Elsewhere, the page moves between graphite, paper and the measured spectrum:
   the rhythm of a colour laboratory rather than one continuous dark template. */

:root {
  --bg: #26282a;
  --bg-2: #2e3033;
  --panel: #34363a;
  --field: #6f7274;          /* the viewing surround for the bands */
  --ink: #f0f0f1;
  --ink-2: #c3c5c7;
  --ink-3: #93969a;
  --rule: #45484c;
  --threshold: #55a8a7;
  --green: #91aa72;
  --blue: #8583bd;
  --paper: #ece9e1;
  --paper-2: #dedbd2;
  --paper-ink: #202326;
  --paper-muted: #5f625f;
  --you: #ffffff;
  --warn: #c9925b;
  --maxw: 45rem;
  --wide: 62rem;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --utility: "IBM Plex Sans Condensed", "Arial Narrow", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Several components below set display, which would otherwise beat the hidden
   attribute and leave covers and controls on screen after they are dismissed. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--body);
  font-feature-settings: "kern" 1;
  overflow-wrap: break-word;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: .6rem 1rem;
  z-index: 20;
}
.skip:focus { left: .5rem; top: .5rem; }

/* ------------------------------------------------------------------ header */

.top {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.25rem 1.25rem .5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.kicker {
  margin: 0;
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.langnav a,
.foot a {
  color: var(--ink-2);
  font: 500 .82rem/1 var(--utility);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
}
.langnav a:hover,
.foot a:hover { color: var(--ink); border-color: currentColor; }

/* -------------------------------------------------------------------- text */

main { max-width: none; margin: 0 auto; padding: 0 0 4rem; }

section {
  max-width: calc(var(--maxw) + 2.5rem);
  margin: 0 auto 3.25rem;
  padding-inline: 1.25rem;
}
section.act,
section.reveal,
section.two { max-width: calc(var(--wide) + 2.5rem); }

.hero {
  max-width: calc(var(--wide) + 2.5rem);
  margin-bottom: 2.5rem;
  position: relative;
}
.hero::after {
  content: "";
  display: block;
  height: 5px;
  margin-top: 1.6rem;
  background: linear-gradient(90deg, var(--green), var(--threshold) 52%, var(--blue));
}

h1 {
  margin: .4rem 0 .5rem;
  font-size: clamp(2.1rem, 6.2vw, 3.9rem);
  line-height: 1.03;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 110;
  letter-spacing: -.018em;
}

.deck {
  margin: 0 0 1.4rem;
  font: 500 clamp(1.05rem, 2.4vw, 1.35rem)/1.4 var(--utility);
  color: var(--ink-2);
  max-width: 44ch;
}

.lead {
  margin: 0 0 1.75rem;
  max-width: 40ch;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 1.5;
  color: var(--ink);
}

h2 {
  margin: 0 0 .75rem;
  font-size: clamp(1.35rem, 3.4vw, 1.95rem);
  line-height: 1.18;
  font-family: var(--display);
  font-weight: 400;
  font-variation-settings: "opsz" 72;
  letter-spacing: -.014em;
}

h3 {
  margin: 0 0 .4rem;
  font: 600 .74rem/1.2 var(--utility);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

p { margin: 0 0 1rem; max-width: 64ch; }

.note {
  font-size: .93rem;
  color: var(--ink-2);
  border-left: 2px solid var(--rule);
  padding-left: .9rem;
}

.xlink {
  color: var(--ink);
  text-decoration-color: var(--threshold);
  text-underline-offset: 3px;
}

/* ----------------------------------------------------------- visual scenes */

.scene-light,
.method-scene,
.sources-scene {
  max-width: none;
  padding-block: clamp(2.75rem, 7vw, 5.25rem);
  padding-inline: max(1.25rem, calc((100% - var(--wide)) / 2));
  color: var(--paper-ink);
  background: var(--paper);
}

.scene-light + .scene-light { margin-top: -3.25rem; }
.scene-light > h2,
.scene-light > .scene-lead,
.scene-light > .taxonomy-band,
.scene-light > .grid-tool,
.scene-light > p,
.scene-light > .cols,
.method-scene > *,
.sources-scene > * {
  margin-inline: auto;
  max-width: var(--wide);
}

.scene-light > p,
.method-scene > p,
.sources-scene > p { max-width: var(--maxw); }

.scene-light h3,
.method-scene h3,
.sources-scene h3 { color: var(--paper-muted); }
.scene-light .note,
.method-scene .note,
.sources-scene .note { color: var(--paper-muted); border-color: #bbb7ad; }

.history-scene {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.spectrum-scene {
  max-width: none;
  padding-block: clamp(3rem, 8vw, 6rem);
  padding-inline: max(1.25rem, calc((100% - var(--maxw)) / 2));
  background:
    linear-gradient(110deg, rgba(145, 170, 114, .12), transparent 35%),
    linear-gradient(250deg, rgba(133, 131, 189, .14), transparent 42%),
    #212527;
}

.romanian-scene {
  position: relative;
  border-left: 3px solid var(--blue);
}

.method-scene {
  margin-top: -3.25rem;
  margin-bottom: 3.25rem;
  background: var(--paper-2);
}
.method-scene + .method-scene {
  border-top: 1px solid #c7c3ba;
}

.sources-scene {
  margin-top: -3.25rem;
  margin-bottom: 0;
  background: var(--paper);
}

.scene-lead {
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  line-height: 1.45;
  color: #303536;
}

/* Three mutually exclusive readings of the same interval. The segmented rule
   carries the actual 35/64/11 proportions before the prose explains them. */
.taxonomy-meter {
  display: flex;
  height: 1.15rem;
  margin: 2rem 0 1.5rem;
  overflow: hidden;
}
.taxonomy-meter span { min-width: 2px; }
.taxonomy-meter .direct { background: var(--threshold); }
.taxonomy-meter .shared { background: var(--green); }
.taxonomy-meter .complex { background: var(--warn); }

.taxonomy-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.taxon { border-top: 1px solid #aaa69d; padding-top: 1rem; }
.taxon-number {
  margin: 0 0 .5rem;
  font: 400 clamp(3.25rem, 8vw, 5.8rem)/.85 var(--display);
  font-variation-settings: "opsz" 120;
  letter-spacing: -.055em;
}
.taxon-direct .taxon-number { color: #2c7778; }
.taxon-shared .taxon-number { color: #607743; }
.taxon-complex .taxon-number { color: #9a6236; }
.taxon h3 { color: var(--paper-ink); }
.taxon p:last-child { color: var(--paper-muted); font-size: .98rem; }

/* ------------------------------------------------------------ evidence strip */

.strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: .1rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.strip li {
  padding: .75rem .9rem .75rem 0;
  min-width: 0;
}

.strip b {
  display: block;
  font: 600 .95rem/1.3 var(--utility);
  color: var(--ink);
}

.strip span {
  display: block;
  margin-top: .15rem;
  font: 500 .68rem/1.2 var(--utility);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* -------------------------------------------------------------- the bands */

.band { margin: 1.5rem 0 .5rem; }

.band-stage {
  position: relative;
  background: var(--field);
  padding: clamp(1.1rem, 3.5vw, 2.25rem);
  border-radius: 2px;
  touch-action: pan-y;
}

.band-strip {
  height: clamp(5rem, 16vw, 8.5rem);
  border-radius: 1px;
}

.band-hit {
  position: absolute;
  inset: clamp(1.1rem, 3.5vw, 2.25rem);
  cursor: ew-resize;
}
.band-hit:focus-visible { outline: 2px solid var(--you); outline-offset: 4px; }

.band-line {
  position: absolute;
  top: clamp(.5rem, 2vw, 1.15rem);
  bottom: clamp(.5rem, 2vw, 1.15rem);
  width: 2px;
  margin-left: -1px;
  background: var(--you);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .38);
  pointer-events: none;
}

.band-flag {
  position: absolute;
  top: -.15rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--you);
  color: #17181a;
  font: 600 .66rem/1 var(--utility);
  letter-spacing: .05em;
  padding: .28rem .45rem;
  white-space: nowrap;
  border-radius: 1px;
}

.band-cover {
  position: absolute;
  inset: 0;
  border: 0;
  width: 100%;
  background: var(--panel);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  cursor: pointer;
  font: inherit;
  padding: 1.25rem;
  text-align: center;
  border-radius: 2px;
}
.band-cover:hover { background: #3a3d41; }

.band-cover-note {
  font: 400 .9rem/1.45 var(--utility);
  color: var(--ink-2);
  max-width: 34ch;
}

.band-cover-go {
  font: 600 .82rem/1 var(--utility);
  letter-spacing: .09em;
  text-transform: uppercase;
  border: 1px solid var(--ink-3);
  padding: .6rem 1.1rem;
  border-radius: 2px;
}

.band-caption {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  justify-content: space-between;
  margin-top: .6rem;
  font: 500 .84rem/1.4 var(--utility);
  color: var(--ink-2);
}

.band-readout { color: var(--ink); font-variant-numeric: tabular-nums; }

.band-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem 1rem;
  margin-top: .5rem;
}

.btn {
  font: 600 .8rem/1 var(--utility);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .7rem 1.15rem;
  border-radius: 2px;
  border: 1px solid transparent;
  background: var(--ink);
  color: #17181a;
  cursor: pointer;
}
.btn:hover { background: #fff; }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--rule); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink-3); }

.hint { font: 400 .84rem/1.4 var(--utility); color: var(--ink-3); }

/* --------------------------------------------------------- the distribution */

.dist {
  width: 100%;
  height: clamp(9rem, 24vw, 12rem);
  display: block;
  margin: 1.25rem 0 .75rem;
  overflow: visible;
}

.curve-fill { fill: rgba(255, 255, 255, .09); }
.curve-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.mk { stroke: rgba(255, 255, 255, .5); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mk-bk { stroke: var(--warn); stroke-dasharray: 3 2; }
.median { stroke: var(--threshold); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.you { stroke: var(--you); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ax {
  fill: var(--ink-3);
  font: 500 9px var(--utility);
}

.verdict {
  font-size: 1.05rem;
  color: var(--ink);
  border-left: 2px solid var(--you);
  padding-left: .9rem;
}

.keys {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  margin: 0;
  padding: 0;
  font: 500 .78rem/1.3 var(--utility);
  color: var(--ink-2);
}
.keys li { display: flex; align-items: center; gap: .4rem; }
.keys i { width: 1rem; height: 2px; display: inline-block; }
.k-you { background: var(--you); }
.k-lang { background: rgba(255, 255, 255, .5); }
.k-med { background: var(--threshold); }

/* ------------------------------------------------------------------ the tie */

.tie-row {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.tie-chip {
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  display: flex;
  align-items: flex-end;
  padding: .8rem;
}

.tie-chip span {
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .09em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, .62);
}

/* --------------------------------------------------------------- the grids */

.grid-tool {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: clamp(.9rem, 2.5vw, 1.4rem);
  margin: 1.25rem 0;
}

.grid-head {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .9rem;
}

.grid-pick {
  font: 500 .74rem/1.2 var(--utility);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
}

.grid-pick select {
  font: 500 .92rem/1 var(--utility);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .45rem .55rem;
  max-width: 12rem;
}

.grid-meta {
  margin: 0;
  font: 500 .8rem/1.3 var(--utility);
  color: var(--ink-2);
}

.chipgrid {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 41.6 / 10;
  shape-rendering: crispEdges;
}
.chipgrid rect { stroke: none; }

.grid-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  margin: .9rem 0 .6rem;
  padding: 0;
}
.grid-legend li { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.grid-legend .sw {
  width: .85rem;
  height: .85rem;
  border-radius: 1px;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
.grid-legend .tm {
  font: 500 .82rem/1.2 var(--utility);
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- two columns */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-top-width: 2px;
  border-radius: 2px;
  padding: 1.1rem;
}
.card.ok { border-top-color: var(--threshold); }
.card.open { border-top-color: var(--warn); }
.card p { margin: 0; color: var(--ink-2); font-size: .98rem; }

/* ------------------------------------------------------------------ tables */

.tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font: 400 .92rem/1.4 var(--utility);
}
.tbl caption {
  text-align: left;
  font: 600 .72rem/1.2 var(--utility);
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: .5rem;
}
.tbl th,
.tbl td {
  text-align: left;
  padding: .5rem .7rem .5rem 0;
  border-bottom: 1px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
.tbl th { color: var(--ink-3); font-weight: 600; font-size: .78rem; }
.tbl td { color: var(--ink-2); }

/* ----------------------------------------------------------------- sources */

.srcs { list-style: none; margin: 0; padding: 0; }
.srcs li { padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.srcs a {
  color: var(--ink);
  font: 500 .98rem/1.4 var(--utility);
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}
.srcs a:hover { text-decoration-color: currentColor; }
.srcs p { margin: .35rem 0 0; font-size: .92rem; color: var(--ink-3); max-width: 70ch; }

/* ------------------------------------------------------------------ footer */

.foot {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
}
.foot p { margin: 0; font: 400 .84rem/1.5 var(--utility); color: var(--ink-3); }

.totop {
  position: fixed;
  right: max(.85rem, env(safe-area-inset-right));
  bottom: max(.85rem, env(safe-area-inset-bottom));
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .5rem .7rem;
  font: 600 .68rem/1 var(--utility);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 8;
}
.totop.on { opacity: 1; pointer-events: auto; }
.totop:hover { color: var(--ink); }

/* ------------------------------------------------------------- without js */

/* No script means no instrument to protect, so the bands simply show and the
   controls that would do nothing are removed rather than left dead. */
.no-js .band-cover,
.no-js .band-actions,
.no-js .band-caption { display: none; }
.no-js #reveal[hidden] { display: block !important; }
.no-js .keys .k-you,
.no-js .keys li:first-child { display: none; }
.no-js .totop {
  position: static;
  min-width: 44px;
  min-height: 44px;
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------- 404 */

.notfound { max-width: var(--maxw); margin: 0 auto; padding: 5rem 1.25rem; }
.notfound a { color: var(--ink); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 44rem) {
  .taxonomy-band { grid-template-columns: minmax(0, 1fr); }
  .taxon-number { font-size: clamp(3rem, 18vw, 4.8rem); }
  .grid-pick select { max-width: 100%; }
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
  .tbl td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .18rem 0; }
  .tbl td::before {
    content: attr(data-h);
    color: var(--ink-3);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
