/* ═══════════════════════════════════════════════════════════════════
   SarahAndBran -- Poems
   Moonlit letter cards over the shared ambience backdrop.
   ═══════════════════════════════════════════════════════════════════ */

body.poems-body {
  height: auto;
  min-height: 100%;
  background: #09050e;
}

.poems {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px 96px;
}

/* ── Hero ────────────────────────────────────────────────────── */

.poems-hero {
  text-align: center;
  padding: 44px 8px 52px;
}

.poems-hero__eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(244, 114, 182, 0.75);
  margin-bottom: 18px;
}

.poems-hero__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 12vw, 4.6rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: #f7ecff;
  background: linear-gradient(100deg, #f9a8d4 0%, #f0abfc 26%, #ffffff 50%, #c4b5fd 74%, #f9a8d4 100%);
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: poemsShimmer 9s ease-in-out infinite;
}

@keyframes poemsShimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.poems-hero__subtitle {
  max-width: 30ch;
  margin: 18px auto 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.6;
  color: rgba(226, 210, 245, 0.72);
}

.poems-hero__rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  color: rgba(244, 114, 182, 0.85);
  font-size: 0.85rem;
}

.poems-hero__rule span {
  display: block;
  width: clamp(48px, 18vw, 110px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 114, 182, 0.55), transparent);
}

/* ── Poem cards ──────────────────────────────────────────────── */

.poems-list {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.poem {
  --poem-accent: #f472b6;
  --poem-accent-soft: rgba(244, 114, 182, 0.18);
  position: relative;
  padding: 30px clamp(20px, 5vw, 38px) 32px;
  border-radius: 20px;
  border: 1px solid rgba(226, 210, 245, 0.09);
  background:
    linear-gradient(158deg, rgba(42, 27, 62, 0.74) 0%, rgba(23, 14, 36, 0.86) 100%);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.45s ease,
    box-shadow 0.45s ease,
    opacity 0.7s ease;
}

.poem:nth-child(3n + 2) {
  --poem-accent: #a78bfa;
  --poem-accent-soft: rgba(167, 139, 250, 0.18);
}

.poem:nth-child(3n + 3) {
  --poem-accent: #fb7185;
  --poem-accent-soft: rgba(251, 113, 133, 0.18);
}

/* Soft accent wash inside the card */
.poem::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.7;
  background:
    radial-gradient(circle at 12% 0%, var(--poem-accent-soft) 0%, transparent 52%),
    radial-gradient(circle at 92% 100%, rgba(167, 139, 250, 0.12) 0%, transparent 55%);
}

.poem:hover {
  transform: translateY(-3px);
  border-color: var(--poem-accent-soft);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.5),
    0 0 42px -12px var(--poem-accent-soft),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.poem > * { position: relative; z-index: 1; }

/* ── Card header ─────────────────────────────────────────────── */

.poem__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.poem__numeral {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 50px;
  border: 1px solid var(--poem-accent-soft);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--poem-accent);
}

.poem__date {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: rgba(200, 184, 220, 0.6);
}

.poem__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.6vw, 1.95rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.25;
  color: #fbf3ff;
  margin-bottom: 4px;
}

.poem__note {
  font-family: var(--font-display), var(--font-emoji);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(226, 210, 245, 0.62);
  padding-left: 14px;
  border-left: 2px solid var(--poem-accent-soft);
  margin-bottom: 4px;
}

.poem__divider {
  width: 54px;
  height: 1px;
  margin: 18px 0 20px;
  background: linear-gradient(90deg, var(--poem-accent), transparent);
}

/* ── Verses ──────────────────────────────────────────────────── */

.poem__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.poem__stanza {
  font-family: var(--font-display), var(--font-emoji);
  font-size: clamp(1rem, 2.6vw, 1.09rem);
  font-weight: 400;
  line-height: 1.95;
  letter-spacing: 0.1px;
  color: #ece2f7;
}

/* Each verse line is its own block, which scopes wrapping to that line so
   `balance` can split it into even halves instead of stranding one word.
   Leading stays inherited from the stanza and no margin is added, so every
   row -- written line or run-over -- sits on the same even rhythm. */
.poem__line {
  display: block;
  text-wrap: balance;
}

/* Prose sign-off that follows the verses on some poems. */
.poem__close {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(226, 210, 245, 0.08);
  font-family: var(--font-display), var(--font-emoji);
  font-style: italic;
  font-size: 0.97rem;
  line-height: 1.85;
  color: rgba(226, 210, 245, 0.66);
}

.poem__seal {
  margin-top: 22px;
  font-family: var(--font-emoji), var(--font-sans);
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

/* ── Scroll reveal ───────────────────────────────────────────── */
/* Gated on .js so a failed script load can never hide the poems. */

.js .poem.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.js .poem.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Closing signature ───────────────────────────────────────── */

.poems-foot {
  text-align: center;
  padding: 62px 12px 12px;
}

.poems-foot__ornament {
  color: rgba(244, 114, 182, 0.6);
  font-size: 1rem;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}

.poems-foot__sig {
  margin-top: 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.8;
  background: linear-gradient(90deg, #b76e79 0%, #e8a4b0 25%, #ffd7e4 50%, #c4b5fd 75%, #b76e79 100%);
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #e8a4b0;
  animation: poemsShimmer 7s ease-in-out infinite;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 560px) {
  .poems { padding: 20px 14px 72px; }
  .poems-hero { padding: 30px 4px 40px; }
  .poems-list { gap: 20px; }
  .poem { padding: 24px 18px 26px; border-radius: 18px; }
  .poem__stanza { line-height: 1.85; }
  .poem__close { font-size: 0.93rem; line-height: 1.8; }
}

@media (prefers-reduced-motion: reduce) {
  .poems-hero__title,
  .poems-foot__sig { animation: none; }

  .poem { transition: none; }

  .js .poem.reveal {
    opacity: 1;
    transform: none;
  }
}
