/*
 * Footnote Gray: components
 * Built only from tokens.css. Load tokens.css first.
 */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fg-paper);
  color: var(--fg-ink);
  font-family: var(--fg-serif);
  font-size: var(--fg-text-body);
  line-height: var(--fg-leading);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { max-width: 100%; display: block; }
a {
  color: inherit;
  text-decoration: underline dotted var(--fg-rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s var(--fg-ease);
}
a:hover { text-decoration-color: var(--fg-ink); text-decoration-style: solid; }
:focus-visible { outline: 2px solid var(--fg-ink); outline-offset: 3px; }
::selection { background: var(--fg-ink); color: var(--fg-ink-inverse); }

/* ---------- Layout ---------- */
.fg-page {
  max-width: var(--fg-container);
  margin: 0 auto;
  padding: 0 calc(var(--fg-side) + var(--fg-gap)) 0 var(--fg-space-4);
  position: relative;
}
.fg-page--wide { padding-right: var(--fg-space-4); }
.fg-section { padding: var(--fg-space-6) 0; }
.fg-section--page { background: var(--fg-page); border-top: var(--fg-dotted-soft); border-bottom: var(--fg-dotted-soft); }
.fg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--fg-space-5); }
.fg-center { text-align: center; }

/* ---------- Masthead: monogram + boxed tabs ---------- */
.fg-masthead {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: var(--fg-space-4);
  align-items: start;
  padding: var(--fg-space-4) 0 var(--fg-space-5);
}
.fg-monogram {
  font-family: var(--fg-black);
  font-size: 86px;
  line-height: .8;
  text-decoration: none;
  color: var(--fg-ink);
  padding-top: 4px;
}
.fg-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fg-tabs a {
  display: block;
  flex: 1 1 auto;
  min-width: 88px;
  padding: 6px 14px 4px;
  border: var(--fg-double);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: var(--fg-tracking-caps);
  font-size: 20px;
  line-height: 1.3;
  white-space: nowrap;
  background: var(--fg-paper);
}
.fg-tabs a:hover { background: var(--fg-wash); }
.fg-tabs a[aria-current="page"] { background: var(--fg-ink); color: var(--fg-ink-inverse); border-color: var(--fg-ink); }

/* Floating toolbar: a column of square icon buttons pinned to the right edge */
.fg-toolbar {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 5;
}
.fg-toolbar button, .fg-toolbar a {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--fg-paper);
  border: var(--fg-hair);
  color: var(--fg-soft);
  cursor: pointer;
  padding: 0;
}
.fg-toolbar button:hover, .fg-toolbar a:hover { color: var(--fg-ink); background: var(--fg-wash); }
.fg-toolbar svg { width: 22px; height: 22px; }

/* ---------- Type ---------- */
.fg-hero-title {
  font-size: var(--fg-text-hero);
  line-height: var(--fg-leading-tight);
  font-weight: 700;
  letter-spacing: -.015em;
  margin: 0 0 var(--fg-space-4);
  text-wrap: balance;
}
.fg-hero-title em { font-weight: 400; }
.fg-h2 {
  font-size: var(--fg-text-h2);
  line-height: 1.2;
  font-weight: 700;
  font-variant-caps: small-caps;
  letter-spacing: .01em;
  margin: 0 0 var(--fg-space-4);
  padding-bottom: 6px;
  border-bottom: var(--fg-dotted);
}
.fg-h3 { font-size: var(--fg-text-h3); line-height: 1.3; font-weight: 600; margin: 0 0 var(--fg-space-2); }
.fg-lead { font-size: var(--fg-text-lead); color: var(--fg-soft); margin: 0 0 var(--fg-space-4); }
.fg-justify { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.fg-runin {
  font-variant-caps: all-small-caps;
  letter-spacing: var(--fg-tracking-caps);
  font-weight: 600;
}
.fg-indent { text-indent: 2.4em; margin-top: 0; }
.fg-eyebrow {
  display: block;
  font-variant-caps: all-small-caps;
  letter-spacing: .12em;
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg-soft);
  margin-bottom: var(--fg-space-2);
}
.fg-small { font-size: var(--fg-text-small); color: var(--fg-soft); }
.fg-mono { font-family: var(--fg-mono); font-size: .82em; }
.fg-dropcap::first-letter {
  font-family: var(--fg-black);
  float: left;
  font-size: 4.4em;
  line-height: .78;
  margin: 6px 10px 0 0;
  font-weight: 400;
}
.fg-meta { font-family: var(--fg-sans); font-size: var(--fg-text-small); color: var(--fg-faint); }
.fg-meta > * + *::before { content: " \00B7 "; padding: 0 6px; }

