/* The Complete Works of William Shakespeare */

:root {
  --bg: #fbf9f4;
  --ink: #23201c;
  --muted: #6f675c;
  --rule: #e6dfd2;
  --accent: #8b2e2a;
  --tint: #f3eee4;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18171a;
    --ink: #e7e2d9;
    --muted: #9d958a;
    --rule: #302d31;
    --accent: #e3988a;
    --tint: #211f23;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 1rem;
  background: var(--bg);
  color: var(--ink);
  font: 1.125rem/1.6 var(--serif);
  text-rendering: optimizeLegibility;
}

a[href] {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a[href]:hover { text-decoration-thickness: 2px; }
a:not([href]) { color: inherit; text-decoration: none; }

:target { background: var(--tint); scroll-margin-top: 4rem; }

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

.masthead {
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  padding: 2rem 0 1.75rem;
  border-bottom: 1px solid var(--rule);
  text-align: center;
}

.crumbs {
  font: 0.75rem/1.5 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.crumbs a[href] { color: inherit; text-decoration: none; }
.crumbs a[href]:hover { color: var(--accent); }
.crumbs .sep { margin: 0 0.45em; opacity: 0.5; }

.title {
  margin: 0.6rem 0 0;
  font-weight: 400;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  line-height: 1.15;
  text-wrap: balance;
}

/* ---------- reading column ---------- */

.text {
  max-width: 36rem;
  margin: 0 auto;
}

.text h2, .text h3 {
  font-weight: 400;
  text-align: center;
  text-wrap: balance;
}
.text h3 {
  margin: 3rem 0 1.5rem;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--muted);
}
.text h3:first-child { margin-top: 0; }

/* speeches */
.play .text a[name^="speech"],
.play .text strong {
  display: block;
  margin-top: 1.25em;
  font-weight: 600;
  font-size: 0.95em;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}
.play .text a[name^="speech"] b { font-weight: inherit; }
.play .text blockquote { margin: 0.1em 0 0 1.5rem; }

/* stage directions */
.play .text i,
.play .text em { color: var(--muted); }
.play .text p { margin: 0.6em 0; }

/* numbered, linkable lines */
.l { display: block; position: relative; padding-left: 1.25em; text-indent: -1.25em; }
.l .n {
  position: absolute;
  text-indent: 0;
  right: calc(100% + 0.8rem);
  top: 0.15em;
  min-width: 2rem;
  text-align: right;
  font: 0.7rem/1.6rem var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  text-decoration: none;
  opacity: 0;
  user-select: none;
  -webkit-user-select: none;
}
.l .n.f { opacity: 0.55; }
.l:hover .n, .l .n:focus-visible { opacity: 1; }
.l .n:hover { color: var(--accent); text-decoration: underline; }
.l:target { background: var(--tint); box-shadow: -0.4rem 0 0 var(--tint), 0.4rem 0 0 var(--tint); }
.l:target .n { opacity: 1; color: var(--accent); }

/* poems */
.poem .text blockquote { margin: 0 0 1.4em; }
.stanza { margin: 0 0 1.4em 2.25rem; }
.poem .text center { display: block; }
.poem .text table { margin: 0 auto; border-collapse: collapse; }
.poem .text td { vertical-align: top; padding: 0 0.5rem; }
.poem .text address { font-style: italic; text-align: right; }
.sonnet .text blockquote { margin: 0; line-height: 1.75; }

/* ---------- contents lists ---------- */

.lede { text-align: center; font-style: italic; margin: 0 0 2.5rem; }

.act h2 {
  margin: 2rem 0 0.5rem;
  font: 0.75rem/1.5 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.scenes, .sonnet-index {
  list-style: none;
  margin: 0;
  padding: 0;
}
.scenes a, .sonnet-index a {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
}
.scenes a:hover, .sonnet-index a:hover { color: var(--accent); }
.scenes .n, .sonnet-index .n {
  flex: 0 0 4.5rem;
  color: var(--muted);
  font: 0.8rem/2 var(--sans);
}
.sonnet-index .n { flex-basis: 3.5rem; }

/* ---------- pager & footer ---------- */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 36rem;
  margin: 3.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font: 0.9rem/1.5 var(--sans);
}
.pager a[href] { text-decoration: none; }
.pager a[href]:hover { text-decoration: underline; }

.colophon {
  max-width: 40rem;
  margin: 3rem auto 0;
  padding: 1.5rem 0 3rem;
  text-align: center;
  font: 0.8rem/1.6 var(--sans);
  color: var(--muted);
}
.colophon a[href] { color: inherit; }

/* ---------- home page ---------- */

.home .masthead { border: 0; margin-bottom: 1rem; }
.home .portrait {
  display: block;
  width: 9rem;
  height: auto;
  margin: 0 auto 1.25rem;
  border-radius: 4px;
  filter: sepia(0.25);
}
@media (prefers-color-scheme: dark) {
  .home .portrait { filter: sepia(0.25) brightness(0.85); }
}
.intro {
  max-width: 34rem;
  margin: 0 auto 3rem;
  text-align: center;
  color: var(--muted);
}
.works {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0 2.5rem;
  max-width: 64rem;
  margin: 0 auto;
  padding-top: 1rem;
  /*border-top: 1px solid var(--rule);*/
}
.works h2 {
  margin: 1.5rem 0 0.75rem;
  font: 0.75rem/1.5 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.works ul { list-style: none; margin: 0; padding: 0; }
.works li { margin: 0.3rem 0; line-height: 1.35; }
.works a[href] { color: var(--ink); text-decoration: none; }
.works a[href]:hover { color: var(--accent); text-decoration: underline; }
.works .poetry a { font-style: italic; }

/* ---------- news ---------- */

.news .text dt {
  margin-top: 1.5rem;
  font: 0.8rem/1.5 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.news .text dd { margin: 0.25rem 0 0; }

@media print {
  .crumbs, .pager, .colophon { display: none; }
  body { background: #fff; color: #000; }
}
