@font-face {
  font-family:BarlowDesk;
  src:url("assets/type/BarlowSemiCondensed-SemiBold.ttf") format("truetype");
  font-weight:600;
  font-style:normal;
  font-display:swap;
}

:root {
  --ink:#17233b;
  --quiet:#536278;
  --blue:#2554db;
  --pale:#edf2ff;
  --desk:#e9eef3;
  --line:#cbd3de;
  --ember:#a94b13;
  --peach:#fff1e5;
  --display:BarlowDesk,"Arial Narrow",sans-serif;
  color:var(--ink);
  background:white;
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  font-variant-numeric:tabular-nums;
}

* {
  box-sizing:border-box;
}

body,figure,p,h1,h2,h3 {
  margin:0;
}

a {
  color:var(--blue);
  text-underline-offset:3px;
}

button,select {
  font:inherit;
  color:inherit;
}

button,select,summary {
  cursor:pointer;
}

button:disabled,select:disabled {
  cursor:default;
  opacity:.55;
}

button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #2456dc;
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.skip {
  position:absolute;
  left:10px;
  top:-100px;
  background:white;
  padding:10px;
  z-index:2;
}

.skip:focus {
  top:5px;
}

.shell {
  width:min(1320px,calc(100% - clamp(32px,8vw,140px)));
  margin-inline:auto;
}

header {
  border-bottom:1px solid var(--line);
}

.mast,.mast nav,.brand,.intro,.local,.viewer-head,.viewer-head span,figcaption,.pager,.section-head,footer .shell {
  display:flex;
  align-items:center;
}

.mast {
  justify-content:space-between;
  min-height:74px;
}

.brand {
  gap:10px;
  font:600 32px/.9 var(--display);
  letter-spacing:-.8px;
  color:var(--ink);
  text-decoration:none;
}

.mast nav {
  gap:clamp(15px,3vw,38px);
}

.mast nav a,.text-link,footer a,.viewer-head a {
  font-size:.86rem;
  font-weight:600;
  text-decoration:none;
}

.mast nav a {
  color:var(--ink);
}

a:hover {
  text-decoration:underline;
}

.intro {
  justify-content:space-between;
  gap:16px;
  padding:clamp(25px,3.2vw,46px) 0 24px;
}

h1,h2,h3 {
  font-family:var(--display);
  font-weight:600;
  line-height:1.05;
}

h1 {
  font-size:clamp(43px,4.45vw,70px);
  letter-spacing:-.035em;
}

h2 {
  font-size:clamp(31px,3.2vw,47px);
  letter-spacing:-.025em;
}

h3 {
  font-size:25px;
}

.intro p,.section-head p,.method-note {
  max-width:75ch;
  color:var(--quiet);
  margin-top:8px;
}

.intro p {
  font-size:clamp(15px,1.25vw,18px);
}

.local {
  gap:8px;
  font-size:.8rem;
  white-space:nowrap;
  color:var(--quiet);
}

.local i {
  width:9px;
  height:9px;
  background:var(--blue);
  border-radius:50%;
}

.bench {
  display:grid;
  grid-template-columns:minmax(270px,.79fr) minmax(0,2fr);
  overflow:hidden;
  border:1px solid #aab7c7;
  border-radius:9px;
}

.console {
  padding:clamp(17px,2.1vw,32px);
  border-right:1px solid #aab7c7;
}

.console label {
  display:block;
  font-size:.83rem;
  font-weight:700;
  margin:14px 0 5px;
}

.console label:first-child {
  margin-top:0;
}

select {
  width:100%;
  padding:9px 30px 9px 10px;
  border:1px solid #aebacb;
  background-color:white;
  border-radius:5px;
  font-size:.87rem;
}

.query-text {
  margin:11px 0 0;
  font:600 clamp(21px,1.85vw,29px)/1.16 var(--display);
  letter-spacing:-.012em;
  overflow-wrap:anywhere;
}

.rule {
  margin-top:18px;
  border-top:1px solid var(--line);
}

.hint,.status,#proof-detail {
  font-size:.79rem;
  line-height:1.45;
  color:var(--quiet);
  margin-top:9px;
}

.primary,.secondary {
  min-height:38px;
  border:1px solid var(--blue);
  border-radius:5px;
  font-size:.87rem;
  font-weight:650;
}

.primary {
  margin-top:16px;
  color:white;
  background:var(--blue);
  width:100%;
}

.primary:hover:not(:disabled) {
  background:#1941b6;
}

.secondary {
  margin-top:10px;
  background:white;
  color:var(--ink);
  border-color:#bac4d2;
  padding:5px 13px;
}

