/* Check your thinking: the plumb line, five quick puzzles, and the evidence. Tokens only. */

/* The first screen is the instrument, so the room head and the part above it stay compact. */
#try { padding-top: var(--s4); }
#try > .wrap > h2 { margin-bottom: var(--s4); }

.plumb {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--s5) clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}

/* ---------- The figure ---------- */
.plumb-fig { margin: 0; position: sticky; top: var(--s4); }
.plumb-stage { position: relative; aspect-ratio: 548 / 440; }
.pl-svg { width: 100%; height: 100%; overflow: visible; }
.pl-ground { stroke: var(--hair); stroke-width: 1; }
.pl-footing, .pl-coping { fill: var(--paper); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.pl-brick { fill: var(--paper-2); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.pl-bar { fill: var(--ink); }
.pl-knot { fill: var(--ink); }
.pl-cord { stroke: var(--ink); stroke-width: 1.5; }
.pl-bob { fill: var(--ink); }
.pl-wedge { fill: var(--yellow); opacity: 0; transition: opacity var(--t-slow) var(--ease) 600ms; }
.pl-true { stroke: var(--blue); stroke-width: 1.5; stroke-dasharray: 3 5; opacity: 0; transition: opacity var(--t-slow) var(--ease) 300ms; }
.pl-measure line { stroke: var(--ink); stroke-width: 1.5; }
.pl-measure { opacity: 0; transition: opacity var(--t-slow) var(--ease) 900ms; }
.is-measured .pl-wedge, .is-measured .pl-true, .is-measured .pl-measure { opacity: 1; }

/* Course names sit to the left of the line, level with their course. */
.pl-label {
  position: absolute;
  transform: translateY(-50%);
  display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; column-gap: var(--s2);
  max-width: 30%;
  text-align: right;
  font-size: var(--fs-small);
  line-height: 1.15;
  color: var(--ink-2);
  font-weight: 500;
}
.pl-label-n { font-weight: 700; }
.is-measured .pl-label-n { display: none; }
.pl-label.is-done { color: var(--ink); }
.pl-label.is-now { color: var(--ink); font-weight: 760; }

.plumb-read { margin-top: var(--s2); text-align: center; font-size: 1.5rem; line-height: 1.2; }
.plumb-read strong { font-weight: 800; }

/* ---------- The panel ---------- */
.plumb-panel { min-width: 0; }
.course-key { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; gap: var(--s2); }
.course-key li { margin: 0; }
.course-key .brick { display: block; width: 30px; height: 14px; border: var(--bw-strong) solid var(--hair); background: var(--paper); }
.course-key li.is-done .brick { border-color: var(--ink); background: var(--ink); }
.course-key li.is-now .brick { border-color: var(--ink); }

.step-title { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem); letter-spacing: -0.02em; margin: 0 0 var(--s3); font-weight: 820; }
.step-title:focus { outline: none; }
.step-title:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.step-n { display: inline-block; min-width: 1.1em; color: var(--ink-2); font-weight: 400; }
.step p { max-width: 36rem; }
.step strong { font-weight: 750; }
.step .anchor { font-size: 1.5em; font-weight: 820; letter-spacing: -0.01em; }

.choice { display: flex; flex-wrap: wrap; gap: var(--s3); width: fit-content; margin: var(--s4) 0; }
.choice .btn { min-width: 7.5rem; }
.then { margin-top: var(--s5); padding-top: var(--s4); border-top: var(--bw) solid var(--hair); }

/* Number inputs. */
.num-in {
  width: 4.75em; min-height: 44px; padding: 0 var(--s3);
  border: var(--bw) solid var(--ink); border-radius: var(--r-control);
  background: var(--paper); font-size: var(--fs-body);
  font-variant-numeric: tabular-nums lining-nums; text-align: right;
}
.num-in.wide { width: 7.5em; }
.num-in:disabled { color: var(--ink-2); border-color: var(--hair); }
.form-msg { min-height: 1.6em; margin: var(--s2) 0 0; font-size: var(--fs-small); color: var(--ink-2); }
.form-msg:empty { min-height: 0; }

/* 1. The number rule. */
.triple { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); width: fit-content; margin: var(--s4) 0 0; }
.triple .btn { margin-left: var(--s2); }
.tests { list-style: none; margin: var(--s3) 0 0; padding: 0; max-height: 12.5rem; overflow-y: auto; }
.tests li { display: flex; justify-content: space-between; gap: var(--s4); margin: 0; padding: var(--s2) 0; border-top: var(--bw) solid var(--hair); font-size: var(--fs-small); }
.tests li:last-child { border-bottom: var(--bw) solid var(--hair); }
.tests .trip { font-weight: 700; }
.tests .verdict { display: inline-flex; align-items: center; gap: var(--s2); }
.tests .verdict::before { content: ""; width: 14px; height: 8px; border: var(--bw-strong) solid var(--ink); }
.tests .yes .verdict::before { background: var(--ink); }
.tests .no .verdict { color: var(--ink-2); }
.rule-pick { margin-top: var(--s5); }
.rule-pick fieldset { border: 0; margin: 0 0 var(--s3); padding: 0; min-width: 0; }
.rule-pick legend { padding: 0; margin-bottom: var(--s2); font-weight: 650; }
.rule-list { display: grid; gap: 0; }
.rule-opt { display: flex; align-items: center; gap: var(--s3); min-height: 44px; cursor: pointer; font-size: var(--fs-small); line-height: 1.3; }
.rule-opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; }

