:root {
  color-scheme: light;
  --ink: #202326;
  --muted: #6d7378;
  --paper: #f4f2ec;
  --sheet: #ffffff;
  --line: #ddd7cd;
  --link: #16346f;
  --link-visited: #594e66;
  --accent: #8b2f2a;
  --gold: #b98945;
  --sage: #3e665c;
  --soft: #eef2ef;
  --shadow: rgba(37, 36, 32, 0.08);
  --sans: "Trebuchet MS", Arial, Helvetica, sans-serif;
  --serif: "Times New Roman Cyr", "Times New Roman", Times, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    repeating-linear-gradient(0deg, rgba(32, 35, 38, 0.018) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, #f8f6f0 0%, var(--paper) 44%, #ece8de 100%);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13pt;
  line-height: 16pt;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition:
    color 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
}

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

.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 14px max(22px, calc((100vw - 1000px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 28px rgba(37, 36, 32, 0.04);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--sage));
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 4px;
  color: var(--accent);
  font-size: 1.28rem;
  font-weight: 700;
  text-decoration: none;
}

.brand:visited {
  color: var(--accent);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--sans);
  font-size: 16px;
}

.top-nav a {
  padding: 7px 10px;
  border-radius: 4px;
  text-decoration: none;
}

.top-nav a:hover {
  background: #f4f0e8;
}

.page {
  position: relative;
  overflow: hidden;
  width: min(1120px, calc(100% - 56px));
  margin: 40px auto 72px;
  padding: clamp(58px, 6.5vw, 92px) clamp(76px, 7vw, 118px) clamp(62px, 7vw, 96px)
    clamp(170px, 15vw, 220px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--sheet);
  box-shadow: 0 18px 46px var(--shadow);
}

.page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--accent), var(--gold), var(--sage));
}

.page::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 22px;
  width: 54px;
  height: 54px;
  border-top: 1px solid color-mix(in srgb, var(--gold) 70%, var(--line));
  border-right: 1px solid color-mix(in srgb, var(--gold) 70%, var(--line));
  opacity: 0.7;
  pointer-events: none;
}

.author-head {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 34px;
  align-items: center;
  margin-bottom: 38px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.portrait-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 92px;
  height: 112px;
  border: 1px solid #c7d0cb;
  border-radius: 4px;
  background:
    linear-gradient(135deg, rgba(143, 47, 42, 0.12), transparent 42%),
    var(--soft);
  color: var(--accent);
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.58);
}

.portrait-mark::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(139, 47, 42, 0.18);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10pt;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  color: #222;
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.16;
}

h1 {
  margin: 0 0 16px;
  color: #56504a;
  font-size: 24pt;
  line-height: 28pt;
}

h2 {
  margin: 42px 0 20px;
  color: #5f5851;
  font-size: 18pt;
  line-height: 22pt;
}

h2::after {
  content: "";
  display: block;
  width: 58px;
  height: 2px;
  margin-top: 9px;
  background: var(--gold);
}

.lead {
  max-width: 720px;
  margin: 0;
  color: #3c444a;
  font-size: 13pt;
  line-height: 16pt;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 34px 0 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--line);
  overflow: hidden;
}

.stats div {
  position: relative;
  min-width: 0;
  padding: 20px 24px;
  background: #fbfbf9;
}

.stats div::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: color-mix(in srgb, var(--accent) 74%, var(--gold));
}

.stats span,
.stats strong {
  display: block;
}

.stats span {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10pt;
  line-height: 14pt;
}

.stats strong {
  margin-top: 4px;
  color: #28231f;
  font-size: 16pt;
  line-height: 18pt;
  font-weight: 700;
}

.poem-list {
  display: block;
  margin: 0;
  padding: 0;
  color: #404040;
  counter-reset: poems;
  list-style: none;
  border-top: 1px solid var(--line);
}

.poem-list li {
  counter-increment: poems;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 12px 30px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.poem-list li::before {
  content: counter(poems, decimal-leading-zero);
  align-self: center;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
}

.poem-list li:hover {
  box-shadow: inset 4px 0 0 rgba(139, 47, 42, 0.22);
}

.poem-list a {
  font-size: 13pt;
  line-height: 16pt;
  text-decoration: none;
}

.poem-list a:hover {
  text-decoration: underline;
}

.poem-list small {
  display: block;
  margin: 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10pt;
  line-height: 14pt;
  text-align: right;
  white-space: nowrap;
}

.note {
  margin-top: 46px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sage);
  border-radius: 6px;
  background: #fbfaf6;
}

.note p {
  max-width: 720px;
  margin: 0;
}

.poem-page {
  max-width: 880px;
}

.poem-page h1 {
  max-width: 760px;
}

.back-link {
  display: inline-block;
  margin-bottom: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fbfaf6;
  font-family: var(--sans);
  font-size: 10pt;
  line-height: 14pt;
  text-decoration: none;
}

.back-link:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.poem-meta {
  margin: 0 0 38px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10pt;
  line-height: 14pt;
}

.poem-placeholder {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbf9;
}

.poem-text-body {
  position: relative;
  margin-top: 8px;
  padding: 42px 0 12px 112px;
  border-left: 2px solid color-mix(in srgb, var(--gold) 54%, var(--line));
  font-size: 13.5pt;
  line-height: 17pt;
}

.poem-text-body::before {
  content: "\00a7";
  position: absolute;
  left: -11px;
  top: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--sheet);
  color: var(--gold);
  font-size: 1rem;
}

.poem-text-body p {
  margin: 0 0 1.35em;
}

.source-link {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 10pt;
  line-height: 14pt;
}

@media (max-width: 700px) {
  body {
    font-size: 13pt;
    line-height: 16pt;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 18px;
  }

  .page {
    width: min(100% - 24px, 940px);
    margin-top: 14px;
    margin-bottom: 32px;
    padding: 36px 24px 38px 58px;
  }

  .page::after {
    display: none;
  }

  .author-head {
    grid-template-columns: 1fr;
  }

  .portrait-mark {
    width: 82px;
    height: 98px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .poem-list li {
    grid-template-columns: 68px 1fr;
    gap: 4px;
    padding: 15px 0;
  }

  .poem-list small {
    grid-column: 2;
    text-align: left;
    white-space: normal;
  }

  .poem-text-body {
    padding-left: 58px;
  }
}
