/* ══════════════════════════════════════════════════════════
   DATAINT.EPISTEME.FYI — the paper
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { background: #07060A; }
body { margin: 0; }

/* A page set the way a printed book of 1543 was set: one narrow column, notes in the margin, a large first
   letter, ruled tables that count their own rows, a catchword at the foot of each part. Night colours, no texture. */
#pp {
  --bg: #07060A; --ink: #DCD7EB; --bright: #F4F2FF; --note: #ABA5C0; --quiet: #9690A8; --rule: #37333F; --rule-2: #23212A;
  --violet: #C8B8E8; --gold: #D4A853;
  --serif: 'EB Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --mono: 'Space Mono', 'SF Mono', ui-monospace, monospace;
  --col: 640px; --side: 210px; --gut: 44px;
  min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--serif); font-size: 20px; line-height: 1.5; font-variant-numeric: oldstyle-nums proportional-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
#pp a { color: var(--bright); text-decoration: none; border-bottom: 1px solid #5A5470; }
#pp a:hover { border-color: var(--bright); }
#pp :focus-visible { outline: 1px solid var(--violet); outline-offset: 3px; }

/* running head */
#rh { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 52px; padding: 0 32px; background: rgba(7,6,10,0.94); border-bottom: 1px solid var(--rule-2); }
#rh .home { display: flex; align-items: center; gap: 9px; border: 0; font-family: 'Cormorant Garamond', var(--serif); font-size: 21px; letter-spacing: 0.05em; color: var(--bright); }
#rh .home svg { width: 19px; height: 19px; display: block; }
#rh .head { font-size: 14px; letter-spacing: 0.42em; text-transform: uppercase; color: var(--ink); padding-left: 0.42em; }
#rh .ver { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--quiet); }

#sheet { width: 100%; max-width: calc(var(--col) + 64px); margin: 0 auto; padding: 64px 32px 96px; }

/* title */
#title { width: 100%; max-width: var(--col); text-align: center; padding-bottom: 12px; }
#title .kick { font-size: 15px; letter-spacing: 0.4em; text-transform: uppercase; color: var(--note); padding-left: 0.4em; }
#title h1 { margin-top: 18px; font-weight: 500; font-size: clamp(54px, 9vw, 84px); line-height: 1; letter-spacing: 0.16em; padding-left: 0.16em; color: var(--bright); }
#title .sub { margin-top: 20px; font-style: italic; font-size: 25px; line-height: 1.3; color: var(--ink); }
#title .vig { display: block; width: 300px; max-width: 70%; height: auto; margin: 40px auto 0; opacity: 0.92; }
#title .imp { margin-top: 34px; font-size: 15px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--note); }
#title .imp b { font-weight: 400; color: var(--ink); }

/* parts */
.part { margin-top: 68px; }
.part > h2 { width: 100%; max-width: var(--col); text-align: center; font-weight: 400; font-size: 17px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--bright); padding-left: 0.34em; }
.part > h2 .n { display: block; margin-bottom: 6px; font-size: 14px; letter-spacing: 0.2em; color: var(--note); }
.row { display: grid; grid-template-columns: var(--col) var(--side); column-gap: var(--gut); width: calc(var(--col) + var(--gut) + var(--side)); margin-top: 22px; }
.row > .tx { min-width: 0; }
.tx p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.tx p + p { text-indent: 1.4em; }
.tx p.first::first-letter { float: left; font-size: 3.05em; line-height: 0.8; padding: 0.09em 0.1em 0 0; font-weight: 500; color: var(--bright); }
.tx p.first + *, .tbl, .tx ol, .tx .seven, .site { clear: both; }
.tx p.run { text-indent: 0; margin-top: 14px; }
.tx em { font-style: italic; }
.tx .seven { margin: 16px 0 4px; padding: 0 0.6em; text-align: center; text-indent: 0; hyphens: none; -webkit-hyphens: none; font-style: italic; font-size: 21px; line-height: 1.55; color: var(--bright); }
.tx .seven span { white-space: nowrap; }
.tx .seven i { font-style: normal; color: var(--quiet); padding: 0 0.3em; }
.tx ol { margin: 10px 0 10px 1.4em; }
.tx ol li { padding-left: 0.3em; }
.mns { align-self: start; display: flex; flex-direction: column; gap: 14px; }
.mn { align-self: start; padding-top: 5px; font-size: 14.5px; line-height: 1.42; color: var(--note); font-variant-numeric: lining-nums; border-left: 1px solid var(--rule); padding-left: 14px; }
.mn b { font-weight: 400; color: var(--ink); }
.mn code { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; color: var(--ink); }
.catch { width: 100%; max-width: var(--col); margin-top: 18px; text-align: right; font-style: italic; font-size: 17px; color: var(--quiet); }