.status:empty {
  display:none;
}

#proof {
  border-left:3px solid var(--ember);
  margin-top:17px;
  padding-left:12px;
}

.proof-title {
  font:600 22px/1.1 var(--display);
  color:var(--ember);
}

#proof.settled {
  border-color:var(--blue);
}

#proof.settled .proof-title {
  color:var(--blue);
}

#proof-detail {
  margin-top:4px;
}

.viewer {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  min-width:0;
  background:var(--desk);
}

.viewer-head {
  justify-content:space-between;
  gap:8px;
  border-bottom:1px solid #c5ced9;
  padding:10px 18px;
  background:#f6f8fa;
  font-size:.82rem;
  font-weight:650;
}

.viewer-head span {
  gap:9px;
}

.paper-icon {
  width:11px;
  height:14px;
  border:1.5px solid currentColor;
  border-radius:1px;
  transform:rotate(-8deg);
  box-shadow:2px 2px 0 #b1bdcd;
}

.canvas {
  display:grid;
  place-items:center;
  padding:clamp(17px,2.1vw,32px);
  min-height:260px;
  background-color:var(--desk);
  background-image:radial-gradient(#b9c6d5 .8px,transparent .8px);
  background-size:12px 12px;
}

.canvas img {
  display:block;
  max-width:100%;
  width:auto;
  height:auto;
  max-height:clamp(315px,32vw,466px);
  box-shadow:0 2px 9px #20334c25;
  background:white;
}

.canvas p {
  background:var(--desk);
  padding:8px;
  color:var(--quiet);
}

figcaption {
  justify-content:space-between;
  gap:10px;
  padding:10px 18px;
  background:white;
  border-top:1px solid var(--line);
}

figcaption>div:first-child {
  min-width:0;
}

figcaption strong,figcaption span {
  display:block;
}

figcaption strong {
  font:600 21px/1.2 var(--display);
  overflow-wrap:anywhere;
}

figcaption span {
  font-size:.77rem;
  color:var(--quiet);
}

.pager {
  gap:4px;
}

.pager button {
  width:35px;
  height:35px;
  border:1px solid var(--line);
  border-radius:4px;
  background:white;
  font-size:25px;
  line-height:1;
}

.pager button:hover:not(:disabled),.secondary:hover {
  background:var(--pale);
}

.section-head {
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin-bottom:19px;
}

.section-head p {
  font-size:.94rem;
}

.text-link {
  flex-shrink:0;
}

.ranks-head {
  margin-top:30px;
  margin-bottom:15px;
}

.ranks {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:9px;
  margin-bottom:22px;
}

.rank {
  padding:0;
  text-align:left;
  background:white;
  border:1px solid var(--line);
  border-radius:5px;
  overflow:hidden;
  min-width:0;
}

.rank[aria-pressed="true"] {
  border-color:var(--blue);
  box-shadow:inset 0 0 0 1px var(--blue);
}

.rank:hover {
  border-color:var(--blue);
}

.thumb {
  display:block;
  position:relative;
  background:#f2f5f8;
  padding:7px;
  border-bottom:1px solid var(--line);
  height:72px;
}

.thumb img {
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.rank-num {
  position:absolute;
  top:5px;
  left:6px;
  padding:1px 6px;
  background:white;
  color:var(--ink);
  border:1px solid #c4ccda;
  border-radius:3px;
  font-weight:700;
  font-size:.77rem;
}

.rank[aria-pressed="true"] .rank-num {
  background:var(--blue);
  border-color:var(--blue);
  color:white;
}

.rank-inner {
  display:block;
  padding:9px;
}

.rank-name {
  font-weight:650;
  font-size:.79rem;
  display:block;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
}

.track {
  display:block;
  height:3px;
  position:relative;
  margin:12px 3px 9px;
  background:#dce3ea;
}

.interval {
  position:absolute;
  height:3px;
  background:var(--ember);
}

.interval:before,.interval:after {
  content:"";
  position:absolute;
  top:-2px;
  width:2px;
  height:7px;
  background:var(--ember);
}

.interval:after {
  right:0;
}

.interval.exact:after,.interval.exact:before {
  width:8px;
  height:8px;
  top:-2.5px;
  border-radius:50%;
  background:var(--blue);
}

.range {
  font-size:.76rem;
  color:var(--quiet);
  display:block;
}

.chapter {
  border-top:2px solid var(--ink);
  margin-top:clamp(38px,6vw,82px);
  padding-top:24px;
}

details {
  border-top:1px solid var(--line);
  padding:0 2px;
}

details:last-child {
  border-bottom:1px solid var(--line);
}

summary {
  font-weight:650;
  font-size:.92rem;
  padding:13px 0;
}

details>div {
  padding:0 0 17px;
  color:var(--quiet);
  font-size:.9rem;
}

details p+p,details table {
  margin-top:8px;
}

.table-scroll {
  max-width:100%;
  overflow-x:auto;
}

table {
  width:100%;
  border-collapse:collapse;
  font-size:.87rem;
  font-variant-numeric:tabular-nums;
  text-align:right;
}

th,td {
  padding:9px 12px;
  border-bottom:1px solid var(--line);
  white-space:nowrap;
}

th:first-child,td:first-child {
  text-align:left;
}

thead {
  background:#eef2f6;
  color:var(--quiet);
}

.table-scroll+h3,#measurements h3:not(:first-child) {
  margin-top:25px;
}

#measurements h3 {
  margin-bottom:12px;
}

