/* Color the Colonies - survey-sheet design system
   Hairlines, graticules, tabular numerals, one warning red. */

:root {
  --paper:      #f6f5f1;
  --paper-2:    #fffefb;
  --paper-sunk: #edebe4;
  --ink:        #16191c;
  --ink-2:      #4a5058;
  --ink-3:      #838a93;
  --rule:       rgba(22, 25, 28, 0.14);
  --rule-2:     rgba(22, 25, 28, 0.07);
  --grat:       rgba(22, 25, 28, 0.055);
  --grat-major: rgba(22, 25, 28, 0.11);

  --v-target:   #0e7c62;
  --v-baseline: #2f6ba3;
  --v-chrom:    #b8761c;
  --v-planar:   #a8392b;
  --v-infeas:   #8c929b;
  --v-timeout:  #6f5aa0;

  --accent:     #a8392b;
  --layer1:     #2f6ba3;
  --layer2:     #b8761c;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "IBM Plex Mono", Menlo, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;

  --gut: clamp(18px, 3.2vw, 44px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d1013; --paper-2: #14181c; --paper-sunk: #090b0d;
    --ink: #e8eaec; --ink-2: #a5adb6; --ink-3: #6d757e;
    --rule: rgba(232, 234, 236, 0.16); --rule-2: rgba(232, 234, 236, 0.08);
    --grat: rgba(232, 234, 236, 0.06); --grat-major: rgba(232, 234, 236, 0.13);
    --v-target: #35c9a4; --v-baseline: #62a8e0; --v-chrom: #e2a54a;
    --v-planar: #e4705e; --v-infeas: #79808a; --v-timeout: #a292d8;
    --accent: #e4705e; --layer1: #62a8e0; --layer2: #e2a54a;
  }
}
:root[data-theme="dark"] {
  --paper: #0d1013; --paper-2: #14181c; --paper-sunk: #090b0d;
  --ink: #e8eaec; --ink-2: #a5adb6; --ink-3: #6d757e;
  --rule: rgba(232, 234, 236, 0.16); --rule-2: rgba(232, 234, 236, 0.08);
  --grat: rgba(232, 234, 236, 0.06); --grat-major: rgba(232, 234, 236, 0.13);
  --v-target: #35c9a4; --v-baseline: #62a8e0; --v-chrom: #e2a54a;
  --v-planar: #e4705e; --v-infeas: #79808a; --v-timeout: #a292d8;
  --accent: #e4705e; --layer1: #62a8e0; --layer2: #e2a54a;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  font-feature-settings: "tnum" 1, "cv05" 1;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ------------------------------------------------------------- structure -- */

.sheet { max-width: 1360px; margin: 0 auto; padding: 0 var(--gut) 96px; }

.masthead {
  border-bottom: 1px solid var(--ink);
  padding: 26px 0 12px;
  margin-bottom: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.masthead h1 {
  font-size: clamp(21px, 2.6vw, 30px);
  font-weight: 620;
  letter-spacing: -0.022em;
  margin: 0 0 3px;
  line-height: 1.1;
}

.masthead .sub {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}

.stamp {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-3);
  text-align: right;
  line-height: 1.8;
  white-space: nowrap;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  display: block;
  margin-bottom: 7px;
}

h2.plate {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  margin: 0 0 4px;
}

p.lede {
  color: var(--ink-2);
  font-size: 13.5px;
  max-width: 74ch;
  margin: 0 0 22px;
}

.figure {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 2px;
  position: relative;
}

.figure > svg { display: block; width: 100%; height: auto; }

/* crop marks - the corner ticks on a plotted sheet */
.figure::before, .figure::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none;
}
.figure::before { top: -1px; left: -1px; border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); }
.figure::after  { bottom: -1px; right: -1px; border-bottom: 2px solid var(--ink); border-right: 2px solid var(--ink); }

.caption {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.65;
  padding: 10px 2px 0;
  max-width: 92ch;
}
.caption b { color: var(--ink-2); font-weight: 500; }

/* ---------------------------------------------------------------- legend -- */

.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 16px; }

.legend .k {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-2);
  letter-spacing: 0.02em; cursor: default;
}
.legend .k i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.legend .k .n { color: var(--ink-3); }

/* ------------------------------------------------------------------ svg -- */