/* ---------- Sidenotes ---------- */
.fg-note-ref {
  font-family: var(--fg-sans);
  font-size: .62em;
  font-weight: 600;
  vertical-align: super;
  line-height: 0;
  padding: 0 1px;
}
.fg-sidenote {
  float: right;
  clear: right;
  width: var(--fg-side);
  margin-right: calc(-1 * (var(--fg-side) + var(--fg-gap)));
  margin-bottom: var(--fg-space-3);
  font-size: var(--fg-text-side);
  line-height: 1.45;
  color: var(--fg-soft);
  text-align: left;
  text-indent: 0;
  hyphens: manual;
  position: relative;
}
.fg-sidenote::before {
  content: attr(data-n);
  font-family: var(--fg-sans);
  font-weight: 600;
  font-size: 11px;
  margin-right: 6px;
  vertical-align: 2px;
  color: var(--fg-ink);
}
.fg-sidenote--box { border: var(--fg-hair); padding: 10px 12px; }

/* ---------- Lists with fleuron bullets ---------- */
.fg-list { list-style: none; margin: 0; padding: 0; }
.fg-list li {
  position: relative;
  padding-left: 28px;
  margin: 0 0 6px;
}
.fg-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .62em;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--fg-ink);
  transform: rotate(45deg);
}
.fg-list--new li::before { background: var(--fg-ink); box-shadow: inset 0 0 0 2px var(--fg-paper); }
.fg-list--num { counter-reset: fg; }
.fg-list--num li { counter-increment: fg; padding-left: 36px; }
.fg-list--num li::before {
  content: counter(fg) ".";
  border: 0;
  transform: none;
  width: auto;
  height: auto;
  top: 0;
  left: 0;
  font-variant-numeric: oldstyle-nums;
  color: var(--fg-soft);
}

/* ---------- Buttons ---------- */
.fg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px 8px;
  border: var(--fg-double);
  border-radius: var(--fg-radius);
  background: var(--fg-paper);
  color: var(--fg-ink);
  font-family: var(--fg-serif);
  font-size: 19px;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: var(--fg-tracking-caps);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s var(--fg-ease);
}
.fg-btn:hover { background: var(--fg-wash); text-decoration: none; }
.fg-btn--primary { background: var(--fg-ink); color: var(--fg-ink-inverse); border-color: var(--fg-ink); box-shadow: inset 0 0 0 2px var(--fg-ink), inset 0 0 0 3px var(--fg-paper); }
.fg-btn--primary:hover { background: var(--fg-rule-strong); }
.fg-btn--sm { padding: 5px 12px 4px; font-size: 16px; }
.fg-btn--block { display: flex; width: 100%; }
.fg-btn--social { border: var(--fg-hair); font-variant-caps: normal; font-family: var(--fg-sans); font-size: 16px; letter-spacing: 0; }
.fg-btn__letter {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1px solid var(--fg-ink);
  font-family: var(--fg-serif);
  font-size: 13px;
  font-weight: 700;
}
.fg-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Boxes, popups, toc ---------- */
.fg-box { border: var(--fg-hair); background: var(--fg-page); padding: var(--fg-space-4); }
.fg-box--double { border: var(--fg-double); background: var(--fg-paper); }
.fg-popup {
  border: 0;
  box-shadow: var(--fg-popup-shadow);
  background: var(--fg-paper);
  padding: 14px 16px;
  font-size: var(--fg-text-side);
  line-height: 1.45;
}
.fg-popup__title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.fg-popup__bar {
  display: flex; justify-content: space-between;
  font-family: var(--fg-sans); font-size: 12px; color: var(--fg-faint);
  border-bottom: var(--fg-dotted-soft); padding-bottom: 6px; margin-bottom: 8px;
}
.fg-toc {
  border: var(--fg-hair);
  background: var(--fg-page);
  padding: 14px 20px 14px 18px;
  font-size: var(--fg-text-small);
  line-height: 1.5;
}
.fg-toc ol { margin: 0; padding-left: 20px; }
.fg-toc li::marker { color: var(--fg-faint); font-family: var(--fg-sans); font-size: 12px; }
.fg-toc a { text-decoration: none; }
.fg-toc a:hover { text-decoration: underline dotted var(--fg-ink); }
.fg-callout { border-left: 3px double var(--fg-ink); padding: 4px 0 4px 18px; color: var(--fg-soft); }