.diagram {
  display:block;
  margin-top:22px;
  background:#f3f6fa;
  border-radius:7px;
}

.diagram img {
  display:block;
  width:100%;
  height:auto;
}

.method-note {
  font-size:.9rem;
  margin:16px 0 0;
}

footer {
  margin-top:60px;
  border-top:1px solid var(--line);
  padding:18px 0 27px;
}

footer .shell {
  gap:18px;
  flex-wrap:wrap;
}

footer b {
  margin-right:auto;
  font:600 25px var(--display);
}

.record {
  border-top:1px solid var(--line);
  padding:10px 0;
  overflow-wrap:anywhere;
}

.record blockquote {
  margin:8px 0;
  padding-left:10px;
  border-left:2px solid var(--line);
  white-space:pre-wrap;
}

.credit {
  overflow-wrap:anywhere;
}

.error {
  color:#9e3520;
}

.table-note {
  margin:12px 0;
  color:var(--quiet);
  font-size:.87rem;
}

@media(max-width:800px) {
  .shell {
    width:calc(100% - 32px);
  }
  .bench {
    grid-template-columns:minmax(235px,.85fr) minmax(0,1.25fr);
  }
  .ranks {
    gap:5px;
  }
  .rank-inner {
    padding:6px;
  }
  .range {
    font-size:.7rem;
  }
  .section-head {
    align-items:flex-start;
    flex-direction:column;
    gap:7px;
  }
  .canvas img {
    max-height:350px;
  }
}

@media(max-width:640px) {
  .mast {
    min-height:58px;
  }
  .mast nav {
    gap:12px;
  }
  .mast nav a {
    font-size:.75rem;
  }
  .brand {
    font-size:26px;
    gap:6px;
  }
  .brand img {
    width:27px;
    height:27px;
  }
  .intro {
    padding:23px 0 19px;
  }
  .local {
    display:none;
  }
  .bench {
    display:flex;
    flex-direction:column;
  }
  .console {
    border-right:0;
    border-bottom:1px solid #aab7c7;
  }
  .canvas {
    min-height:235px;
    padding:13px;
  }
  .canvas img {
    max-height:330px;
  }
  .ranks {
    display:flex;
    overflow-x:auto;
    padding:3px 2px 9px;
    scroll-snap-type:x proximity;
  }
  .rank {
    min-width:143px;
    scroll-snap-align:center;
  }
  .rank-inner {
    padding:9px;
  }
  .thumb {
    height:78px;
  }
  .range {
    font-size:.76rem;
  }
  .chapter {
    margin-top:36px;
  }
  .diagram {
    overflow-x:auto;
  }
  .diagram img {
    min-width:650px;
  }
  .method-note {
    margin-top:12px;
  }
  footer .shell {
    gap:12px;
  }
  footer a {
    font-size:.77rem;
  }
}

.image-tools {
  display:flex;
  align-items:center;
  gap:14px;
}

.image-tools button {
  padding:3px 8px;
  font-size:.8rem;
  background:white;
  border:1px solid var(--line);
  border-radius:4px;
  color:var(--ink);
}

.canvas.zoomed {
  display:block;
  justify-items:start;
  overflow:auto;
  height:clamp(315px,36vw,520px);
  align-self:stretch;
  min-width:0;
}

.canvas.zoomed img {
  width:auto;
  height:auto;
  max-width:none;
  max-height:none;
}

.canvas:focus-visible {
  outline:3px solid var(--blue);
  outline-offset:-3px;
}

.interval.exact:before {
  display:none;
}

.interval.exact:after {
  right:-4px;
}
