/* bestmodafinilsources.com
   A dated field note: ink on paper, one green rule under the title and
   nowhere else (per source-copy/site_plan.md). Single family, Alegreya.
   No client JS. */

@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Alegreya";
  src: url("/assets/fonts/alegreya-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f8f2;
  --ink: #23281f;
  --ink-soft: #525a4f;
  --green: #2e7d52; /* the single green rule; nothing else is green */
  --hairline: #e0e3d5;
  --measure: 37rem;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Alegreya", Georgia, "Times New Roman", serif;
  font-size: 1.09rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4.5vw, 2rem);
}

/* ---- masthead -------------------------------------------------- */

.masthead {
  padding-top: 1.9rem;
}

.wordmark {
  font-style: italic;
  font-weight: 500;
  font-size: 1.04rem;
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ---- skip link -------------------------------------------------- */

.skip {
  position: absolute;
  left: -999px;
  top: 0.6rem;
  background: var(--paper);
  color: var(--ink);
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--ink);
}

.skip:focus {
  left: 0.6rem;
  z-index: 10;
}

/* ---- the note --------------------------------------------------- */

.note {
  padding-top: 3.2rem;
}

.note h1 {
  font-size: clamp(1.72rem, 3.1vw + 1rem, 2.4rem);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.012em;
  text-wrap: balance;
  max-width: 29ch;
  margin: 0 0 1.05rem;
}

.green-rule {
  height: 3px;
  background: var(--green);
  margin: 0 0 0.95rem;
}

.byline {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.99rem;
  margin: 0 0 2.7rem;
}

/* ---- body prose -------------------------------------------------- */

.prose p {
  margin: 0 0 1.05rem;
  text-wrap: pretty;
}

.prose li {
  margin-bottom: 0.42em;
  text-wrap: pretty;
}

.prose > p:first-child {
  font-size: 1.14em;
  line-height: 1.55;
  margin-bottom: 1.4rem;
}

.prose h2 {
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.008em;
  margin: 2.25em 0 0.55em;
}

.prose h2:first-child {
  margin-top: 0.9em;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2rem;
  padding-left: 1.6em;
}

.prose li::marker {
  color: var(--ink-soft);
}

.prose ol li::marker {
  font-weight: 500;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35rem 0 1.7rem;
  font-size: 0.94em;
  line-height: 1.5;
}

.prose th {
  text-align: left;
  font-weight: 700;
  padding: 0.45rem 1.1rem 0.45rem 0;
  border-bottom: 1.5px solid var(--ink);
}

.prose td {
  padding: 0.6rem 1.1rem 0.6rem 0;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

.prose th:last-child,
.prose td:last-child {
  padding-right: 0;
}

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #8d9484;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose a:hover {
  text-decoration-color: var(--ink);
}

/* ---- footer ------------------------------------------------------ */

.site-foot {
  margin-top: 4.1rem;
  border-top: 1px solid var(--hairline);
  padding-top: 1.5rem;
  padding-bottom: 3.4rem;
  font-size: 0.97rem;
}

.site-foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-foot li {
  margin-bottom: 0.4em;
}

.site-foot a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.16em;
}

.site-foot a:hover,
.site-foot a:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.site-foot a[aria-current="page"] {
  color: var(--ink);
  font-style: italic;
  text-decoration: none;
}

/* ---- states ------------------------------------------------------ */

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

::selection {
  background: #e7e9db;
}

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

@media (max-width: 640px) {
  body {
    font-size: 1.02rem;
  }

  .note {
    padding-top: 2.1rem;
  }

  .byline {
    margin-bottom: 2.2rem;
  }

  .prose h2 {
    font-size: 1.24rem;
  }

  .prose table {
    font-size: 0.9em;
  }

  .prose th,
  .prose td {
    padding-right: 0.7rem;
  }

  .site-foot {
    margin-top: 3.2rem;
  }
}
