/* Design tokens and foundations */
:root {
  color-scheme: light;
  --ink: #233e38;
  --muted: #536b62;
  --green: #29594b;
  --green-dark: #1c4438;
  --paper: #fffef8;
  --line: #dce8df;
  --gold: #aa8050;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  font-family: var(--sans);
  background: radial-gradient(ellipse at 84% 5%, #fff5d9 0%, transparent 39%), radial-gradient(ellipse at 8% 32%, #d5ebe1 0%, transparent 48%), linear-gradient(145deg, #eff6eb, #f8f5e9 70%, #e0efe8);
}

button {
  font: inherit;
}

button:focus-visible, summary:focus-visible {
  outline: 3px solid #347d69;
  outline-offset: 5px;
}

.shell {
  width: min(100% - 2rem, 57rem);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4.5rem) 0 2rem;
  position: relative;
  z-index: 1;
}

/* Decorative sunrise and landscape */
.landscape {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  height: min(34vh, 19rem);
  pointer-events: none;
  z-index: 0;
  opacity: .65;
}

.masthead {
  text-align: center;
  margin-bottom: 2rem;
}

.emblem {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border: 1px solid #c4d9c9;
  border-radius: 50%;
  color: var(--green);
  background: #ffffff80;
  box-shadow: 0 0 0 .45rem #ffffff45;
}

.eyebrow {
  margin: 0;
  color: var(--green);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

h1 {
  font: 400 clamp(2.7rem, 7vw, 4.7rem)/1.05 var(--serif);
  letter-spacing: -.055em;
  margin: .65rem 0 .65rem;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  font-size: .97rem;
}

/* Main reading card */
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid #ffffff;
  border-radius: 1.9rem;
  background: linear-gradient(150deg, #fffffff5, #fffef8ef);
  box-shadow: 0 24px 70px #315b4920, 0 3px 12px #315b490b;
  padding: clamp(1.35rem, 5vw, 3.5rem);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #94bda6, #e9d09d, #94bda6);
}

.reading {
  text-align: center;
}

.reading.is-entering {
  animation: arrive .65s cubic-bezier(.2,.7,.3,1) both;
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.theme {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: .5rem .9rem;
  border-radius: 2rem;
  background: #eaf3eb;
  color: var(--green-dark);
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.5;
}

.quote-mark {
  display: block;
  height: 3.6rem;
  margin-top: .8rem;
  color: var(--gold);
  font: 5.5rem/.95 var(--serif);
  opacity: .75;
}

blockquote {
  max-width: 43rem;
  margin: 0 auto;
  font: 400 clamp(1.32rem, 3.4vw, 2.05rem)/1.55 var(--serif);
  letter-spacing: -.018em;
  text-wrap: pretty;
}

blockquote p {
  margin: 0;
}

blockquote p + p {
  margin-top: .5em;
}

blockquote.long {
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
}

.verse-num {
  font: 600 .6em var(--sans);
  color: var(--muted);
  vertical-align: super;
  margin-right: .25em;
}

.reference {
  display: block;
  margin: 1.4rem 0 0;
  color: var(--green);
  font-size: .8rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-style: normal;
}

.prayer {
  margin: 1.9rem 0 0;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: #f2f7f0;
  text-align: left;
}

.prayer summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 650;
  font-size: .83rem;
  letter-spacing: .045em;
}

.prayer p {
  margin: .85rem 0 0;
  font: italic 1.06rem/1.75 var(--serif);
  color: #3f5b50;
}

/* Theme selection and reading controls */
.theme-control, .share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .6rem;
}

.theme-control {
  margin-bottom: 1.7rem;
  color: var(--green-dark);
  font-size: .95rem;
}

.theme-control select {
  appearance: none;
  max-width: 100%;
  padding: .65rem 2.35rem .65rem .9rem;
  border: 1px solid #b1c8bb;
  border-radius: .7rem;
  color: var(--green-dark);
  font: inherit;
  background: #fffef8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%2329594b' fill='none' stroke-width='1.6'/%3E%3C/svg%3E") right .8rem center / .75rem auto no-repeat;
}

.theme-control select:focus-visible, .sharing textarea:focus-visible {
  outline: 3px solid #347d69;
  outline-offset: 3px;
}

.sharing {
  margin: 1rem auto 0;
  text-align: center;
}

.sharing summary {
  width: fit-content;
  margin: auto;
  padding: .6rem;
  color: var(--green);
  cursor: pointer;
  font-size: .95rem;
}

.share-actions {
  margin: .5rem auto 0;
}

.sharing textarea {
  width: 100%;
  max-width: 35rem;
  min-height: 5rem;
  padding: .65rem;
  font: inherit;
}

#copy-status {
  color: var(--muted);
  font-size: .9rem;
}

#copy-status:empty {
  margin: 0;
}

.button:disabled {
  opacity: .55;
  cursor: default;
}

/* Reading timer */
.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 3rem;
  padding: .85rem 1.3rem;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 650;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.button svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.primary {
  color: white;
  background: var(--green);
  box-shadow: 0 7px 19px #29594b30;
}

.primary:hover {
  background: var(--green-dark);
  box-shadow: 0 10px 23px #29594b40;
}

.secondary {
  color: var(--green-dark);
  background: #ffffff8c;
  border-color: #c9dbce;
}

.secondary:hover {
  background: white;
}

.button:active {
  transform: scale(.98);
}

.timer-area {
  max-width: 17rem;
  margin: 1.3rem auto 0;
  text-align: center;
}

.track {
  height: 3px;
  border-radius: 8px;
  overflow: hidden;
  background: #dce8df;
}

.fill {
  width: 100%;
  height: 100%;
  background: #7ba58c;
  transform-origin: left;
  transform: scaleX(0);
}

.timer-note {
  margin: .6rem 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.foot {
  text-align: center;
  color: var(--muted);
  margin: 1.8rem auto 0;
}

.foot p {
  margin: .4rem 0;
}

.foot .invitation {
  font: italic 1.1rem/1.6 var(--serif);
}

.foot .edition {
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.no-script {
  text-align: center;
  color: var(--muted);
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .25rem 1.25rem;
  margin-top: 1rem;
}

.site-links a, .prose a {
  color: var(--green-dark);
  text-underline-offset: .2em;
}

.site-links a {
  padding: .55rem .2rem;
  font-size: .95rem;
}

.site-links a[aria-current="page"] {
  font-weight: 700;
}

a:focus-visible {
  outline: 3px solid #347d69;
  outline-offset: 3px;
}

.prose {
  max-width: 44rem;
  margin-inline: auto;
  font: 1.15rem/1.7 var(--serif);
}

.prose p {
  margin: 0;
}

.prose p + p {
  margin-top: 1em;
}

.prose h2 {
  font: 600 1.18rem/1.35 var(--sans);
  color: var(--green-dark);
  margin: 1.7em 0 .5em;
}

.policy-date {
  font: .9rem/1.5 var(--sans);
  color: var(--muted);
}

@media (max-width: 480px) {
  .shell {
    width: calc(100% - 1.25rem);
  }
  .card {
    border-radius: 1.35rem;
  }
  .actions {
    flex-direction: column;
  }
  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body {
    background: white;
  }
  .shell {
    width: 100%;
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .landscape, .actions, .theme-control, .sharing, .timer-area {
    display: none;
  }
}
