:root {
  --bg: #ffffff;
  --text: #1c1b22;
  --muted: #5d5a66;
  --rule: #dcdae2;
  --accent: #4b2a7b;
  --table-head: #f3f1f7;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141318;
    --text: #ebe9f0;
    --muted: #a7a3b2;
    --rule: #34313d;
    --accent: #c4a8f0;
    --table-head: #1f1d25;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

main {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

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

h1,
h2,
h3 {
  font-family: "EB Garamond", Georgia, serif;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  font-size: 2.75rem;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1.6rem;
  margin: 2.5rem 0 0.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.25rem;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.logo,
.back img {
  display: block;
  height: auto;
}

.back img {
  width: 3rem;
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.masthead .details {
  margin-bottom: 0;
}

.logo {
  flex: none;
  width: 8rem;
}

@media (max-width: 30rem) {
  .logo {
    width: 4.5rem;
  }
}

@media (prefers-color-scheme: dark) {
  .logo,
  .back img {
    filter: invert(1);
  }
}

html {
  scroll-behavior: smooth;
}

h2[id] {
  scroll-margin-top: 1rem;
}

.toc h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--muted);
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
}

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

.toc a {
  display: block;
  padding: 0.3rem 0;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.toc a:hover {
  text-decoration: underline;
}

.toc a[aria-current] {
  color: var(--accent);
  font-weight: bold;
}

/* Narrow screens: a plain contents list above the first section. */
.toc {
  margin: 0 0 1rem;
}

/* Wide screens: a fixed panel to the right of the text. */
@media (min-width: 76rem) {
  .toc {
    position: fixed;
    top: 6rem;
    left: calc(50% + 22rem + 2rem);
    width: 13rem;
    margin: 0;
    padding: 1rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--rule);
  }
}

.details {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.details p {
  margin: 0.15rem 0;
}

.deadline {
  font-weight: bold;
  color: var(--text);
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.photos figure {
  margin: 0;
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: var(--rule);
}

.photos figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.packs {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.packs li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}

.packs li:first-child {
  border-top: 1px solid var(--rule);
}

.packs a {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.packs p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

ol li {
  margin-bottom: 0.4rem;
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.95rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--rule);
}

th {
  background: var(--table-head);
}

td p {
  margin: 0 0 0.35rem;
}

td p:last-child {
  margin-bottom: 0;
}

.script p {
  margin: 0 0 0.75rem;
}

.script strong {
  letter-spacing: 0.03em;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 30rem) {
  h1 {
    font-size: 2.1rem;
  }

  .photos {
    gap: 0.4rem;
  }

  .photos figcaption {
    font-size: 0.75rem;
  }
}
