/* Collected Poems — a quiet, classy, single-page typographic theme. */

:root {
  --ink:        #2b2622;   /* warm near-black for text   */
  --ink-soft:   #6b6259;   /* muted brown for metadata   */
  --paper:      #f5f1e8;   /* aged-paper background      */
  --rule:       #d8cfbe;   /* hairline rules             */
  --accent:     #8a5a44;   /* terracotta for links       */
  --accent-dk:  #6f4636;
  --measure:    34rem;     /* comfortable reading width  */
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  line-height: 1.65;
  font-feature-settings: "liga" 1, "onum" 1, "kern" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  flex: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 9vh, 6.5rem) 1.5rem 3rem;
}

/* ---------- Masthead ---------- */

.masthead {
  text-align: center;
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
}

.collection-title {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0;
}

.collection-sub {
  margin: 0.75rem 0 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

.collection-sub::before,
.collection-sub::after {
  content: "·";
  margin: 0 0.6em;
  color: var(--rule);
}

/* ---------- Table of contents ---------- */

.contents {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: poem;
}

.entry {
  counter-increment: poem;
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

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

.entry::before {
  content: counter(poem, decimal-leading-zero);
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  min-width: 2.2ch;
}

.entry a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1.25rem;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 0.3s ease, color 0.2s ease;
}

.entry a:hover {
  color: var(--accent-dk);
  background-size: 100% 1px;
}

.entry-meta {
  margin-left: auto;
  text-align: right;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.empty {
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
}

/* Ornament between the contents and the poems themselves. */
.contents-rule {
  text-align: center;
  color: var(--rule);
  font-size: 1.6rem;
  margin: clamp(2.5rem, 7vh, 4.5rem) 0;
  user-select: none;
}

/* ---------- Poems ---------- */

.poem {
  scroll-margin-top: 2rem;
}

.poem-head {
  text-align: center;
  margin-bottom: clamp(1.6rem, 5vh, 2.6rem);
}

.poem-title {
  font-family: "Cormorant Garamond", "EB Garamond", serif;
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.7rem);
  line-height: 1.1;
  margin: 0;
}

.byline {
  margin: 0.7rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.byline-author { font-variant: small-caps; letter-spacing: 0.08em; }

.poem-body {
  font-size: 1.3rem;
}

/* Hanging indent so long wrapped lines stay legible. */
.stanza {
  margin: 0 0 1.6rem;
  padding-left: 1.4rem;
  text-indent: -1.4rem;
}

.stanza:last-child { margin-bottom: 0; }

/* Ornamental divider between consecutive poems. */
.divider {
  text-align: center;
  color: var(--accent);
  opacity: 0.7;
  font-size: 1.5rem;
  margin: clamp(3rem, 9vh, 5.5rem) 0;
  user-select: none;
}

/* Quiet "back to top" mark after each poem. */
.to-top {
  text-align: center;
  margin: 1.8rem 0 0;
}

.to-top a {
  color: var(--rule);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.2s ease;
}

.to-top a:hover { color: var(--accent-dk); }

/* ---------- Footer ---------- */

.site-foot {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.site-foot a {
  color: var(--ink-soft);
  text-decoration: none;
  font-style: italic;
  transition: color 0.2s ease;
}

.site-foot a:hover { color: var(--accent-dk); }

@media (max-width: 30rem) {
  body { font-size: 1.15rem; }
  .entry { flex-wrap: wrap; gap: 0.4rem 0.85rem; }
  .entry-meta { margin-left: 2.2ch; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