/* ---------- Stats ---------- */
.fg-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: var(--fg-dotted); border-bottom: var(--fg-dotted); }
.fg-stat { padding: var(--fg-space-4) var(--fg-space-3); text-align: center; }
.fg-stat + .fg-stat { border-left: var(--fg-dotted-soft); }
.fg-stat__n { font-size: 40px; font-weight: 700; line-height: 1; font-variant-numeric: oldstyle-nums; }
.fg-stat__l { font-variant-caps: all-small-caps; letter-spacing: var(--fg-tracking-caps); color: var(--fg-soft); font-size: 17px; margin-top: 6px; }

/* ---------- Tables ---------- */
.fg-table-wrap { overflow-x: auto; border-top: 2px solid var(--fg-ink); border-bottom: 2px solid var(--fg-ink); }
.fg-table { width: 100%; border-collapse: collapse; font-size: 17px; font-variant-numeric: tabular-nums; }
.fg-table th, .fg-table td { padding: 9px 12px; text-align: left; border-bottom: var(--fg-dotted-soft); vertical-align: top; }
.fg-table thead th { font-variant-caps: all-small-caps; letter-spacing: var(--fg-tracking-caps); border-bottom: 1px solid var(--fg-ink); white-space: nowrap; }
.fg-table tbody tr:last-child td, .fg-table tbody tr:last-child th { border-bottom: 0; }
.fg-table__yes::before { content: "\25C6"; font-size: 12px; }
.fg-table__no { color: var(--fg-faint); }
.fg-table__no::before { content: "\25C7"; font-size: 12px; }

/* ---------- Pricing ---------- */
.fg-toggle { display: inline-flex; border: var(--fg-double); }
.fg-toggle button {
  border: 0; background: var(--fg-paper); color: var(--fg-ink);
  padding: 6px 18px 5px;
  font-family: var(--fg-serif); font-size: 17px; font-weight: 600;
  font-variant-caps: all-small-caps; letter-spacing: var(--fg-tracking-caps);
  cursor: pointer; white-space: nowrap;
}
.fg-toggle button[aria-pressed="true"] { background: var(--fg-ink); color: var(--fg-ink-inverse); }
.fg-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--fg-space-4); align-items: stretch; }
.fg-plan { border: var(--fg-hair); padding: var(--fg-space-4); display: flex; flex-direction: column; background: var(--fg-paper); }
.fg-plan--featured { border: 4px double var(--fg-ink); }
.fg-plan__label { font-family: var(--fg-sans); font-size: var(--fg-text-micro); text-transform: uppercase; letter-spacing: .14em; color: var(--fg-soft); min-height: 18px; }
.fg-plan__name { font-size: 26px; font-weight: 700; font-variant-caps: small-caps; margin: 4px 0 6px; }
.fg-plan__desc { font-size: var(--fg-text-small); color: var(--fg-soft); margin: 0 0 var(--fg-space-3); }
.fg-plan__price { font-size: 46px; font-weight: 700; line-height: 1; font-variant-numeric: oldstyle-nums; padding: var(--fg-space-3) 0; border-top: var(--fg-dotted-soft); border-bottom: var(--fg-dotted-soft); margin-bottom: var(--fg-space-3); }
.fg-plan__price small { font-size: 16px; font-weight: 400; color: var(--fg-soft); margin-left: 4px; }
.fg-plan__list { margin-bottom: var(--fg-space-4); font-size: 17px; flex: 1; }

