* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
}

html[data-text-size="larger"] {
  font-size: 115%;
}

html[data-text-size="largest"] {
  font-size: 130%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.18em;
}

a:visited {
  color: var(--visited);
}

a:hover {
  text-decoration-thickness: 0.18em;
}

:focus-visible {
  outline: 0.25rem solid var(--focus);
  outline-offset: 0.2rem;
}

button,
a {
  touch-action: manipulation;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  padding: 0.8rem 1rem;
  background: var(--surface);
  color: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.preview-banner {
  margin: 0;
  padding: 0.5rem 1rem;
  background: #fff1a8;
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

.site-header {
  border-bottom: 0.18rem solid var(--accent);
  background: var(--surface);
}

.site-header__inner,
main,
.site-footer {
  width: min(100%, 46rem);
  margin-inline: auto;
  padding-inline: 1rem;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.25rem;
  padding-block: 0.9rem;
}

.brand {
  color: var(--accent-dark);
  font-size: 1.3rem;
  font-weight: 800;
  text-decoration: none;
}

.brand span {
  display: block;
  font-size: 1rem;
  font-weight: 700;
}

.text-size {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.text-size__label {
  margin-right: 0.15rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.text-size button {
  min-width: 3rem;
  min-height: 3rem;
  border: 0.15rem solid var(--accent);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.text-size button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
}

main {
  padding-block: 1.5rem 3rem;
}

.site-footer {
  padding-block: 1.5rem 2.5rem;
  border-top: 0.12rem solid var(--border);
  font-weight: 700;
}

.eyebrow,
.sequence-position {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

h1,
h2 {
  line-height: 1.2;
}

h1 {
  margin: 0;
  font-size: 2.15rem;
}

.home h1 span {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.55rem;
}

.intro {
  max-width: 34rem;
  margin-block: 1rem 1.5rem;
  font-size: 1.2rem;
}

.start-link,
.next-link,
.all-link {
  display: flex;
  min-height: 4.75rem;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 1.1rem;
  border: 0.18rem solid var(--accent-dark);
  border-radius: 0.7rem;
  background: var(--accent);
  color: #ffffff;
  font-size: 1.1rem;
  text-decoration: none;
}

.start-link:visited,
.next-link:visited,
.all-link:visited {
  color: #ffffff;
}

.start-link__main,
.next-link strong {
  font-size: 1.35rem;
  font-weight: 800;
}

.home h2 {
  margin: 2.25rem 0 1rem;
  font-size: 1.55rem;
}

.home h2 span {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.15rem;
}

.reading-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reading-link {
  display: grid;
  min-height: 5.5rem;
  grid-template-columns: 3rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 0.14rem solid var(--border);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.reading-link:visited {
  color: var(--ink);
  border-color: var(--visited);
}

.reading-number {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-weight: 850;
}

.reading-title,
.reading-title-hi {
  display: block;
  overflow-wrap: anywhere;
}

.reading-link > span:last-child {
  min-width: 0;
}

.reading-title {
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.15em;
}

.reading-title-hi {
  margin-top: 0.35rem;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.4;
}

.return-nav {
  margin-bottom: 1.5rem;
}

.return-nav a {
  display: inline-block;
  min-height: 3rem;
  padding-block: 0.65rem;
  font-weight: 750;
}

.reading-header {
  padding-bottom: 1.25rem;
  border-bottom: 0.15rem solid var(--border);
}

.reading-heading-hi {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 1.45rem;
  font-weight: 750;
}

.reading-body {
  padding-block: 1.5rem 0.5rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.65rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.reading-body p {
  margin: 0 0 1.55em;
}

.reading-body h2 {
  margin: 2.1em 0 0.8em;
  color: var(--accent-dark);
  font-size: 1.25em;
}

.reading-body h3 {
  margin: 1.8em 0 0.7em;
  font-size: 1.08em;
}

.reading-body hr {
  width: 45%;
  margin: 2.2em auto;
  border: 0;
  border-top: 0.12rem solid var(--border);
}

.reading-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 0.18rem solid var(--accent);
}

.next-link__label {
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.next-link > span:last-child {
  margin-top: 0.2rem;
}

.complete-message {
  padding: 1rem;
  border: 0.15rem solid var(--accent);
  border-radius: 0.7rem;
  background: var(--surface);
  font-size: 1.25rem;
}

.source-details {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 1rem;
}

.source-details summary {
  min-height: 3rem;
  padding-block: 0.7rem;
  color: var(--accent-dark);
  font-weight: 750;
  cursor: pointer;
}

.source-details p {
  margin-block: 0.5rem;
}

@media (forced-colors: active) {
  .reading-number,
  .start-link,
  .next-link,
  .all-link,
  .text-size button[aria-pressed="true"] {
    border: 0.15rem solid ButtonText;
  }
}

@media print {
  .site-header,
  .site-footer,
  .return-nav,
  .reading-footer {
    display: none;
  }

  main {
    width: auto;
    padding: 0;
  }

  .reading-body {
    font-size: 16pt;
  }
}
