:root {
  color-scheme: light;
  --paper: #f7f8f6;
  --sheet: #fff;
  --ink: #202820;
  --muted: #546156;
  --line: #dce3db;
  --green: #285a41;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #111613;
    --sheet: #1a211c;
    --ink: #e8efe7;
    --muted: #b1c1b4;
    --line: #36453b;
    --green: #a9cfb4;
  }
  :root:not([data-theme="light"]) .wordmark img {
    filter: invert(1);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111613;
  --sheet: #1a211c;
  --ink: #e8efe7;
  --muted: #b1c1b4;
  --line: #36453b;
  --green: #a9cfb4;
}

:root[data-theme="dark"] .wordmark img {
  filter: invert(1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 15px/1.85 Peyda, Tahoma,sans-serif;
  color: var(--ink);
  background: var(--paper);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,input {
  font: inherit;
}

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

.shell {
  width: min(1080px,calc(100% - 38px));
  margin-inline: auto;
}

.mast {
  border-bottom: 1px solid var(--line);
  background: var(--sheet);
}

.mast-inner,.mast nav,.wordmark,.foot {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mast-inner {
  min-height: 68px;
  justify-content: space-between;
}

.wordmark {
  gap: 8px;
  white-space: nowrap;
}

.wordmark strong {
  font-size: 22px;
  letter-spacing: -.6px;
}

.wordmark span {
  color: var(--muted);
  border-inline-start: 1px solid var(--line);
  padding-inline-start: 8px;
}

.button,button {
  border: 1px solid var(--ink);
  border-radius: 7px;
  padding: 7px 13px;
  background: var(--ink);
  color: var(--sheet);
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  cursor: pointer;
}

.intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 26px;
  padding: clamp(30px,6vw,90px) 0 clamp(22px,4vw,55px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-weight: 700;
}

h1,h2,h3,p {
  margin: 0;
}

h1 {
  font-size: clamp(34px,6vw,76px);
  line-height: 1.25;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.intro h1 {
  margin-block: 7px 12px;
}

.intro p:last-child,.story-copy>p:not(.byline) {
  color: var(--muted);
}

.intro form {
  width: min(100%,340px);
  flex-shrink: 0;
}

.intro form label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
}

.intro form div {
  display: flex;
  gap: 6px;
}

.intro input {
  min-width: 0;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--sheet);
  color: var(--ink);
}

.library {
  width: min(100%,800px);
  margin-inline: auto;
  padding: 30px 0;
}

.library h2 {
  font-size: 21px;
  margin-bottom: 6px;
}

.story-row {
  padding: 20px 0;
  display: flex;
  align-items: center;
  gap: 17px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.story-copy {
  min-width: 0;
}

.story-copy h3 {
  font-size: clamp(20px,3vw,28px);
  line-height: 1.5;
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.story-copy>p {
  overflow-wrap: anywhere;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.byline a {
  font-weight: 700;
  color: var(--ink);
}

.thumbnail {
  width: min(24vw,142px);
  aspect-ratio: 1.25;
  flex: none;
  overflow: hidden;
  border-radius: 9px;
}

.thumbnail img,.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.topics a {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 9px;
  color: var(--green);
  font-size: 13px;
}

.empty {
  padding: 38px 0;
  color: var(--muted);
}

.empty a {
  margin-top: 12px;
  display: inline-flex;
}

.reading {
  max-width: 750px;
  margin: 0 auto;
  padding: clamp(30px,6vw,76px) 0;
}

.reading h1 {
  font-size: clamp(30px,5vw,54px);
  margin: 8px 0 14px;
}

.reading .cover {
  max-height: 420px;
  aspect-ratio: 16/9;
  margin: 25px 0;
  border-radius: 10px;
}

.prose {
  margin: 24px 0;
  font-size: clamp(16px,2vw,19px);
  line-height: 2.1;
}

.prose p {
  margin: 1em 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.prose h2,.prose h3 {
  margin-top: 1.4em;
}

.prose pre {
  overflow: auto;
  background: var(--sheet);
  border: 1px solid var(--line);
  padding: 13px;
  font-size: 14px;
  line-height: 1.6;
}

.foot,.paging,.discuss {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 16px 0;
  color: var(--muted);
}

.discuss {
  margin-top: 28px;
}

@media (max-width:680px) {
  .intro {
    align-items: start;
    flex-direction: column;
  }
  .mast nav {
    gap: 8px;
  }
  .wordmark strong {
    font-size: 18px;
  }
  .mast-inner {
    gap: 7px;
  }
}

@media (max-width:360px) {
  .shell {
    width: calc(100% - 24px);
  }
  .wordmark span {
    display: none;
  }
}