/* ---------- FAQ ---------- */
.fg-faq details { border-bottom: var(--fg-dotted-soft); padding: 14px 0; }
.fg-faq details:first-child { border-top: var(--fg-dotted); }
.fg-faq summary { cursor: pointer; list-style: none; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; }
.fg-faq summary::-webkit-details-marker { display: none; }
.fg-faq summary::after { content: "+"; font-family: var(--fg-sans); color: var(--fg-soft); }
.fg-faq details[open] summary::after { content: "\2212"; }
.fg-faq p { margin: 10px 0 0; color: var(--fg-soft); }

/* ---------- Article prose ---------- */
.fg-prose { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.fg-prose p { margin: 0; }
.fg-prose p + p { text-indent: 2.4em; }
.fg-prose > p:last-child { margin-bottom: var(--fg-space-4); }
.fg-prose h2 { font-size: var(--fg-text-h2); font-variant-caps: small-caps; border-bottom: var(--fg-dotted); padding-bottom: 6px; margin: var(--fg-space-5) 0 var(--fg-space-3); line-height: 1.2; text-align: left; }
.fg-prose h3 { font-size: var(--fg-text-h3); font-style: italic; font-weight: 600; margin: var(--fg-space-4) 0 var(--fg-space-2); text-align: left; }
.fg-prose blockquote { margin: var(--fg-space-4) 0; padding: 0 0 0 var(--fg-space-4); border-left: var(--fg-double); font-style: italic; color: var(--fg-soft); }
.fg-prose code { font-family: var(--fg-mono); font-size: .8em; background: var(--fg-wash); padding: 1px 5px; }
.fg-prose pre { font-family: var(--fg-mono); font-size: 14px; line-height: 1.55; background: var(--fg-page); border: var(--fg-hair); border-left: 3px double var(--fg-ink); padding: 14px 16px; overflow-x: auto; text-align: left; hyphens: none; }
.fg-prose pre code { background: none; padding: 0; font-size: inherit; }
.fg-prose figure { margin: var(--fg-space-4) 0; }
.fg-prose figcaption { font-size: var(--fg-text-small); color: var(--fg-soft); text-align: center; margin-top: 8px; font-style: italic; }
.fg-prose ul, .fg-prose ol { padding-left: 0; margin: var(--fg-space-3) 0; }
.fg-prose hr, .fg-asterism { border: 0; text-align: center; margin: var(--fg-space-5) 0; height: auto; }
.fg-prose hr::after, .fg-asterism::after { content: "*\2003*\2003*"; color: var(--fg-soft); font-size: 18px; }
.fg-author { display: flex; align-items: center; gap: 14px; }
.fg-author__mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border: var(--fg-double);
  font-family: var(--fg-black); font-size: 28px;
}
.fg-author__name { font-weight: 600; line-height: 1.2; }
.fg-author--card { border-top: var(--fg-dotted); border-bottom: var(--fg-dotted); padding: var(--fg-space-4) 0; align-items: flex-start; }
.fg-post { border-top: var(--fg-dotted); padding-top: var(--fg-space-3); }
.fg-post__title { font-size: 20px; font-weight: 700; line-height: 1.3; margin: 4px 0 6px; }
.fg-post__title a { text-decoration: none; }
.fg-post__title a:hover { text-decoration: underline dotted var(--fg-ink); }
.fg-post p { margin: 0; font-size: var(--fg-text-small); color: var(--fg-soft); }

