@font-face {
  font-family: "Census Serif";
  src: url("/fonts/fraunces-normal-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Census Mono";
  src: url("/fonts/dm-mono-normal-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

.lantern {
  --night: #101f26;
  --deep: #071519;
  --paper: #f2ecdb;
  --sheet: #e7e0cd;
  --ink: #1c302e;
  --sub: #485952;
  --ruling: #a6a797;
  --rule-bright: #5e726b;
  --ground-band: #203536;
  --lamp: #ffc674;
  --rust: #883e26;
  --teal: #28594f;
  --serif: "Census Serif", Georgia, serif;
  --mono: "Census Mono", ui-monospace, monospace;
  margin: 0;
  background: #14272a;
  color: #f2eedc;
  font: 1.08rem/1.55 Georgia, serif;
}

.lc-shell, .lc-shell *, .lc-shell *::before, .lc-shell *::after { box-sizing: border-box; }
.lc-shell { max-width: 1344px; margin-inline: auto; overflow-wrap: break-word; color: var(--ink); }
.lc-shell [id], .lantern #assay { scroll-margin-block-start: 3.5rem; }
.lc-shell [hidden] { display: none !important; }
:where(.lc-shell) :is(button,select,input,label) { font: inherit; }
.lc-shell :is(button,select,input) { accent-color: var(--teal); }
.lc-shell :is(button,select,summary,label:has(input)) { cursor: pointer; }
.lc-shell :focus-visible {
  outline: 3px solid #a64823;
  outline-offset: 3px;
}
.lc-shell a { color: var(--teal); text-underline-offset: .19em; text-decoration-thickness: 1px; }
.lc-shell a:hover { text-decoration-thickness: 2px; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

.masthead {
  position: relative;
  padding: clamp(1.8rem, 3.7vw, 3.4rem) clamp(1rem, 5vw, 5rem) clamp(2rem, 3.6vw, 3.6rem);
  color: #f5edda;
  background: radial-gradient(ellipse at 80% 140%, #2c4643, transparent 64%), #14272a;
}
.masthead::after {
  content: "";
  position: absolute;
  inset: auto clamp(1rem, 5vw, 5rem) 0;
  height: 5px;
  background: repeating-linear-gradient(90deg,#b9c8af 0 1px,transparent 1px 8px);
  opacity: .65;
}
.folio, .house-label, .case-strip label, .house-note,
.candidate-counter, .certainty-readout, .orientation, .values {
  font-family: var(--mono);
}
.folio {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .35rem 1rem;
  margin: 0 0 .7rem;
  color: #c6d6c3;
  font-size: .73rem; letter-spacing: .12em; text-transform: uppercase;
}
.folio a, .masthead a { color: #e3e8cd; }
.masthead h1 {
  margin: 0;
  max-width: 16ch;
  color: #fff3d9;
  font: 400 clamp(3rem, 6.8vw, 6.75rem)/1 var(--serif);
  letter-spacing: -.055em;
  text-wrap: balance;
}
.intro {
  max-width: 67ch; margin: 1rem 0 0;
  color: #e1e4d5; font-size: clamp(1.04rem, 1.65vw, 1.32rem); line-height: 1.45;
}

.instrument {
  padding: clamp(1.25rem, 3.4vw, 3.1rem) clamp(1rem, 3.8vw, 3.8rem) clamp(1.5rem, 3vw, 3rem);
  background-color: var(--sheet);
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, #56442105 3px 4px);
  border-block: 1px solid #b8b49c;
}
.instrument h2, .instrument h3, .field-notes h2, .field-notes h3 { font-family: var(--serif); font-weight: 400; }
.case-strip {
  display: flex; align-items: center; flex-wrap: wrap; column-gap: 1rem; row-gap: .45rem;
  border-top: 2px solid var(--ink); padding-block: .7rem .95rem;
}
.case-strip label {
  color: var(--sub); font-size: .73rem; text-transform: uppercase; letter-spacing: .07em;
}
.case-select {
  max-width: 100%;
  min-height: 2.6rem; padding: .3rem 1.8rem .3rem .65rem;
  border-radius: 2px; border: 1px solid #747d70;
  background: #f8f4e8; color: var(--ink);
}
.case-note { margin: 0; color: var(--sub); font-size: 1rem; }
.desk-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(230px, .82fr); align-items: stretch; gap: 0; }
.scene-column, .measurements { min-width: 0; }
.scene-column {
  background: var(--night); color: #f4ecda;
  border: 1px solid var(--deep);
  box-shadow: 0 4px 5px -4px #151e17;
}
.scene {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: clamp(.4rem, 2.5vw, 2rem);
  align-items: end;
  padding: 1.35rem clamp(.9rem, 3.4vw, 2.85rem) 0;
  background:
    radial-gradient(ellipse at 13% 100%, #84684a57, transparent 52%),
    linear-gradient(0deg, #465953, #253e43 40%, #152831 85%);
}
.scene::before {
  content: "";
  position: absolute; z-index: -1; inset: 0; pointer-events: none;
  opacity: .08;
  background: repeating-linear-gradient(0deg,transparent 0 3px,#aac1ba 3px 4px);
}
.facade {
  min-width: 0; margin: 0;
  display: flex; flex-direction: column; align-items: center;
}
.facade figcaption {
  align-self: stretch;
  min-height: 3.9rem; margin-bottom: .65rem;
  color: #f2e9d4; text-align: center; line-height: 1.25;
}
.house-label { display: block; font-size: .84rem; letter-spacing: .025em; }
.house-note { display: block; margin-top: .28em; color: #bdcec6; font-size: .68rem; }
.window-grid {
  --stone: #3d4847;
  --frame: #151f23;
  --edge: #71807a;
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); grid-template-rows: repeat(4,1fr);
  width: min(100%, 264px); aspect-ratio: .93;
  gap: 9% 10%;
  padding: 8% 7% 9%;
  border-inline: 2px solid #233034;
  border-top: 5px solid #71807a;
  box-shadow: inset 4px 0 0 #a4a8942f, inset -4px 0 0 #101d22a6;
  background:
    repeating-linear-gradient(0deg,transparent 0 calc(24% - 5px),#515e59 calc(24% - 5px) calc(24% - 2px),#253235 calc(24% - 2px) 24%),
    repeating-linear-gradient(0deg,transparent 0 7px,#14222845 7px 8px),
    linear-gradient(90deg,#344346,var(--stone) 35%,#364248);
}
.possible-house .window-grid { --stone: #4d5048; }
.window-grid::before {
  content: "";
  z-index: -1; position: absolute; inset: -1rem -3% auto; height: .86rem;
  border-top: 2px solid #89948a;
  background: linear-gradient(#454f4b 0 38%,#273032 38% 67%,#737b6c 67% 85%,#2b3434 85%);
  box-shadow: 0 3px 3px #0d161b77;
}
.window-grid::after {
  content: ""; position: absolute; z-index: -2;
  right: 12%; top: -1.75rem; width: 9%; height: 1.65rem;
  border-top: 3px solid #6c7770;
  background: linear-gradient(90deg,#26373b 55%,#3c4845 55%);
}
.possible-house .window-grid::after { left: 13%; right: auto; }
.window-grid .window {
  position: relative; display: block; align-self: stretch;
  min-width: 0; min-height: 0; width: 100%; height: 100%; padding: 0;
  border-radius: 1px 1px 0 0;
  border: 1px solid var(--frame);
  color: transparent;
  box-shadow: 0 -2px 0 var(--edge), 0 2px 0 #111f24, 0 4px 0 #718078, inset 0 1px 3px #0006;
  background-color: #15252c;
  background-image: linear-gradient(120deg,#34464b55,transparent 55%);
}
.window::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg,transparent 0 calc(50% - .6px),#192525a6 calc(50% - .6px) calc(50% + .6px),transparent calc(50% + .6px)),
    linear-gradient(0deg,transparent 0 calc(65% - .6px),#19252599 calc(65% - .6px) calc(65% + .6px),transparent calc(65% + .6px));
}
.window-grid .window[data-on="true"] {
  background: linear-gradient(145deg,#ffe9a9,#ffd18b 49%,#ecab60);
  box-shadow: 0 -2px 0 var(--edge), 0 2px 0 #142125, 0 4px 0 #8f927e, 0 0 11px #ffcc7e4d, inset 0 0 0 1px #fff2c06e;
}
.window-grid button.window:hover, .window-grid button.window:focus-visible {
  z-index: 2; outline: 2px solid white; outline-offset: 3px;
}
.show-certainty .window[data-certainty="open"] { outline: 2px dashed #f9b988; outline-offset: 2px; }
.show-certainty .window[data-certainty="lit"], .show-certainty .window[data-certainty="dark"] {
  outline: 2px solid #bce7da; outline-offset: 2px;
}

.scene-foot, .certainty-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  column-gap: 1rem; row-gap: .5rem;
  padding: .85rem clamp(.85rem, 2vw, 1.4rem);
}
.scene-foot {
  position: relative; border-top: 5px solid #7a8270;
  box-shadow: 0 -3px 0 #19252a;
}
.swap-button, .reset-button {
  border-radius: 2px;
  font-family: var(--mono); font-size: .85rem; line-height: 1.35;
}
.swap-button {
  min-height: 2.75rem; padding: .58rem .95rem;
  border: 1px solid #ffd791; background: var(--lamp); color: #202a25;
  box-shadow: 0 2px 0 #7d6139;
}
.swap-button:hover { background: #ffdb9d; }
.swap-button:disabled { cursor: default; background: #394949; border-color: #667976; color: #d3d9d1; box-shadow: none; }
.scene-column :is(button,input):focus-visible { outline-color: #fff2bd; }
.candidate-counter { color: #e2e6d7; font-size: .76rem; font-variant-numeric: tabular-nums; }
.certainty-bar {
  border-top: 1px solid #3e5354;
  background: #15282d; font-size: .9rem; line-height: 1.35;
}
.certainty-bar label { display: inline-flex; align-items: center; gap: .45rem; }
.certainty-bar input { accent-color: #ffe0a2; }
.certainty-readout { margin: 0; color: #c6d5cb; font-size: .72rem; }
.measurements {
  padding: 1rem clamp(1rem,2vw,1.6rem);
  border: 1px solid #9b9f8d; border-left: 0;
  background: var(--paper);
}
.measurements h2 { margin: 0 0 .15rem; font-size: clamp(1.6rem,2.5vw,2.1rem); letter-spacing: -.04em; line-height: 1.16; }
.measurements p { margin: .4rem 0 .75rem; font-size: .94rem; line-height: 1.45; }
.directions { padding: 0; border: 0; margin: .75rem 0 0; }
.direction {
  display: grid; grid-template-columns: 1.1rem minmax(0,1fr); align-items: center; column-gap: .55rem;
  padding: .58rem 0; border-top: 1px solid #a9ab98;
  line-height: 1.28;
}
.direction input, .certainty-bar input { width: 1.08rem; height: 1.08rem; margin: 0; }
.direction-name { font-family: var(--mono); font-size: .85rem; }
.direction .orientation, .direction .values { grid-column: 2; }
.direction .orientation { margin-top: .13rem; color: var(--sub); font-size: .66rem; }
.direction .values {
  display: block; margin-top: .35rem;
  font-size: .86rem; font-variant-numeric: tabular-nums; letter-spacing: .04em;
  color: var(--rust);
}
.direction:has(input:not(:checked)) .values { color: var(--sub); }
.reset-button {
  min-height: 2.6rem; padding: .4rem .65rem;
  border: 1px solid #839183; color: var(--ink); background: transparent;
}
.reset-button:hover { background: #dde2d1; }
.reset-button:disabled { color: #5e695e; border-color: #adae9e; background: transparent; cursor: default; }
.case-strip .reset-button { margin-left: auto; }
.window-answer { margin: 0; padding: .5rem 1rem; background: #20383a; color: #e2e7d5; font: .78rem/1.55 var(--mono); }
.window-answer:empty { display: none; }
.no-script { padding: .7rem; border: 1px solid var(--rust); }

.field-notes {
  padding: clamp(2.2rem, 5vw, 5rem) max(clamp(1rem, 7vw, 7rem), calc((100% - 74ch) / 2));
  background: #f5f0e3;
  color: var(--ink);
  font-size: clamp(1.06rem, 1.4vw, 1.2rem);
  line-height: 1.65;
}
.field-notes h2, .field-notes h3 { line-height: 1.14; text-wrap: balance; }
.field-notes h2 { margin: 0 0 .65em; font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -.055em; }
.field-notes h3 { margin: 0 0 .55em; font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -.035em; }
.field-notes section + section { border-top: 1px solid var(--ruling); padding-top: 1.65rem; margin-top: 2.2rem; }
.field-notes p { margin: .7em 0; }
.field-notes table {
  width: 100%; margin-block: 1.25rem;
  border-collapse: collapse; border-block: 2px solid #6a796e;
  font-family: var(--mono); font-size: clamp(.72rem,1.1vw,.86rem); line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.field-notes caption { padding-bottom: .4rem; text-align: left; color: var(--sub); }
.field-notes :is(th,td) { padding: .55rem .4rem; border-bottom: 1px solid #c3c5b5; text-align: left; vertical-align: top; }
.field-notes th { font-weight: 600; }
.field-notes figure {
  margin: 1.25rem 0; padding: 1rem clamp(.75rem, 2.5vw, 1.5rem);
  color: #f0eddb; background: #1a3034; border-left: 4px solid var(--lamp);
}
.field-notes pre { max-width: 100%; overflow: auto; font: .94rem/1.5 var(--mono); }
.field-notes figure pre { color: #ffe0a0; }
.field-notes :is(figcaption,summary) { font: .84rem/1.6 var(--mono); }
.field-notes details { margin: 1rem 0; padding: .7rem 0; border-block: 1px solid var(--ruling); }
.field-notes summary { color: var(--teal); }
.field-notes a:focus-visible { border-radius: 1px; }

@media (min-width: 1000px) {
  .masthead::before {
    content: "";
    position: absolute; inset: 26% 8% auto auto;
    width: clamp(7.5rem, 13vw, 11rem); aspect-ratio: 1;
    pointer-events: none; border-radius: 50%;
    color: #c7cfac70;
    background:
      radial-gradient(circle, #eece8f 0 2px, transparent 2.5px),
      radial-gradient(circle closest-side, transparent 0 64%, currentColor 64.5% 65%, transparent 66% 84%, currentColor 84.5% 85%, transparent 86% 96%, currentColor 96.5% 97%, transparent 98%),
      repeating-conic-gradient(from -.35deg, currentColor 0 .7deg, transparent .8deg 45deg);
  }
  .masthead .intro { max-width: min(67ch, 72%); }
}
@media (max-width: 820px) {
  .desk-layout { grid-template-columns: 1fr; }
  .measurements { border-left: 1px solid #9b9f8d; border-top: 0; }
  .directions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); column-gap: 1rem; }
  .window-grid { max-width: 218px; }
  .scene { padding-inline: clamp(.7rem,7vw,3rem); }
}
@media (max-width: 520px) {
  .instrument { padding-inline: .8rem; }
  .masthead { padding-inline: 1.1rem; }
  .masthead h1 { max-width: 11ch; }
  .case-strip { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .4rem .5rem; }
  .case-select { width: 100%; padding-right: .25rem; }
  .case-note { grid-column: 1 / -1; order: 1; font-size: .9rem; }
  .case-strip .reset-button { font-size: .75rem; padding: .25rem .4rem; }
  .scene { gap: clamp(.7rem,4.2vw,1.3rem); padding-inline: clamp(.65rem,3.3vw,1rem); }
  .facade figcaption { min-height: 4rem; margin-bottom: .6rem; }
  .house-label { font-size: .73rem; }
  .house-note { font-size: .64rem; }
  .window-grid { padding: 7% 5% 8%; gap: 8% 9%; aspect-ratio: .8; }
  .scene-foot, .certainty-bar { padding: .65rem .75rem; }
  .candidate-counter, .certainty-readout { font-size: .7rem; }
  .field-notes { padding-inline: 1.15rem; }
}
@media (max-width: 350px) {
  .directions { grid-template-columns: 1fr; }
  .scene { padding-inline: .5rem; gap: .8rem; }
}
@media (forced-colors: active) {
  .window-grid .window { forced-color-adjust: none; border-color: CanvasText; background: Canvas; box-shadow: none; }
  .window-grid .window[data-on="true"] { background: Highlight; box-shadow: inset 0 0 0 3px Canvas; }
  .window-grid .window:focus-visible { outline-color: Highlight; }
  .show-certainty .window[data-certainty] { outline-color: CanvasText; }
}
@media print {
  .lantern, .masthead, .instrument, .field-notes, .measurements { background: white; color: black; }
  .masthead, .instrument, .field-notes { padding: .5cm 0; }
  .masthead h1 { color: black; font-size: 34pt; }
  .masthead .intro, .masthead .folio, .masthead a { color: black; }
  .scene-column { break-inside: avoid; }
  .window-grid, .scene, .scene-foot, .certainty-bar, .field-notes figure {
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .field-notes h2, .field-notes h3 { break-after: avoid; }
  .field-notes table, .field-notes figure { break-inside: avoid; }
  .field-notes a { text-decoration: underline; }
}
