@font-face {
  font-family: "Inter";
  src: url("fonts/inter.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* The yellow, the two greys and the dark are read off the sketch of 20 Nov.
   They are loose, not final. The paper is a stand-in: the sketch is on white. */
:root {
  --mark: #f7ffa3;
  --light: #b9b9b9;
  --mid: #626363;
  --ink: #323232;
  --paper: #f2f2f0;

  /* Lines and veils are the dark, let through. */
  --rule: color-mix(in srgb, var(--ink) 22%, transparent);
  --veil: color-mix(in srgb, var(--ink) 7%, transparent);

  --line: 1.5rem;
  --pad: 1.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

/* One size, one weight, all lower case. */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/var(--line) "Inter", "Helvetica Neue", Arial, sans-serif;
  text-transform: lowercase;
}

h1, p, ul, li, dl, dt, dd, figure { margin: 0; padding: 0; font: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.quiet { color: var(--mid); }

/* THE FRAME. The window is the page: a bar at the head, a bar at the foot,
   and between them two halves that meet under the hyphen of the name.
   Words go in the left half, under "public". Pictures go in the right half,
   under "evidence". Every page keeps that split. */
.frame {
  height: 100vh;
  height: 100dvh;
  min-height: 26rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.head { padding: .75rem var(--pad); border-bottom: 1px solid var(--rule); text-align: center; }
.head h1 { display: inline; }
/* Nudged so the hyphen, not the middle of the word, sits on the centre line. */
.name { display: inline-block; padding: .5rem 1rem; background: var(--mark); transform: translateX(.484em); }

.halves { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.bay { min-width: 0; min-height: 0; overflow: auto; padding: var(--line) var(--pad); }
.bay + .bay { border-left: 1px solid var(--rule); }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem var(--pad);
  padding: .75rem var(--pad);
  border-top: 1px solid var(--rule);
}

/* What a bay holds is named at its head, with a count or a state opposite. */
.label { display: flex; justify-content: space-between; gap: var(--pad); color: var(--mid); }

/* PLACES. The words half is divided into named places, one open at a time.
   A closed place is its name and a plus; the open one takes the room. */
.places { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.place { min-height: 0; }
.place + .place { border-top: 1px solid var(--rule); }
.place[open] { flex: 1 1 0; overflow: auto; }
.place > summary {
  display: flex;
  justify-content: space-between;
  gap: var(--pad);
  padding: .75rem var(--pad);
  color: var(--mid);
  cursor: pointer;
  list-style: none;
}
.place > summary::-webkit-details-marker { display: none; }
.place > summary:hover { color: var(--ink); }
.place > summary:focus-visible { outline: 1px solid var(--ink); outline-offset: -3px; }
.sign::before { content: "+"; }
.place[open] .sign::before { content: "\2212"; }
.place > :not(summary) { margin: .75rem var(--pad) var(--line); }

/* BLOCKS. A page that can be opened is a block. Yellow: it is open, or it is
   the one being pointed at. */
.blocks { display: grid; gap: .5rem; justify-items: start; margin-top: var(--line); }
.blocks.row { display: flex; flex-wrap: wrap; margin-top: 0; }
.block { display: inline-block; padding: .5rem .75rem; background: var(--veil); }
.block.on, a.block:hover { background: var(--mark); }

/* THE PICTURE HALF. A picture is shown whole, at the head of its bay on the
   dark ground, never cut by the window. When and where sit on a strip at the
   foot of the bay that you can see through. With the investigations closed,
   the ground is empty. */
.proof { position: relative; padding: 0; overflow: hidden; background: var(--ink); }
.proof a { display: block; height: 100%; }
.proof figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 100%; }
.proof img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: top; }
.proof figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 var(--pad);
  padding: .75rem var(--pad);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
}
.halves:has(.place:first-child:not([open])) .proof > a { display: none; }
.proof.two { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 1px; background: var(--paper); }
.proof.two figure { background: var(--ink); }

/* The two halves answer each other: point at the words and the picture's
   strip is marked; point at the picture and its words are. */
.halves:has(.words a.block:hover) .proof figcaption,
.proof a:hover figcaption { background: var(--mark); }
.halves:has(.proof a:hover) .words a.block { background: var(--mark); }

.facts { display: grid; grid-template-columns: 9rem minmax(0, 1fr); margin-top: var(--line); }
.facts dt { color: var(--mid); }

/* A narrow window: the halves stack, words first. */
@media (max-width: 36rem) {
  :root { --pad: 1rem; }
  .frame { height: auto; min-height: 100vh; min-height: 100dvh; grid-template-rows: auto 1fr auto; }
  .name { transform: none; }
  .halves { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .bay { overflow: visible; }
  .bay + .bay { border-left: 0; border-top: 1px solid var(--rule); }
  .words { min-height: 14rem; }
  .place[open] { flex: 1 0 auto; overflow: visible; }
  .proof a, .proof figure, .proof img { height: auto; }
  .proof figure { display: block; }
  .proof.two { display: block; }
  .proof.two figure + figure { border-top: 1px solid var(--paper); }
}