/* ---------- Forms ---------- */
.fg-form { display: grid; gap: var(--fg-space-4); }
.fg-field { display: grid; gap: 6px; }
.fg-label { font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: var(--fg-tracking-caps); font-size: 18px; line-height: 1.2; }
.fg-input, .fg-select {
  width: 100%;
  font-family: var(--fg-serif);
  font-size: 18px;
  color: var(--fg-ink);
  background: var(--fg-paper);
  border: 1px solid var(--fg-ink);
  border-radius: var(--fg-radius);
  padding: 10px 12px;
  outline: none;
  appearance: none;
}
.fg-select { background-image: linear-gradient(45deg, transparent 50%, var(--fg-ink) 50%), linear-gradient(135deg, var(--fg-ink) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.fg-input:focus, .fg-select:focus { box-shadow: 0 0 0 3px var(--fg-paper), 0 0 0 4px var(--fg-ink); }
.fg-input::placeholder { color: var(--fg-faint); font-style: italic; }
.fg-input-wrap { position: relative; }
.fg-input-wrap .fg-input { padding-right: 76px; }
.fg-input-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer;
  font-family: var(--fg-sans); font-size: 13px; color: var(--fg-soft);
  text-decoration: underline dotted var(--fg-rule); text-underline-offset: 3px;
}
.fg-help { font-size: var(--fg-text-small); color: var(--fg-faint); font-style: italic; margin: 0; }
.fg-field--error .fg-input { border-color: var(--fg-error); border-width: 2px; padding: 9px 11px; }
.fg-error { font-family: var(--fg-sans); font-size: 14px; color: var(--fg-error); margin: 0; }
.fg-check { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.45; cursor: pointer; }
.fg-check input { appearance: none; width: 18px; height: 18px; flex: none; margin: 3px 0 0; border: 1px solid var(--fg-ink); background: var(--fg-paper); display: grid; place-items: center; cursor: pointer; }
.fg-check input:checked::after { content: ""; width: 8px; height: 8px; background: var(--fg-ink); transform: rotate(45deg); }
.fg-divider-text { display: flex; align-items: center; gap: 14px; color: var(--fg-faint); font-variant-caps: all-small-caps; letter-spacing: .1em; }
.fg-divider-text::before, .fg-divider-text::after { content: ""; flex: 1; border-top: var(--fg-dotted-soft); }

/* ---------- Footer ---------- */
.fg-footer { border-top: var(--fg-double); margin-top: var(--fg-space-6); padding: var(--fg-space-5) 0 var(--fg-space-5); }
.fg-footer__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--fg-space-4); font-size: var(--fg-text-small); }
.fg-footer__cols h4 { margin: 0 0 8px; font-variant-caps: all-small-caps; letter-spacing: var(--fg-tracking-caps); font-size: 17px; }
.fg-footer__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fg-footer__bottom { margin-top: var(--fg-space-5); padding-top: var(--fg-space-3); border-top: var(--fg-dotted-soft); font-family: var(--fg-sans); font-size: 13px; color: var(--fg-faint); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- Motion ---------- */
.fg-fade { animation: fg-fade .9s var(--fg-ease) both; }
@keyframes fg-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .fg-fade { animation: none; } }

/* ---------- Small screens ---------- */
@media (max-width: 960px) {
  .fg-page { padding: 0 var(--fg-space-4); }
  .fg-toolbar { display: none; }
  .fg-sidenote {
    float: none;
    display: block;
    width: auto;
    margin: var(--fg-space-2) 0 var(--fg-space-3);
    padding: 8px 12px;
    border-left: 3px double var(--fg-rule-strong);
    background: var(--fg-page);
  }
  .fg-plans { grid-template-columns: 1fr; }
  .fg-footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 18px; }
  .fg-page { padding: 0 16px; }
  .fg-masthead { grid-template-columns: 1fr; gap: var(--fg-space-3); }
  .fg-monogram { font-size: 64px; }
  .fg-tabs a { min-width: 0; flex: 1 1 30%; font-size: 17px; padding: 5px 8px 4px; }
  .fg-cols { grid-template-columns: 1fr; gap: var(--fg-space-4); }
  .fg-stats { grid-template-columns: 1fr; }
  .fg-stat + .fg-stat { border-left: 0; border-top: var(--fg-dotted-soft); }
  .fg-prose, .fg-justify { text-align: left; }
  .fg-footer__cols { grid-template-columns: 1fr; }
}