/* tables: ruled, captioned in spaced capitals, closed by a line that counts the rows */
.tbl { width: 100%; margin: 20px 0 6px; border-collapse: collapse; font-size: 17.5px; line-height: 1.32; font-variant-numeric: lining-nums tabular-nums; border: 1px solid var(--rule); }
.tbl caption { caption-side: top; padding: 0 0 8px; text-align: left; font-size: 13.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--note); }
.tbl caption b { font-weight: 400; color: var(--bright); padding-right: 0.5em; }
.tbl th, .tbl td { padding: 5px 10px; text-align: left; vertical-align: baseline; border-left: 1px solid var(--rule); }
.tbl th:first-child, .tbl td:first-child { border-left: 0; }
.tbl thead th { font-weight: 400; font-style: italic; color: var(--bright); border-bottom: 1px solid var(--rule); }
.tbl tbody tr + tr td { border-top: 1px solid var(--rule-2); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .who { color: var(--note); font-size: 16px; }
.tbl tfoot td { border-top: 1px solid var(--rule); text-align: center; font-style: italic; color: var(--bright); padding: 6px 10px; }
.tbl td.bar { width: 26%; padding-right: 12px; }
.tbl td.bar span { position: relative; display: block; height: 9px; background: rgba(200,184,232,0.13); border-radius: 0 3px 3px 0; }
.tbl td.bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--violet); border-radius: 0 3px 3px 0; min-width: 2px; }
.tbl tr:hover td { background: rgba(200,184,232,0.05); }
.tbl .late { color: var(--bright); }
.gold { color: var(--gold); }

/* plates */
.plate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: center; margin: 26px 0 4px; }
.plate img { display: block; width: 100%; height: auto; }
.plate figcaption { font-size: 16.5px; line-height: 1.45; color: var(--note); }
.plate figcaption b { display: block; margin-bottom: 8px; font-weight: 400; font-size: 13.5px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--bright); }
.plate figcaption q { font-style: italic; color: var(--ink); quotes: '“' '”'; }

/* the two sites */
.site { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.site .mark { flex: 0 0 auto; height: 30px; display: flex; align-items: center; }
.site .mark img { display: block; height: 30px; width: auto; }
.site .wm-databook { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 22px; letter-spacing: -0.6px; color: #E6E8EB; }
.site .wm-databook em { font-style: italic; font-weight: 400; color: #FF475B; }
.site .url { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; }

#colophon { margin-top: 84px; width: 100%; max-width: var(--col); text-align: center; font-size: 17px; line-height: 1.55; color: var(--note); }
#colophon .orn { display: block; margin: 0 auto 26px; width: 44px; height: 1px; background: var(--rule); }
#colophon p + p { margin-top: 12px; }
#colophon .sig { display: inline-flex; align-items: center; gap: 12px; margin-top: 34px; border: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--quiet); }
#colophon .sig img { display: block; height: 30px; width: auto; }

@media (max-width: 1230px) {
  /* no room for a hanging margin on both sides: the whole block is centred instead */
  #sheet { max-width: calc(var(--col) + var(--gut) + var(--side) + 64px); }
  .row { width: auto; grid-template-columns: minmax(0, var(--col)) var(--side); }
}
@media (max-width: 1000px) {
  #pp { font-size: 19px; }
  #sheet { padding: 44px 20px 72px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .mn, .mns { margin-top: 12px; }
  #title, .part > h2, .catch, #colophon { max-width: none; }
  #rh { padding: 0 16px; }
  #rh .ver { display: none; }
}
@media (max-width: 620px) {
  #pp { font-size: 18px; }
  .tx p { text-align: left; }
  .tbl { font-size: 15.5px; }
  .tbl th, .tbl td { padding: 5px 7px; }
  .tbl .who, .tbl td.bar { display: none; }
  .plate { grid-template-columns: minmax(0, 1fr); }
  #rh .head { letter-spacing: 0.3em; font-size: 12px; }
  #title .sub br { display: none; }
}