/* 3. The arch: a number line on a ratio scale. */
.guess { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.guess label { flex-basis: 100%; font-weight: 650; }
.with-unit { display: inline-flex; align-items: center; gap: var(--s2); }
.unit, .to { color: var(--ink-2); font-size: var(--fs-small); }
.guess .form-msg { flex-basis: 100%; }
.nl { position: relative; height: 92px; margin: var(--s4) 0 var(--s4); }
.nl-axis { position: absolute; left: 0; right: 0; top: 46px; border-top: var(--bw-strong) solid var(--ink); }
.nl-lean { position: absolute; top: 41px; height: 12px; background: var(--yellow); }
.nl-mark { position: absolute; top: 34px; width: 0; height: 26px; border-left: var(--bw-strong) solid var(--ink); }
.nl-t { position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: var(--fs-small); font-weight: 650; }
.nl-truth .nl-t, .nl-anchor .nl-t { top: 30px; }
.nl-guess { top: 38px; height: 0; border: 0; }
.nl-guess::before { content: ""; position: absolute; left: -8px; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: var(--bw-strong) solid var(--paper); }
.nl-guess .nl-t { bottom: 14px; }
.nl-anchor { border-left-style: dashed; }
.nl-mark:first-of-type .nl-t { transform: translateX(-50%); }

/* 4. The plans: option A is blue, option B is ink on lamp yellow (the site's two options). */
.plans { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.btn.plan { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; justify-items: start; gap: var(--s1); width: 100%; padding: var(--s3) var(--s4); text-align: left; line-height: 1.35; font-weight: 500; font-size: var(--fs-small); }
.plan-name { font-weight: 800; font-size: 1.0625rem; }
.plan-a .plan-name { color: var(--blue); }
.plan-b .plan-name { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 0.3em; text-underline-offset: -0.08em; text-decoration-skip-ink: none; }
.btn.plan[aria-pressed="true"] .plan-name { color: var(--paper); }
.btn.plan:disabled { opacity: 1; cursor: default; }
.btn.plan:disabled:not([aria-pressed="true"]) { border-color: var(--hair); color: var(--ink-2); }
.choice .btn:disabled { opacity: 1; cursor: default; }
.choice .btn:disabled:not([aria-pressed="true"]) { border-color: var(--hair); color: var(--ink-2); }

/* 5. The ranges. */
.range-row { padding: var(--s3) 0; border-top: var(--bw) solid var(--hair); }
.range-row:first-child { margin-top: var(--s3); }
.range-q { margin: 0 0 var(--s2); font-size: var(--fs-small); font-weight: 600; line-height: 1.35; }
.range-in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); width: fit-content; }
.range-res { margin: var(--s2) 0 0; font-size: var(--fs-small); }
.range-row.miss .range-res strong { text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 0.3em; text-underline-offset: -0.08em; text-decoration-skip-ink: none; }
.ranges > p:last-child { margin-top: var(--s3); }

/* Reveals: a rule and a few sentences, never a box. */
.reveal { margin-top: var(--s5); padding-top: var(--s4); border-top: var(--bw-strong) solid var(--ink); }
.reveal:focus { outline: none; }
.reveal-big { font-size: clamp(1.1875rem, 1rem + 0.6vw, 1.4375rem); line-height: 1.32; font-weight: 650; letter-spacing: -0.01em; }
.reveal p { max-width: 36rem; }
.reveal-course { font-size: var(--fs-small); color: var(--ink-2); }
.reveal-course strong { color: var(--ink); }
.reveal-next { margin-top: var(--s4); }

