/* Index Line. Barlow and Barlow Condensed, SIL Open Font License 1.1,
   The Barlow Project Authors; see /fonts/OFL.txt. */
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #e9efde;
  --sheet: #f1f5e9;
  --grid: #d3dfc4;
  --grid-major: #bccfa8;
  --ink: #1d2919;
  --ink-soft: #4a5a42;
  --rule: #9fb38c;
  --red: #c4221a;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10160e;
    --sheet: #151d12;
    --grid: #1d2819;
    --grid-major: #2a3924;
    --ink: #d8e3ca;
    --ink-soft: #9caf8f;
    --rule: #3d5134;
    --red: #ff6a57;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration-color: var(--red); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.strip {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.7rem clamp(1rem, 3vw, 2rem);
  border-bottom: 1.5px solid var(--ink);
  font: 600 0.95rem/1.2 var(--cond);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.strip a { text-decoration: none; }
.strip .mark { font-size: 1.15rem; letter-spacing: 0.04em; }
.strip .mark::before {
  content: ""; display: inline-block; width: 1.6em; height: 2px; margin-right: 0.45em;
  vertical-align: 0.3em; background: var(--red); transform: rotate(-18deg);
}

main { padding: 0 clamp(1rem, 3vw, 2rem); }

h1, h2, h3 { font-family: var(--cond); font-weight: 600; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.005em; }
h2 {
  font-size: 0.95rem; letter-spacing: 0.1em; text-transform: uppercase;
  margin: 2rem 0 0.6rem; padding-top: 0.5rem; border-top: 1px solid var(--rule);
}
p { margin: 0 0 0.85rem; max-width: 36rem; }
.lede { font-size: 1.2rem; line-height: 1.45; max-width: 34rem; margin-top: 0.8rem; }
.small { font-size: 0.9rem; color: var(--ink-soft); }
ol.directions { margin: 0; padding-left: 1.4rem; max-width: 36rem; }
ol.directions li { margin-bottom: 0.4rem; padding-left: 0.2rem; }
ol.directions li::marker { font-family: var(--cond); font-weight: 600; color: var(--red); }
.sources { font-size: 0.9rem; padding-left: 1.2rem; max-width: 38rem; }
.sources li { margin-bottom: 0.45rem; }
code, .f { font-family: var(--cond); font-weight: 500; font-size: 1.08em; letter-spacing: 0.02em; }

/* A sheet: chart on the left, text on the right. */
.sheet {
  display: grid; gap: clamp(1.5rem, 3vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
  padding: 1.5rem 0 2rem;
}
@media (min-width: 960px) {
  .sheet { grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); align-items: start; }
  .sheet .chart { position: sticky; top: 1rem; }
}
.chart {
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
  border: 1.5px solid var(--ink);
  margin: 0;
}
.chart svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.chart figcaption {
  border-top: 1.5px solid var(--ink); padding: 0.45rem 0.75rem;
  font: 500 0.92rem/1.3 var(--cond); letter-spacing: 0.03em; color: var(--ink-soft);
}

/* Nomogram drawing. */
.nomo .axis { stroke: var(--ink); stroke-width: 1.6; }
.nomo .tick { stroke: var(--ink); stroke-width: 1.1; }
.nomo .tick.minor { stroke-width: 0.8; }
.nomo .tick-label { fill: var(--ink); font: 500 14px var(--cond); }
.nomo .scale-name { fill: var(--ink); font: 600 15px var(--cond); letter-spacing: 0.08em; text-transform: uppercase; }
.nomo .scale-unit { fill: var(--ink-soft); font: 500 14px var(--cond); }
.nomo .index-line { stroke: var(--red); stroke-width: 2; stroke-linecap: round; }
.nomo .cross { fill: var(--sheet); stroke: var(--red); stroke-width: 2; }
.nomo .hit { fill: transparent; cursor: ns-resize; }
.nomo .handle { cursor: ns-resize; outline: none; }
.nomo .handle-ring { fill: color-mix(in srgb, var(--red) 14%, transparent); stroke: var(--red); stroke-width: 2; }
.nomo .handle-dot { fill: var(--red); }
.nomo .handle:focus-visible .handle-ring { stroke-width: 3.5; }
@media (max-width: 600px) {
  .nomo .tick-label, .nomo .scale-unit { font-size: 22px; }
  .nomo .scale-name { font-size: 21px; letter-spacing: 0.04em; }
  .nomo .handle-ring { r: 15px; }
}

/* Readout under the title. */
.readout {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  border: 1.5px solid var(--ink); margin: 1.2rem 0 0.4rem; max-width: 38rem;
}
.readout div { padding: 0.5rem 0.75rem; border-right: 1px solid var(--rule); }
.readout div:last-child { border-right: 0; }
.readout dt { font: 600 0.78rem/1.2 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); }
.readout dd { margin: 0.15rem 0 0; font: 600 1.6rem/1.1 var(--cond); }
.readout .out dd { color: var(--red); }

/* Title block, as in the corner of a drawing. */
.titleblock {
  display: grid; grid-template-columns: max-content 1fr; max-width: 38rem;
  border: 1.5px solid var(--ink); margin-top: 2rem; font-size: 0.92rem;
}
.titleblock dt, .titleblock dd { margin: 0; padding: 0.35rem 0.7rem; border-bottom: 1px solid var(--rule); }
.titleblock dt { font: 600 0.78rem/1.6 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); border-right: 1px solid var(--rule); }
.titleblock dt:nth-last-of-type(1), .titleblock dd:last-of-type { border-bottom: 0; }

/* Home: the drawing register. */
.register { width: 100%; border-collapse: collapse; margin-top: 0.4rem; border: 1.5px solid var(--ink); }
.register th, .register td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.register th { font: 600 0.78rem/1.3 var(--cond); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); border-bottom: 1.5px solid var(--ink); }
.register td.no { font: 600 1.25rem/1.2 var(--cond); color: var(--red); white-space: nowrap; }
.register td.title a { font: 600 1.25rem/1.2 var(--cond); }
.register tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
  .register thead { display: none; }
  .register, .register tbody, .register tr, .register td { display: block; }
  .register tr { border-bottom: 1px solid var(--rule); padding: 0.4rem 0; }
  .register td { border: 0; padding: 0.15rem 0.75rem; }
}

.nb { display: inline-block; }
.home-head { display: grid; gap: 2rem; padding: 2rem 0 1rem; }
@media (min-width: 960px) { .home-head { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); align-items: start; } }

footer.foot {
  margin-top: 3rem; padding: 0.9rem clamp(1rem, 3vw, 2rem) 1.4rem;
  border-top: 1.5px solid var(--ink);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; justify-content: space-between;
  font: 500 0.9rem/1.4 var(--cond); letter-spacing: 0.04em; color: var(--ink-soft);
}
