/* Daily Verse: one narrow reading column set like a well-made article. Warm
   paper cream, deep brown-black ink, a single faded teal accent, a slender
   ornament rule beneath the date. Change tokens first; add rules second. */
:root {
  color-scheme: light dark;

  /* Palette: warm paper cream, deep brown-black ink, a faded teal accent. */
  --ink: #2b2118;
  --muted: #7a6a58;
  --line: #e6dcc8;
  --bg: #f7f1e3;
  --surface: #fbf6ea;
  --accent: #5d8a87;
  --accent-ink: #f7f1e3;
  --rule: #c9b997;

  /* Type families: a serif throughout, set like a literary product. */
  --serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052,
    Georgia, serif;

  /* Type scale. */
  --step-0: 0.9375rem; /* small print */
  --step-1: 1.1875rem; /* body / poem text */
  --step-2: 1.375rem; /* the poem title */
  --step-3: clamp(2.25rem, 6vw, 3rem); /* the masthead */

  /* Shape: soft. */
  --radius: 12px;
  --shadow: 0 1px 2px rgb(43 33 24 / 0.05), 0 8px 24px rgb(43 33 24 / 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ece4d4;
    --muted: #b3a892;
    --line: #3a3328;
    --bg: #1b1813;
    --surface: #23201a;
    --accent: #8fb5b1;
    --accent-ink: #1b1813;
    --rule: #5a4f3c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    var(--step-1) / 1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.masthead,
main {
  max-width: 36rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* The product's name and its one sentence: the first thing a visitor reads,
   so it is the largest thing on the page. */
.masthead {
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.masthead h1 {
  margin: 0 0 0.5rem;
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 650;
  text-wrap: balance;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: var(--step-1);
  max-width: 34rem;
  font-style: italic;
  text-wrap: pretty;
}

main {
  padding-bottom: 4rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* The poem: an editorial column with generous type and space. */
.poem {
  max-width: 34rem;
}

/* The date, set in small caps with a slender ornament rule beneath it. */
.poem__date {
  margin: 0 0 0.75rem;
  font-size: var(--step-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant: small-caps;
}

.poem__ornament {
  position: relative;
  height: 0.75rem;
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--rule);
}

/* The small diamond mark on the ornament rule. */
.poem__ornament::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--bg);
  border: 1px solid var(--rule);
}

.poem__title {
  margin: 0 0 0.4rem;
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.01em;
  font-weight: 600;
  font-style: italic;
}

.poem__author {
  margin: 0 0 1.75rem;
  font-size: var(--step-0);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* The poem text: each line preserved on its own line, generous line-height. */
.poem__text {
  font-size: var(--step-1);
  line-height: 1.8;
  white-space: pre-wrap;
}

.poem__line,
.poem__break {
  display: block;
}

.poem__break {
  height: 1em;
}

/* The archive: a quiet list of past days beneath today's poem. */
.archive {
  max-width: 34rem;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line);
}

.archive__heading {
  margin: 0 0 1rem;
  font-size: var(--step-0);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant: small-caps;
  font-weight: 600;
}

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

.archive__item + .archive__item {
  border-top: 1px solid var(--line);
}

.archive__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em 0.75em;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.6rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius);
}

.archive__link:hover,
.archive__link:focus-visible {
  background: var(--surface);
  color: var(--accent);
  outline-offset: -2px;
}

.archive__date {
  flex: 0 0 auto;
  font-size: var(--step-0);
  letter-spacing: 0.06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.archive__link:hover .archive__date,
.archive__link:focus-visible .archive__date {
  color: var(--accent);
}

.archive__title {
  font-style: italic;
}

.archive__author {
  margin-left: auto;
  font-size: var(--step-0);
  color: var(--muted);
}

/* An empty state is a designed state, not an absence. */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  max-width: 34rem;
}