/* The end. */
.end-list { list-style: none; margin: var(--s4) 0 var(--s5); padding: 0; }
.end-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s4); margin: 0; padding: var(--s3) 0; border-top: var(--bw) solid var(--hair); }
.end-list li:last-child { border-bottom: var(--bw) solid var(--hair); }
.end-name { font-weight: 760; }
.end-amt { font-weight: 700; text-align: right; }
.end-why { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--ink-2); }
.end-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }

/* ---------- What just happened ---------- */
#happened .prose h3 { margin-top: var(--s7); }
.evidence-wrap { margin: var(--s5) 0 var(--s6); }
.evidence tbody th { width: 13%; }
.evidence td:nth-child(2) { width: 22%; }
.evidence .you-col, .evidence td.you { width: 9rem; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }

/* The nested sets: each box holds the tests that fit it and nothing wider. */
.sets { margin: var(--s5) 0 var(--s6); max-width: 48rem; }
.set { border: var(--bw) solid var(--hair); padding: var(--s3) var(--s3) var(--s3); }
.set + .set, .set > .set { margin-top: var(--s3); }
.set-up { border: var(--bw-strong) solid var(--ink); }
.set-name { margin: 0 0 var(--s2); font-size: var(--fs-small); font-weight: 700; }
.set-dots { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); font-size: var(--fs-small); }
.set-dots li { margin: 0; display: inline-flex; align-items: center; gap: var(--s2); }
.set-dots .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); }
.set-dots .eg .dot { background: transparent; border: 1.5px solid var(--ink); }
.set-dots .eg { color: var(--ink-2); }
.set-none { margin: 0 0 var(--s2); font-size: var(--fs-small); color: var(--ink-2); font-style: italic; }
.sets figcaption { margin-top: var(--s3); font-size: var(--fs-small); color: var(--ink-2); }

.left-out { margin-top: calc(var(--s2) * -1); }
.left-out-list { margin: 0; }
.left-out-list > div { padding: var(--s3) 0; border-top: var(--bw) solid var(--hair); }
.left-out-list > div:last-child { border-bottom: var(--bw) solid var(--hair); }
.left-out-list dt { font-weight: 700; }
.left-out-list dd { margin: var(--s1) 0 0; }

/* ---------- Where you'll meet this ---------- */
.meet tbody th { width: 28%; font-size: 1.0625rem; }
.meet td:nth-child(2) { width: 36%; }

/* ---------- Scripture ---------- */
#scripture .verses .verse:last-child { margin-bottom: 0; }

/* ---------- Use it ---------- */
.use .btn { margin-top: var(--s2); }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
  .plumb { grid-template-columns: minmax(0, 1fr); }
  .plumb-fig { position: static; max-width: 30rem; width: 100%; margin-inline: auto; }
}
@media (max-width: 640px) {
  .room-head { padding-block: var(--s5) var(--s3); }
  #try { padding-top: var(--s2); }
  /* Course names hide on phones, so the drawing is cropped to the line and the wall. */
  .plumb-fig { max-width: 15rem; }
  .plumb-stage { aspect-ratio: 472 / 440; overflow: hidden; }
  .pl-svg { width: calc(100% * 548 / 472); max-width: none; height: auto; margin-left: calc(-100% * 76 / 472); }
  .pl-label { display: none; }
  .course-key { justify-content: center; }
  .evidence thead, .meet thead { display: none; }
  .evidence, .evidence tbody, .evidence tr, .evidence th, .evidence td,
  .meet, .meet tbody, .meet tr, .meet th, .meet td { display: block; width: auto !important; }
  .evidence tr, .meet tr { padding: var(--s3) 0; border-bottom: var(--bw) solid var(--hair); }
  .evidence th, .evidence td, .meet th, .meet td { border: 0; padding: 0 0 var(--s1); }
  .evidence td:nth-child(2), .meet td:nth-child(2) { color: var(--ink-2); }
  .evidence td.you::before { content: "Your wall: "; font-weight: 400; color: var(--ink-2); }
  .triple .btn { margin-left: 0; }
  .num-in.wide { width: 6.25em; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-wedge, .pl-true, .pl-measure { transition: none; }
}
