/* Rulingpen product site.
   The look is the viewer's (docs/workstreams/viewer.md, "Identity"): drafting film, India ink,
   rules at ISO pen widths in real millimetres, no shadows, gradients or rounded cards.
   Routed Gothic letters the sheet; anything read off a file or a measurement (numbers,
   commands, file names, prices) is set in B612, where every digit is unmistakable.
   Non-photo blue is construction (hover, selection); redline is checking (what is not
   done, what missed its target). The signature: every page is a sheet with a title block. */

@font-face { font-family: "Routed Gothic"; src: url("/fonts/routed-gothic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Routed Gothic Wide"; src: url("/fonts/routed-gothic-wide.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "B612"; src: url("/fonts/b612-regular.ttf") format("truetype"); font-display: swap; }

:root {
  --film: #e4e9e6;
  --film-raised: #eff2f0;
  --film-worn: #d3dad6;
  --ink: #15191c;
  --ink-soft: #46505a;
  --graphite: #8d989d;
  --guide: #a8dcee;
  --blueprint: #0e6686;
  --redline: #b9261b;
  --canvas: #1c2126;

  --pen-fine: 0.18mm;
  --pen: 0.35mm;
  --pen-bold: 0.7mm;

  --lettering: "Routed Gothic", "DIN Alternate", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --lettering-wide: "Routed Gothic Wide", "Routed Gothic", "DIN Alternate", "Bahnschrift", system-ui, sans-serif;
  --reading: "B612", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
  --measure: 68ch;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--film);
  color: var(--ink);
  font: 17px/1.55 var(--lettering);
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, table { margin: 0; }
img, svg { max-width: 100%; height: auto; }

a { color: var(--blueprint); text-decoration: underline; text-decoration-thickness: var(--pen-fine); text-underline-offset: 3px; }
a:hover { background: var(--guide); color: var(--ink); }
:focus-visible { outline: 2px solid var(--blueprint); outline-offset: 2px; }

.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 8px 12px; background: var(--ink); color: var(--film); }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

code, kbd, samp, pre, .r { font-family: var(--reading); font-size: 0.86em; }
.r { font-size: 0.92em; font-variant-numeric: tabular-nums; }
code { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ bar */

.bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px;
  padding: 10px clamp(12px, 3vw, 28px);
  border-bottom: var(--pen-bold) solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 23px/1 var(--lettering-wide); }
.brand:hover { background: none; }
.mark { width: 28px; height: 28px; fill: none; stroke: var(--ink); stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.mark-line { stroke-width: 2; }
.nav { display: flex; flex-wrap: wrap; gap: 0; margin-left: auto; }
.nav a {
  display: inline-block; padding: 7px 12px; min-height: 36px;
  color: var(--ink); text-decoration: none; border: var(--pen) solid transparent;
}
.nav a:hover { background: var(--guide); }
.nav a[aria-current="page"] { border-color: var(--ink); background: var(--film-raised); }
.nav .nav-view { background: var(--ink); color: var(--film); border-color: var(--ink); margin-left: 8px; }
.nav .nav-view:hover { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }

/* ------------------------------------------------------------------ the sheet */

.sheet {
  max-width: 1180px;
  margin: clamp(10px, 2.2vw, 26px) auto;
  border: var(--pen-bold) solid var(--ink);
  background: var(--film-raised);
  margin-inline: clamp(8px, 2.2vw, 26px);
}
@media (min-width: 1240px) { .sheet { margin-inline: auto; } }
.sheet-body { padding: clamp(18px, 4vw, 48px); }

.prose > * + * { margin-top: 0.9em; }
.prose p, .prose li { max-width: var(--measure); }
.prose h2 { margin-top: 1.9em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }

h1 { font: 44px/1.08 var(--lettering-wide); text-wrap: balance; letter-spacing: 0.005em; }
h2 { font: 28px/1.15 var(--lettering-wide); text-wrap: balance; }
h3 { font: 21px/1.2 var(--lettering-wide); }
h4 { font: 18px/1.25 var(--lettering); }
.lede { font-size: 20px; line-height: 1.5; color: var(--ink); max-width: 60ch; margin-top: 14px; }
.soft { color: var(--ink-soft); }
.small { font-size: 15px; }

.rule { border: 0; border-top: var(--pen) solid var(--ink); margin: 34px 0; }

/* Section with a lettered caption, like a view label on a drawing. */
.view-label { display: flex; align-items: baseline; gap: 12px; margin: 44px 0 16px; padding-bottom: 6px; border-bottom: var(--pen) solid var(--ink); }
.view-label h2 { margin: 0; }
.view-label .tag { font: 13px/1 var(--reading); color: var(--ink-soft); }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 18px;
  background: var(--film-raised); color: var(--ink);
  border: var(--pen) solid var(--ink); border-radius: 0;
  text-decoration: none; white-space: nowrap; font: inherit;
}
.btn:hover { background: var(--guide); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--film); }
.btn-ink:hover { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }
.btn[aria-disabled="true"] { color: var(--ink-soft); border-color: var(--graphite); background: transparent; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ------------------------------------------------------------------ home */

.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.drawing {
  position: relative; margin: 0;
  border: var(--pen-bold) solid var(--ink); background: var(--canvas);
}
.drawing img { display: block; width: 100%; }
.drawing .titleblock { position: absolute; right: 0; bottom: 0; }
.drawing figcaption { padding: 6px 10px; background: var(--film); border-top: var(--pen) solid var(--ink); font-size: 15px; color: var(--ink-soft); }

.columns { display: grid; gap: 22px 34px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.columns > div > h3 { margin-bottom: 6px; }

/* ------------------------------------------------------------------ title block (signature) */

.titleblock {
  display: grid; grid-template-columns: repeat(4, auto);
  background: var(--film); color: var(--ink);
  border-top: var(--pen-bold) solid var(--ink); border-left: var(--pen-bold) solid var(--ink);
  max-width: min(100%, 560px);
}
.tb-cell { padding: 3px 12px 5px 8px; border-right: var(--pen) solid var(--ink); border-bottom: var(--pen) solid var(--ink); min-width: 0; }
.tb-cell dt { font-size: 11px; line-height: 1.25; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-soft); }
.tb-cell dd { font: 14px/1.35 var(--reading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-wide { grid-column: 1 / -1; border-right: 0; }
.tb-wide dd { font: 17px/1.3 var(--lettering-wide); white-space: normal; }
.tb-last { border-right: 0; }
.tb-bottom { border-bottom: 0; }

.sheet-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; border-top: var(--pen-bold) solid var(--ink); }
.sheet-foot .titleblock { border-top: 0; }
.foot-notes { padding: 12px clamp(14px, 3vw, 22px); font-size: 14.5px; color: var(--ink-soft); }
.foot-notes p + p { margin-top: 6px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot-links a { color: var(--ink); }

/* ------------------------------------------------------------------ numbers */

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); border-top: var(--pen) solid var(--ink); border-left: var(--pen) solid var(--ink); margin-top: 18px; }
.figure { padding: 12px 14px 14px; border-right: var(--pen) solid var(--ink); border-bottom: var(--pen) solid var(--ink); background: var(--film-raised); }
.figure .value { font: 34px/1.1 var(--reading); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.figure .value small { font-size: 16px; }
.figure .what { margin-top: 4px; }
.figure .how { margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
.figure.short { border-left: 5px solid var(--redline); }
.figure.short .value { color: var(--redline); }
.met, .missed { font: 13px/1 var(--lettering); padding: 2px 6px; border: var(--pen) solid currentColor; white-space: nowrap; display: inline-block; }
.missed { color: var(--redline); }
.met { color: var(--ink); }

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; margin-top: 16px; border: var(--pen) solid var(--ink); background: #fff; }
.table-wrap:focus-visible { outline-offset: 3px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: var(--pen-fine) solid var(--graphite); border-right: var(--pen-fine) solid var(--graphite); }
th:last-child, td:last-child { border-right: 0; }
thead th { background: var(--film-worn); border-bottom: var(--pen) solid var(--ink); font-weight: normal; font-family: var(--lettering-wide); font-size: 15px; }
tbody th { font-weight: normal; font-family: var(--lettering-wide); }
tbody tr:last-child > * { border-bottom: 0; }
td.n, th.n { text-align: right; font-family: var(--reading); font-size: 14.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .src { display: block; margin-top: 4px; font-size: 13.5px; color: var(--ink-soft); }
tr.ours > * { background: var(--film-raised); }
.wide-table table { min-width: 860px; }

/* ------------------------------------------------------------------ pricing */

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); border-top: var(--pen) solid var(--ink); border-left: var(--pen) solid var(--ink); margin-top: 22px; }
.tier { display: flex; flex-direction: column; padding: 16px 16px 18px; border-right: var(--pen) solid var(--ink); border-bottom: var(--pen) solid var(--ink); background: var(--film-raised); }
.tier h3 { font-size: 23px; }
.tier .price { margin-top: 10px; font: 34px/1 var(--reading); font-variant-numeric: tabular-nums; }
.tier .per { font: 15px/1.2 var(--lettering); color: var(--ink-soft); margin-top: 4px; }
.tier ul { padding-left: 1.1em; margin-top: 12px; font-size: 15.5px; }
.tier li + li { margin-top: 4px; }
.tier .actions { margin-top: auto; padding-top: 16px; }
.tier .btn { width: 100%; }
.tier.free { background: #fff; }
.tier .not-yet { margin-top: 12px; padding-left: 10px; border-left: 4px solid var(--redline); font-size: 15px; }

.note { margin-top: 18px; padding: 10px 14px; border: var(--pen) solid var(--ink); background: var(--film); max-width: 78ch; }
.note.check { border-left: 6px solid var(--redline); }

/* ------------------------------------------------------------------ code */

pre {
  margin: 14px 0 0; padding: 12px 14px; overflow-x: auto;
  background: var(--canvas); color: #e9eef0;
  border: var(--pen) solid var(--ink); line-height: 1.5; font-size: 14px;
}
pre code { font-size: inherit; overflow-wrap: normal; }
:not(pre) > code { padding: 0 3px; background: var(--film); border: var(--pen-fine) solid var(--graphite); }
pre:focus-visible { outline-offset: 3px; }

/* ------------------------------------------------------------------ manual */

.manual { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.toc { font-size: 15.5px; }
.toc h2 { font-size: 19px; margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; border-top: var(--pen) solid var(--ink); }
.toc li { border-bottom: var(--pen-fine) solid var(--graphite); }
.toc a { display: block; padding: 6px 4px; color: var(--ink); text-decoration: none; }
.toc a:hover { background: var(--guide); }
.toc a[aria-current="page"] { background: var(--ink); color: var(--film); }
.prose table { margin-top: 14px; }
.prose .table-wrap table { margin: 0; }

dl.facts { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr); max-width: 80ch; margin-top: 14px; }
dl.facts dt, dl.facts dd { padding: 6px 0; border-bottom: var(--pen-fine) solid var(--graphite); }
dl.facts dt { color: var(--ink-soft); padding-right: 12px; }

/* ------------------------------------------------------------------ larger screens */

@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; }
  .manual { grid-template-columns: 240px minmax(0, 1fr); }
  .toc { position: sticky; top: 16px; align-self: start; }
}

/* ------------------------------------------------------------------ small screens */

@media (max-width: 700px) {
  body { font-size: 16.5px; }
  h1 { font-size: 34px; }
  h2 { font-size: 24px; }
  .lede { font-size: 18px; }
  .nav { margin-left: 0; width: 100%; }
  .nav a { padding: 6px 9px; }
  .nav .nav-view { margin-left: 0; }
  .sheet-foot { grid-template-columns: minmax(0, 1fr); }
  .sheet-foot .titleblock { border-left: 0; border-top: var(--pen) solid var(--ink); max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-foot .tb-cell:nth-child(even of .tb-cell:not(.tb-wide)) { border-right: var(--pen) solid var(--ink); }
  .drawing .titleblock { position: static; max-width: none; border-left: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure .value { font-size: 30px; }
  dl.facts { grid-template-columns: minmax(0, 1fr); }
  dl.facts dt { border-bottom: 0; padding-bottom: 0; }
}

@media print {
  .bar .nav, .skip { display: none; }
  .sheet { margin: 0; }
}
@media (forced-colors: active) {
  .nav a[aria-current="page"], .toc a[aria-current="page"] { outline: 2px solid Highlight; }
}

.measure { max-width: 78ch; }
.plain-list { margin-top: 18px; padding-left: 1.3em; }
.drawing.shot { margin: 0 0 26px; background: var(--film); }
ol > li::marker { font-family: var(--reading); font-size: 0.9em; }
@media (min-width: 1100px) { .tiers { grid-template-columns: repeat(5, minmax(0, 1fr)); } .tier { padding-inline: 14px; } .tier .price { font-size: 30px; } }
td.small code { background: none; border: 0; padding: 0; }
.tier code { white-space: nowrap; }
.table-wrap + .prose, .table-wrap + p, ol + p.soft, ul + p.soft { margin-top: 16px; }
