:root {
  --bg: #0e1114;
  --fg: #f4f1ec;
  --muted: rgba(244, 241, 236, 0.55);
  --print-ink: #111;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, serif;
}

body {
  min-height: 100dvh;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.status {
  margin: 0;
  max-width: 28rem;
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  animation: pulse 1.6s ease-in-out infinite;
}

.status.is-error {
  color: #e8b4b4;
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

.verse-frame {
  margin: 0;
  width: min(100%, 100dvh - 1.5rem, 92vw);
  aspect-ratio: 1 / 1;
  max-height: calc(100dvh - 1.5rem);
}

.verse-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.chrome {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.4rem 0.35rem 0.75rem;
  border-radius: 999px;
  color: rgba(244, 241, 236, 0.72);
  background: rgba(14, 17, 20, 0.45);
  backdrop-filter: blur(6px);
  transition: opacity 160ms ease, background 160ms ease;
}

.source-link {
  color: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms ease;
}

.source-link:hover,
.source-link:focus-visible {
  color: var(--fg);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.print-btn {
  width: 2.15rem;
  height: 2.15rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: inherit;
  background: transparent;
  transition: color 160ms ease, background 160ms ease;
}

.print-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.print-btn:hover,
.print-btn:focus-visible {
  color: var(--fg);
  background: rgba(244, 241, 236, 0.1);
  outline: none;
}

.print-btn:focus-visible {
  box-shadow: 0 0 0 2px rgba(244, 241, 236, 0.35);
}

@media (hover: hover) {
  .chrome {
    opacity: 0.55;
  }

  .chrome:hover,
  .chrome:focus-within {
    opacity: 1;
    background: rgba(14, 17, 20, 0.65);
  }
}

.print-footer {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  html,
  body {
    background: #fff;
    color: var(--print-ink);
    min-height: auto;
  }

  .status,
  .chrome {
    display: none !important;
  }

  body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6mm;
  }

  .stage {
    min-height: auto;
    height: auto;
    width: 100%;
    padding: 0;
    place-items: center;
  }

  .verse-frame {
    width: 100%;
    max-width: none;
    max-height: none;
    height: auto;
    aspect-ratio: auto;
    margin: 0;
  }

  .verse-frame img {
    width: 100%;
    height: auto;
    max-height: 250mm;
    object-fit: contain;
    box-shadow: none;
    background: transparent;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-footer {
    display: block;
    position: static;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 9px;
    line-height: 1.2;
    text-align: left;
    color: #000;
  }

  .print-footer a {
    color: #000;
    text-decoration: none;
  }
}