svg text { font-family: var(--mono); fill: var(--ink-2); }
.ax        { font-size: 9.5px; fill: var(--ink-3); }
.ax-title  { font-size: 9.5px; fill: var(--ink-3); letter-spacing: 0.15em; text-transform: uppercase; }
.grat      { stroke: var(--grat); stroke-width: 1; shape-rendering: crispEdges; }
.grat-maj  { stroke: var(--grat-major); stroke-width: 1; shape-rendering: crispEdges; }
.frame     { fill: none; stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.bound     { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.lbl       { font-size: 10px; fill: var(--ink-2); }
.lbl-sm    { font-size: 9px; fill: var(--ink-3); }
.hit       { fill: transparent; cursor: crosshair; }

/* --------------------------------------------------------------- tables -- */

table.ledger { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
table.ledger th {
  text-align: left; font-weight: 500; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--ink-3); padding: 0 10px 7px 0;
  border-bottom: 1px solid var(--ink); white-space: nowrap;
}
table.ledger td { padding: 5px 10px 5px 0; border-bottom: 1px solid var(--rule-2); vertical-align: baseline; }
table.ledger tbody tr:hover { background: var(--paper-sunk); }
table.ledger .num { text-align: right; font-variant-numeric: tabular-nums; }
table.ledger .dim { color: var(--ink-3); }

/* ---------------------------------------------------------------- chips -- */

.chip {
  display: inline-block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px;
  border: 1px solid var(--rule); border-radius: 2px; color: var(--ink-2);
  white-space: nowrap;
}
.chip.on { border-color: currentColor; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }

button.ctl {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  background: transparent; color: var(--ink-2); border: 1px solid var(--rule);
  border-radius: 2px; padding: 5px 10px; cursor: pointer;
}
button.ctl:hover { border-color: var(--ink-2); color: var(--ink); }
button.ctl[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* -------------------------------------------------------------- tooltip -- */

.tip {
  position: fixed; z-index: 60; pointer-events: none; opacity: 0;
  transition: opacity .1s; background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 2px; padding: 8px 10px;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.6; max-width: 340px;
  box-shadow: 0 6px 22px rgba(0,0,0,.14);
}
.tip.on { opacity: 1; }
.tip b { font-weight: 600; }
.tip .w { color: var(--ink-2); display: block; margin-top: 4px; }

/* -------------------------------------------------------------- gallery -- */

.grid { display: grid; gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
@media (min-width: 700px)  { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1080px) { .grid { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--paper-2); padding: 18px 18px 14px; text-decoration: none;
  display: flex; flex-direction: column; gap: 10px; position: relative;
}
.card:hover { background: var(--paper); }
.card:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.card .no {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: 0.14em;
}
.card h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.012em; }
.card p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.card .thumb {
  background: var(--paper); border: 1px solid var(--rule-2); margin-top: auto;
  aspect-ratio: 16 / 9; overflow: hidden;
}
.card .thumb svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ nav -- */

.plate-nav {
  display: flex; gap: 0; flex-wrap: wrap; border: 1px solid var(--rule);
  margin-bottom: 26px; background: var(--paper-2);
}
.plate-nav a {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 8px 11px; text-decoration: none; color: var(--ink-3);
  border-right: 1px solid var(--rule); flex: 1 1 auto; text-align: center; white-space: nowrap;
}
.plate-nav a:last-child { border-right: 0; }
.plate-nav a:hover { color: var(--ink); background: var(--paper); }
.plate-nav a[aria-current] { background: var(--ink); color: var(--paper); }

.stats { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--rule); margin-bottom: 26px; }
.stat { flex: 1 1 140px; padding: 12px 15px; border-right: 1px solid var(--rule); background: var(--paper-2); }
.stat:last-child { border-right: 0; }
.stat .l { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--ink-3); }
.stat .v { font-family: var(--mono); font-size: 22px; letter-spacing: -0.02em; margin-top: 3px; }
.stat .v small { font-size: 12px; color: var(--ink-3); letter-spacing: 0; }

.foot {
  border-top: 1px solid var(--rule); margin-top: 56px; padding-top: 16px;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); line-height: 1.8;
}
.foot a { color: var(--ink-2); }

.loading { font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding: 40px 0; }

/* --- start here ------------------------------------------------------------
   Replaces the old one-line topnav. The ledger, the two write-ups and the
   source are what most readers actually want, and a row of small links buried
   them. Stacked rows with a sentence of context each give them the weight they
   were missing. */
.starthere {
  border: 1px solid var(--rule); background: var(--paper-2);
  margin: 18px 0 30px;
}
.sh-head {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 12px 18px 11px; border-bottom: 1px solid var(--rule);
}
.sh-row {
  display: grid; grid-template-columns: 13.5rem 1fr; gap: 4px 22px;
  padding: 14px 18px; text-decoration: none; color: inherit;
  border-top: 1px solid var(--rule-2);
}
.sh-row:first-of-type { border-top: none; }
.sh-row:hover { background: var(--paper); }
.sh-name {
  font-size: 15px; font-weight: 600; letter-spacing: -0.012em;
  color: var(--ink); display: flex; align-items: baseline; gap: 7px;
}
.sh-row:hover .sh-name { text-decoration: underline; text-underline-offset: 3px; }
.sh-ar { font-size: 12px; color: var(--ink-3); }
.sh-row:hover .sh-ar { color: var(--ink-2); }
.sh-desc { font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }

@media (max-width: 640px) {
  .sh-row { grid-template-columns: 1fr; gap: 5px; }
}
