/* Read by Structure: a dark room, one question, one work, one reading at a time. */
:root {
  color-scheme: dark;
  --night: #121110; --ink: #eee8dc; --muted: #a59f92; --faint: #5c5951; --rule: #2a2825;
  --signal: #e8875f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --edge: clamp(16px, 3vw, 56px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--ink); font-family: var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
a { color: inherit; }
[hidden] { display: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.in { opacity: 0; animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }

/* ---------------- the questions ---------------- */
.home { position: fixed; inset: 0; overflow-y: auto; padding: calc(var(--edge) * 1.4) var(--edge) 80px; }
.masthead { width: min(1180px, 100%); margin: 0 auto 4vh; position: relative; z-index: 1; }
.masthead h1 { font: 400 clamp(15px, 1.2vw, 18px) var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--signal); margin: 0 0 .6em; }
.masthead p { font: 400 clamp(17px, 1.5vw, 22px)/1.4 var(--serif); color: var(--muted); margin: 0; max-width: 40em; }
.home ol { list-style: none; margin: 0 auto; padding: 0; width: min(1180px, 100%); position: relative; z-index: 1; }
.home li { border-top: 1px solid var(--rule); }
.home li:last-child { border-bottom: 1px solid var(--rule); }
.home li.theme { border: 0; padding: 26px 0 8px; font: 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.home li.theme:first-child { padding-top: 0; }
.home li button { display: grid; grid-template-columns: 3em 1fr auto; align-items: center; gap: 1em; width: 100%;
  padding: clamp(10px, 1.7vh, 18px) 0; font: 400 clamp(18px, 2.15vw, 31px)/1.22 var(--serif); transition: color .2s; }
.home li button .n { font: 12px var(--mono); color: var(--faint); }
.home li button .w { display: block; font: 12px/1.4 var(--mono); color: var(--faint); margin-top: .35em; letter-spacing: .02em; transition: color .2s; }
.home li button:hover, .home li button:focus-visible { color: var(--signal); outline: none; }
.home li button:hover .w { color: var(--muted); }
.ticks { display: flex; gap: 3px; align-items: end; height: 1.1em; }
.ticks i { display: block; width: 3px; background: var(--faint); transition: background .2s; }
.home li button:hover .ticks i { background: var(--signal); }
#ghost { position: fixed; right: 0; top: 0; bottom: 0; width: 48vw; background: center / contain no-repeat; opacity: 0;
  transition: opacity .6s ease; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 45%); mask-image: linear-gradient(to right, transparent, #000 45%); }
#ghost.on { opacity: .2; }
.foot { width: min(1180px, 100%); margin: 3em auto 0; display: flex; gap: 2em; flex-wrap: wrap; position: relative; z-index: 1;
  font: 13px var(--mono); letter-spacing: .05em; color: var(--faint); }
.foot a, .foot button { color: var(--faint); text-decoration: none; }
.foot a:hover, .foot button:hover { color: var(--signal); }

/* ---------------- one work ---------------- */
.room { position: fixed; inset: 0; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.question { position: absolute; left: var(--edge); top: calc(var(--edge) * .55); max-width: min(56vw, 880px);
  font: 400 clamp(17px, 1.75vw, 27px)/1.22 var(--serif); color: var(--ink); z-index: 2; transition: color .2s; }
.question:hover { color: var(--signal); }
.tele { position: absolute; right: var(--edge); top: calc(var(--edge) * .55); text-align: right; z-index: 2;
  font: clamp(11px, .9vw, 14px)/1.6 var(--mono); color: var(--muted); letter-spacing: .08em; white-space: pre; }
.tele .s { color: var(--faint); font-size: .85em; }
.col { position: absolute; z-index: 2; overflow-y: auto; overflow-x: hidden; padding-right: 10px; transition: opacity .22s ease;
  scrollbar-width: thin; scrollbar-color: #33312d transparent; }
.col.out { opacity: 0; }
.col::-webkit-scrollbar { width: 6px; } .col::-webkit-scrollbar-thumb { background: #33312d; border-radius: 3px; }
.label { position: absolute; left: var(--edge); bottom: calc(var(--edge) * .5 + 30px); max-width: 56vw; z-index: 2;
  font-size: clamp(12px, .95vw, 15px); line-height: 1.4; color: var(--muted); }
.label b { color: var(--ink); font-weight: 500; }
.rail { position: absolute; left: var(--edge); bottom: calc(var(--edge) * .5); height: 20px; display: flex; gap: 6px; align-items: end; z-index: 2; }
.rail a { display: block; width: 18px; height: 6px; background: #3a3833; transition: background .25s, height .25s; }
.rail a:hover { background: var(--muted); }
.rail a.on { background: var(--signal); height: 10px; }
.rail a.done { background: #6d675c; }
.viewtag { position: absolute; z-index: 2; font: 10px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  transition: opacity .4s; pointer-events: none; }
.viewtag b { color: var(--signal); font-weight: 400; }

/* the column */
.kick { font: 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--signal); margin: 0 0 1em; }
.chips { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 .9em; }
.ch { font: 10.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--night); background: var(--signal); padding: .3em .6em .25em; }
.tier { font: 10.5px var(--mono); letter-spacing: .08em; padding: .25em .55em; color: var(--ink); cursor: help; white-space: nowrap; }
.tier.stable, .tier.confirmatory { border: 1px solid var(--ink); }
.tier.narrowed, .tier.pixel-verified, .tier.null-controlled { border: 1px solid var(--muted); color: var(--muted); }
.tier.measured { border: 1px solid var(--faint); color: var(--muted); }
.tier.aid { border: 1px dashed var(--muted); color: var(--muted); }
.tier.exploratory, .tier.provisional { border: 1px dotted var(--muted); color: var(--muted); }
.tier.observation { border: 1px solid var(--rule); color: var(--faint); font-style: italic; }
.entry { font: 11px var(--mono); color: var(--faint); }
.claim { font: 400 clamp(19px, 1.7vw, 27px)/1.34 var(--serif); margin: 0 0 1.1em; text-wrap: pretty; }
.read { margin: 0 0 1.2em; }
.read .r { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 7px 0; border-top: 1px solid var(--rule); }
.read .r:last-child { border-bottom: 1px solid var(--rule); }
.read .k { font: 12px/1.4 var(--sans); color: var(--muted); }
.read .v { font: 13px/1.4 var(--mono); color: var(--signal); text-align: right; max-width: 22em; }
.vs { font-size: 13.5px; line-height: 1.5; color: #c9c2b4; margin: 0 0 1.4em; padding-left: 12px; border-left: 1px solid var(--signal); }
.vs b { display: block; font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 400; margin-bottom: 3px; }
.fig { margin: 0 0 1em; }
.fig .ft { display: flex; justify-content: space-between; gap: 1em; border-top: 1px solid #3a3833; padding-top: 6px; margin-bottom: 8px;
  font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.fig .ft span:last-child { color: var(--faint); }
.fig img { display: block; max-width: 100%; max-height: 34vh; cursor: zoom-in; background: #fff; }
.fig figcaption { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 7px; }
.intro .hl { font: 400 clamp(26px, 2.6vw, 40px)/1.15 var(--serif); margin: 0 0 .5em; }
.intro .lede { font: 400 clamp(17px, 1.35vw, 21px)/1.45 var(--serif); color: #d8d1c3; margin: 0 0 1.3em; }
.intro dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; color: #c9c2b4; margin: 0 0 1.4em; }
.intro dt { font: 10.5px/1.9 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.intro dd { margin: 0; }
.intro ol { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.intro ol li { counter-increment: r; font-size: 14px; line-height: 1.4; padding: 6px 0; border-top: 1px solid var(--rule); color: var(--muted); }
.intro ol li::before { content: counter(r, decimal-leading-zero); font: 11px var(--mono); color: var(--faint); margin-right: 1em; }
.intro ol li b { font: 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); font-weight: 400; margin-right: .6em; }
.hint { font: 12px var(--mono); color: var(--faint); margin-top: 1.4em; letter-spacing: .04em; }
.record h3 { font: 400 11px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--signal); margin: 0 0 .8em; }
.record ul { list-style: none; padding: 0; margin: 0 0 2em; }
.record li { font: 400 clamp(15px, 1.15vw, 18px)/1.45 var(--serif); padding: 8px 0 8px 18px; border-top: 1px solid var(--rule); position: relative; color: #ddd6c9; }
.record li::before { content: ""; position: absolute; left: 0; top: 1.25em; width: 8px; height: 1px; background: var(--faint); }
.record ul.fixed li::before { content: "↺"; width: auto; height: auto; background: none; top: 8px; color: var(--signal); font-size: 13px; }
.record .links { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 1.6em; }
.record .links a { font: 12px var(--mono); letter-spacing: .06em; text-decoration: none; border: 1px solid #4a4741; padding: 8px 14px; transition: all .2s; }
.record .links a:hover { border-color: var(--signal); color: var(--signal); }
.record .next { font: 13px var(--mono); color: var(--faint); }
.record .next a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--signal); }

/* ---------------- the sheet ---------------- */
.sheet { position: fixed; inset: 0; overflow-y: auto; padding: calc(var(--edge) * 1.2) var(--edge) 80px; z-index: 5; background: var(--night); }
.sheet .top { display: flex; justify-content: space-between; align-items: baseline; width: min(1300px, 100%); margin: 0 auto 2em; }
.sheet h2 { font: 400 12px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--signal); margin: 0; }
.sheet .x { font: 13px var(--mono); color: var(--faint); }
.sheet .x:hover { color: var(--signal); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px; width: min(1300px, 100%); margin: 0 auto; background: var(--rule); border: 1px solid var(--rule); }
.card { background: var(--night); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 10px; transition: background .2s; }
.card:hover { background: #1b1a18; }
.card .th { aspect-ratio: 4 / 3; background: #0c0b0a center / contain no-repeat; }
.card .n { font: 11px var(--mono); color: var(--faint); letter-spacing: .1em; }
.card .q { font: 400 19px/1.25 var(--serif); }
.card:hover .q { color: var(--signal); }
.card .h { font: italic 14px/1.35 var(--serif); color: var(--muted); }
.card .k { font: 12px/1.4 var(--mono); color: var(--signal); margin-top: auto; }
.card .k span { color: var(--faint); display: block; }

/* ---------------- overlays ---------------- */
#lightbox { position: fixed; inset: 0; z-index: 30; background: rgba(8,8,7,.94); display: flex; align-items: center; justify-content: center; padding: 3vw; animation: fade .25s; cursor: zoom-out; }
#lightbox figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-height: 100%; }
#lightbox img { max-width: 100%; max-height: calc(100vh - 140px); background: #fff; }
#lightbox figcaption { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin-top: 12px; max-width: 70em; }
.keys { position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto 18px; width: max-content; max-width: 92vw; padding: 14px 20px; z-index: 25;
  background: #1b1a18; border: 1px solid #33312d; font: 12px var(--mono); color: var(--muted); animation: rise .3s; }
.keys p { margin: .35em 0; }

/* ---------------- narrow and portrait: the work above, the reading below ---------------- */
@media (max-aspect-ratio: 1/1) {
  .question { max-width: calc(100vw - 2 * var(--edge) - 118px); font-size: 17px; }
  .tele { max-width: 110px; }
  .read .r { grid-template-columns: 1fr; }
  .read .v { text-align: left; max-width: none; }
  .tele { font-size: 11px; }
  .label { display: none; }
  .rail { left: var(--edge); right: var(--edge); bottom: max(10px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .rail a { flex: 1; max-width: 32px; }
  .claim { font-size: 19px; }
  .fig img { max-height: 40vh; }
  .home li button { grid-template-columns: 2.2em 1fr; }
  .home li button .ticks { display: none; }
  #ghost { display: none; }
}

/* ---------------- plain copy: the big number, the instrument, the full reading folded away ---------------- */
.big { margin: -.2em 0 1.3em; }
.big .bv { font: 400 clamp(30px, 3.2vw, 50px)/1.05 var(--mono); color: var(--signal); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big .bl { font: 12.5px/1.4 var(--sans); color: var(--muted); margin-top: .45em; max-width: 34em; }
canvas.inst { display: block; width: 100%; max-width: 460px; height: 118px; margin: 0 0 1.4em; }
details.more { margin: .4em 0 1.2em; border-top: 1px solid var(--rule); }
details.more summary { cursor: pointer; list-style: none; padding: 10px 0; font: 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); transition: color .2s; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; display: inline-block; width: 1.3em; color: var(--signal); }
details.more[open] summary::before { content: "−"; }
details.more summary:hover { color: var(--ink); }
details.more[open] > *:not(summary) { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
details.more .orig { font: 400 16px/1.45 var(--serif); color: #d8d1c3; margin: .2em 0 1em; }
details.more .grade { font: 11px var(--mono); color: var(--faint); letter-spacing: .04em; }
details.more .grade b { color: var(--muted); font-weight: 400; }
.claim { font-size: clamp(20px, 1.85vw, 29px); }

/* ---------------- see, then say ---------------- */
.see { position: absolute; z-index: 2; pointer-events: none; }
.see .look { font: 400 clamp(15px, 1.2vw, 19px)/1.4 var(--serif); color: var(--ink); margin: 0 0 .35em; text-wrap: pretty; }
.see .k, .say .k { display: inline-block; font: 10.5px var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--night);
  background: var(--signal); padding: .28em .55em .22em; margin-right: .8em; vertical-align: .15em; }
.say { margin: 0 0 .5em; }
.see .src { font: 10px/1.5 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0; }
.see .enl { pointer-events: auto; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--signal); margin-left: .8em;
  border-bottom: 1px solid currentColor; cursor: zoom-in; }
.record .note { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin: -.3em 0 1em; }
.record ul.also li a { color: #ddd6c9; text-decoration: none; border-bottom: 1px solid #4a4741; }
.record ul.also li a:hover { color: var(--signal); border-color: var(--signal); }
.record ul.also .tier { margin-left: .4em; font-size: 9.5px; vertical-align: .15em; }

/* the closing screen: one line, a recap, then where to read more */
.record .closehl { font: 400 clamp(26px, 2.6vw, 40px)/1.15 var(--serif); color: var(--ink); margin: 0 0 .6em; }
.record .recap { font: 400 clamp(17px, 1.35vw, 21px)/1.55 var(--serif); color: #d8d1c3; margin: 0 0 1.4em; max-width: 34em; }
.record .more { font: 400 clamp(14px, 1.05vw, 16px)/1.5 var(--serif); font-style: italic; color: var(--muted); margin: 0 0 1em; max-width: 34em; }
