/* ==========================================================================
   ReguFile Systems — site stylesheet
   Plain CSS, no build tools. One typeface (Charis SIL), stored with the site.
   The look: a page from a carefully edited reference manual.
     - section marks (§ 1, § 2 …) and citations sit in the left margin
     - a "thumb index" made from the logo's bars runs down the right edge
   ========================================================================== */

/* ---- Typeface (SIL Open Font License; see fonts/LICENSE-Charis-SIL.txt) -- */
@font-face {
  font-family: "Charis SIL";
  src: url("../fonts/charis-sil-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Charis SIL";
  src: url("../fonts/charis-sil-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Charis SIL";
  src: url("../fonts/charis-sil-latin-700-normal.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- Colors and measures ------------------------------------------------- */
:root {
  --paper: #FFFFFF;
  --ink: #0F2A44;          /* logo navy: all text */
  --slate: #3D5468;        /* quieter text: margin notes, captions */
  --rule: #C9D2DA;         /* hairlines */
  --teal: #1F8A70;         /* logo teal: graphic marks only */
  --teal-text: #17705B;    /* a darker teal that passes contrast as text */
  --teal-light: #5FD3B3;   /* teal on navy */

  --margin: 10.5rem;       /* the margin column for § marks and citations */
  --gap: 2.75rem;
  --measure: 40rem;        /* the text column */
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Charis SIL", Charter, "Bitstream Charter", Georgia, serif;
  font-size: 1.1875rem;
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
}
::selection { background: #BFEADB; color: var(--ink); }
p { margin: 0 0 1rem; text-wrap: pretty; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
a { color: var(--teal-text); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 2px; }
[id] { scroll-margin-top: 1.5rem; }

.sr {  /* for screen readers only */
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: var(--ink); padding: .5rem .75rem; z-index: 20; }
.skip:focus { left: .5rem; top: .5rem; }

.page {
  max-width: calc(var(--margin) + var(--gap) + var(--measure) + 4rem);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Running head -------------------------------------------------------- */
.runhead {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.6rem 0 1rem;
  border-bottom: 1px solid var(--ink);
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: var(--ink); text-decoration: none;
  font-weight: 700; font-size: 1.1875rem; letter-spacing: .005em;
}
.brand .mark { width: 1.65rem; height: auto; flex: none; }
.runtitle { margin: 0; font-style: italic; color: var(--slate); font-size: 1rem; text-align: right; }

/* ---- Thumb index: the logo's bars as tabs on the edge of the page -------- */
.thumbs {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 5;
  display: flex; flex-direction: column; gap: 3px;
  list-style: none; margin: 0; padding: 0;
  scroll-target-group: auto;   /* lets browsers that can mark the section in view */
}
.thumbs a {
  display: flex; align-items: baseline; gap: .55rem;
  width: 11.25rem; padding: .55rem .9rem .55rem .85rem;
  background: var(--ink); color: #fff; text-decoration: none;
  border-radius: 7px 0 0 7px;
  font-size: .9375rem; line-height: 1.2;
}
.thumbs a b { color: var(--teal-light); font-weight: 700; min-width: 1.6rem; }
.thumbs a:hover, .thumbs a:focus-visible, .thumbs a:target-current { background: var(--teal-text); }
.thumbs a:hover b, .thumbs a:focus-visible b, .thumbs a:target-current b { color: #fff; }
.thumbs .s { display: none; }   /* short labels, used on narrow screens */

/* ---- Rows: a margin column, then the text column ------------------------- */
.row {
  display: grid;
  grid-template-columns: var(--margin) minmax(0, var(--measure));
  column-gap: var(--gap);
}
.note {
  grid-column: 1; margin: 0; padding-top: .25rem;
  text-align: right; font-style: italic; font-size: .9375rem; line-height: 1.45;
  color: var(--slate); text-wrap: balance;
}
.body { grid-column: 2; min-width: 0; }
.body > :first-child { margin-top: 0; }   /* so a margin note lines up with its text */
.row.gap { margin-top: 2.2rem; }
.row.gap-s { margin-top: 1.4rem; }

.sec { padding: 4.5rem 0 1rem; border-top: 1px solid var(--rule); }
.sec:first-of-type { border-top: 0; }
.sec-head { align-items: baseline; margin-bottom: 1.6rem; }
.secmark {
  grid-column: 1; text-align: right; white-space: nowrap;
  color: var(--teal-text); font-size: 1.75rem; font-weight: 700; line-height: 1.1;
}
h2 { grid-column: 2; font-size: 1.875rem; line-height: 1.2; }
h3 { font-size: 1.1875rem; line-height: 1.35; margin: 2.2rem 0 .7rem; }
h4 { font-size: 1rem; font-style: italic; font-weight: 400; color: var(--slate); margin: 1.6rem 0 .35rem; }

/* ---- § 1: the title page -------------------------------------------------- */
.hero { padding: 5rem 0 2.5rem; }
.hero h1 {
  grid-column: 2;
  font-size: clamp(2.15rem, 3.4vw, 3rem); line-height: 1.12; letter-spacing: -.005em;
  max-width: 20ch; margin-bottom: 1.8rem;
}
.hero .secmark { padding-top: .55rem; }
.lead { font-size: 1.3125rem; line-height: 1.55; }

/* Ruled tables: the "at a glance" table and the table of labels */
.ruled { width: 100%; border-collapse: collapse; font-size: 1.0625rem; }
.ruled th, .ruled td { text-align: left; vertical-align: top; padding: .65rem 0; border-bottom: 1px solid var(--rule); }
.ruled tr:first-child th, .ruled tr:first-child td { border-top: 2px solid var(--ink); }
.ruled tr:last-child th, .ruled tr:last-child td { border-bottom: 2px solid var(--ink); }
.facts { margin: 1.2rem 0 0; }
.facts th { font-weight: 400; font-style: italic; color: var(--slate); width: 8.5rem; padding-right: 1rem; }
.labels { margin: .4rem 0 1.6rem; }
.labels th { white-space: nowrap; padding-right: 1.25rem; font-weight: 700; letter-spacing: .01em; width: 1%; }

/* ---- Lists ---------------------------------------------------------------- */
ul.plain { margin: 0 0 1rem; padding-left: 1.15rem; }
ul.plain li { margin: .35rem 0; }
ul.plain li::marker { color: var(--teal-text); }

/* ---- § 3: the contents page, with dot leaders ----------------------------- */
.part { font-size: 1.375rem; margin: 2.2rem 0 .2rem; }
.part small { font-weight: 400; font-style: italic; color: var(--slate); font-size: 1rem; margin-left: .4rem; }
.toc { list-style: none; margin: 0 0 .5rem; padding: 0; }
.toc li { display: flex; align-items: baseline; align-items: last baseline; gap: .5rem; padding: .12rem 0; }
.toc .t { flex: 1 1 auto; min-width: 0; overflow: hidden; position: relative; }
.toc .t::after {
  /* the row of dots; the second line gives it an empty spoken name */
  content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .";
  content: " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ." / "";
  position: absolute; white-space: nowrap; padding-left: .3em;
  color: #8394A3; letter-spacing: .06em;
}
.toc .id { flex: 0 0 auto; font-weight: 700; font-size: 1rem; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }

/* ---- § 4: numbered paragraphs --------------------------------------------- */
.para { margin: 0 0 1.15rem; }

/* ---- § 5: price ------------------------------------------------------------ */
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem 1rem; margin: 0 0 1.4rem; }
.price .amount { font-size: 3.25rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; }
.price .terms { font-size: 1.125rem; color: var(--slate); font-style: italic; }
.provision { border-left: 4px solid var(--teal); padding: .2rem 0 .2rem 1.1rem; margin: 0 0 1.4rem; font-size: 1.25rem; line-height: 1.5; }
.small { font-size: 1rem; color: var(--slate); }

/* ---- § 6 and § 7 ----------------------------------------------------------- */
.qa h3 { margin: 1.8rem 0 .4rem; }
.qa h3:first-child { margin-top: 0; }
.email { font-size: 1.625rem; font-weight: 700; overflow-wrap: anywhere; }

/* ---- Legal pages: Refunds, and later Terms and Privacy -------------------- */
/* <body class="legal">. The same rows and margin marks as the home page, set
   closer, because these pages are short sections of plain text.             */
.legal .hero { padding: 4rem 0 1rem; }
.legal .hero h1 { font-size: clamp(2rem, 3vw, 2.5rem); max-width: none; margin-bottom: .4rem; }
.legal .sec:not(.hero) { padding-top: 2.75rem; padding-bottom: .5rem; }
.legal .sec-head { margin-bottom: 1rem; }
.legal h2 { font-size: 1.5rem; }
.legal .secmark { font-size: 1.5rem; }
.legal .email { font-size: 1.3125rem; }
.updated { margin: 0 0 1.4rem; font-size: 1rem; font-style: italic; color: var(--slate); }
.url { overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .legal .hero { padding-top: 2.25rem; }
  .legal .sec:not(.hero) { padding-top: 2.25rem; }
  .legal .secmark { font-size: 1.25rem; }
}

/* ---- Footer ---------------------------------------------------------------- */
.foot { border-top: 2px solid var(--ink); margin-top: 4rem; padding: 1.6rem 0 3rem; }
.disclaimer { font-size: 1rem; line-height: 1.55; max-width: 46rem; margin: 0 0 1.1rem; }
.footnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; margin: 0 0 1rem; padding: 0; font-size: 1rem; }
.copy { font-size: .9375rem; color: var(--slate); margin: 0; }

/* ---- Placeholders: gaps that wait on a decision. None may remain at launch. */
.ph {
  border: 2px dashed #B42318; border-radius: 4px; background: #FFFBFA; color: #8A1C12;
  padding: .75rem 1rem; margin: 1rem 0;
  font: 400 .9375rem/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.ph b { margin-right: .35rem; }

/* ---- Narrower screens ------------------------------------------------------ */
/* Below 1280px the thumb index becomes a row of tabs under the running head. */
@media (max-width: 1279px) {
  .thumbs { position: static; transform: none; flex-direction: row; flex-wrap: wrap; margin: 1rem 0 0; }
  .thumbs a { width: auto; border-radius: 7px 7px 0 0; padding: .45rem .7rem; font-size: .875rem; }
  .thumbs .l { display: none; }
  .thumbs .s { display: inline; }
}
/* Below 860px the margin column folds away: notes sit under their text. */
@media (max-width: 860px) {
  body { font-size: 1.125rem; }
  .row { display: flex; flex-direction: column; }
  .note { order: 2; text-align: left; border-left: 2px solid var(--teal); padding: .1rem 0 .1rem .75rem; margin: -.4rem 0 1.1rem; }
  .note:empty { display: none; }
  .secmark { text-align: left; font-size: 1.25rem; margin-bottom: .35rem; }
  .sec-head { margin-bottom: 1.2rem; }
  .runhead { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .runtitle { text-align: left; }
  .hero { padding-top: 2.5rem; }
  .hero .secmark { padding-top: 0; }
  .sec { padding-top: 3rem; }
  .toc li { flex-wrap: wrap; align-items: baseline; gap: 0; padding: .3rem 0; }
  .toc .t::after { display: none; }
  .toc .id { order: -1; width: 100%; font-size: .9375rem; color: var(--teal-text); }
  .facts th { width: 6.5rem; }
  .labels th, .labels td { display: block; width: auto; }
  .labels th { border-bottom: 0; padding-bottom: 0; }
  .labels td { padding-top: .2rem; }
  .labels tr:first-child td { border-top: 0; }
  .labels tr:last-child th { border-bottom: 0; }
  .price .amount { font-size: 2.75rem; }
  .email { font-size: 1.3125rem; }
}

/* ---- Print: the page prints as a clean document ---------------------------- */
@media print {
  .thumbs, .skip { display: none; }
  body { font-size: 11pt; }
  .sec { padding-top: 2rem; break-inside: auto; }
  a { color: inherit; }
}
