:root {
  color-scheme: dark;
  --ink: #2b1b1b;
  --paper: #f0e5cd;
  --paper-deep: #dfcba6;
  --wine: #6f2336;
  --gold: #a7783e;
  --cream: #fff8e9;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #160d10;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at 16% 12%, rgba(151, 65, 70, .32), transparent 30rem),
    radial-gradient(circle at 84% 88%, rgba(130, 82, 44, .25), transparent 28rem),
    linear-gradient(135deg, #150c0f 0%, #2b151c 48%, #130b0e 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .28;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.page-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1rem, 4vw, 3rem);
}

.poem-card {
  position: relative;
  width: min(100%, 51rem);
  padding: clamp(2.2rem, 6vw, 5.6rem) clamp(1.4rem, 7vw, 6.2rem) clamp(1.8rem, 5vw, 4rem);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(108, 71, 34, .08), transparent 12%, transparent 88%, rgba(108, 71, 34, .08)),
    radial-gradient(circle at 50% 0, rgba(255, 255, 255, .6), transparent 40%),
    var(--paper);
  border: 1px solid rgba(214, 180, 120, .72);
  border-radius: 2px;
  box-shadow:
    0 2rem 6rem rgba(0, 0, 0, .48),
    0 0 0 1px rgba(255, 255, 255, .06),
    inset 0 0 4rem rgba(111, 70, 32, .08);
  animation: reveal 900ms cubic-bezier(.2, .75, .25, 1) both;
}

.poem-card::before,
.poem-card::after {
  position: absolute;
  width: 6rem;
  height: 6rem;
  content: "";
  border-color: var(--gold);
  opacity: .55;
}

.poem-card::before {
  top: 1.1rem;
  left: 1.1rem;
  border-top: 1px solid;
  border-left: 1px solid;
}

.poem-card::after {
  right: 1.1rem;
  bottom: 1.1rem;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.poem-card__header {
  text-align: center;
}

.monogram {
  display: inline-grid;
  grid-auto-flow: column;
  gap: .45rem;
  align-items: center;
  margin-bottom: 1.3rem;
  color: var(--wine);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.monogram span {
  color: var(--gold);
  font-size: .65em;
}

.eyebrow {
  margin: 0 0 .7rem;
  color: #805a34;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .69rem;
  font-weight: 650;
  letter-spacing: .25em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--wine);
  font-size: clamp(2.2rem, 8vw, 4.8rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.04em;
  line-height: .96;
}

.ornament {
  display: grid;
  grid-template-columns: minmax(2rem, 5rem) auto minmax(2rem, 5rem);
  gap: .75rem;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto clamp(2rem, 5vw, 3.7rem);
  color: var(--gold);
  font-size: .58rem;
}

.ornament span {
  width: clamp(2rem, 9vw, 5rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.ornament span:last-child {
  background: linear-gradient(90deg, currentColor, transparent);
}

.poem {
  width: fit-content;
  margin: 0 auto;
  font-size: clamp(1.05rem, 3vw, 1.52rem);
  line-height: 1.78;
  text-wrap: balance;
}

.poem p {
  margin: 0;
}

.poem p + p {
  margin-top: 1.65em;
}

.poem-card__footer {
  display: flex;
  gap: 2rem;
  align-items: end;
  justify-content: space-between;
  margin-top: clamp(2.4rem, 6vw, 4.5rem);
  padding-top: 1.35rem;
  border-top: 1px solid rgba(128, 86, 42, .25);
}

.author,
.year {
  margin: 0;
}

.author {
  color: var(--wine);
  font-size: clamp(1rem, 2.6vw, 1.25rem);
  font-style: italic;
}

.year {
  margin-top: .35rem;
  color: #806a51;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .68rem;
  letter-spacing: .18em;
}

.quill {
  width: clamp(4.2rem, 12vw, 6.2rem);
  color: var(--gold);
  opacity: .72;
  transform: rotate(3deg);
}

.imprint {
  position: absolute;
  bottom: .75rem;
  margin: 0;
  color: rgba(255, 248, 233, .46);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .62rem;
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(.985);
  }
}

@media (max-width: 560px) {
  .page-shell {
    display: block;
    padding: .65rem .65rem 2.8rem;
  }

  .poem-card {
    min-height: calc(100svh - 3.45rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .poem {
    width: 100%;
    font-size: clamp(.98rem, 4.2vw, 1.18rem);
    line-height: 1.72;
  }

  .poem-card::before,
  .poem-card::after {
    width: 3.5rem;
    height: 3.5rem;
  }

  .imprint {
    right: 1rem;
    bottom: .85rem;
    left: 1rem;
    font-size: .53rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .poem-card {
    animation: none;
  }
}
