/* Tally Press — shared stylesheet */

:root {
  --stock: #f1f3ee;
  --stock-band: #e2e8dd;
  --stock-raised: #f8f9f5;
  --rule: #c3d0bf;
  --rule-faint: #dbe3d7;
  --ink: #1c2a22;
  --ink-soft: #4c5c52;
  --folio: #78877d;
  --redline: #94301f;
  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --step: clamp(2.5rem, 6vw, 4.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--stock);
  color: var(--ink);
  font-family: Karla, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
}

h1,
h2,
h3 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 40;
  line-height: 1.12;
  letter-spacing: -0.012em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.5rem);
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 2rem);
  margin-top: 0;
}

h3 {
  font-size: 1.15rem;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 20;
}

p,
li {
  max-width: var(--measure);
}

a {
  color: var(--ink);
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: var(--redline);
}

:focus-visible {
  outline: 2px solid var(--redline);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--stock-raised);
  border: 1px solid var(--ink);
  padding: 0.5rem 0.9rem;
  z-index: 10;
}

.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}

/* Sheet: the ruled ledger page the whole site sits on */

.sheet {
  max-width: 74rem;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  border-left: 1px solid var(--rule-faint);
  border-right: 1px solid var(--rule-faint);
  background-image: linear-gradient(
    to right,
    transparent 0,
    transparent calc(var(--gutter) - 13px),
    var(--redline) calc(var(--gutter) - 13px),
    var(--redline) calc(var(--gutter) - 12px),
    transparent calc(var(--gutter) - 12px)
  );
  min-height: 100vh;
}

/* Masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.6rem 0 1.1rem;
  border-bottom: 2px solid var(--ink);
}

.wordmark {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 30;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark span {
  color: var(--redline);
}

.masthead nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.masthead nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  font-size: 0.95rem;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  border-bottom-color: var(--redline);
}

/* Blocks */

main {
  padding-bottom: var(--step);
}

section {
  padding-top: var(--step);
}

.lede {
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 58ch;
}

.hero {
  padding-top: clamp(2.5rem, 7vw, 5rem);
  padding-bottom: 0;
}

.hero p {
  max-width: 60ch;
}

/* Ledger register — the article index */

.register {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.98rem;
}

.register caption {
  text-align: left;
  color: var(--folio);
  padding-bottom: 0.5rem;
  font-size: 0.9rem;
}

.register th {
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding: 0.4rem 0.8rem 0.4rem 0;
  white-space: nowrap;
}

.register td {
  vertical-align: top;
  padding: 0.85rem 0.8rem 0.85rem 0;
  border-bottom: 1px solid var(--rule-faint);
}

.register tbody tr:nth-child(odd) {
  background-color: var(--stock-band);
}

.register td:first-child {
  padding-left: 0.6rem;
}

.register .title a {
  font-family: Fraunces, Georgia, serif;
  font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 24;
  font-size: 1.12rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.register .title a:hover {
  border-bottom-color: var(--redline);
}

.register .title p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 52ch;
}

.register .figure {
  text-align: right;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Principle and note lists */

.stack {
  display: grid;
  gap: 1.4rem;
  max-width: var(--measure);
  padding: 0;
  margin: 1.4rem 0 0;
  list-style: none;
}

.stack > li {
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
}

.stack h3 {
  margin-bottom: 0.25rem;
}

.stack p {
  margin: 0;
  color: var(--ink-soft);
}

.negative {
  margin: 1.4rem 0 0;
  padding: 1.4rem 1.4rem 1.5rem;
  background: var(--stock-raised);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--redline);
  max-width: 62ch;
}

.negative ul {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
}

.negative li {
  margin-bottom: 0.45rem;
}

dl.faq {
  margin: 1.4rem 0 0;
  max-width: var(--measure);
}

dl.faq dt {
  font-weight: 700;
  border-top: 1px solid var(--rule-faint);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
}

dl.faq dd {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
}

/* Article body */

.article-head {
  padding-top: clamp(2rem, 6vw, 3.5rem);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.2rem;
}

.article-meta {
  color: var(--folio);
  font-size: 0.9rem;
  margin: 0 0 0.9rem;
}

.prose {
  padding-top: 2rem;
}

.prose p,
.prose li {
  max-width: 64ch;
}

.prose h2 {
  margin-top: 2.2rem;
  font-size: 1.35rem;
}

.prose blockquote {
  margin: 1.6rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--rule);
  color: var(--ink-soft);
}

.refs {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--ink);
}

.refs ol {
  padding-left: 1.2rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.refs li {
  margin-bottom: 0.6rem;
}

/* Legal pages */

.legal h2 {
  margin-top: 2.4rem;
  font-size: 1.25rem;
}

.legal p,
.legal li {
  max-width: 68ch;
}

.legal ul {
  padding-left: 1.15rem;
}

.legal li {
  margin-bottom: 0.4rem;
}

.updated {
  color: var(--folio);
  font-size: 0.9rem;
}

/* Support block and footer */

.support {
  margin-top: var(--step);
  padding: 1.5rem 0 0;
  border-top: 2px solid var(--ink);
}

.support a {
  font-weight: 700;
}

footer {
  border-top: 1px solid var(--rule);
  margin-top: var(--step);
  padding: 1.5rem 0 3rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

footer p {
  max-width: 60ch;
  margin: 0.4rem 0 0;
}

/* Narrow screens */

@media (max-width: 640px) {
  .register,
  .register thead,
  .register tbody,
  .register tr,
  .register th,
  .register td {
    display: block;
    white-space: normal;
  }

  .register thead {
    display: none;
  }

  .register tr {
    border-bottom: 1px solid var(--rule-faint);
    padding: 0.8rem 0.6rem;
  }

  .register td {
    border-bottom: 0;
    padding: 0.15rem 0;
  }

  .register td:first-child {
    padding-left: 0;
  }

  .register .figure {
    text-align: left;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
